App crash when there's another tableview in controller

#42 · closed · 3 comments

View on GitHub ↗

sameer4

i had to use context menu on multiple screens so i made `@interface UIBaseControllerForMenu : UIViewController <UITableViewDelegate,UITableViewDataSource,YALContextMenuTableViewDelegate>` and added all menu code in this controller's m file.didn't make xib file for this controller file. and where i needed to use it, i used `@interface UIMyAppointmentViewController : UIBaseControllerForMenu` and call the action button of UIBaseControllerForMenu from child controllers to show/init menu.it works fine in controllers without tableview of there own but crashes the app when there's a other tableview in them.issue is you are getting cell from visible cells function of tableview which returns the controller's own cell not the one belonging to menu. and try to call functions defined in YALContextMenuCell protocol and app crashes as other cells are not implementing this function. any solution to this???

Comments

sameer4

sorry my mistake.i should have redirected tableview datasource calls to superview's implementations if tableview is not equal to controller's own

shraddha-patel-1891

@sameer4 i have same issue can you please give me brief answer? Always called sub class cellfor row not called super class cellfor row. Thanks

shraddha-patel-1891

@sameer4 i have same issue can you please give me brief answer? Always called sub class cellfor row not called super class cellfor row. Thanks