First off let me state that I am an absolute newbie regarding Objective-C and Xcode as I'm coming from a Flash Builder (IDE) / AS3 background. I have recently started learning Objective-C and using Xcode.
I'm now writing my first program and notice that the autocomplete function in Xcode is not working as I would expect it. It is showing me all kinds of values seemingly unrelated to the type of Class I'm using.
If I declare:
NSFileManager *manager;
then if I type
manager = [NSFileManager
and type command+space here I expect defaultManager
to be one of the suggestions. And the suggestions should only be methods and properties of the NSFileManager
class. This is how I was used to it in Flash Builder.
Is this a bug in Xcode, some misconfiguration or just not as Xcode is supposed to work?
Go to Xcode > Preferences > Text Editing again. Quit out of Xcode and then relaunch Xcode. Now go to Code completion and check 'Suggest completions while typing'. Try typing library function or enum and enjoy!
Press the escape key when auto-complete makes the first suggestion. This will display the list. Escape or control-comma will show the list, control-period will accept the current suggestion and (subsequently) rotate through suggestions, control-slash will move to the next placeholder argument that was inserted.
Xcode tip #9: Xcode has great code completion built right in, but sometimes as you scroll through the options you might find the names are too long to fit. Fortunately, you can just grab the edge of the autocomplete popup and drag it as wide as you want!
The left-most button is the run button. This will build and run your application and launch your app in the iOS Simulator. The button beside it will stop the execution of your application and return you to Xcode.
I upgraded Xcode 4 to 5 whilst in the middle of a project and found any new files I created in subgroups (equating to subfolders in the project) didn't autocomplete whilst new files in the top folder did autocomplete. I fixed this by setting:
Build Settings ==> Search Paths ==> Always Search User Paths
to Yes
. All files now autocomplete.
As mentioned here there are many reasons and solutions.
For me helped this solution: Go to Preferences > Locations > Derived Data > click the arrow to open in Finder. Delete folder named "Derived Data". And everything works again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With