0
下面是相關的代碼設置的UIImageView的圖像屬性 - 不工作
.H
IBOutlet UIImageView *productImageView;
@property(nonatomic, retain) IBOutlet UIImageView *productImageView;
.M
@synthesize productImageView
在initWithNibName自定義初始化
:
你的initWithNibName是你在調用[super initWithNibName]; ? – Jeremy 2010-08-18 20:43:15
它在以下內容中: if((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])){NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@「http://www.myurl。淨/ test.jpg放在「]]; UIImage * image = [UIImage imageWithData:[NSData dataWithContentsOfURL:url]]; productImageView.image = image; } – CLW 2010-08-18 20:53:23