Re: Code Completion & Nested Obj-C Messages: Wrong Scope
Re: Code Completion & Nested Obj-C Messages: Wrong Scope
- Subject: Re: Code Completion & Nested Obj-C Messages: Wrong Scope
- From: Mason Mark <email@hidden>
- Date: Tue, 13 Jun 2006 19:10:20 +0900
I don't have a solution, but have basically the same problem. I don't
get code-completion suggestions for NSArray or other inappropriate
classes, I just get "no completions found" all the time.
This is in basically any "real" project. That is to say, it doesn't
happen with little test projects but happens in every real project I
work on (say over a few dozen source files?). Rebuilding the index
doesn't affect this (although I do it often to fix other problems).
I assume in my case it's been this way for a long time, because I
have a bunch of text-expansion macros like:
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
NSFileManager *fileManager = [NSFileManager defaultManager];
...and so forth, for exactly that reason.
Since in my experience "Code Sense" is pretty broken generally, I
have just chalked this up as a limitation. Since most of those type
of methods have a return type of "id", there is a huge number of
potential completions.
Although a simple heuristic to guess which methods might be
appropriate should work fine, I just have always assumed that Code
Sense doesn't have one and is simply baffled by the large number of
possibilities, so it silently gives up (which it seems to do in a
number of other situations also).
Your post made me wonder, though, since you say it works fine in your
other projects. Does it work even in reasonably-sized projects? I had
always assumed this was broken for everybody pretty much all the time.
Cheers,
--
Mason Mark
Five Speed Software, Inc.
http://www.fivespeed.com
On Jun 11, 2006, at 2:23 PM, Sean Murphy wrote:
Xcode's code completion is giving me trouble when using nested
objective-c messages. The scope being used to determine valid
completions is incorrect after the first nested message. Here's an
example:
[[NSBundle mainBundle] *InvokeCodeSenseHere*
- The scope label on the bottom left of the completion list
indicates that it is providing NSArray * methods as valid choices.
To get the proper completions for a NSBundle instance, I would have
to avoid nesting:
NSBundle *mainBundle = [NSBundle mainBundle];
NSString *path = [mainBundle *InvokeCodeSenseHere*
I have found out this is a problem unique to my particular Xcode
Project. I can try the above mentioned routine and it works fine
in any other project, and just selects the scope as "id" and
returns all methods.
I tried rebuilding my code sense index, but it was no help..
This may be hard to troubleshoot, since it is unique to
my .xcodeproj, but has anyone had this happen, or know of a solution?
Thanks for helping!
Sean
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40masonmark.com
This email sent to email@hidden
_______________________________________________
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