16

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 サービスに使用しているホスト名ですか?

このエラーをデバッグし、その原因を特定するにはどうすればよいですか?

4

2 に答える 2

2

同じ問題がありました。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];
}

この 2 つのコード ブロックを AppDelegate からメインの ViewController ファイルに移動した後、エラー メッセージが表示されなくなりました。

于 2013-04-11T06:54:03.730 に答える