繁体   English   中英

如果不是64位版本,IOS7应用会在模拟器中崩溃,并且在iPhone4和5s上可以正常运行

[英]IOS7 app crashes in simulator when not in 64 bits, runs fine on iPhone4 and 5s

我是这里的新手,也是iOS编程的新手,请多多包涵!

我遇到了这个奇怪的问题。 我创建了一个可以在iPhone 5s和iPhone 4上正常运行的iPhone应用程序。但是,当我在iOS模拟器7.1版(463.9.41)上运行该应用程序时,该应用程序仅在64位模式下运行,并且在所有其他模式下均崩溃。

根据您的建议提供的信息:

  1. 我重命名了属性“ Description”,没有任何更改,并且完全相同的错误消息包括单词“ Description”。 但是,“ Description”一词在我的代码中已不复存在。
  2. 我清除了ViewController中的所有内容,但仍然可以正常运行。
  3. 检查所有插座和连接,然后单击确定。

知道可能是什么原因吗?


*由于未捕获的异常'NSUnknownKeyException'而终止应用程序,原因:'[setValue:forUndefinedKey:]:此类不符合键说明的键值编码。 *首先抛出调用堆栈:

0   CoreFoundation                      0x018021e4 __exceptionPreprocess + 180
1   libobjc.A.dylib                     0x015818e5 objc_exception_throw + 44
2   CoreFoundation                      0x01891fe1 -[NSException raise] + 17
3   Foundation                          0x01241d9e -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
4   Foundation                          0x011ae1d7 _NSSetUsingKeyValueSetter + 88
5   Foundation                          0x011ad731 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267

6   Foundation                          0x0120fb0a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
7   UIKit                               0x004f81f4 -[UIRuntimeOutletConnection connect] + 106
8   libobjc.A.dylib                     0x015937de -[NSObject performSelector:] + 62
9   CoreFoundation                      0x017fd76a -[NSArray makeObjectsPerformSelector:] + 314
10  UIKit                               0x004f6d4d -[UINib instantiateWithOwner:options:] + 1417
11  UIKit                               0x0035f6f5 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
12  UIKit                               0x0035fe9d -[UIViewController loadView] + 302
13  UIKit                               0x003600d3 -[UIViewController loadViewIfRequired] + 78
14  UIKit                               0x003605d9 -[UIViewController view] + 35
15  UIKit                               0x00280267 -[UIWindow addRootViewControllerViewIfPossible] + 66
16  UIKit                               0x002805ef -[UIWindow _setHidden:forced:] + 312
17  UIKit                               0x0028086b -[UIWindow _orderFrontWithoutMakingKey] + 49
18  UIKit                               0x0028b3c8 -[UIWindow makeKeyAndVisible] + 65
19  UIKit                               0x0023bbc0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 2097
20  UIKit                               0x00240667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
21  UIKit                               0x00254f92 -[UIApplication handleEvent:withNewEvent:] + 3517
22  UIKit                               0x00255555 -[UIApplication sendEvent:] + 85
23  UIKit                               0x00242250 _UIApplicationHandleEvent + 683
24  GraphicsServices                    0x037f7f02 _PurpleEventCallback + 776
25  GraphicsServices                    0x037f7a0d PurpleEventCallback + 46
26  CoreFoundation                      0x0177dca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
27  CoreFoundation                      0x0177d9db __CFRunLoopDoSource1 + 523
28  CoreFoundation                      0x017a868c __CFRunLoopRun + 2156
29  CoreFoundation                      0x017a79d3 CFRunLoopRunSpecific + 467
30  CoreFoundation                      0x017a77eb CFRunLoopRunInMode + 123
31  UIKit                               0x0023fd9c -[UIApplication _run] + 840
32  UIKit                               0x00241f9b UIApplicationMain + 1225
33  Cards                               0x0000c24d main + 141
34  libdyld.dylib                       0x01e49701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

尝试将属性Description重命名为其他名称。 description是NSObject和其他一些对象的只读属性,可能与您的属性冲突。

检查Xibs或Storyboard的插座,如果其中一个未连接,则会出现此错误。 如果您使用的是“键值编码”,则键名不正确(请检查拼写)。

我找到了答案。

更改项目名称后(在xcode窗口的左上方),发生了这种情况。 当您这样做时,Xcode询问是否还必须重命名我回答“是”的几个系统文件。 此后,我的应用程序名称已正确更改,但除非在64位模式下运行,否则在模拟器上会崩溃。 在iPhone上,在任何情况下都可以正常工作。

即使我保留所有项目名称(应用程序名称除外)不变,也会发生相同的情况。 当我改回应用程序名称时,一切正常。

我说这是Xcode中的错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM