iOS 笔记(1)

来源:互联网 发布:方维借贷源码 编辑:程序博客网 时间:2024/06/05 12:42

由于之前公司的项目是从外包手里接回来搞了一段时间,准备开新的工程,重构项目;下面记录一些重构中遇到的问题,让自己加深印象、也希望对另外的朋友有帮助~说的不对的地方请指正~谢谢!

1、xcode6中去除了pch文件,如果需要用到pch文件需要自己创建一个、然后设置pch文件的路径

第一步:创建PCH文件

第二步:在项目build setting中设置 pch文件路径


这里是pch 文件的路径。如果提示找不到pch文件的话 就查看地址对不对


2、即成支付宝SDK的时候提示说 'openssl/asn1.h' file not found

我是这样解决的,在build setting -> header search paths 里面有木有设置alipay的SDK路径


$(SRCROOT) :表示的当前目录

3、新开的项目是ARC的,导入一些地方库的时候经常出现  'autorelease' is unavailable: not available in automatic reference counting mode  这个问题是因为导入的问题是非ARC文件、这时候我们需要混编模式。

 在build phases -> Compile Sources 里面找到报错的文件 ,把Compiler Falg 设置为-fno-objc-arc 就OK了。


4、已项目还支持了32位的iOS系统,所以换到64位的时候会出现很多的黄色警告看的都很不爽~~

我们可以直接通过设置 target -> build settting -> other warning flags 为 -Wno-shorten-64-to-32 来关闭工程中的类型警告



5、因为新项目对项目本来的文件做了整理,所以出现了The Copy Bundle Resources build phase contains this target's Info.plist file  这样一个黄色的警告。在苹果技术问答是说这样解决的。

在target -> build phases ->copy bundle resources 把info.plist文件引用移除

The INFOPLIST_FILE build setting specifies the name of the Info.plist associated with your target. When building a target, Xcode reads this build setting and copies the referenced Info.plist into your application bundle. Because Xcode automatically processes theInfo.plist, you should not add it to your Copy Bundle Resources build phase or make it a target member.

To resolve this warning, select your Info.plist from the Copy Bundle Resource build phase as shown in Figure 1, then click the Remove (–) button to delete it from the phase

0 0