If you have a code that is in a vertical section and you would like to select it, for copy/cut/paste/delete functions hold down the alt key while dragging your cursor over the code. The screen shot below shows me selecting //’s so that I can uncomment the code
The selection you make can also be used in pasting and will paste vertical down from your cursor point.
I’ve copied the code below so that I have a reference to it as well.
You also need to ensure the following steps are followed…
Make your controller implement UITextViewDelegate
setup your textfield’s (s) delegate to be your controller
in the controller @interface add an int verticalOffset
in the controller @implementation add the functions below
#pragma mark "-- text editing support --"
// Animate the entire view up or down, to prevent the keyboard from covering the text field.
- (void)moveView:(int)offset {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
// Make changes to the view's frame inside the animation block. They will be animated instead
// of taking place immediately.
CGRect rect = self.view.frame;
rect.origin.y -= offset;
rect.size.height += offset;
self.view.frame = rect;
[UIView commitAnimations];
}
- (BOOL)textFieldShouldReturn:(UITextField *) sender {
[sender resignFirstResponder];
if (verticalOffset!=0) {
[self moveView: -verticalOffset];
verticalOffset = 0;
}
return TRUE;
}
- (void)textFieldDidBeginEditing:(UITextField *)theTextField {
int wantedOffset = theTextField.frame.origin.y-200;
if ( wantedOffset < 0 ) {
wantedOffset = 0;
}
if ( wantedOffset != verticalOffset ) {
[self moveView: wantedOffset - verticalOffset];
verticalOffset = wantedOffset;
}
}
I recently had a problem where I couldn’t check in files from my project because I was getting an error stating that the folder was locked. I tried to run a cleanup on the folder but that failed due to the “build” folder not being under source control. Quick and dirty solution to this is move the build folder to a different directory, run the cleanup again, then move the folder back. All worked after that.
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];
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
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
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:
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.
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.
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
Choose your location and then select the entities you want created.