{"id":275,"date":"2012-10-22T15:56:17","date_gmt":"2012-10-22T07:56:17","guid":{"rendered":"http:\/\/www.withonly.com\/?p=275"},"modified":"2012-10-22T15:56:17","modified_gmt":"2012-10-22T07:56:17","slug":"xcode-%e8%b0%83%e8%af%95%e6%9f%a5%e6%89%be-exc_bad_access-%e9%97%ae%e9%a2%98%e6%a0%b9%e6%ba%90","status":"publish","type":"post","link":"https:\/\/blog.5danyuan.com\/?p=275","title":{"rendered":"xcode \u8c03\u8bd5\u67e5\u627e EXC_BAD_ACCESS \u95ee\u9898\u6839\u6e90"},"content":{"rendered":"<p>\u8fd9\u51e0\u5929\u5728\u8c03\u8bd5\u5f53\u521d\u7684\u4e00\u4e2ademo\u7684\u7a0b\u5e8f\u7684\u65f6\u5019\uff0c\u4e00\u8fd0\u884c\u5c31\u62a5\u9519\uff0c\u672c\u6765\u5c31\u5bf9 xcode \u4e0d\u719f\u6089\uff0c\u8fd9\u4e0b\u66f4\u662f\u624b\u5fd9\u811a\u4e71\u7684\u3002\u8c8c\u4f3c\u8fd9\u91cc\u9762\u7684\u65ad\u70b9\u8c03\u8bd5\u4e5f\u4e0d\u600e\u4e48\u597d\u7528\uff0c\u653e\u4e86\u51e0\u4e2a\u65ad\u70b9\uff0c\u7136\u540e\u9010\u6b65\u6267\u884c\u3002<\/p>\n<p>\u8fd0\u884c\u5230\u6700\u540e\uff0c\u51fa\u9519\u7684\u65f6\u5019\u662f\u505c\u7559\u5728\u8868\u683c\u7684\u663e\u793a\u7684\u65b9\u6cd5\u91cc\uff0c\u4f46\u662f\u611f\u89c9\u4e0d\u5bf9\u3002\u5f88\u662f\u90c1\u95f7\uff0c\u8fd9\u4e2a\u548cvs \u6bd4\u8d77\u6765\u8981\u5f31\u7206\u4e86\u3002\u770b\u4e86\u4e0b\u5f02\u5e38\u4fe1\u606f\uff0c\u63d0\u793a\u7684\u662f\u00a0EXC_BAD_ACCESS \u9519\u8bef\u3002\u5728\u7f51\u4e0a\u641c\u7d22\u4e86\u4e0b\uff0c\u8fd8\u5f88\u591a\u4eba\u90fd\u6709\u8fd9\u4e2a\u9519\u8bef\u5462\u3002<\/p>\n<p>\u603b\u8ba1\u4e86\u4e0b\u5927\u5bb6\u7684\u5efa\u8bae\uff0c\u8bf4\u7684\u662f 90% \u7684EXC_BAD_ACCESS \u5f02\u5e38\u90fd\u662f\u56e0\u4e3a\u91ca\u653e\u4e86\u5df2\u7ecf\u91ca\u653e\u7684\u53d8\u91cf\u5bfc\u81f4\u3002\u5b89\u88c5\u7f51\u4e0a\u7684\u8bf4\u6cd5\u8981\u6253\u5f00\u00a0NSZombieEnabled \u6765\u663e\u793a\u66f4\u591a\u7684\u4fe1\u606f\u3002<\/p>\n<p>\u6211\u8fd9\u91cc\u8bf4\u4e00\u4e2a\u7b80\u5355\u7684\u65b9\u5f0f\uff1aProduct-&gt;Edit Scheme\uff0c\u7136\u540e\u9009\u62e9 Diagnostics \u9009\u9879\u5361\uff0c\u52fe\u9009 Enable Zombie Objects \uff0c\u7136\u540e\u518d\u91cd\u65b0\u8c03\u8bd5\uff0c\u5c31\u53ef\u4ee5\u663e\u793a\u4e00\u4e9b\u66f4\u6709\u7528\u7684\u4fe1\u606f\u4e86\u3002\u518d Output \u91cc\u663e\u793a\u4e86 UIAlertView \u7684\u5b57\u7b26\u4e32\uff0c\u6211\u7684\u9879\u76ee\u91cc\u7528\u5230\u4e86\u8fd9\u4e2a\uff0c\u4f46\u662f\u4e0d\u592a\u591a\uff0c\u4e00\u641c\u7d22\u679c\u7136\u53d1\u73b0\u548c\u5b9a\u4f4d\u4e86\u9519\u8bef\u3002<\/p>\n<p>\u6211\u5728\u4e00\u5904\u58f0\u660e\u4e86 UIAlertView \u5e76\u4e14\u4f7f\u7528\u4e86 autorelease \u5173\u952e\u5b57\uff0c\u4f46\u662f\u5728\u540e\u9762\uff0c\u6211\u53c8 release \u4e86\u4e00\u904d\uff0c\u5bfc\u81f4\u51fa\u9519\u4e86\u3002\u6700\u5f00\u59cb\u5b66\u4e60\u7684\u65f6\u5019\uff0c\u6211\u662f\u4ece\u7f51\u4e0a\u7167\u846b\u82a6\u753b\u74e2\u5730\u5199\u7684\u8fd9\u6837\u7684\u4ee3\u7801\u3002<\/p>\n<p>\u4fee\u6b63\u4e86\u9519\u8bef\u540e\uff0c\u91cd\u65b0\u7f16\u8bd1\u5c31\u6ca1\u6709\u95ee\u9898\u4e86\u3002\u5fc3\u91cc\u7684\u77f3\u5934\u7b97\u662f\u653e\u4e0b\u6765\u4e86\u3002\u7f51\u4e0a\u7684\u6587\u7ae0\u8fd8\u6709\u7ee7\u7eed\u8bb2\u89e3\u5982\u4f55\u6765\u6765\u8fdb\u884c\u5b9a\u4f4d\u64cd\u4f5c\u7684\uff0c\u6211\u770b\u4e86\u4e0b\u8fd8\u9700\u8981\u6267\u884c\u547d\u4ee4\uff0c\u8fd9\u5bf9\u6211\u6765\u8bf4\u590d\u6742\u4e86\uff0c\u95ee\u9898\u672c\u6765\u4e5f\u89e3\u51b3\u4e86\uff0c\u5c31\u6ca1\u6709\u7ee7\u7eed\u8ddf\u4e86\u3002\u6709\u5174\u8da3\u7684\u540c\u5b66\u53ef\u4ee5\u641c\u7d22\u7f51\u4e0a\u76f8\u5173\u7684\u6587\u7ae0\u770b\u770b\u3002<\/p>\n<p>\u6700\u540e\u9700\u8981\u63d0\u9192\u5927\u5bb6\u7684\uff0c\u518d\u627e\u5230\u4e86\u9519\u8bef\u539f\u56e0\u540e\uff0c\u9700\u8981\u91cd\u65b0\u53d6\u6d88\u52fe\u9009 Enable Zobie Objects \u590d\u9009\u6846\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u51e0\u5929\u5728\u8c03\u8bd5\u5f53\u521d\u7684\u4e00\u4e2ademo\u7684\u7a0b\u5e8f\u7684\u65f6\u5019\uff0c\u4e00\u8fd0\u884c\u5c31\u62a5\u9519\uff0c\u672c\u6765\u5c31\u5bf9 xcode \u4e0d\u719f\u6089\uff0c\u8fd9\u4e0b\u66f4\u662f\u624b\u5fd9\u811a\u4e71\u7684\u3002\u8c8c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,3],"tags":[113,253],"class_list":["post-275","post","type-post","status-publish","format-standard","hentry","category-ios","category-a-short-word","tag-exc_bad_access","tag-ios"],"_links":{"self":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts\/275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=275"}],"version-history":[{"count":0,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts\/275\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}