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

View Single Post
Old 06-25-2009, 03:19 PM   #18 (permalink)
rusew
Registered Member
 
Join Date: Jun 2009
Posts: 4
Default

Below, I think you are missing a bracket at the end of each line..

Code:
- (void)viewDidLoad {
	imageArray = [[NSMutableArray alloc] init];
	[imageArray addObject:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"rock" ofType:@"jpg"]];
	[imageArray addObject:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"paper" ofType:@"jpg"]];
	[imageArray addObject:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"scissors" ofType:@"jpg"]];
    [super viewDidLoad];
}
And here, I've had trouble with this method. The method above seems to work better. I'm not sure why, but, at least when there are a lot of images, the technique below crashes after a while.

Code:
- (void)viewDidLoad {
	imageArray = [[NSMutableArray alloc] init];
	[imageArray addObject:[UIImage imageNamed:@"rock.jpg"]];
	[imageArray addObject:[UIImage imageNamed:@"paper.jpg"]];
	[imageArray addObject:[UIImage imageNamed:@"scissors.jpg"]];
    [super viewDidLoad];
}
rusew is offline   Reply With Quote
 

» Advertisements
» Online Users: 347
21 members and 326 guests
ADY, chemistry, Duncan C, fkmtc, HemiMG, her-ur, iDifferent, leahov, MarkC, marto1914, Meoz, padsoftware, Promo Dispenser, Raffaello, sneaky, sojourner, syver, tathaastu, tgjorgoski, Thrillhouse1919, ziocleto
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,220
Posts: 380,716
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

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