【发布时间】:2014-10-08 11:09:35
【问题描述】:
我正在编写一个 iPad 应用程序,今天我意识到,如果没有互联网连接,就会出现问题。
我收到这个信息量很大的错误:
*** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“数据参数为零”
我想,我把它限制在这个 sn-p:
@implementation WebviewPanelFactory
- (WebviewPanelViewController *)webviewPanelForSection:(NSDictionary *)section {
WebviewPanelViewController *webviewPanel = [[WebviewPanelViewController new] initWithNibName:@"WebviewPanel" bundle:nil];
webviewPanel.sectionTitle = section[@"Title"];
NSLog(@"HERE I AM. %@ %@", webviewPanel, section);
[self setupURLsForWebview:webviewPanel withSection:section];
NSLog(@"HERE I STILL AM");
[webviewPanel initWebviewPanel];
return webviewPanel;
}
- (void)setupURLsForWebview:(WebviewPanelViewController *)webviewPanel withSection:(NSDictionary *)section {
NSLog(@"HERE I AM. %@", section);
...
}
@end
第一个 NSLog 得到打印并且两个变量都存在。但是第二个和第三个(应该在第一个之后立即调用)都不会被打印出来。
有什么想法,怎么继续?
【问题讨论】:
标签: ios objective-c cocoa cocoa-touch