【发布时间】:2013-12-02 18:19:26
【问题描述】:
我有一个扩展 UIImageView 的 UIImageCustom 对象,并且在一个方法中,我想在这个类中获取 ViewController 实例,我的对象 UICustom 在其中添加。
在我的 UIImageCustom 类的 touchesBegan 方法中,当我触摸 UIImage 时,我想在我的 ViewController 中添加其他 UIImage:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UIImageView* newImageView=[[UIImageView alloc] initWithFrame:CGRectMake(60, 200, 200, 200)];
//Here I need add newImageView in my ViewController
[??? addSubview:newImageView];
}
有人可以帮助我吗?
【问题讨论】:
-
为什么不在 ViewController 本身中实现 touchesBegan ?
-
嗨@Bhumeshwerkatre!我已经实现了,但现在我想在其他 ViewControllers 中使用我的 UIImageCustom !!
标签: ios objective-c uiviewcontroller uiimageview