xcode 在模拟器上运行良好,但部署到 ios 6 时遇到错误

Posted

技术标签:

【中文标题】xcode 在模拟器上运行良好,但部署到 ios 6 时遇到错误【英文标题】:xcode running well on simulator but when deploy to ios 6 encounter error 【发布时间】:2012-10-08 06:50:59 【问题描述】:

2012-10-08 14:48:14.579 sageby[2716:907] * 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[SBJsonParser errorTrace]:无法识别的选择器发送到实例 0x1fda4660” * 首先抛出调用栈: (0x352412a3 0x34a1397f 0x35244e07 0x35243531 0x3519af68 0x12932f 0x1293a7 0x12cda3 0x12c9b1 0x12c753 0x12aac7 0x12e567 0x12eac3 0x3a26bef5 0x3a1ab9f1 0x3a1ab90d 0x384ba5df 0x384b9ccb 0x384e2133 0x3518774d 0x384e2593 0x3844615d 0x35216683 0x35215ee9 0x35214cb7 0x35187ebd 0x35187d49 0x35ef02eb 0x37dcd301 0xaaaf1 0x39e0cb20) libc++abi.dylib:终止调用抛出异常 (lldb)


//MBProgressHUD 
    MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.view animated:YES];
    hud.labelText=@"Accessing account..";
    hud.labelFont=[UIFont fontWithName:@"Arial Rounded MT Bold" size:14];


            //URL GETTING
            NSString *phpfile=[[NSString alloc]initWithFormat:@"http://dev.xxxx.com/pxxx/Module_MyPxxx/json_xxxx_xxx_info.php"];
            NSString *param_str=[[NSString alloc]initWithFormat:@"email=%@", mydelegate.overall_email];
            NSString *receivedDataAsString=[mydelegate phpConnection:param_str :phpfile];

            SBJsonParser *parser=[[SBJsonParser alloc]init];
            NSError *error=nil;
            self.dic_user_info=[[parser objectWithString:receivedDataAsString error:&error]objectAtIndex:0];
            if(error)
            
                NSLog(@"JSON Parser error! Reason: %@", error.localizedDescription);
            



            //URL GETTING
            phpfile=[[NSString alloc]initWithFormat:@"http://dev.xxx.com/pxxx/Module_MyPxxx/json_get_xxx_xxx_pxxx.php"];
            param_str=[[NSString alloc]initWithFormat:@"email=%@", mydelegate.overall_email];
            receivedDataAsString=[mydelegate phpConnection:param_str :phpfile];

            parser=[[SBJsonParser alloc]init];
            error=nil;
            self.array_polls=[parser objectWithString:receivedDataAsString error:&error];
            if(error)
            
                NSLog(@"JSON Parser error! Reason: %@", error.localizedDescription);
            

        [self.tableView reloadData];
        [MBProgressHUD hideHUDForView:self.view animated:YES];

【问题讨论】:

你能在这个错误的来源附近显示一些代码吗?你在哪里打电话“errorTrace”?? #import int main(int argc, char *argv[]) @autoreleasepool int retVal = UIApplicationMain(argc, argv, nil, nil);返回 retVal; 您必须发布代码,而不仅仅是发布错误输出。但显然,SBJsonParser 对象/变量是null 在 xcode 模拟器上可以正常工作,但在 ios 6 上部署时就不行 【参考方案1】:

您好,我是该应用程序的开发人员。

问题是在 Xcode 4.5 上运行是正确的,但只是在 iphone 设备上运行它不会工作..

【讨论】:

iphone设备已经更新到iOS6。 iOS6和iphone模拟器x4.5之间会不会有些不匹配?感谢您的帮助!

以上是关于xcode 在模拟器上运行良好,但部署到 ios 6 时遇到错误的主要内容,如果未能解决你的问题,请参考以下文章

我的应用在 iPad 模拟器上运行良好,但在 iPad(iOS 8.4)上崩溃,xcode 说无法在捆绑中加载 NIB

仪器无法在 Xcode 4.4 的真实 iOS 设备中运行 GUI 测试脚本

IOS模拟器问题应用程序仅在第二次启动时运行..

XCode 6项目在ios 7.1上segue后崩溃

在iOS 7.0 上运行的应用程序具有iOS 6.0 界面

升级到 Xcode 4.2 和 iOS5 后,应用程序无法在 iPhone 上运行