Xcode 4 UIImage imageNamed: Method Not Found Error

While working with an Iphone Application i wanted to display an image using UIImageView control i have designed using Interface Builder. The working environment is Mac 10.6, Xcode 4 and IOs SDK 4. Required images added to Resources folder in project. The code line is as below.

[imageView1 setImage:[UIImage imageNamed:@”130_001.jpg”]];

When i build and run application compiler break at this point and throw an error : Method ‘+imageNamed:’ not found (return type defaults to ‘id’)

I tried searching everywhere including IOS SDK documentation but could not find anything related to this issue. Finally, i tried to assign image to UIImageView in two steps. First is creating UIImage object using imageNamed method and then assign that image object to ImageView using setImage method. imageView object already added to Interface Builder. I did this in two steps below:

UIImage *image = [UIImage imageNamed: @”130_001.jpg”];
[imageView1 setImage:image];

As you see there is not much difference in both code. Somehow image object could not assigned directly using setImage method. If you have any idea please share your information using comments box.

Written by Bala Krishna

I have high-class programming talent, and the able to work efficiently with international time zones. Outsource your web and software development project to us and get access to some of the best expertise and talent in IT industry. I offer flexible and affordable solution depending upon your project needs. You outsource your coding assignment to us and we finish it on time at a specific cost.

Leave a Comment

Your email address will not be published. Required fields are marked *