-(void)ImageDownloadCompleat
{
[self performSelectorOnMainThread:@selector(updateImageButton:)
withObject:nil
waitUntilDone:YES];
}
-(void)updateImageButton {
NSLog(@"image OKEY");
UIImage *img = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:
@"%@/%@.jpg",pathPreview,self.idProducts]];
//images.image = img;
[images setBackgroundImage:img forState:UIControlEventTouchUpInside];
[img release];
}
它与发送到实例错误的无法识别的选择器崩溃。上面的代码有什么问题?
提前致谢
答案 0 :(得分:8)
由于您的方法被声明为
-(void)updateImageButton
相应的选择器是@selector(updateImageButton)
,没有尾随冒号。更改:
[self performSelectorOnMainThread:@selector(updateImageButton:)
withObject:nil
waitUntilDone:YES];
到
[self performSelectorOnMainThread:@selector(updateImageButton)
withObject:nil
waitUntilDone:YES];
它应该有用。