ちょっと!私はこの小さな問題があります。サブビュー内のメソッドを呼び出す
を私持っている私はこのような何か持っているので、私のViewControllerで2つのサブビューを追加1のViewController:
//in my viewController.m i have this:
- (void)startIcons
{
IconHolder *newIconHolder = [[IconHolder alloc] initWithItem:@"SomeItenName"];
[self.view addSubview:newIconHolder];
}
- (void)onPressIcon targetIcon(IconHolder *)pressedIcon
{
NSLog(@"IconPressed %@", [pressedIcon getName]);
}
を、これは私のサブクラスtouchsです:今
//And in my IconHolder.m i have this:
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
//Here i need to call the method onPressIcon from my ViewController
}
: どうすればいいですか?最良の方法は、私のコンストラクタでViewControllerを保存するためのリンケージを作成することです。私はどうしたらいいのですか?
ありがとうございます!