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
Post a Comment