I have a custom UIView I use for displaying a popover (on iPhone). In the popover are some UIButtons that I need to call methods from the ViewController's class (NOT the UIView's class, but the View that is showing the UIView).
How do I properly set this up?
UIView Button Code located in Custom UIView class:
UIButton *logoutButton = [UIButton buttonWithType:UIButtonTypeCustom];
[logoutButton setTitle:@"Logout" forState:UIControlStateNormal];
[logoutButton setFrame:CGRectMake(0, 0, content.frame.size.width, 44)];
[logoutButton addTarget:self.superview.superview action:@selector(logout) forControlEvents:UIControlEventTouchUpInside];
[logoutButton setBackgroundImage:redImage forState:UIControlStateNormal];
[logoutButton setBackgroundImage:redImageHighlight forState:UIControlStateHighlighted];
[logoutButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[content addSubview:logoutButton];