IOS开发入门iOS 开发 Xcode 8.1创建新项目的配置--详解
白羽 2019-05-21 来源 :网络 阅读 888 评论 0

摘要:本文将带你了解IOS开发入门iOS 开发 Xcode 8.1创建新项目的配置--详解,希望本文对大家学IOS有所帮助。

    本文将带你了解IOS开发入门iOS 开发 Xcode 8.1创建新项目的配置--详解,希望本文对大家学IOS有所帮助。


IOS开发入门iOS 开发 Xcode 8.1创建新项目的配置--详解


iOS 开发 Xcode   8.1创建新项目的配置–详解
    1.创建项目内容
   
    2.TARGETS–>General设置
    // 图标,启动图片,拖入图片资源//名称,版本,支持的方向,系统的版本info.plistBundle display   name;Bundle versions string , short;Supported interface   orientations;(三个方向)项目-TARGETS-General - 8.0以上
   
   
    3..pch文件设置
  //pch文件创建:iOS-Other-PCH.file //直接拖入已写好的配置:项目-TARGETS-Build Setting -   All - Prefix - Prefix Header - 双击添加相对路径 ./项目名称/pch文件名.pch;
   
   
    ////    PrefixHeader.pch////  Created by Apple on 14/6/13.//  Copyright ?   2014年 zhouyu. All rights reserved.// #ifndef PrefixHeader_pch#define   PrefixHeader_pch // 如果当前是OC的代码就用下面的这些东西// 主要是屏蔽c文件# ifdef   __OBJC__ #define JDGUITextFieldHeight 40.0#define KUIScreenSize   [UIScreen mainScreen].bounds.size#define KUIScreenWidth [UIScreen   mainScreen].bounds.size.width#define KUIScreenHeight [UIScreen   mainScreen].bounds.size.height#define BackGroundColor(R,G,B) [UIColor   colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:1.0] // 自定义输入日志   Log#ifdef  DEBUG // 如果当前是开发 调试阶段可以用ZYLog输入#define ZYLog(...)   NSLog(__VA_ARGS__)#else // 发布后就不能输入了#define   ZYLog(...)#endif #endif #endif /* PrefixHeader_pch */
    4.设置图片资源
    删除LaunchScreen.storyboard
   

    设置启动图标和APP图片
   
   
    5.隐私设置
    包括访问 相册/相机/麦克风/通讯录 iOS 10不设置,使用相关功能APP会发生崩溃
    还有蓝牙,日历,健康,地图定位等等
   
   
    6.纯代码搭建界面
    删除不必要文件
   
   
    AppDelegate<喎� target="_blank">vcD4NCjxwcmUgY2xhc3M9"brush:java;">
    #import "AppDelegate.h"
    #import "TabBarController.h"
   
   
    @interface AppDelegate ()
   
    @end
   
    @implementation AppDelegate
   
   
    - (BOOL)application:(UIApplication *)application   didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
   
   
        self.window = [[UIWindow alloc]   initWithFrame:[UIScreen mainScreen].bounds];
        // 2.设置为窗口的跟控制器
    //    if ([self isNewVersion])   {
    //       
    //          self.window.rootViewController = [[GuideController alloc] init];
    //    } else {
   
              self.window.rootViewController = [[TabBarController alloc]   init];
    //    }
   
        [self.window   makeKeyAndVisible];
   
        return YES;
    }
    根据功能搭建架构
   
    7.cocoapods集成第三方库
    打开终端cd 切换到当前项目路径
   
    pod init
   
   
    打开Podfile文件修改内容
   
   
    platform :ios, ‘8.0’ #项目名称(英文名称),替换成项目名称target   '项目名称(英文名称)' dopod 'Masonry'pod 'AFNetworking'pod 'SDWebImage'pod   'SVProgressHUD'pod 'Bugly' end
    ?12//安装第三方库pod install
    初次安装比较费时
   
    安装成功
   
    8.项目.xcworkspace文件生成不出来的情况
   
    解决方案:运行 gem install cocoapods 更新cocoapods工具,然后再执行pod install
      xxxxx$   gem install cocoapodsFetching: nap-1.0.0.gem (100%)Successfully installed   nap-1.0.0Fetching: molinillo-0.4.0.gem (100%)Successfully installed   molinillo-0.4.0Fetching: cocoapods-trunk-0.6.4.gem (100%)Successfully   installed cocoapods-trunk-0.6.4Fetching: cocoapods-try-0.5.1.gem   (100%)Successfully installed cocoapods-try-0.5.1Fetching:   cocoapods-stats-0.6.2.gem (100%)Successfully installed   cocoapods-stats-0.6.2Fetching: cocoapods-search-0.1.0.gem (100%)Successfully   installed cocoapods-search-0.1.0Fetching: cocoapods-downloader-0.9.3.gem   (100%)Successfully installed cocoapods-downloader-0.9.3Fetching:   cocoapods-core-0.39.0.gem (100%)Successfully installed   cocoapods-core-0.39.0Fetching: cocoapods-0.39.0.gem (100%)Successfully   installed cocoapods-0.39.0Parsing documentation for nap-1.0.0Installing ri   documentation for nap-1.0.0Parsing documentation for   molinillo-0.4.0Installing ri documentation for molinillo-0.4.0Parsing   documentation for cocoapods-trunk-0.6.4Installing ri documentation for   cocoapods-trunk-0.6.4Parsing documentation for cocoapods-try-0.5.1Installing   ri documentation for cocoapods-try-0.5.1Parsing documentation for   cocoapods-stats-0.6.2Installing ri documentation for   cocoapods-stats-0.6.2Parsing documentation for cocoapods-search-0.1.0Installing   ri documentation for cocoapods-search-0.1.0Parsing documentation for   cocoapods-downloader-0.9.3Installing ri documentation for   cocoapods-downloader-0.9.3Parsing documentation for   cocoapods-core-0.39.0Installing ri documentation for cocoapods-core-0.39.0Parsing   documentation for cocoapods-0.39.0Installing ri documentation for   cocoapods-0.39.09 gems installedxxxxx$ pod installUpdating local specs   repositoriesAnalyzing dependenciesDownloading dependenciesInstalling   AFNetworking (2.5.4)Installing DACircularProgress (2.3.1)Installing FMDB   (2.5)Installing GCJSONKit (1.5.0)Installing IQKeyboardManager   (3.2.0.3)Installing MBProgressHUD (0.9.1)Installing MWPhotoBrowser   (1.4.1)Installing MarqueeLabel (2.0.10)Installing NJKScrollFullScreen   (0.2.6)Installing PSTCollectionView (1.2.3)Installing SDWebImage   (3.7.3)Installing SSKeychain (1.2.3)Installing TOWebViewController   (2.0.19)Installing TTTAttributedLabel (1.10.1)Installing UICountingLabel   (1.1.0)Installing UMeng (2.2.1)Installing UMengSocial (4.3)Installing   XYPieChart (0.2)Generating Pods projectIntegrating client project [!]   Please close any current Xcode sessions and use `xxx.xcworkspace` for this   project from now on.Sending statsPod installation complete! There are 14   dependencies from the Podfile and 18total pods installed.xxxxx$   


本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标移动开发之IOS频道!

本文由 @白羽 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 0
看完这篇文章有何感觉?已经有0人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved

208小时内训课程