控制的UIImageView子視圖我有兩個類:MainViewController和PlayerImageController(NSObject的)添加並從另一個類
我將如何能夠從PlayerImageController我的UIImageView的子視圖添加到我的MainViewController和規定操作,如
- (void)viewDidLoad
{
[super viewDidLoad];
[self.view addSubview:[PlayerImageController addPlayerImage]];
}
- (void)somethingHappened
{
[PlayerImageController changePlayerImage];
}
,並有我在我的PlayerImageController類的方法,如
+ (UIImageView *) addPlayerImage
{
heroPlayerImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hero-still.png"]];
[heroPlayerImageView setFrame:CGRectMake(151, 200, 17, 23)];
return heroPlayerImageView;
}
+ (void) changePlayerImage
{
//change image
}
謝謝!