Re: Xcode 4, llvm and jump to definition
Re: Xcode 4, llvm and jump to definition
- Subject: Re: Xcode 4, llvm and jump to definition
- From: Jens Alfke <email@hidden>
- Date: Wed, 12 Oct 2011 11:01:56 -0700
On Oct 12, 2011, at 1:08 AM, Thomas Clement wrote: If you ask to jump to definition on the "setDelegate:" method it would jump you to the definition of -[NSCache setDelegate:]. Well actually it does not, instead it displays a menu filled with all the setDelegate: methods gathered from all the frameworks and project. This works correctly for me (it jumps to the statically-resolved -setDelegate implementation.) What version of Xcode are you on? Maybe this was improved in 4.2. (Is 4.2 public yet now that iOS 5 is out?)
On Oct 12, 2011, at 2:18 AM, Quincey Morris wrote: I'm not sure why you think this is a result of deficient *indexing* rather than a design decision. Jump to Definition takes you to the definition of the *selector*, not to the definition of the method being called. So, if there are multiple methods declared with that selector, you get to choose.
I disagree. While technically Obj-C is a late-binding language and it’s possible for any -setDelegate implementation to be invoked at runtime, static typing limits this (unless you try to trick it with casts) so there really is a limited number of methods that are going to be invoked (most often one.) The programmer definitely wants Xcode to “do what I mean” and find the most relevant implementation(s). And as I said above, Xcode is pretty good nowadays at doing exactly that.
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden