ios - error while setting image in imageView in iphone -


i have written code setting imageview ...as per button clicked...but problem when press button giving me error like...too many arguments function imagenamed...while executing line...

uiimage* photo = [uiimage imagenamed:@"robort %d.jpg",x];

the whole code is....

-(void)buttonclicked:(uibutton*)button { nslog(@"%d",button.tag); int x; x=button.tag; // create image view. uiimage* photo = [uiimage imagenamed:@"robort %d.jpg",x]; nslog(@"%d",x); cgsize photosize = [photo size]; uiimageview *imageview = [[uiimageview alloc] initwithframe:cgrectmake(0.0, 0.0, photosize.width, photosize.height)]; [imageview setimage:photo]; [self.view addsubview:imageview]; } 

use uiimage* photo = [uiimage imagenamed:[nsstring stringwithformat:@"robort de nero%d.jpg",x]];

cheers :)


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -