{"id":67,"date":"2013-05-21T15:15:54","date_gmt":"2013-05-21T07:15:54","guid":{"rendered":"https:\/\/macshuo.com\/?p=67"},"modified":"2013-06-01T20:18:43","modified_gmt":"2013-06-01T12:18:43","slug":"%e6%9e%9a%e4%b8%be","status":"publish","type":"post","link":"https:\/\/macshuo.com\/?p=67","title":{"rendered":"\u679a\u4e3e"},"content":{"rendered":"<p><a href=\"https:\/\/macshuo.com\/wp-content\/uploads\/2013\/06\/2013-05-12-10.58.24.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/macshuo.com\/wp-content\/uploads\/2013\/06\/2013-05-12-10.58.24.jpg\" alt=\"2013-05-12 10.58.24\" width=\"500\" height=\"372\" class=\"alignnone size-full wp-image-68\" \/><\/a><\/p>\n<p>\u5982\u679c\u4f60\u4ee5\u4e3a\u8fd9\u662f\u4e2a\u6807\u9898\u515a\uff0c\u90a3\u4f60\u5c31\u9519\u4e86\u3002\u4eca\u5929\u7684\u5185\u5bb9\u5c31\u662f\u63a5\u7740\u6628\u5929\u7684\u8bdd\u9898\u8bb2Objective-C\u3002<\/p>\n<p>\u60f3\u542c\u626f\u6de1\u7684\u7b49\u660e\u5929\u5427\u3002<\/p>\n<p>2\u3001\u679a\u4e3e\u7c7b\u578b\u7684\u6539\u8fdb<\/p>\n<p>\u5728OS X v10.5\u4e4b\u524d\uff0c\u6211\u4eec\u5982\u4f55\u5728Objective-C\u4e2d\u5b9a\u4e49\u4e00\u4e2a\u679a\u4e3e\u7c7b\u578b\u5462\uff1f\u5982\u4e0b\uff1a<\/p>\n<pre><code>typedef enum { \n    ObjectiveC,\n    Java, \n    Ruby, \n    Python, \n    Erlang }\nLanguage;\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u5199\u6cd5\u7b80\u5355\u660e\u4e86\uff0c\u7528\u8d77\u6765\u4e5f\u4e0d\u590d\u6742\uff0c\u4f46\u662f\u6709\u4e00\u4e2a\u95ee\u9898\uff0c\u5c31\u662f\u5176\u679a\u4e3e\u503c\u7684\u6570\u636e\u8303\u56f4\u662f\u6a21\u7cca\u7684\uff0c\u8fd9\u4e2a\u6570\u503c\u53ef\u80fd\u975e\u5e38\u5927\uff0c\u53ef\u80fd\u662f\u8d1f\u6570\uff0c\u65e0\u6cd5\u754c\u5b9a\u3002<\/p>\n<p>\u5728OS X v10.5\u4e4b\u540e\u548ciOS\u4e2d\uff0c\u4f60\u53ef\u4ee5\u8fd9\u6837\u5199\uff1a<\/p>\n<pre><code>enum {\n    ObjectiveC,\n    Java,\n    Ruby,\n    Python,\n    Erlang\n};\n<\/code><\/pre>\n<p>typedef NSUInteger Language;<\/p>\n<p>\u8fd9\u79cd\u5199\u6cd5\u7684\u597d\u5904\u662f\uff0c\u9996\u5148\u8fd9\u4e2a\u679a\u4e3e\u7684\u6570\u636e\u7c7b\u578b\u662f\u786e\u5b9a\u7684\uff0c\u65e0\u7b26\u53f7\u6574\u6570\u3002\u5176\u6b21\u7531\u4e8e\u6211\u4eec\u91c7\u7528\u4e86 NSUInteger\uff0c\u53ef\u4ee5\u4e0d\u7528\u8003\u865132\u4f4d\u548c64\u4f4d\u7684\u95ee\u9898\u3002\u5e26\u6765\u7684\u95ee\u9898\u662f\u6570\u636e\u7c7b\u578b\u548c\u679a\u4e3e\u5e38\u91cf\u6ca1\u6709\u663e\u5f0f\u7684\u5173\u8054\u3002<\/p>\n<p>\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u8fd9\u6837\u5199\u679a\u4e3e\u4e86\uff1a<\/p>\n<pre><code>typedef enum Language : NSUInteger{\n    ObjectiveC,\n    Java, \n    Ruby, \n    Python, \n    Erlang \n}Language;\n<\/code><\/pre>\n<p>\u5728\u5217\u51fa\u679a\u4e3e\u5185\u5bb9\u7684\u540c\u65f6\u7ed1\u5b9a\u4e86\u679a\u4e3e\u6570\u636e\u7c7b\u578bNSUInteger\uff0c\u8fd9\u6837\u5e26\u6765\u7684\u597d\u5904\u662f\u589e\u5f3a\u7684\u7c7b\u578b\u68c0\u67e5\u548c\u66f4\u597d\u7684\u4ee3\u7801\u53ef\u8bfb\u6027\u3002<\/p>\n<p>\u5f53\u7136\uff0c\u5bf9\u4e8e\u666e\u901a\u5f00\u53d1\u8fd9\u6765\u8bf4\uff0c\u679a\u4e3e\u7c7b\u578b\u53ef\u80fd\u4e0d\u4f1a\u6d89\u53ca\u5230\u590d\u6742\u7684\u6570\u636e\uff0c\u4f7f\u7528\u4e4b\u524d\u7684\u4e24\u79cd\u5199\u6cd5\u4e5f\u4e0d\u4f1a\u6709\u4ec0\u4e48\u5927\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u4f60\u4ee5\u4e3a\u8fd9\u662f\u4e2a\u6807\u9898\u515a\uff0c\u90a3\u4f60\u5c31\u9519\u4e86\u3002\u4eca\u5929\u7684\u5185\u5bb9\u5c31\u662f\u63a5\u7740\u6628\u5929\u7684\u8bdd\u9898\u8bb2Objecti &hellip; <a href=\"https:\/\/macshuo.com\/?p=67\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":68,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[1],"tags":[3],"class_list":["post-67","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-objective-c","has-featured-image"],"jetpack_featured_media_url":"https:\/\/macshuo.com\/wp-content\/uploads\/2013\/06\/2013-05-12-10.58.24.jpg","_links":{"self":[{"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/macshuo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67"}],"version-history":[{"count":5,"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":107,"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions\/107"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/media\/68"}],"wp:attachment":[{"href":"https:\/\/macshuo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/macshuo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/macshuo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}