iTahDoodle Build Failded (taskField)


#1

Build failed when i tried to run iTahDoodle. Double checked then rechecked the code against the book and I can’t tell what i’ve done wrong.

taskField = [[UITextField alloc] initWithFrame:fieldFrame];
warning: incompatible pointer types assigning to ‘UITextView *__strong’ from ‘UITextField *’ [-Wincompatible-pointer-types,3]

[taskField setBorderStyle:UITextBorderStyleRoundedRect];
error: receiver type ‘UITextView’ for instance message does not declare a method with selector ‘setBorderStyle:’ [4]

[taskField setPlaceholder:@“Type a task, tap Insert”];
error: receiver type ‘UITextView’ for instance message does not declare a method with selector ‘setPlaceholder:’ [4]

also get:
warning: incomplete implementation [-Wincomplete-implementation,3] - but i know this is because at this point in the code addTask: hasn’t been implemented.

Running xcode 4.2 on mac os x lion 10.7. Any thoughts?


#2

I think you declared your variable the wrong type. It should be:

UITextField *taskField;
I think you declared it a UITextView – a common error when you rely too much on autocomplete. :slight_smile:


#3

That fixed it. Lots of great lessons in your reply - thank you! :smiley: