iphone - how to call a methode in the superview from the subview? -
i had view controller initialised in appdelegate.i added viewcontroller navigation controller addsubview methode,inorder show above navigation bar.now adding viewcontrollers view subview of view.now when pressing button on subview need perform methodes in superview.i tried way`
appdelegate.viewcontroller =(viewcontroller*)self.view.superview; } if(appdelegate.viewcontroller==nil) { nslog(@"appdelegate viewcontroller nil"); } else { [appdelegate.viewcontroller setmessage:@""]; }
`but giving me error
[uiview setmessage:]: unrecognized selector sent instance.can point me in going wrong?
for (uiview* next = [self.view superview]; next; next = next.superview) { uiresponder* nextresponder = [next nextresponder]; if ([nextresponder iskindofclass:[uiviewcontroller class]]) { [(uiviewcontroller*)nextresponder viewwillappear:yes]; } }
Comments
Post a Comment