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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -