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 03-18-2009, 04:51 PM   #17 (permalink)
DenVog
Registered Member
 
DenVog's Avatar
 
Join Date: Jan 2009
Location: Silicon Valley, USA
Posts: 622
Default

Quote:
Originally Posted by CommanderData View Post
I think you were missing a bracket here and there (in case anyone else is playing along at home )

Code:
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Default" ofType:@"png"]];
I'm following along. Have tried this a couple different ways, but both present an error. The following gives me three "error: syntax error before ';' token" errors.
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];
}
Doing it the way below runs, but gives me three "warning: 'NSArray' may not respond to '-addObject:'" warnings.

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];
}
If someone can tell me what I'm doing wrong, it would be appreciated. Thanks.

PS-I'm not building a Rock, Paper, Scissors application. It's just an example.
DenVog is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,736
Threads: 89,192
Posts: 380,537
Top Poster: BrianSlick (7,129)
Welcome to our newest member, wrapsol
Powered by vBadvanced CMPS v3.1.0

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