UIActionSheet in a tab view

I was getting problems displaying an action sheet in a view that was contained within a tab control.

UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Are you sure you wish to continue?" 
									   delegate:self 
									  cancelButtonTitle:@"No"
								   destructiveButtonTitle:@"Yes"
									  otherButtonTitles:nil];
[sheet showInView:self.view];
[sheet release];

The prompt would be displayed but the clicking of the “No” button didn’t always work. The problem is although there is a view that can display the prompt, the correct view to do it is the tab bar, The following code works fine

UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Are you sure you wish to continue?" 
									   delegate:self 
									  cancelButtonTitle:@"No"
								   destructiveButtonTitle:@"Yes"
									  otherButtonTitles:nil];
[sheet showFromTabBar:self.tabBarController.tabBar];
[sheet release];

CoreData – SQLite Manager for Firefox

This Firefox add-on allows you to view the data you are running against while using the iPhone simulator. Your sqlite files can be found in the following folder

/Users/”user name”/Library/Application Support/iPhone Simulator/User/Applications/”application guid”/Documents

SQLite Firefox add-on

This is a great tool for view the data you’ve created within your apps, but I would suggest that is best to define your data model via Xcode



In order to move the cursor automatically to the next data entry field when the user presses Next on the keyboard you need to resignFirstResponder from the current field and assign it to the next field using becomeFirstResponder

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
	if (textField == field1TextField) {
		[textField resignFirstResponder];
		[field2TextField becomeFirstResponder];
	} 
	else if (textField == field2TextField) {
		[textField resignFirstResponder];
		[field3TextField becomeFirstResponder];
	}
	else if (textField == field3TextField) {
		[textField resignFirstResponder];
	}
	return YES;
}


You need to set the Return Key types accordingly within the interface builder. Your ViewController must also implement UITextFieldDelegate and the textfields delegate assignment must be set via IB to the File’s Owner

See what I do

Provisioning 3.0.1 iPhones

If you’ve updated your development phones to have the latest OS, 3.0.1, then you won’t be able to load you apps onto the device without first following this apple advisory

2. Copy and paste the following line into Terminal:

ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\) / Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0.1

But theres a catch, if you copy the text they have from the document into Terminal there is an extra space created before the second “Developer” path, remove that and all should be ok.

i.e. the command line should be…

ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\) /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0.1

Data Model change causes iPhone Simulator to fail

When you alter your underlying data model the iPhone simulator will not be able to load your app as the cached version of the database doesn’t match the new one. The easiest way to resolve the problem is to run the simulator, click and hold your app and remove it like you would remove an app from your actual phone.

Create Objective-C classes from Core Data model

Once you’ve created your data model within Xcode, you may need to generate the classes so that you can use and reference them in your main project. To do this open the data model, select File/New File… from the Xcode menu system, this will display the following screen…


New File screen with Managed Object Class selected

New File screen with Managed Object Class selected




Choose your location and then select the entities you want created.