{"id":11,"date":"2016-11-23T22:57:41","date_gmt":"2016-11-23T14:57:41","guid":{"rendered":"http:\/\/blog.fly-kite.com\/?p=11"},"modified":"2019-02-19T15:43:36","modified_gmt":"2019-02-19T07:43:36","slug":"32%e4%bd%8dcpu%ef%bc%88iphone5%ef%bc%89%e5%87%ba%e7%8e%b0%e7%9a%84nsinteger%e6%ba%a2%e5%87%ba%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/flykite.me\/?p=11","title":{"rendered":"32\u4f4dCPU\uff08iPhone5\uff09\u51fa\u73b0\u7684NSInteger\u6ea2\u51fa\u95ee\u9898"},"content":{"rendered":"<p>\u5728\u6211\u4eec\u7684APP\u4e2d\uff0c\u6709\u4e00\u5904\u5730\u65b9\u5c55\u793a\u7684\u662f\u201c\u751f\u65e5\u201d\uff0c\u8fd9\u4e2a\u751f\u65e5\u6570\u636e\u662f\u8bf7\u6c42\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6570\u636e\uff0c\u5728\u4e0a\u4e00\u4e2a\u7248\u672c\u53d1\u5e03\u4e4b\u540e\u9646\u7eed\u5730\u6709\u7528\u6237\u53cd\u9988\u8bf4\u6bcf\u6b21\u4fee\u6539\u5b8c\u751f\u65e5\u5c31\u53d8\u6210\u4e861969\u5e74\u62161970\u5e74\u7684\u65e5\u671f\uff0c\u4e0e\u540e\u53f0\u7684\u54e5\u4eec\u6c9f\u901a\u4e86\u4e4b\u540e\u53d1\u73b0\uff0cAPP\u4f20\u7ed9\u670d\u52a1\u5668\u7684\u53c2\u6570\u6709\u65f6\u5019\u751a\u81f3\u53ef\u80fd\u662f\u8d1f\u7684\uff08\u53c2\u6570\u662f\u6beb\u79d2\u6570\uff09\u3002<\/p>\n<p>\u90a3\u4e00\u5929\u6211\u4eec\u51e0\u4e4e\u82b1\u4e86\u4e00\u6574\u5929\u7684\u65f6\u95f4\u53bb\u590d\u73b0\u8fd9\u4e00\u4e2aBug\uff0c\u7136\u800c\u5e76\u6ca1\u6709\u627e\u5230\u539f\u56e0\uff0c\u76f4\u5230\u4e0b\u5348\u4e94\u70b9\u2026\u2026<\/p>\n<p>\u6211\u63d0\u51fa\u4e86\u4e00\u4e2a\u95ee\u9898\uff1a\u201c\u662f\u4e0d\u662f\u7279\u5b9a\u7684\u90a3\u51e0\u4e2a\u7528\u6237\u603b\u662f\u51fa\u73b0\u8fd9\u4e2a\u95ee\u9898\uff0c\u800c\u522b\u7684\u7528\u6237\u6ca1\u6709\u51fa\u73b0\uff1f\u201d\uff0c\u968f\u540e\u901a\u8fc7\u540e\u53f0\u7edf\u8ba1\u6570\u636e\u53d1\u73b0\uff0c\u51fa\u73b0\u4e86\u8fd9\u4e2a\u95ee\u9898\u7684\u7528\u6237\u4f7f\u7528\u7684\u624b\u673a\u90fd\u662fiPhone5\uff0c\u7cfb\u7edf\u7248\u672c\u6709iOS8\u4e5f\u6709iOS9\u3002<\/p>\n<p>OK\uff0c\u5b9a\u4f4d\u5230\u4e86\u95ee\u9898\u6240\u5728\u5c31\u5bb9\u6613\u89e3\u51b3\u5566\u3002\u6211\u4eec\u7684\u6d4b\u8bd5\u673a\u662f\u4e00\u53f0iOS8\u7684iPhone5s\u548c\u4e00\u53f0iOS9\u7684iPhone5s\uff0c\u540c\u4e8b\u4eec\u4ee5\u53ca\u672c\u4eba\u7684\u624b\u673a\u4e0d\u662fiPhone6\u5c31\u662fiPhone6s\uff0c\u6211\u4eec\u90fd\u6ca1\u6709\u9047\u5230\u8fd9\u4e2a\u95ee\u9898\uff0c\u5e76\u4e14\u6240\u6709\u7684\u975eiPhone5\u7528\u6237\u4e5f\u6ca1\u6709\u51fa\u73b0\u8fd9\u4e2a\u95ee\u9898\uff0c\u8fd9\u6837\u770b\u6765\u95ee\u9898\u5e94\u8be5\u5c31\u51fa\u5728iPhone5\u4e0a\u3002<\/p>\n<p>\u4ed4\u7ec6\u60f3\u4e86\u4e00\u4e0b\uff0c\u82f9\u679c\u5728iPhone5s\u4e0a\u5f00\u59cb\u4f7f\u752864\u4f4d\u7684CPU\uff0c\u800c\u5728iPhone5\u4ee5\u53ca\u66f4\u8001\u7684iPhone\u4e0a\u4f7f\u7528\u7684\u4e00\u76f4\u90fd\u662f32\u4f4d\u7684CPU\uff0c\u4f1a\u4e0d\u4f1a\u662f\u8fd9\u4e2a\u539f\u56e0\uff1f<\/p>\n<p>\u4e3a\u4e86\u9a8c\u8bc1\u662f\u5426\u771f\u662f\u8fd9\u4e2a\u539f\u56e0\uff0c\u5728xcode\u4e2d\u8fd0\u884cAPP\u7684\u65f6\u5019\u6211\u9009\u62e9\u4e86iPhone5\u6a21\u62df\u5668\uff0c\u679c\u7136\uff01\u968f\u540e\u6309\u4f4fCommand\u952e\u70b9\u51fb<code>NSInteger<\/code>\u53d1\u73b0<code>NSInteger<\/code>\u7684\u5b9a\u4e49\u662f\u8fd9\u6837\u7684\u3002<\/p>\n<blockquote><p>#if __LP64__ || (TARGET_OS_EMBEDDED &amp;&amp; !TARGET_OS_IPHONE) || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64<br \/>\ntypedef long NSInteger;<br \/>\ntypedef unsigned long NSUInteger;<br \/>\n#else<br \/>\ntypedef int NSInteger;<br \/>\ntypedef unsigned int NSUInteger;<br \/>\n#endif<\/p><\/blockquote>\n<p>\u82f9\u679c\u572832\u4f4d\u7684\u673a\u5b50\u4e0a\u5c06<code>NSInteger<\/code>\u5b9a\u4e49\u4e3a\u4e86<code>int<\/code>\u7c7b\u578b\uff0c\u800c\u572864\u4f4d\u673a\u5b50\u4e0a\u5b9a\u4e49\u4e3a<code>long<\/code>\u7c7b\u578b\uff08<code>int<\/code>\u7c7b\u578b\u5728\u5b58\u50a8\u73b0\u5728\u7684\u6beb\u79d2\u6570\u7684\u65f6\u5019\u5f53\u7136\u4f1a\u6ea2\u51fa\u5566\uff09\u3002<\/p>\n<p>\u65e2\u7136\u95ee\u9898\u627e\u5230\u4e86\uff0c\u90a3\u5c31\u5f00\u59cb\u89e3\u51b3\u5427~\u539f\u672c\u60f3\u7740\u624b\u52a8\u5c06\u7528\u5230<code>NSInteger<\/code>\u6765\u8bb0\u5f55\u6beb\u79d2\u6570\u7684\u53d8\u91cf\u6539\u6210<code>long<\/code>\u7c7b\u578b\uff0c\u4f46\u662f\u53d1\u73b0\u9700\u8981\u6539\u7684\u5730\u65b9\u5f88\u591a\u3002\u60f3\u5230\u6211\u4eec\u7684\u9879\u76ee\u4e2d\u6709\u4e00\u4e2apch\u6587\u4ef6\uff0c\u4e8e\u662f\u5728pch\u6587\u4ef6\u4e2d\u5199\u4e86\u8fd9\u4e48\u4e00\u884c\u4ee3\u7801<\/p>\n<blockquote><p>#define NSInteger long<\/p><\/blockquote>\n<p><del datetime=\"2016-11-23T14:54:04+00:00\">\u673a\u667a\u5982\u6211\u54c8\u54c8\u54c8<\/del><\/p>\n<p>\u7b49\u7b49\uff0c\u4fdd\u9669\u8d77\u89c1\u8fd8\u662f\u5f97\u518d\u7f16\u8bd1\u8fd0\u884c\u4e00\u6b21\u770b\u770b\u3002\u5509\uff1f\u600e\u4e48\u8fd8\u662f1970\u5e74\uff1f\u8fd9\u4e0d\u79d1\u5b66\u554a\uff01\uff01\uff01<\/p>\n<p>\u7ee7\u7eed\u67e5\u9605\u4e86\u4e00\u4e0b\u8d44\u6599\u540e\u53d1\u73b0\uff0c\u539f\u676532\u4f4d\u8ddf64\u4f4d\u7684\u57fa\u672c\u6570\u636e\u7c7b\u578b\u8fd8\u662f\u6709\u533a\u522b\u7684<\/p>\n<table>\n<tbody>\n<tr>\n<th><\/th>\n<th>int<\/th>\n<th>long<\/th>\n<th>long long<\/th>\n<\/tr>\n<tr>\n<td>32\u4f4dCPU<\/td>\n<td>32bit<\/td>\n<td>32bit<\/td>\n<td>64bit<\/td>\n<\/tr>\n<tr>\n<td>64\u4f4dCPU<\/td>\n<td>32bit<\/td>\n<td>64bit<\/td>\n<td>64bit<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728iPhone5\u4e0a\uff0cint\u8ddf<code>long<\/code>\u7c7b\u578b\u5176\u5b9e\u662f\u7b49\u540c\u7684\uff0c\u90fd\u662f32bit\uff0c\u800c\u5728iPhone5s\u4e0a<code>long<\/code>\u7c7b\u578b\u4e0e<code>long long<\/code>\u7c7b\u578b\u662f\u7b49\u540c\u7684\uff0c\u90fd\u662f64bit\u3002\u4e8e\u662f\u5c06pch\u6587\u4ef6\u4e2d\u7684\u5b8f\u5b9a\u4e49\u4fee\u6539\u4e86\u4e00\u4e0b\u3002<\/p>\n<blockquote><p>#define NSInteger long long<\/p><\/blockquote>\n<p>\u7f16\u8bd1\u8fd0\u884c\uff0cOK\uff0c\u95ee\u9898\u89e3\u51b3<del datetime=\"2016-11-23T14:54:04+00:00\">~\u673a\u667a\u5982\u6211~<\/del><\/p>\n<p>\u7b49\u7b49\uff0c\u8fd9\u6ee1\u5c4f\u5e55\u7684<code>warning<\/code>\u662f\u600e\u4e48\u56de\u4e8b\uff1f\uff1f\uff1f(\u256f\u2035\u25a1\u2032)\u256f\ufe35\u253b\u2501\u253b<\/p>\n<h1>\u5c0f\u7ed3<\/h1>\n<p><del datetime=\"2016-11-23T14:54:04+00:00\">\u6bd5\u7adf\u672c\u4eba\u61d2\u764c\u665a\u671f<\/del>\uff0c\u8fd9\u79cd\u65b9\u6cd5\u7b80\u5355\u7c97\u66b4\uff0c\u4f46\u4f1a\u8ba9\u4f60\u7684\u9879\u76ee\u5230\u5904\u90fd\u662f<code>warning<\/code>\uff0c\u5f3a\u8feb\u75c7\u60a3\u8005\u614e\u7528\uff01\uff01\uff01\u5982\u679c\u6709\u66f4\u597d\u7684\u89e3\u51b3\u65b9\u6cd5\uff08\u53ea\u8981\u4e0d\u662f\u624b\u52a8\u5c06\u9700\u8981<code>NSInteger<\/code>\u66ff\u6362\u6210<code>long long<\/code>\uff09\u8bf7\u544a\u8bc9\u6211~<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u6211\u4eec\u7684APP\u4e2d\uff0c\u6709\u4e00\u5904\u5730\u65b9\u5c55\u793a\u7684\u662f\u201c\u751f\u65e5\u201d\uff0c\u8fd9\u4e2a\u751f\u65e5\u6570\u636e\u662f\u8bf7\u6c42\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6570\u636e\uff0c\u5728\u4e0a\u4e00\u4e2a\u7248\u672c\u53d1\u5e03\u4e4b\u540e\u9646\u7eed\u5730\u6709 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/flykite.me\/index.php?rest_route=\/wp\/v2\/posts\/11"}],"collection":[{"href":"https:\/\/flykite.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flykite.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flykite.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flykite.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11"}],"version-history":[{"count":1,"href":"https:\/\/flykite.me\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":12,"href":"https:\/\/flykite.me\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions\/12"}],"wp:attachment":[{"href":"https:\/\/flykite.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flykite.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flykite.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}