AppDelegate.m
に次のコードがあります。NSLog
の結果は常に(null)
であり、到達不可能な条件は決して発生しません。なぜこれが起こっているのか/私が間違っていることを知りたいのですが。RestKit到達可能性null
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[IKRestKitManager configureRestKit];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
[self prepareForLogin];
return YES;
}
#pragma mark - onstart
- (void)prepareForLogin {
if ([[[RKClient sharedClient] reachabilityObserver] isReachabilityDetermined] && ![[RKClient sharedClient] isNetworkReachable]) {
UIAlertView *reachAV = [[UIAlertView alloc] initWithTitle:@"Cannot connect to Internet" message:@"iK9 cannot reach the Internet. Please be sure that your device is connected to the Internet and try again." delegate:self cancelButtonTitle:@"Retry" otherButtonTitles:nil];
reachAV.tag = 0;
[reachAV show];
}
NSLog(@"%@",[[[RKClient sharedClient] reachabilityObserver] isReachabilityDetermined]);
if (![IKUserController loggedInUser]) {
IKLoginViewController *loginVC = [[IKLoginViewController alloc] init];
loginVC.scenario = SCENARIO_NEW;
[self.window.rootViewController presentModalViewController:loginVC animated:YES];
}
}
Doh - そうです。しかし、まだ疑問は残っていますね、なぜそれはいつもNOですか? –