views:

50

answers:

3

I am new to iPhone. What i need is i have to assign image name (eg.parrot.jpg) to NSString value.i need to display image in imageview using this string variable.

apporxmatly imageview.image = NSStringvarible; where NSStringVArible is image name.

How can i done this?

A: 
youreImageView.image = [UIImage imageNamed:@"parrot.jpg"];
Larsaronen
what i need is imageview.image = NSstringVariable; where string variable is parrot.jpg how can i done this
MaheshBabu
Instead of jumping in to try and get this working I would recommend that you learn the basics of Objective-C
Liam
+2  A: 
NSString *imageName = @"parrot.jpg";

UIImageView *view = [[UIImageView alloc]initWithImage:[UIImage imageNamed:imageName]];
kool4u
A: 

You can use

imageview.image = [UIImage imageNamed:NSStringvarible];

as imageview.image needs image and not simple string... So you line will give you warning and will terminate the application Use the above line will help you solve the problem...

hAPPY iCODING...

Suriya