sessionWithConfiguration freezing iOS 8 iPhone 4S on new Xcode 6.0.1

二次信任 提交于 2020-01-02 23:14:22

问题


I am experiencing a disturbing issue when trying to execute one of my apps on an iPhone 4S with iOS8 and Xcode 6.0.1. What happens is that the control seems to freeze in the last instruction of the block:

dispatch_once(&onceToken, ^{
    NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:@"myBackgroundSessionIdentifier"];
    NSLog(@"configuration=%@", configuration);
    configuration.allowsCellularAccess = YES;
    configuration.timeoutIntervalForRequest = 30.0;
    configuration.timeoutIntervalForResource = 60.0;
    configuration.HTTPMaximumConnectionsPerHost = 1;
    session = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:[NSOperationQueue
                                                                                                mainQueue]];
});

Please note that neither the iPad I tested nor the simulator have any issues about it. Also the same app on the store, compiled with the past Xcode, seems to have no issue on any device, both according to my tests and on the lack of users feedbacks. I could not test it on my iPhone 4 as I seem unable to install the app on it from the new Xcode: it complaints the iPhone is busy when I try to install it.

Has anyone had a similar problem and knows how to fix it?


回答1:


Wipe the device and restore from backup.



来源:https://stackoverflow.com/questions/26002518/sessionwithconfiguration-freezing-ios-8-iphone-4s-on-new-xcode-6-0-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!