私は次のコードを持っていますAppDelegate.m
-の結果NSLog
は常に(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];
}
}