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

View Single Post
Old 01-18-2010, 05:12 PM   #8 (permalink)
smasher
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

Quote:
Originally Posted by qwertyp View Post
Well, I did that, and I got no errors, but when the button is pushed the program crashes. I didn't have a viewWillAppear method, so I put the initialization in viewDidLoad.
Sorry, arrayWithCapacity returns an array that gets "autoreleased" - the usual way to deal with this is to create a "property" and use that to retain the object. If you haven't learned about properties yet, try this instead:


Code:
//for your .h file, between the interface brackets{}
NSMutableArray* array;

//for your .m file, in initWithNib or viewWillAppear
array =  [[NSMutableArray alloc] init];
__________________

Free Games!

Last edited by smasher; 01-19-2010 at 07:30 PM. Reason: autorelesed > autoreleased
smasher is offline   Reply With Quote
 

» Advertisements
» Online Users: 454
12 members and 442 guests
acegames, baja_yu, Bobarino, David-T, djbrooks111, HemiMG, ilmman, inkcpp, jimmyon122, kilobytedump, PowerGoofy, taewhan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,433
Threads: 94,026
Posts: 402,588
Top Poster: BrianSlick (7,978)
Welcome to our newest member, caraldo32
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:40 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.