首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >iOS应用程序中出现错误,导致PBRequester失败

iOS应用程序中出现错误,导致PBRequester失败
EN

Stack Overflow用户
提问于 2012-12-19 12:58:28
回答 2查看 5.9K关注 0票数 16

我在我的iOS应用中遇到了一些奇怪的问题。当我的应用程序打开时,用户按下睡眠/唤醒按钮,应用程序调用

代码语言:javascript
复制
applicationWillResignActive
applicationDidEnterBackground

当用户右击解锁屏幕时,应用程序调用

代码语言:javascript
复制
applicationWillEnterForeground
applicationDidBecomeActive

之后,它会在控制台中打印以下错误:

代码语言:javascript
复制
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服务的主机名?

我如何调试这个错误,并确定它的来源?

EN

回答 2

Stack Overflow用户

发布于 2013-04-11 14:54:04

我也有同样的问题。我将parse.com框架集成到我的应用程序中。

代码语言:javascript
复制
- (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文件中之后,错误消息就消失了……也许这对你有帮助..。

票数 2
EN

Stack Overflow用户

发布于 2014-10-29 19:02:54

我也有过类似的错误。我有一个MKMapView的应用程序。当我测试应用程序时,我故意断开设备Wifi以查看应用程序的行为,在调试中我看到了错误:

代码语言:javascript
复制
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

代码语言:javascript
复制
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),但不会引发错误。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13945792

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档