【发布时间】:2014-12-30 11:31:26
【问题描述】:
现在,我有一个名为“MyFramework.framework”的框架,其中包含一个window.nib,我编写了一个示例来在终端中调用它。 代码:
//<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
Dialog可以出现,但是好像被卡住了,没有焦点,我不能输入任何东西,我什么也不能做,怎么了?
【问题讨论】:
标签: objective-c macos frameworks dylib