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 Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-29-2010, 05:32 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2009
Location: Wien/Austria
Posts: 242
StefanL is on a distinguished road
Default Loop and NSUserDefaults

Hi Folks,

In my App I am working with NSUserDefaults to get the Status from my Game:

f.ex:
Code:
[userSettings setInteger:1 forKey:@"1"];
[userSettings setInteger:0 forKey:@"2"];
Is it possible to loop those "Keys"? and if it is possible, how must the loop look like?

Thanks for any Feedback,

Stefan
StefanL is offline   Reply With Quote
Old 03-29-2010, 09:01 AM   #2 (permalink)
Registered Member
 
manicaesar's Avatar
 
Join Date: Feb 2009
Location: Poznań, Poland
Age: 25
Posts: 103
manicaesar is on a distinguished road
Default

Quote:
Originally Posted by StefanL View Post
Hi Folks,

In my App I am working with NSUserDefaults to get the Status from my Game:

f.ex:
Code:
[userSettings setInteger:1 forKey:@"1"];
[userSettings setInteger:0 forKey:@"2"];
Is it possible to loop those "Keys"? and if it is possible, how must the loop look like?

Thanks for any Feedback,

Stefan
Code:
for(int i = 0; i < LIMIT; i++) {
   NSString *key = [NSString stringWithFormat:@"%d", i];
   [userSettings setInteger:SOME_VALUE forKey:key];
}
Regards,
__________________
Do you like Age Of War? Have you played 'The Wars' and are not fully satisfied? Try Empires At War - we bet you will love it!


------------------
Full Version
------------------
Lite Version
------------------
YouTube Game Trailer
manicaesar is offline   Reply With Quote
Reply

Bookmarks

Tags
loop, nsuserdefaults

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: 354
13 members and 341 guests
akacaj, c2matrix, cgokey, esoteric, GHuebner, givensur, HemiMG, Mirotion22, mjnafjke, Pudding, SLIC, Sonuye857, Techgirl-52
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,652
Threads: 94,115
Posts: 402,887
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Sonuye857
Powered by vBadvanced CMPS v3.1.0

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