{"id":579,"date":"2018-02-23T23:40:10","date_gmt":"2018-02-23T15:40:10","guid":{"rendered":"http:\/\/60.205.208.74\/2018\/02\/23\/ios%e9%80%9a%e7%94%a8%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f\/"},"modified":"2018-02-23T23:40:10","modified_gmt":"2018-02-23T15:40:10","slug":"ios%e9%80%9a%e7%94%a8%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/www.puzi7.net\/?p=579","title":{"rendered":"iOS\u901a\u7528\u5e94\u7528\u7a0b\u5e8f"},"content":{"rendered":"<span itemprop=\"description\"><div class=\"article-body\">\n<div class=\"article-intro\" id=\"content\">\n<h1>IOS\u901a\u7528\u5e94\u7528\u7a0b\u5e8f<\/h1>\n<hr>\n<h2>\u7b80\u4ecb<\/h2>\n<p>\u901a\u7528\u7684\u5e94\u7528\u7a0b\u5e8f\u662f\u4e3aiPhone\u548ciPad\u5728\u4e00\u4e2a\u5355\u4e00\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u8bbe\u8ba1\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u8fd9\u6709\u52a9\u4e8e\u4ee3\u7801\u91cd\u7528\uff0c\u5e76\u80fd\u591f\u5e2e\u52a9\u66f4\u5feb\u8fdb\u884c\u66f4\u65b0\u3002<\/p>\n<h3>\u5b9e\u4f8b\u6b65\u9aa4<\/h3>\n<p>1\u3001\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684View based application\uff08\u89c6\u56fe\u5e94\u7528\u7a0b\u5e8f\uff09<\/p>\n<p>2\u3001\u5728\u6587\u4ef6\u67e5\u770b\u5668\u7684\u53f3\u8fb9\uff0c\u5c06\u6587\u4ef6ViewController.xib\u7684\u6587\u4ef6\u540d\u79f0\u66f4\u6539\u4e3aViewController_iPhone.xib\uff0c\u5982\u4e0b\u6240\u793a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" alt=\"UniversalAppInterfaceRename\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2013\/11\/UniversalAppInterfaceRename.jpg\" width=\"560\" height=\"403\" data-pinit=\"registered\"><\/p>\n<p>3\u3001\u9009\u62e9&#8221;File -&gt; New -&gt; File&#8230; &#8220;\uff0c\u7136\u540e\u9009\u62e9User Interface\uff0c\u518d\u9009\u62e9View\uff0c\u5355\u51fb\u4e0b\u4e00\u6b65<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" alt=\"NewIpadXib\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2013\/11\/NewIpadXib.jpg\" width=\"560\" height=\"381\" data-pinit=\"registered\"><\/p>\n<p>4\u3001\u9009\u62e9iPad\u4f5c\u4e3a\u8bbe\u5907\uff0c\u5355\u51fb\u4e0b\u4e00\u6b65:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" alt=\"UniversalAppSelectDeviceType\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2013\/11\/UniversalAppSelectDeviceType.jpg\" width=\"560\" height=\"378\" data-pinit=\"registered\"><\/p>\n<p>5\u3001\u5c06\u8be5\u6587\u4ef6\u53e6\u5b58\u4e3aViewController_iPad.xib\uff0c\u7136\u540e\u9009\u62e9\u521b\u5efa<\/p>\n<p>6\u3001\u5728ViewController_iPhone.xib\u548cViewController_iPad.xibd\u7684\u5c4f\u5e55\u4e2d\u5fc3\u6dfb\u52a0\u6807\u7b7e<\/p>\n<p>7\u3001\u5728ViewController_iPhone.xib\u4e2d\u9009\u62e9identity inspector\uff0c\u8bbe\u7f6ecustom class\u4e3aViewController<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" alt=\"UniversalAppSetClass\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2013\/11\/UniversalAppSetClass.jpg\" width=\"560\" height=\"402\" data-pinit=\"registered\"><\/p>\n<p>8\u3001\u66f4\u65b0AppDelegate.m\u4e2d\u7684 application:DidFinishLaunching:withOptions\u65b9\u6cd5<\/p>\n<pre>\n- (BOOL)application:(UIApplication *)application\n  didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n   self.window = [[UIWindow alloc] initWithFrame:[[UIScreen \n   mainScreen] bounds]];\n   \/\/ Override point for customization after application launch.\n   if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {\n        self.viewController = [[ViewController alloc] \n        initWithNibName:@\"ViewController_iPhone\" bundle:nil];\n   }\n   else{\n        self.viewController = [[ViewController alloc] initWithNibName:\n        @\"ViewController_iPad\" bundle:nil];\n   }\n   self.window.rootViewController = self.viewController;\n   [self.window makeKeyAndVisible];\n   return YES;\n}\n<\/pre>\n<p>9\u3001\u5728\u9879\u76ee\u6458\u8981\u4e2d\u66f4\u65b0\u8bbe\u5907\u4e2d\u4e3auniversal\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" alt=\"UniversalAppSetDevices\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2013\/11\/UniversalAppSetDevices.jpg\" width=\"560\" height=\"406\" data-pinit=\"registered\"><\/p>\n<h3>\u8f93\u51fa<\/h3>\n<p>\u8fd0\u884c\u8be5\u5e94\u7528\u7a0b\u5e8f\uff0c\u6211\u4eec\u4f1a\u770b\u5230\u4e0b\u9762\u7684\u8f93\u51fa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" alt=\"UniversalAppiPhone_Output\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2013\/11\/UniversalAppiPhone_Output.jpg\" width=\"250\" height=\"498\" data-pinit=\"registered\"><\/p>\n<p>\u5728iPad\u6a21\u62df\u5668\u4e2d\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f,\u6211\u4eec\u4f1a\u5f97\u5230\u4e0b\u9762\u7684\u8f93\u51fa:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" alt=\"UniversalAppiPad_Output\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2013\/11\/UniversalAppiPad_Output.jpg\" width=\"350\" height=\"480\" data-pinit=\"registered\"><\/p>\n<\/p><\/div>\n<\/p><\/div>\n<span>","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\"><span itemprop=\"description\">IOS\u901a\u7528\u5e94\u7528\u7a0b\u5e8f \u7b80\u4ecb \u901a\u7528\u7684\u5e94\u7528\u7a0b\u5e8f\u662f\u4e3aiPhone\u548ciPad\u5728\u4e00\u4e2a\u5355\u4e00\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d&hellip;<\/span><\/p>\n<p class=\"more-link-p btn-align-right\"><a class=\"green zoom-btn\" href=\"https:\/\/www.puzi7.net\/?p=579\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,26],"tags":[74,93],"class_list":["post-579","post","type-post","status-publish","format-standard","hentry","category-ios","category-mobile","tag-ios","tag-mobile","zoom-theme-has-thumb"],"_links":{"self":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=579"}],"version-history":[{"count":0,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/579\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}