我正在开发一个申请,以获取MacOS X 10.5或以上已安装的软件清单。 该方案采用客观标准++(c,c++, obj-c)。 每当我管理该方案时,它都会坠毁。
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
//My part of coding
[pool drain]; // This is the crash prone place
return 0;
}
这里提供项目细节:
档案范围:
编为:目标C++
Objc GC:无支持
使用的图书馆:libxml2.2.dylib, Foundation Framework
具体目标 x86_x64
发展:MacOS X 10.6.8,Xcode 3.2.6
申请类型:假释申请
我不知道需要制定任何其他办法,以汇编客观的C++。 在这方面的任何帮助都值得赞赏。
是的。 我已经将基调定为10.5
记录仪:
The Debugger has exited with status 0. [Session started at 2011-10-03 22:29:25 +0530.] GNU gdb 6.3.50-20050815 (Apple version gdb-1515) (Sat Jan 15 08:33:48 UTC 2011) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys003 Loading program into debugger… Program loaded. run [Switching to process 2973] Running… Program received signal: “EXC_BAD_ACCESS”. sharedlibrary apply-load-rules all (gdb)
I have one more question. Is it valid to release the obj-c object in c++ class destructor? like this
myclass::myclasss() { myobjcinterface* myobjc = [[myobjcinterface alloc] init]; }
我的阶级:~myqu(){[我的释放];}