tags:

views:

965

answers:

6

For example, when I type

[UIView commitAni

then I would expect that it finishes it like:

[UIView commitAnimations

so that I have:

[UIView commitAnimations];

but here, it doesn't. Although I have included CoreGraphics.framework Strange: When I try with other animation related stuff, it works:

[UIView setAnimationDura

will be completed to:

[UIView setAnimationDuration:<#(NSTimeInterval)#>

But this one will not be recognized by codeSense:

[UIView setAnimationTr

...here, I would expect an completion to

[UIView setAnimationTransition

but it doesn't happen. What could be the problem here? I don't think that I miss an included framework, because everything compiles well and works in the iPhone simulator.

+1  A: 

Usually, when codeSense doesn't give me a correct completion I type ESC for displaying all possibilities and I choose the one I want.

When codeSense answers: No completion found, most of the time there is a typo in the object declaration or a missing ; or ) or ] somewhere near the completion request.

mouviciel
so it's recommended to always immediately finish brackets when typing? like [foo autocompl]; for [foo autocomplete]; ?
Thanks
No, I would have said somewhere before completion request. I mean that syntax errors may confuse codeSense.
mouviciel
+2  A: 

Is that the (I'm assuming you haven't changed the keybindings, for simplicity) Cmd-. "give me the next completion" or Cmd-, "give me the completion menu", or the "wait until something turns up and hit return"? I've often seen the last of those fail to give me the completion I want, where Cmd-, will show the correct option.

Graham Lee
it's the "wait until something turns up and hit return" aspect. I never tried that Cmd- thing, but thanks for the hint. I'll try it!
Thanks
A: 

I have the same problem, but no idea what's going on...

A: 

It sounds like you've probably already tried this, but whenver I get an unresponsive codesense, I save all the files I recently added imports to. It seems like saving the file updates the codesense scope for the newly referenced items.

Skyler
A: 

Just upgraded to xcode3.1.3 with iphone 3.0 sdk. Codesense wont autocomplete for simple things like UIScreen mainScreen. its able to find only UIScreen main(). I've tried rebuilding the index several times and no luck.

+3  A: 

This appears to be a conflict between the static code analysis tools (Clang) and CodeSense. See http://www.openradar.appspot.com/7338181

I turned off the "Run Static Analyzer" build setting and clicked on the "Rebuild Code Sense Index" under general and it solved the problem for me. However, I want static code analysis too.

ThomasW
Yeah, this is the solution. Stupid bugs.
David Wong
What I've been doing is run the analyzer occasionally using "Build and Analyze" and then do the "Rebuild Code Sense Index" every once in a while when it breaks.
ThomasW