Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tools & Utilities

Reply
 
LinkBack Thread Tools Display Modes
Old 02-04-2012, 04:27 AM   #1 (permalink)
Tech Genius Developer
 
Join Date: Jul 2011
Posts: 40
vilisei is on a distinguished road
Send a message via Skype™ to vilisei
Default iCloud if statements

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];
    }

Last edited by vilisei; 02-04-2012 at 04:42 AM.
vilisei is offline   Reply With Quote
Old 02-04-2012, 04:42 AM   #2 (permalink)
Tech Genius Developer
 
Join Date: Jul 2011
Posts: 40
vilisei is on a distinguished road
Send a message via Skype™ to vilisei
Default Fixed

Quote:
Originally Posted by vilisei View Post
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?
vilisei is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 469
15 members and 454 guests
7twenty7, alexeir, David-T, Dj_kades, Elad, HemiMG, iAppDeveloper, jeroenkeij, LunarMoon, Mijator, Pauluz85, QuantumDoja, sacha1996, smithdale87, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,679
Threads: 94,129
Posts: 402,928
Top Poster: BrianSlick (7,990)
Welcome to our newest member, xzoonxoom
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:20 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0