【发布时间】:2014-03-03 02:08:25
【问题描述】:
我正在构建/学习我的第一个 Xcode 应用程序。我以前用过 C,现在正在尝试学习 Objective C 来构建 iPhone 应用程序。
我构建了一个简单的应用程序,当我运行 iOS 模拟器并按下一个指向故事板中另一个屏幕的按钮时,应用程序崩溃了。到目前为止,我已经使用故事板构建了整个应用程序。
这是我的整个 main.m 文件...
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
这是错误...
2014-03-02 21:22:04.422 膳食计划生成器[4777:70b] * 终止 应用程序由于未捕获的异常“NSGenericException”,原因:“推送 仅当源控制器由 UINavigationController 的实例。 * 第一次抛出调用堆栈:( 0 CoreFoundation 0x00000001018a2795 exceptionPreprocess + 165 1 libobjc.A.dylib
0x00000001015ee991 objc_exception_throw + 43 2 UIKit
0x00000001006ef051 -[UIStoryboardPushSegue destinationContainmentContext] + 0 3 UIKit
0x0000000100252096 -[UIApplication sendAction:to:from:forEvent:] + 80 4 UIKit 0x0000000100252044 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 17 5 UIKit 0x0000000100326450 -[UIControl _sendActionsForEvents:withEvent:] + 203 6 UIKit 0x00000001003259c0 -[UIControl touchesEnded:withEvent:] + 530 7
UIKit 0x0000000100286c15 -[UIWindow _sendTouchesForEvent:] + 701 8 UIKit 0x0000000100287633 -[UIWindow sendEvent:] + 988 9 UIKit
0x0000000100260fa2 -[UIApplication sendEvent:] + 211 10 UIKit
0x000000010024ed7f _UIApplicationHandleEventQueue + 9549 11 核心基础 0x0000000101831ec1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 12 核心基础 0x0000000101831792 __CFRunLoopDoSources0 + 242 13 CoreFoundation 0x000000010184d61f __CFRunLoopRun + 767 14 CoreFoundation
0x000000010184cf33 CFRunLoopRunSpecific + 467 15 图形服务
0x00000001039923a0 GSEventRunModal + 161 16 UIKit
0x0000000100251043 UIApplicationMain + 1010 17 膳食计划生成器
0x0000000100001193 main + 115 18 libdyld.dylib
0x0000000101f1a5fd start + 1 ) libc++abi.dylib: 终止于 NSException (lldb) 类型的未捕获异常
【问题讨论】:
-
当您发布这样的问题时,您必须始终包含完整的错误消息。
-
对不起。我将包含错误消息。它位于哪里?另外,@rmaddy 我会读到的!看起来像一篇高质量的文章!
-
@rmaddy 我已经添加了完整的错误消息(我相信)。
标签: ios crash ios-simulator