OS 问题集合

来源:互联网 发布:智能电视 视频软件 编辑:程序博客网 时间:2024/06/06 13:00

10.(xcode5.0 DEV target:iOS5.0) Could not find a storyboard named 'Main' in bundle

描述:用xcode新建工程,将development target 设置为5.0,在5.0的设备上运行报错“Could not find a storyboard named 'Main' in bundle”

  解决办法如下:
打开storyboard,将设置改为如下图所示,再运行即可

 

 

9.百度地图v2.02 -[SingleCircleView layer]: message sent to deallocated instance 错误。

由于进入进行位置跟踪之前打开了位置定位服务:mapView.showsUserLocation = YES;//显示定位图层  ,初步判断地层SingleCircleView调用了layer的画图方法。由于这个推出前没有关闭,导致后台还继续在画图。

解决办法:在推出之前关闭定位,问题解决。但是lz退出后释放了内存,奇怪为什么mapview还是处于活跃状态。有更深了解的大侠请赐教。

 

 

8. iOS APP Project or  Mac APP Project编译错误提示:
“The run destination My Mac 64-bit is not valid for Running the scheme '***'.
The scheme '***' contains no buildables that can be built for the SDKs supported by the run destination My Mac 64-bit. Make sure your targets all specify SDKs that are supported by this version of Xcode.“

.  问题原因:
工程设定的SDK Version和PC上安装的Xcode对应的Mac or iOS SDK Version不一致。

. 解决办法:
Solution,to change the Base SDK Version:
1) Click on the project icon in the left hand panel.
2) In the right hand panel that appears, select Build Settings » all.
3) You'll see the option to change the "Base SDK". Architectures » Base SDK.
4) change Base SDK option to your project corresponding SDK version, OS X SDKs or iOS SDKs.  eg: OS X 10.8 or iOS 6.0.

 

7.调试技巧:

1.开启NSZombieEnabled:

  方式一:

  Xcode4  Product -> Edit Scheme-> Arguments, 然后将点击”加号”, 将 NSZombieEnabled 参数加到Environment Variables 窗口中, 后面的数值写上 ”YES”.

 

  方式二:

   Xcode4 菜单 Product -> EditScheme -> Diagnostics 设置窗口中直接勾上Enable ZombieObjects 即可,Xcode 可用 cmd+shift+< 进到这个窗口。

2.调用输出方法执行顺序.

  有时程序崩溃根本不知错误发生在什么地方。比如程序出现EXEC_BAD_ACCESS的时候,虽然大部分情况使用设定NSZombieEnabled环境变量可以帮助你找到问题的所在,但少数情况下,即使设定了NSZombieEnabled环境变量,还是不知道程序崩溃在什么地方。那么就需要使用下列代码进行帮助了:

 



#ifdef _FOR_DEBUG_
-(BOOL)respondsToSelector:(SEL)aSelector{
printf("SELECTOR: %s\n",[NSStringFromSelector(aSelector)UTF8String]);
return[super respondsToSelector:aSelector];
}

#endif

 

你需要在每个object的.m或者.mm文件中加入上面代码,并且在other c flags中加入-D _FOR_DEBUG_(记住请只在Debug Configuration下加入此标记)。这样当你程序崩溃时,Xcode的console上就会准确地记录了最后运行的object的方法。

3.使用Object Allocations

  1.Run in Performance tool ‘Object Allocations’

  2.如图示:

 

 

  

 6..升级xcode 4.5,真机测试中出现如问题:Could not instantiate class named NSLayoutConstraint

原因:设置了xib自动布局.

解决方法:选中xib,在属性面板第一个选项卡:将interface builder document 中间use autolayout 复选框的勾去掉.

5. 添加SenTestingKit.framework后报错如下:

 

dyld:Librarynot loaded:@rpath/SenTestingKit.framework/Versions/A/SenTestingKit  Referencedfrom:/Users/turner/Library/ApplicationSupport/iPhone Simulator/5.1/Applications/798C5368-9BE2-4697-916B-37111953F2C8/EISElasticImage.app/EISElasticImage  Reason: image not found(lldb)解决办法:在项目/targets/link binary with libary: 把改类库的可选属性:requried 改为optional

 

4. 使用Hpple时解析html,添加libxml2 框架后,编译出现: "libxml/tree.h"  header file not found.

  解决办法: 这是由于没有添加头文件路径所致. 点击项目>>targets>> build Setting>>search paths 给header search paths 添加一个值:${SDKROOT}/usr/include/libxml2

3. Provisioning profile XXXX can't be found"

解决办法:这时候,先copy那行出错信息,然后关闭这个项目,打开finder到你的项目文件xxxx.xcodeproj上面按鼠标右键,选择Show Package Contents菜单,在新打开的finder的,找到project.pbxproj,使用一个文本edit打开它,用查找功能找到所有的有那行编码的位置,删除那一行,至少应该有两个地方 .删除以后,保存这个 project.pbxproj 文件,用xcode重新打开你的项目,再编译一下试试 

 

2.asiHttpRequest 导致的链接错误.

<span style="color: #ff0000;">_inflate", referenced from:
      +[ASIHTTPRequest uncompressZippedData:] in ASIHTTPRequest.o
      +[ASIHTTPRequest uncompressZippedDataFromSource:toDestination:] in ASIHTTPRequest.o</span>

解决办法:由于缺少了类库,导入CFNetWork,libz.1.2.5.dylib,systemConfiguration,mobileCoreServices即可. 

1.编译报错:Unsupported compiler 'GCC 4.2' selected for architecture 'i386' 

解决办法: Compiler for C/C++/Objective-C 这项,改为 LLVM GCC 4.2 即可 

作者:@Time4cnblogs
出处:http://www.cnblogs.com/try2do-neo/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.
0 0