我注意到Xcode(或更确切地说是Apple LLVM编译器?)不再需要前向方法声明。换句话说,下面的代码生成无警告:从什么时候Xcode不再需要转发方法声明,为什么?
@implementation Foo
-(void) foo {
[self bar];
}
-(void) bar {}
@end
这种用完就扔在-foo
警告说,Foo
可能不-bar
回应,对不对?编译器现在更聪明还是这是别的?我使用Xcode 4.3.1和Apple LLVM编译器3.1。
你确定你没有在'@interface Foo'的头文件中包含'bar'声明吗? – hamstergene 2012-03-27 07:41:21
确实很确定。 – zoul 2012-03-27 08:47:57