Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mbabauer

macrumors regular
Original poster
Feb 14, 2006
105
0
I am a pretty HEAVY Java developer, new to Mac (bought a MBP 2.0) and Objective-C. I was very excited about about getting my hands on XCode and learning some Cocoa development stuff.

I have been working my way through several books, and I have to say, for the most part, I am extremely happy with XCode. I do have some gripes, though, some of which may just be user error on my part. I thought I would share, in the hopes someone with some pull might be able to fix this.

Bad code completion (auto-complete):
As I stated, I am a pretty heavy Java developer, but I also know C, C++, VB, and many other languages. As a result, I have used a LOT of IDEs, the best of which for auto-complete, IMHO, is Eclipse.

Eclipse, for those that dont know, is an IDE written primarily in java, for java, but which has a TON of plugins that do everything from C to Pascal, to Python. The Java editors do an AWESOME job of recommending auto-complete.

On the other hand, when using XCode, I find I am fighting the auto-complete at least 25% of the time. What the heck am I talking about, right? Well, take as an instance code to get reference to the NSUndoController. I did something like this:
Code:
NSUndoManager undo = [self undoManager]
Now, later on, I try to send a message to undo, only the auto-complete automatically fills in
Code:
undoDev
I can't tell you HOW many times I have been typing what I was reading, only to find 1/4 of what I just typed was WAY wrong. Or compiled an app to find it core, and then find out its because the reference I thought I used wasn't the right one. And, given Objective-C's unstrict nature when it comes to type casting, the compiler just compiles it right up and tries to run it! No errors, no warnings, just code that craps itself all over my debugger.

My second gripe about auto-complete is that it falls short sometimes. If you use it to insert a for loop, you get
Code:
for (<#initial#>; <#condition#>; <#increment#>) {
		<#statements#>
	}
and the <#initial#> is highlighted ready for input. I am like WOW! but, as soon as I type "i=0"...now I have to take my hands off the keyboard, grab the mouse, and select the next section <#condition#> OR I have to hit the right arrow 2 times, followed by Shift-Right Arrow 12 times! Not the model of efficiency. What would be nice is some key, maybe like Option-Tab, that would take you to the next section and highlight it automatically.

Next gripe...it doesn't auto-complete everything! Here's some things I found that don't work that I think should.
  1. Typing @" should know you want a trailing "
  2. Typing [ should out in the trailing ]
  3. Removing a @" or a [ should remove the corresponding " or ]
  4. Typing a selector name that is in the interface but not your implementation should insert the selectors signature with the brackets, much like it does for init and dealloc
  5. Typing a selector name that overrides a super's selector should allow you to fill in the signature for that selector with a [super <selector>] call in there already

