Aren’t you annoyed by the lack of a timer on the iPhone’s camera?
I am, so I developed one.
Along with Justyna Marczewska (awesome designer from Warsaw), we created a camera timer app with a simple interface and a great user experience.
It’s name is Timera (camera + timer) and it’s available for free in the App Store.
Go and get it!!
Next Wednesday (25th) I will be releasing my next app in the App Store. Stay tuned.
For this week I would like to recommend a podcast that I’ve been enjoying during this winter: This Developer’s Life.
It’s not an overly technical podcast discussing the headers of some C library or obscure specs of certain compiler on certain platform.
Rather than that, Rob Conery and Scott Hanselman — the hosts — explore all the interesting topics around ‘life as a developer’: education, taking criticism, fame, getting fired, etc.
Every show is accompanied by lots of interviews with awesome developers and a wonderful soundtrack used cleverly to round-up all the ideas of each show.
If you are the kind of developer that ‘asks lots of questions’ (you should be), enjoyed The Wonder Years or are simply prone to introspection, you are definitively gonna enjoy it.
For both persons and programming variables, a good name is an invitation to a prosperous life. Luckily for your Objective-C variables, changing their name is easier than the legal trouble of changing your own name to ‘Max Power’.
Find out how:
‘Edit All In Scope’
To rename a symbol present solely inside a function, use the ‘Edit All In Scope’ function. As it the name implies, this will edit the symbol’s name inside the current scope.
To make use of this feature:
- Place the cursor on top of the symbol to be renamed and press
- Edit your symbol’s name.
Enter to finish the edit.
Alternatively, you can try placing your mouse on top of a symbol, wait until it is underlined, select the menu ‘Edit All In Scope’ and go on from there.
Personally, I found this approach annoying.
If the symbol you intend to rename is a property of a class, a constant used across your project or any other symbol used in any scope wider than a function or method, you should use Xcode’s Refactor instead:
- Left-click the symbol to be renamed.
- Select Refactor -> Rename from the contextual menu.
- Finally, give that poor variable a name it can be proud of.
If you selected the ‘Rename related files’ option, Xcode will look for other files using the variable and rename it there but, this method is not fail safe — keep reading!
Avoid Breaking Stuff: NSStringFromSelector
- The first strategy is not to trust Xcode’s refactor by a 100% and run a project-wide search for the soon-to-be-replaced identifier. Look particularly for occurrences inside strings passed to NSPredicates or used in KVO. It’s pretty easy to miss those ones just to find them later as unexpected
NSUndefinedKeyExceptions. Not good…
- To help Xcode’s refactor tools, use the function NSStringFromSelector() every time you make reference to an object’s property (instead of simply typing it inside a string)
self.name = [aDecoder decodeObjectForKey:@"name"];
NSStringFromSelector gives Xcode a little bit of context on what that particular string means and a hint to include that occurrence in case of refactoring.
self.name = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(name))];