Recently in iPhone Dev Category

The possibleTitles property of UIBarButtonItem is pretty useful if you need to change the title and also animate the changes. I was trying to animate both the back button and the title of the right barbutton at the same time, but the back button wouldn't disappear properly (i.e. not animated) until I set the possibleTitles of the right barbutton.

First create the button. Do this in viewDidLoad.

self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UIBarButtonItemStyleBordered target:self action:@selector(toggleEditing)] autorelease];
self.navigationItem.rightBarButtonItem.possibleTitles = [NSSet setWithObjects:@"Edit", @"Done", nil];

To change the title just set the title property. Very easy. Both changes will be animated.

- (void)toggleEditing {
	if (!self.editing) {
		self.navigationItem.rightBarButtonItem.title = @"Done";
		[self.navigationItem setHidesBackButton:YES animated:YES];
	} else {
		self.navigationItem.rightBarButtonItem.title = @"Edit";
		[self.navigationItem setHidesBackButton:NO animated:YES];
	}
}

This works in OS 3.0.

It's confirmed that if you have a 2G iPhone that is unlocked with BootNeuter (running firmware 2.2.1), you can safely update to OS 3.0 using iTunes (yes just press that Update button).

For detailed and step-by-step instructions see here

Subclassing UITextView

| | Comments (0)

MPTextView is a subclass of UITextView with just one little extra function: pass in a criteria to determine if the delegate method (handleTouchEvent) should be called or not. Feel free to use it in whatever way you want.

Don't forget to set the delegate. Read the header file for more information.

Download MPTextView.zip

Email/SMS template app

| | Comments (0)

Currently I am working on an iphone app that lets user create templates, and when it's time to send an email or SMS, the user can select a template, fill out some fields (or check some check boxes), and send it.

The template accepts text variables and expressions. Expressions are infix expression with the option of parenthesis, which are calculated upon sending the actual email or SMS.

The app is still in an alpha status, so there are many features that I cannot disclose just yet.

The template would look like this:

Happy New Year, {@name}!
{{{#Number Of Products}*{#Product Price}*(1+{#Sales Tax})+{#Shipping Fee}}}

Clear Crash Logs of iPhone

| | Comments (0)

This afternoon I noticed, for the first time, that I have 757 crash logs on the iPhone I use for development, great. Here is a very simple way to delete all of them in 2 steps:

  • Disconnect the iPhone from your computer. Quit XCode, too.
  • The path to crash logs for iPhone (and iPod Touch) is: /Users/user/Library/Logs/CrashReporter/MobileDevice. To clear all crash logs, simply deleted everything inside that folder.

Flash-Me Screenshots

| | Comments (0)

Latest project from Miphol Studio—here are some quick screenshots of Flash-Me, an iPhone flash card app that syncs with Cramberry. Currently the app offers 3 study modes, supports tagging decks, and more...

iPhone Color Profile

| | Comments (1)

For a quick and easy way to preview what the colors would look like on iPhone in Photoshop, set the color profile to Apple RGB.