IOS小知识点8之IOS调试过程错误情况一览
2014-10-30 13:55
471 查看
IOS调试过程中错误log信息一览:以后发现逐渐添加
(1)Terminating
app due to uncaught exception 'NSInternalInconsistencyException', reason: '* -[NSCFArray
insertObject:atIndex:]: mutating method sent to immutable object'
表示数组在添加新的成员的时候出错:将一个数据添加到一个不可变的对象中了(有可能是add上去的,可有可能是insert上去的)。有时候我们在定义NSMutableArray的时候,虽然定义的是这种类型,但是在使用的时候没有初始化,所以这个对象还是固定的。
例如:原代码
NSMutableArray *urls=[defaults
objectForKey:@"URLS"];
if (!urls) {
urls=[[NSMutableArray
alloc]init];
}
[urls addObject:textUrl];
代码修改为:
NSMutableArray *urls=[defaults
objectForKey:@"URLS"];
if (!urls) {
urls=[[NSMutableArray
alloc]init];
}
NSMutableArray *newurl = [[NSMutableArrayalloc]init];
[newurl addObjectsFromArray:urls];
[newurl addObject:textUrl];
urls = newurl;
(2)linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_VRGCalendarView", referenced from:
objc-class-ref in InquirePlanViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
这个问题真的是太大名鼎鼎了,使用、***第三方静态、动态库不可避免的都会碰到这个问题,那么如何去解决呢?
《1》最有可能是项目中引入了相同的文件,如库有某个fromwork,app中又重复引入了某个app。又如打包Framework中Build Phase中的架构和文件中的重复。
《2》修改下Build settings->Linking->Other Linker Flags 这个属性。设置为-ObjC -all_load
《3》核对下Search Paths中:
Library Search Paths 以及Header Search Paths
以及 Framework Search Paths的路径是否正确。
(3)另外iphone4 4s 5c都是32位系统,而5s 6都是 64位系统,因此在编码的时候,如:
NSInterger 这里在32位系统中是int类型,在64位系统中是long类型,因此要注意数据的完整性。
(4)The
scheme 'Appname' contains
no buildables that can be built
for the
`SDKs` supported
by the run destination iPhone
Retina (4-inch).
Make sure your
targets all specify
`SDKs` that are supported
by
this version of
`Xcode`.
一般都是IOS Development Target的版本不正确,这个是应用打包之后可以运行的最低版本。比如你的手机是IOS7.0的,这个地方就不能选择IOS7.1的系统。
Base SDK是指现在程序的源代码正在编译的版本。
(1)Terminating
app due to uncaught exception 'NSInternalInconsistencyException', reason: '* -[NSCFArray
insertObject:atIndex:]: mutating method sent to immutable object'
表示数组在添加新的成员的时候出错:将一个数据添加到一个不可变的对象中了(有可能是add上去的,可有可能是insert上去的)。有时候我们在定义NSMutableArray的时候,虽然定义的是这种类型,但是在使用的时候没有初始化,所以这个对象还是固定的。
例如:原代码
NSMutableArray *urls=[defaults
objectForKey:@"URLS"];
if (!urls) {
urls=[[NSMutableArray
alloc]init];
}
[urls addObject:textUrl];
代码修改为:
NSMutableArray *urls=[defaults
objectForKey:@"URLS"];
if (!urls) {
urls=[[NSMutableArray
alloc]init];
}
NSMutableArray *newurl = [[NSMutableArrayalloc]init];
[newurl addObjectsFromArray:urls];
[newurl addObject:textUrl];
urls = newurl;
(2)linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_VRGCalendarView", referenced from:
objc-class-ref in InquirePlanViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
这个问题真的是太大名鼎鼎了,使用、***第三方静态、动态库不可避免的都会碰到这个问题,那么如何去解决呢?
《1》最有可能是项目中引入了相同的文件,如库有某个fromwork,app中又重复引入了某个app。又如打包Framework中Build Phase中的架构和文件中的重复。
《2》修改下Build settings->Linking->Other Linker Flags 这个属性。设置为-ObjC -all_load
《3》核对下Search Paths中:
Library Search Paths 以及Header Search Paths
以及 Framework Search Paths的路径是否正确。
(3)另外iphone4 4s 5c都是32位系统,而5s 6都是 64位系统,因此在编码的时候,如:
NSInterger 这里在32位系统中是int类型,在64位系统中是long类型,因此要注意数据的完整性。
(4)The
scheme 'Appname' contains
no buildables that can be built
for the
`SDKs` supported
by the run destination iPhone
Retina (4-inch).
Make sure your
targets all specify
`SDKs` that are supported
by
this version of
`Xcode`.
一般都是IOS Development Target的版本不正确,这个是应用打包之后可以运行的最低版本。比如你的手机是IOS7.0的,这个地方就不能选择IOS7.1的系统。
Base SDK是指现在程序的源代码正在编译的版本。
相关文章推荐
- .Net开发过程中安装、调试的常见问题与错误!!!
- 避免java.lang.NullPointerException错误(jsp调试过程中烦人而无奈的java异常)
- 个人在iOS开发过程中真机调试遇到的问题及解决方法 推荐
- iOS开发过程中专门在调试时运行代码的方法
- [ios]添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试 【转】
- 一网打尽 .Net 开发过程中安装、调试的常见问题与错误!
- 【ios真机调试错误汇总】Could not change executable permissions on the application.
- 开发过程中的一次GDB调试(段错误,core文件)
- iOS 调试时的错误:Couldn't register com.xxxx with the bootstrap server
- iOS开发过程中的一些错误提示和解决办法大全
- Ext调试过程中遇到错误代码:0x80070057
- linux下GCC编译环境中二叉树遍历、C语言实现以及调试过程中段错误
- rac情况下单步调试存储过程可能会挂掉
- iOS真机调试常见错误及解决方案
- ios 调试技巧收藏 一 解决EXC_BAD_ACCESS错误的一种方法--NSZombieEnabled
- 关于在查询分析器下调试存储过程提示Sqlle.dll错误的一种解决办法
- 调试VIVI: 一系列莫名错误及其解决过程
- orcale 存储过程调试以及常见错误
- iOS开发笔记--添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 关于多次颁发ios开发证书后,真机调试的错误问题解决