何らかの理由で、アプリで以下のコードを実行すると、ステータス バーが消えます。上記の applicaitonLaunchOptions の最後で実行すると、YES が返されます。
なぜこれが起こるのか誰か知っていますか?
以下のコードは、アプリの新しいバージョンにアップグレードするかどうかをユーザーに尋ねます。
NSString * version = @"";
NSString * nstri = [NSString stringWithFormat: @"http://itunes.apple.com/lookup?id=%@", APPID];
NSURL *url = [NSURL URLWithString: nstri];
ASIFormDataRequest * versionRequest = [ASIFormDataRequest requestWithURL:url];
[versionRequest setRequestMethod:@"GET"];
[versionRequest setDelegate:self];
[versionRequest setTimeOutSeconds:150];
[versionRequest addRequestHeader:@"Content-Type" value:@"application/json"];
[versionRequest startSynchronous];
//Response string of our REST call
NSString* jsonResponseString = [versionRequest responseString];
NSDictionary *loginAuthenticationResponse = [jsonResponseString objectFromJSONString];
NSArray *configData = [loginAuthenticationResponse valueForKey:@"results"];
for (id config in configData)
{
version = [config valueForKey:@"version"];
}
NSLog(@"app version: %@", version);
//Check your version with the version in app store
if (![version isEqualToString: APPVERSION])
{
UIAlertView *createUserResponseAlert = [[UIAlertView alloc] initWithTitle:@"New Version!" message: @"A new version of Handybook app is available to download. Please update your app for the latest features." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles: @"Download", nil];
[createUserResponseAlert show];
}