ios - Popovers in UITableView -
i display popovers uitableview
's content (this works) on button presses , selected item string buttontitle or textview text. i've found few example on how protocols still error. code:
in popoverviewcontroller.h
@protocol popoverviewcontrollerdelegate <nsobject> -(void)getrowtext:(nsstring *)string; @end
i declare id delegate2 variable , set property to:
@property(nonatomic,assign) id<popoverviewcontrollerdelegate> delegate2;
in popoverviewcontroller.m file synthesize variable, , in didselectrowatindexpath
method have this, , line seems cause error i`m having:
[self.delegate2 getrowtext:[somearray objectatindex:indexpath.row];
in mainviewcontroller.m add popoverviewcontrollerdelegate viewcontrollers protocol , have header file imported. , have code in -(void)getrowtext:
method doesnt called.
uipopovers
, such set work needed, problem arises when press row in tableview.
terminating app due uncaught exception 'nsinvalidargumentexception', reason: '* -[uipopoverviewcontroller getrowtext:]: unrecognized selector sent instance 0x57ca80'
could give advice this?
finally found error , cant believe how silly i/it was.
i had viewcontroller.delegate2 = self. line period instead of semicolon, wonder why compiled tho.
Comments
Post a Comment