0
現在,我有一個框架名爲「MyFramework.framework」,其中包括一個window.nib,我寫了一個例子,以在終端中調用它。 代碼:調用框架在termimal窗口似乎被阻止
//<MyFramework/myUI.h>
#ifndef Frmwork_myUI_h
#define Frmwork_myUI_h
#ifdef __cplusplus
extern "C"{
#endif
void ShowDialog();
#ifdef __cplusplus
}
#endif
#endif
//test.mm
#include <MyFramework/myUI.h>
#include <Foundation/NSRunLoop.h>
int main(int argc, char *argv[])
{
ShowDialog() ;
while (!isTransmitCompleted)
{
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
}
return 0;
}
//build test.mm
g++ -c test.mm -o test.o
g++ test.o -o test -lpthread -framework Cocoa -framework AppKit -framework CoreData -framework Foundation -framework MyFramework
//run
$./test
對話框會出現,但似乎被封鎖,沒有焦點,我不能輸入任何東西,我可以做什麼,有什麼不好?