我在我的iOS应用中遇到了一些奇怪的问题。当我的应用程序打开时,用户按下睡眠/唤醒按钮,应用程序调用
applicationWillResignActive
applicationDidEnterBackground
当用户右击解锁屏幕时,应用程序调用
applicationWillEnterForeground
applicationDidBecomeActive
之后,它会在控制台中打印以下错误:
PBRequester failed with Error Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo=0x1cdfbc00 {NSErrorFailingURLStringKey=https://gsp10-ssl.apple.com/use, NSErrorFailingURLKey=https://gsp10-ssl.apple.com/use, NSLocalizedDescription=A server with the specified hostname could not be found., NSUnderlyingError=0x1cddca10 "A server with the specified hostname could not be found."}
我知道这个错误说明没有找到指定的主机名。但是哪个主机名呢?是https://gsp10-ssl.apple.com/use还是我用于web服务的主机名?
我如何调试这个错误,并确定它的来源?
发布于 2013-04-11 14:54:04
我也有同样的问题。我将parse.com框架集成到我的应用程序中。
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
// Store the deviceToken in the current installation and save it to Parse.
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
[currentInstallation setDeviceTokenFromData:deviceToken];
[currentInstallation saveInBackground];
}
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo {
[PFPush handlePush:userInfo];
}
在我将这两个代码块从AppDelegate移到我的主ViewController文件中之后,错误消息就消失了……也许这对你有帮助..。
发布于 2014-10-29 19:02:54
我也有过类似的错误。我有一个MKMapView的应用程序。当我测试应用程序时,我故意断开设备Wifi以查看应用程序的行为,在调试中我看到了错误:
PBRequester failed with Error Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo=0x18e4fac0 {NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorCodeKey=-9806, NSErrorFailingURLStringKey=https://gsp10-ssl.apple.com/use, _kCFStreamErrorDomainKey=3, NSUnderlyingError=0x18e51690 "An SSL error has occurred and a secure connection to the server cannot be made.", NSErrorFailingURLKey=https://gsp10-ssl.apple.com/use}
此时,设备正在尝试连接3G,因为设备启用了“移动数据”。我也没有3G连接的积分。我认为这就是这个错误的具体来源(3G没有信用),因为当我禁用“移动数据”时,我已经收到了另一个错误,也来自PBRequester
PBRequester failed with Error Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo=0x188e4b00 {NSErrorFailingURLStringKey=https://gsp10-ssl.apple.com/use, _kCFStreamErrorCodeKey=8, NSErrorFailingURLKey=https://gsp10-ssl.apple.com/use, NSLocalizedDescription=The Internet connection appears to be offline., _kCFStreamErrorDomainKey=12, NSUnderlyingError=0x18d78410 "The Internet connection appears to be offline."}
我倾向于指责MKMapView对象引发了这些错误,因为它需要持续的活动连接来检索地图图层/标题。虽然应用程序有其他活动屏幕(没有MKMapView),但不会引发错误。
https://stackoverflow.com/questions/13945792
复制相似问题