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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 08-21-2009, 06:09 PM   #1 (permalink)
iPhone Developer
 
Join Date: Aug 2009
Posts: 64
Post NSArray

hello all
i have 2 questions:
first of all, what is the difference between NSArray and NSMutableArray?

my second question is that i need 5 different arrays that hold 3 integers each and also be able to save/load the arrays using NSUserDefaults.

thanks in advance:-}
losingSkillz is offline   Reply With Quote
Old 08-21-2009, 07:04 PM   #2 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 248
Default

contents of NSArray are static, you can't add or delete objects on it, with NSMutableArray you can add, delete, sort, etc, read the Docs..

for saving to NSUserDefaults:

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:myArray1 forKey:@"myArray1"];
...
[defaults synchronize];
__________________
BovioSoft Games

Last edited by vbovio; 08-27-2009 at 05:45 PM.
vbovio is offline   Reply With Quote
Old 08-21-2009, 07:18 PM   #3 (permalink)
iPhone Developer
 
Join Date: Aug 2009
Posts: 64
Post thanks for the help

Quote:
Originally Posted by vbovio View Post
contents of NSArray are static, you can't add or delete objects on it, with NSMutableArray you can add, delete, sort, etc, read the Docs..

for saving to NSUserDefaults:

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:myArray1 forKey:@"myArray1"];
...
[defaults synchronize];
one last thing- how do you store information in a three dimensional array?
thanks for the help again
losingSkillz is offline   Reply With Quote
Reply

Bookmarks

Tags
integer, iphone, nsarray, nsmutablearray, 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: 274
22 members and 252 guests
2WeeksToGo, ADY, apatsufas, ckgni, dacapo, Dani77, Fritzer, ghost, HDshot, headkaze, jakerocheleau, joeallenpro, masc2279, mer10, MozyMac, mystic.purple, objch, Rudy, tathaastu, themathminister, timle8n1, Zool
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,878
Threads: 89,223
Posts: 380,731
Top Poster: BrianSlick (7,129)
Welcome to our newest member, olga2000
Powered by vBadvanced CMPS v3.1.0

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