我在.mm從目標C++
void MyMIDINotifyProc(const MIDINotification *message, void *refCon);
,與此線
MIDIClientCreate((CFStringRef)@"MidiMonitor MIDI Client", MyMIDINotifyProc, self, &client);
然後MyMIDINotifyProc被從稱爲變爲有這樣的代碼轉換爲目標C CoreMIDI。
在不改變文件擴展名的.m,我翻譯成一個OBJ-C簽名:
@interface MidiInput (Private)
-(void) MyMIDINotifyProc:(const MIDINotification *)message reference:(void *)refCon;
@end
其編譯,但我不知道該怎麼做的MIDIClientCreate
線。因爲它產生了"MyMIDINotifyProc" was not declared in this scope
。它應該是void *
類型...並且文檔100%清楚,它是A refCon passed back to notifyRefCon
(link)。
這個問題在Obj-C中可以解決嗎?我想我必須將C++的東西翻譯成C語言,在這種情況下,我會放棄它。
謝謝,+1,我會在接受這個答案後,我消化它(或一次XCode不會;))。 – 2010-12-12 20:01:17