After using eclipse for so long i have become a custom to my shortcuts and xcode just doesn't stand up to the job as far as i am concerned so here is a small list of the custom key bindings i have setup for myself. I will add more as I create them.
To create a custom key bindings file goto XCode>Preferences>Bindings> Duplicate an existing binding and name it whatever you want then go to and open the file you just created in a text editor so you can see the xml output.
A good list of available commands can be found here
1. Duplicate code!
I can't believe xcode doesn't have this in Eclipse you simple select your text and press Ctrl + Alt and either Up or Down on the keypad and it will duplicate your code placing it either above or below the current selection. It will also reselect the newly duplicated code so that you can duplicate it as many times as you like.
<key>^~\U700</key>
<array>
<string>copy:</string>
<string>moveUp:</string>
<string>moveToEndOfLine:</string>
<string>insertLineBreak:</string>
<string>insertNewLine:</string>
<string>setMark:</string>
<string>paste:</string>
<string>selectToMark:</string>
</array>
<key>^~\U701</key>
<array>
<string>copy:</string>
<string>moveDown:</string>
<string>moveToBeginningOfLine:</string>
<string>insertLineBreak:</string>
<string>insertNewLine:</string>
<string>moveUp:</string>
<string>setMark:</string>
<string>paste:</string>
<string>selectToMark:</string>
</array>
2. Delete Line.
Deletes the current line your cursor is on. press Ctrl + D.
I have been meaning to start building an iphone application for some time now and recently stumbled across Stanfords CS193p iphone development course on ITunes U I have found it really useful especially the Assignments. more...
Just in case anyone was having as much trouble as me installing one of the above languages onto their UK Blackberry I thought i would post this very useful link.
Using FireFox as your main browser when developing on Windows means that by default you end up getting loads of tabs for all your canceled debug sessions. In order to prevent this behavior simply type in
about:config
into the address bar and do a search for
browser.link.open_external
then change it's value from 3 to 1; this will make your flex debug session always appear in one tab.
I have been looking into bits, bytes and bit shifting a lot recently so I thought I would quickly make a small binary clock to help burn it into my mind. In addition it also gave me the chance to experiment with the spark skinning. Below is the result. Not pretty I know but thats what the skinning is for.
val = num | 0; //Same as Math.floor();
val = num + 0.5 | 0; // Rounds positive numbers.//Divide by power of two
val = num >>1; //Divide by 2 and floor.
val = num / 32 is the same as val = num >> 5
val = 65535 >> 8; //255//actual value is 255.996...//But it is being floored as well
i = (x^(x>>31)) - (x>>31);//about 2700% faster than Maths.abs();if(++count&1){}//alternation i need to check this one.
Just a quick note here. I use the excellent snippet plugin from Lee Brimlow over at the theFlashBlog so that i don't have to put up with all the cfeclipse icons across the top of my toolbar. But I recently installed a beta version of FlashBuilder and found that when i installed the plugin it would no longer work. After much searching i found the solution for me was to go into the plugin folder and open the META-INF/MANIFEST.MF file and remove the following two lines from the bottom of the file.
Another little tip with working with snippets and workspaces:
when switching workspaces you lose all your snippets as they are kept in the workspaces .metadata/.plugins/org.cfeclipse.cfml/snippets
this folder is recreated for each new workspace you create. So what i do is keep a global snippets folder in my main workspace and simply replace the snippets folder in my other workspaces with a simlink to the main one. That way when ever i add a new snippet it is shared across all my workspaces.
just a little side note:: if you don't know how to show hidden files in mac osx. type the following into the terminal and then restart finder.
To turn it off set it to false. You also need to restart Finder for it to take effect.
Also if you don't know how to create the simlink you simple go into the terminal, navigate to your workspace then .metadata>.plugins>org.cfeclipse.cfml delete the snippets folder that is in there and then type
ln -s PATH TO YOUR WORKSPACE WHERE YOU KEEP YOUR MAIN SNIPPET FOLDER/snippets Snippets
This should then put a simlink inside your workspace and you can then share your snippets across all your workspaces instead of having to copy them into each.
I have been using Flex for a couple of years now and i still find new and interesting framework items. In comes IMXMLObject. Up until recently whenever i wanted to place a non visual component into mxml i was extending UIComponent to allow me to place these items in MXML, however among other things this meant that they would be included in the layout and come with a high footprint.
The solution seems to be to implement the IMXMLObject interface this will allow you to place non visual components into your mxml code without having to worry about layout or an unnecessary memory footprint.