Monday, April 04, 2011

WWDC2010 Session308 Developing Your App with Xcode 4

This session covers source control, source editor, find an replace and version editor.

Source control

When you create a new project, you have an option to create a local git repository. You can copy a git link from github.com, create a repository in Organizer, and clone it.

Source editor

Assistant editor - the secondary editor to show related file. For example, if you select .h file, the .m file will show in the assistant editor. You can press Option key and click a file to show it in the assistant editor. Option key works for all items. You can right click an item, press Option key and click 'Jump to definition'. Then the definition shows in the secondary editor.

Auto completion

When you want to implement a method declared in .h file, you need not copy that declaration. You just need to type in a couple of letters of that function name, Xcode will show all unimplemented methods automatically. You can use ctrl-space to invoke it manually. However, looks like Xcode 4 indexes a little bit slow, it does not show my method. I closed my xcode, and restarted it. Then my method showed up. Another problem is the shortcut 'Ctrl-space' conflicts with Spotlight of the OS X.

Code Snippet Library

You can create your code snippet by dragging some lines of code into Code Snippet Library.

Example:

static dispatch_once_t once;

dispatch_once(&once, ^{

});

You can give it a name and the shortcut (key word). And you can also add a token. After you used this code snippet, you just press Tab to move the cursor to that token.

Example:

static dispatch_once_t once;

dispatch_once(&once, ^{

<#code#>

});

Find and Replace

Find bar stores history now.

Supports regular expression.

Replace Preview UI is very cool. It looks like version comparing.

Version control

Integrated version history

View changes

Find and fix regressions using Blame mode.

WWDC2010 Session308 Developing Your App with Xcode 4

Author: Kerry Hazelgren - Software Engineering Manager

No comments: