Quote:
Originally Posted by vilisei
I want to use an if statement to check if system version is greater or equal to the set version (5.0.0) to notify user the first time they launch the app to tell them that you can sun to iCloud. But when I do the if statement, the iPhone ignores it and shows the popup and UISwitch on any version. Is this a problem with the iPhone OS or my code?
Code:
// Get system version and iCloud requirement
NSString *reqSysVer = @"5.0.0";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
// Set this notification to appear only if you have iOS 5 installed
if (currSysVer >= reqSysVer) {
UIAlertView *icloudNotification = [[UIAlertView alloc] initWithTitle:@"iClound Notification" message:@"This app supports iCloud syncing. In order to use this function, you must enable it in the settings app. Just open Settings, scroll down to this app, and set Use iCloud to on." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[icloudNotification show];
[icloudNotification release];
}
|
I was able to fix this problem temporarily. But this solution only works if you are running iOS 5 but won't when apple releases iOS 6, 7, 8, etc.
Code:
// Set this notification to appear only if you have iOS 5 installed
if ([[[UIDevice currentDevice] systemVersion] hasPrefix:@"5"]) {
UIAlertView *icloudNotification = [[UIAlertView alloc] initWithTitle:@"iClound Notification" message:@"This app supports iCloud syncing. In order to use this function, you must enable it in the settings app. Just open Settings, scroll down to this app, and set Use iCloud to on." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[icloudNotification show];
[icloudNotification release];
}
Does anyone have a permanent fix to this problem?