objective c - How do I deal with typing nested message calls in ObjC source from only the keyboard? -


I feel that over the last year, using cocoa and cocoa touch development, I get to I'm struggling to support this important coding scenario, to support an important macro Xcode ...

I do not know myself again and again how much time a message was sent to a Together with a new line of code, for example, I write this I can t ... (pipe character represents the cursor location)

  some variable = [some object a message] |  

... then I know that I need to chain up a message from the returned item (since messaging is safe in zero objc, this is a common idiom.) Then I To change the line of code to look like this ...

  some variables = [[some objects some messages] |  

The big problem is to include before the bracket pair before the pair, which, when I needed it, I have to use the mouse or several repeating keys. After closing about 40 hours or so and after trying any pre-existing keyboard shortcuts or scripts (I tested Pearl, Shell scripting, and a bit of Amax Lisp scripting in my Googling), I have been together In this demonic Apple script, all of the things ...

  Tell the application "system events" delay set 0.2 "Menu" menu bar from the "Edit" "Process" menu Set the "Edit" process "Xcode" KLeftArrowKey for 123 key code in the KLftArrowKey menu item item in the "Balance" menu set in the "Format" menu in the "Menu" menu in the "Format" menu On the menu, click on the menu in the menu item "Bracket Expression" menu in the "Setting" menu item of "Objective C" menu item "Insert Text Item" in the "Insert Text Macro" Menu in the "Insert Text Macro" menu. Please indicate the menu key code kLeftArrowKey end  

should be a better way.

I have mentioned at least five problems above. Cad. (Which I comment on) Cad.) I often see online complaints from new objas developers about this syntax, and I suspect that this is a typical problem a major problem. Although I like how to read syntax (so much so that I avoid dot notation for properties beyond coding stability), what kind of idle it is before (just like Apple script, the irony is that my existing hack Given the implementation done.)

Help me eliminate my pain, and you will probably end up suffering along with many other ObjC developers as well ...

Which version of Xcode are you using? In my version, the left brackets are automatically created if I type correct-bracket after a valid selector name.

In Xcode 3.2, go to Preferences, then select "Text Editing", then "Insert Opening Bracket".


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -