- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试使用 cygwin 和 THEOS 构建一个 ios 应用程序
教程: https://sites.google.com/site/theostutorials/home
经过几次尝试,我成功地完成了教程。最后我只需要运行命令“制作包安装”
然后我卡住了...
CYGWIN 终端:
ron_000@Laptop-Ron ~/projects/hello3
$ make package install
/home/ron_000/projects/hello3/theos/makefiles/targets/Cygwin/iphone.mk:38: Deplo
ying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for application hello3...
Copying resource directories into the application wrapper...
Compiling main.m...
main.m:2:2: error: use of undeclared identifier 'NSAutoreleasePool'
NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init];
^
main.m:2:21: error: use of undeclared identifier 'p'
NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init];
^
main.m:2:27: error: use of undeclared identifier 'NSAutoreleasePool'
NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init];
^
main.m:3:12: error: implicit declaration of function 'UIApplicationMain' is
invalid in C99 [-Werror,-Wimplicit-function-decla`enter code here`ration]
int ret = UIApplicationMain(argc, argv, @"hello3Application", @"...
^
main.m:4:3: error: use of undeclared identifier 'p'
[p drain];
^
5 errors generated.
/home/ron_000/projects/hello3/theos/makefiles/instance/rules.mk:96: recipe for t
arget 'obj/main.m.ce2c1a2b.o' failed
make[2]: *** [obj/main.m.ce2c1a2b.o] Error 1
/home/ron_000/projects/hello3/theos/makefiles/instance/application.mk:39: recipe
for target 'internal-application-all_' failed
make[1]: *** [internal-application-all_] Error 2
/home/ron_000/projects/hello3/theos/makefiles/master/rules.mk:54: recipe for tar
get 'hello3.all.application.variables' failed
make: *** [hello3.all.application.variables] Error 2
有人知道我做错了什么吗?
感谢任何输入,
p.s我希望我以正确的方式使用代码块来解决这个问题......
最佳答案
难道你是用ARC(automatic reference counting)编译的?在这种情况下,docs说:
如果使用自动引用计数 (ARC),则不能直接使用自动释放池。相反,您使用 @autoreleasepool
block 。例如,代替:
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Code benefitting from a local autorelease pool.
[pool release];
你会写:
@autoreleasepool {
// Code benefitting from a local autorelease pool.
}
可以为单个文件禁用 ARC,请参阅 here .
关于ios - 未声明的 NSAutorelease,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23873265/
我在控制台中收到此错误消息: *** _NSAutoreleaseNoPool(): Object 0x10d2e0 of class NSPathStore2 autoreleased wit
好吧,假设我有一个如下所示的函数: -(NSNumber *)calculate{ NSNumber *myNum = [[[NSNumber alloc]initWithInt:5] autor
我尝试使用 cygwin 和 THEOS 构建一个 ios 应用程序 教程: https://sites.google.com/site/theostutorials/home 经过几次尝试,我成功地
我对 NSAutorelease 池的工作原理有一个大致的了解。 我们在其中有自动释放的对象,并且在调用 drain 方法时。 检查池中保留计数为 +1 的对象,并因此被释放。 但我不确定的是。 我们
我是一名优秀的程序员,十分优秀!