Adding picture in pickerview

Posted by iSharreth on Stack Overflow See other posts from Stack Overflow or by iSharreth
Published on 2010-04-06T17:58:10Z Indexed on 2010/04/30 5:57 UTC
Read the original article Hit count: 403

UIImageView *one = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball1.png"]]] ;

UIImageView *two = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball2.png"]]] ;
UIImageView *three = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball3.png"]]] ;

arrayBalls = [[NSArray alloc]initWithObjects:one,two,three,nil];

I used the above code for displaying image in the pickerview. But the application is crashing when executing this code.

Anyone please help.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk