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 02-17-2011, 09:30 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 70
juanchofern is on a distinguished road
Thumbs up Create and using a mutable array in another piece of code.

Hello i am new in development in objetive C. I would like to create a mutable
array of integers and using in another piece of my code (another function).
How can i do it? could you post all the code please. Thank you very much in advance.
juanchofern is offline   Reply With Quote
Old 02-17-2011, 09:38 AM   #2 (permalink)
Registered Member
 
87vert's Avatar
 
Join Date: Sep 2010
Location: Pittsburgh
Posts: 172
87vert is on a distinguished road
Default

Loading…

There is the document for an NSMutableArray, it will tell you how to define it and access it.
__________________
Wolfador Coding
Check out my apps:
Crazy Dog Daily Log || Crazy Spouse Daily Log || iCourtReport
87vert is offline   Reply With Quote
Old 02-18-2011, 07:39 AM   #3 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 70
juanchofern is on a distinguished road
Default

Quote:
Originally Posted by 87vert View Post
Loading…

There is the document for an NSMutableArray, it will tell you how to define it and access it.
Thank you very much!! I will read it.
juanchofern is offline   Reply With Quote
Old 02-18-2011, 08:04 AM   #4 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 70
juanchofern is on a distinguished road
Thumbs up

Quote:
Originally Posted by 87vert View Post
Loading…

There is the document for an NSMutableArray, it will tell you how to define it and access it.
Hello again, i am novice. Could you post a simple code.

I would like to create a mutable array of integer in the viewdidload.

And in another procedure for example in touchesbegan
i would like to remove a elemente.

Could you post it?

Thank you very much in advance.
juanchofern is offline   Reply With Quote
Old 02-18-2011, 08:59 AM   #5 (permalink)
Registered Member
 
royale61's Avatar
 
Join Date: Jul 2010
Posts: 48
royale61 is on a distinguished road
Default

i had placed for you but it's removed..
You must be have patient when you opened your own topic.
Code:
- (void)viewDidLoad {
[super viewDidLoad];

myMutableArray = [[NSMutableArray alloc] initWithObjects:@"First", @"Second", nil];

[self deleteArrayItem:1]; //delete string "second"
}

-(void)deleteArrayItem:(NSInteger *)value
{
[myMutableArray removeObjectAt:value];
}
this should work..
royale61 is offline   Reply With Quote
Old 02-18-2011, 10:02 AM   #6 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 70
juanchofern is on a distinguished road
Default

Quote:
Originally Posted by royale61 View Post
i had placed for you but it's removed..
You must be have patient when you opened your own topic.
Code:
- (void)viewDidLoad {
[super viewDidLoad];

myMutableArray = [[NSMutableArray alloc] initWithObjects:@"First", @"Second", nil];

[self deleteArrayItem:1]; //delete string "second"
}

-(void)deleteArrayItem:(NSInteger *)value
{
[myMutableArray removeObjectAt:value];
}
this should work..
Thank you very much, you are very nice.
I didn´t know how to call a function, now it works
juanchofern is offline   Reply With Quote
Reply

Bookmarks

Tags
array, mutable

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: 370
13 members and 357 guests
cpsclicker, dre, Error404, Gaz, gmarro, jeroenkeij, Kirkout, Music Man, PavelMik, teebee74, whitey99, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

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