I am following your code on page 185 and received an error for the last two lines of code for setBorderStyle and setPlaceholder. Xcode generated this message, "! Receiver type ‘UITextView’ for instance message does not declare a method with selector 'setBorderStyle’
I am not sure what this means.
// Create and configure the text field where new tasks will be entered
taskField = [[UITextField alloc] initWithFrame:fieldFrame];
[taskField setBorderStyle:UITextBorderStyleRoundedRect];
[taskField setPlaceholder:@“Type a task, tap Insert”];
I am using your Objective C Programming, Big Nerd Ranch Guide. Sorry, I am new to your site. Please let me know if I should be posting my questions differently. Thanks.
[quote]Receiver type ‘[color=#FF0000]UITextView[/color]’ for instance message does not declare a method with selector 'setBorderStyle’
I am not sure what this means.[/quote]
// Create and configure the text field where new tasks will be entered
taskField = [[UITextField alloc] initWithFrame:fieldFrame];
[taskField setBorderStyle:UITextBorderStyleRoundedRect];
[taskField setPlaceholder:@"Type a task, tap Insert"];
What is the type of taskField? The error is referring to UITextView but you are setting taskField to an instance of UITextField.
Thank you! You were right on target about the field type. I made an error in the header field when I declared the taskField as UITextView type when it should be “UITextField.” I am using Xcode 4.2.1. Thank you again!