In this recipe we will learn how to delete an item from a table view, as well our core data model.
Following on from our previous recipe, we will learn how to apply customized keyboard styles to fields within our UIAlertView
as defined in our btnAdd
method that we defined in an earlier recipe.
To begin, follow these simple steps as outlined in the following order:
BooksViewController.m
implementation file from the Project Navigator window.btnAdd
method to apply a custom keyboard type for our bookTitle
field, as shown by the highlighted code section in the following code snippet. UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Add Book Details" message:@"
"
delegate:self cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK", nil];
bookTitle = [[UITextField alloc]
initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)];
[bookTitle setPlaceholder:@"Book Title:"];
[bookTitle setBackgroundColor:[UIColor whiteColor]];
bookTitle.keyboardType = UIKeyboardTypeAlphabet;
[alertaddSubview:bookTitle];
In this recipe, we begin by updating the
keyboardType
property of the bookTitleUITextField
control and then specify the UIKeyboardTypeAlphabet
variable as the keyboard type to use.
The keyboardType
property accepts an enumeration type named UIKeyboardType
.
The following table explains some of these types:
For more information on the
UIKeyboardType
class, as well as the various keyboard types, refer to the Apple Developer Documentation located at: http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UITextInputTraits_Protocol/Reference/UITextInputTraits.html