我有.mm文件,其中我有一些C++函數和幾行目標c。混合問題目標C和C++在單個文件中
例如,
void display()
{
....
....
}
void doSomthing()
{
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 100, 50)];
[button addTarget:??? action:@selector(display) ....]
[rooView addSubView:UIButton];
}
我不知道如何調用在同一個mm文件中定義的顯示功能嗎? 什麼是我的addTarget? (自己/這在我的情況下不工作)
目標是將接收'display'消息的對象。 – 2011-12-22 09:09:24