Since when does Xcode no longer require forward declarations, and why?

I noticed that Xcode (or rather, the Apple LLVM compiler?) No longer requires direct method calls. In other words, the following code builds without warning:

@implementation Foo -(void) foo { [self bar]; } -(void) bar {} @end 

This was used as a warning in -foo saying that Foo might not respond to -bar , right? Is the compiler smarter now or is it something else? Im using Xcode 4.3.1 plus Apple LLVM Compiler 3.1.

+6
source share
2 answers

This has definitely changed, and it seems that such advanced declarations are not required in Xcode 4.3 and later. Cp Private methods in Objective-C, in Xcode 4.3 I no longer need to declare them in my implementation file? .

+2
source

In my Xcode 4.2, the warning still exists, moreover, when ARC is enabled, it is an error, not just a warning.

0
source

Source: https://habr.com/ru/post/911724/


All Articles