My last gripe has to do with the auto-complete trigger. If I type if( I usually end up with one too many '('s like this:
Code:
if (() {
		<#statements#>
	}
What should happen is that the ( is identified as the leading paren, matched with the corresponding ), and left alone, OR just assume I want to type the if manually, don't help me, and leave me alone! There are several places where this context-sensitive autocomplete can be used to make the experience much better.

Interface Builder:
Ok, this isn't really part of XCode I know, but I consider it part of it, so sue me. Anyway, some outline of the NSView hierarchy would be nice here. For instance, I am tring to change attributes in Inspector for a NSTableView in a NSScrollView inside an NSBox. I click, I get the box, I double click again, I get the scroll view, I doulbe click again and FINALLY I get the table view! God help me if I wanted to change a column name! It also becomes confussing when you try to Click-drag the connections between nested components...my god it gets confussing!

Interface:
Changes I make to the interface do not seem to stick. For instance, I prefer a certain sized window, and the 3-way split with the Editor in the bottom right pane. But, low and behold, I have to redo this EVERY time I open or create a project! Not only that, but clicking the "Toggle Embedded Editor" button makes the editor pane cover the file pane at the top! For the newb, its like "Where the heck did my files go?"

Also, could you make is a little easier to get to Inspector/Info? I mean, pretty much all the coding I have done requires me to have Inspector up in Interface Builder. Why do I have to manually open it EVERY TIME! Same me some clicks, and just remember if I had it open last time I exited. Problem solved.

One final gripe...I wish I could make it auto-compile when I save my source files. I would like to see if pop up errors immediately withought me having to manually run the build. If I save the file, compile.


Well, this is just some of my complaints. I know it looks like I hate XCode, but that can't be farther from the trueth. In fact, thus far, I have rather enjoyed most of it. I just think the whole experience could be better.
 

Soulstorm

macrumors 68000
Feb 1, 2005
1,887
1
I have noticed a few bugs about Xcode too. I am a C++ programmer, and I have used a little Interface Builder.

As far as auto-completion is concerned, I find this annoying:
and the <#initial#> is highlighted ready for input. I am like WOW! but, as soon as I type "i=0"...now I have to take my hands off the keyboard, grab the mouse, and select the next section <#condition#> OR I have to hit the right arrow 2 times, followed by Shift-Right Arrow 12 times! Not the model of efficiency. What would be nice is some key, maybe like Option-Tab, that would take you to the next section and highlight it automatically.
I find this one of the most disturbing things.

Second, when I have auto-identation enabled and try to create a class like this:
Code:
class example{
    int x;
    int y;
public:
    void set();
the "void set()" is not idented the appropriate way (just 4 spaces) but 8!!! When i correct that mistake, and press enter, the 8-character identation happens again!! When I avoid hitting enter, and continue to the definition of the "set()" function, the function is indented the wrong way AGAIN!

Secondly, sometimes the program gets overloaded and beeps all the time. This rarely happens though. Restarting the program is the solution.

Finally the autocompletion does not always present the proper functions. For tha basic classes the autocompletion works ok, but whith vectors, the autocompletion does not work at all.
 

whooleytoo

macrumors 604
Aug 2, 2002
6,607
716
Cork, Ireland.
Too confusing to quote all your message here, so I'll just address a couple of points down here at the bottom.. ;)

Personally, I always have "Automatically suggest matching option" turned off, it seems to be more awkward than helpful, but that's a personal preference. That's why I always invoke auto-complete manually (Ctrl-.)

I don't use auto-complete for constructs such as for loops (so I don't know if this hint holds true), but in Cocoa you can move from section to section - or parameter to parameter - by typing (Ctrl-/).

Xcode is very configurable here, you can add or modify hot keys for most of the application's menu items and text editing functions.

Some of your suggestions for auto-complete would be very useful, but would of course have to be configurable. For instance I wouldn't want [super ...] to be auto-inserted into every over-ridden method, as it's not always desirable, and I generally prefer my compiler not to second guess what I'm trying to do! ;)

Interface Builder

I know what you mean about the hierarchy of views and table views etc. It certainly isn't the most intuitive (other than "double click until you get the object you want!"), but the hierarchical view - the small buttons on the right side of the nib window - are one handy way around this, especially for connections.

You can set Interface Builder to open the Info Panel at launch, it's in the General Settings of its preference dialog.

As for "building when you save", I don't think that exact feature exists, but Xcodes predictive compilation (in the Build section of its preferences dialog) might be the closest thing?

Hope this helps some..
 

odedia

macrumors 65816
Nov 24, 2005
1,047
157
Interesting to read those restrictions. I, too, am a Java programmer, and after using Eclipse for so long, it seems impossible to go back to something not as intuitive.

I recommend that you still use Eclipse for mac for your java development. With Objective C, you have less options I guess... you might want to have a look at this plugin for eclipse that claims to support Objective C (though probably very limited compared to XCode)...

http://www.robrohan.com/projects/afae/

Oded S.
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
Interface builder can have the the info window open at startup see the preferences window (here) Picture 1.png
 

gekko513

macrumors 603
Oct 16, 2003
6,301
1
whooleytoo is right. To get to the next placeholder <#...#> use the keyboard shortcut for "Code Sense Select Next Placeholder" that can be set in Preferences.

I also have code completion turned off until I ask for it because it's not always that good. I have changed the keyboard shortcuts for Code Sense so that ctrl+x is "Next Completion", ctrl+z is "Previous Completion" and ctrl+space is "Completion List". I find ctrl+x usually guesses correct if I repeat a method call several places.

And the completion list is often more accurate if I make sure my recent changes are saved (cmd+option+s).
 

Soulstorm

macrumors 68000
Feb 1, 2005
1,887
1
gekko513 said:
whooleytoo is right. To get to the next placeholder <#...#> use the keyboard shortcut for "Code Sense Select Next Placeholder" that can be set in Preferences.

I also have code completion turned off until I ask for it because it's not always that good. I have changed the keyboard shortcuts for Code Sense so that ctrl+x is "Next Completion", ctrl+z is "Previous Completion" and ctrl+space is "Completion List". I find ctrl+x usually guesses correct if I repeat a method call several places.

And the completion list is often more accurate if I make sure my recent changes are saved (cmd+option+s).
This is a valuable piece of information that will probably save me tons of working hours... Guess I have to revisit the Xcode preferences once more... ;)
 

superwoman

macrumors regular
Apr 25, 2005
194
0
Monterey,CA
I also had to choose between XCode and Eclipse, and in the end, I chose Eclipse because it just helped me better.

But I have one MAJOR gripe about Eclipse - The GUI freezes almost daily, causing me to close and reopen the app. It usually happens when I click on the red cross mark on the left column. What's up with that?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.