Re: Xcode 4 auto-importing Objective C categories from static library
Re: Xcode 4 auto-importing Objective C categories from static library
- Subject: Re: Xcode 4 auto-importing Objective C categories from static library
- From: Kyle Sluder <email@hidden>
- Date: Sat, 23 Apr 2011 15:57:56 -0700
On Sat, Apr 23, 2011 at 3:22 PM, Stephen J. Butler
<email@hidden> wrote:
> Now the tools, on the other hand, were less smart in Xcode3 and below.
> Autocomplete, IB message browser, etc only knew about the
> messages/properties visible to the immediate code block (via import,
> include, etc). That Apple has fixed this in Xcode 4 to better match
> reality is a GOOD THING.
I'd say it is not a good thing as it stands, because all it does is
make it more likely that you're going to run into a compiler error in
the next five minutes. There's no indication that the method you're
trying to call is declared in a header you haven't imported. There's
just a generic "Could not find method -someCategoryMethod". Visual
Studio will at least automatically add using directives (similar in
purpose to Objective-C #import statements) if you attempt to reference
an identifier that it knows about but is in a namespace you haven't
imported yet.
Discussion about Xcode 4's behavior of showing all category methods
regardless of #import directives really belongs on the xcode-users
list, in the Developer Forums at http://devforums.apple.com , and/or
in the Bug Reporter at http://bugreport.apple.com.
Now, as for runtime behavior, as Stephen said it has *always* been the
case that the mere act of loading code containing a category code will
add that category's methods to the class, regardless of the #import
directives used at compile time.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden