On 03-Feb-2010, at 6:33 PM, Johan Lund wrote:
Why does not camelcase completion work? e.g. typeing “UIPV” should cause UIPickerView to be suggested.
as far as I know because it doesn't, I've never even thought about that feature before, I type uip and then <esc> and go pick from the list, by the time you typed uipi you're pretty much there. Perhaps you're used to thinking in camelCase, I never really have.
Why does the editor not insert a closing brace automatically? I type a new method in my .m file and press enter after typing in the opening brace and it should automatically add the closing brace but it doesn’t.
There's a preference for that, I have it turned off because it annoyed me and I can't remember why, look in the indentation options. There's also an option to supply an opening bracket if you close one you didn't open, but I just turned that one off too because XCode and I disagree about spacing in brackets.
Why does the completion not know about variables declared in the .h file?
Oh, it does, just found out... But only if you have saved your .h file, which brings me to my next question.
This, having to save all the time is highly annoying. Especially when you add an outlet and switch into interface builder and its not there. Is there a way to automatically save the document everytime I switch between counterparts or into xcode or before compiling etc. In IntelliJ IDEA there is no need to save - ever! If you need to go back on something dangerous you just pull up local history, and in addition to that you have VCN.
the only autosave option I know of, and I have it turned on, is in the building tab where you can get it to save files when you build. I've become used to hitting Cmd-S as I leave a file, especially a header file, knowing that will fix autocomplete, but yes that is sometimes a little annoying.
Why do I sometimes get two tabs instead of one? I find that I quite often have to press backspace on a new line because XCode inserted two tabs instead of one.
Is there a way to add a newline after the one I am currently positioned in the middle of? Right now I am moving the the end of the line first then pressing enter but in e.g. IntelliJ IDEA I can just press shift enter.
I don't know why you get two tabs, I don't think I do and I don't know how to add a newline after the line you're in, but I don't recall ever wanting to do so.
Is there a way to auto indent a block of code that has become a bit messy?
well there's a re-indent feature, but I'd like more myself. I'd like to be able to set up my own rules for brackets and braces and spaces and be able to reindent and reformat a block of code with those features in. That's particularly so because where XCode templates out
if ([[object foo] bar] ){
action
}
which separates the opening ( from the if, squashes [ up against the object and puts the opening brace on the same line, I change it to
if( [ [ object foo ] bar ] )
{
action
}
and that gets old really fast when you start as many new projects as I do. yes I could edit the templates but I did that once and then a new version of XCode came out with new templates and I didn't feel like doing it all over again.
Is there really no intelligent code generation built in? E.g.:
If I nominate e.g. the fileowner in interface builder to be the delegate of some component, why does not XCode automatically offer to insert the necessary e.g. <UIPickerViewDelegate, UIPickerViewDataSource> in my .h file?
If I add a property in my .h file I want XCode to be able to automatically add the corresponding synthesize statement in the .m file. If I add a method signature in my .h file I want XCode to automatically add it to the .m file. Can these things be done?
I don't believe either of those things can be done. The property code, I'm in two minds about that, I only synthesize 1/2 the things I declare and don't want the synthesize automatically added. Adding a method in the .h, it would be nice to have a hotkey perhaps when you're in the .m file which shows you the methods you've not implemented. Mostly I use autocomplete for this, type the start of the method and hit <esc> and it fills in the rest but yes I've found that bit of the workflow a bit clunky sometimes too.
I don't know if XCode is supposed to be like IntelliJ and if the XCode team really intend to make it full-featured like that. It's very good at what it does do and you get quite used to the workflow. However you can always file a bug report or feature request and if enough people want it, they may do it. Asking here was a good idea however, as firstly you may get some tips and tricks, and secondly the XCode guys from apple may reply and suggest what features have been requested and need more bug reports.