objective c - Obj C - UITextViewDelegate incompatible type warning -
warning on line journalcomment.delegate = self: assigning 'id' incompatible type 'journalentryviewcontroller*'
journalcomment textview.
i'm not sure warning about, should - warning: "newb @ keyboard, go take obj c classes."
thank help.
- (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { self = [super initwithnibname:nibnameornil bundle:nibbundleornil]; if (self) { // custom initialization // hide keyboard when done key pressed // define area , location uitextview cgrect tfframe = cgrectmake(0, 0, 320, 460); journalcomment = [[uitextview alloc] initwithframe:tfframe]; // make sure editable journalcomment.editable = yes; // add controller delegate journalcomment.delegate = self; } return self; }
your class must conform uitextviewdelegate protocol, in .h file make like
@interface journalentryviewcontroller : nsviewcontroller <uitextviewdelegate> { ... } then compiler know class conforms protocol. of course, still need implement needed methods.
Comments
Post a Comment