我设置UIButton
为myButton到隐藏在viewDidLoad
的UIButton不会隐藏/显示
在splitviewcontroller
我有这样,当我点击一个tablecell
,某些项目取消隐藏这对于我textviews
的伟大工程,但我的按钮给我这个:
ERROR: member reference base type void is not a structure or union
下面是一些代码片段:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 0) {
detailViewController.myButton.hidden= NO;
detailViewController.textView1.hidden= NO;
detailViewController.textView2.hidden= NO;
}
在.h文件中有
@property (strong, nonatomic) DetailViewController *detailViewController;
在
DetailViewController
是在按钮和textviews
被声明为
@interface DetailViewController : UIViewController <UISplitViewControllerDelegate>{
IBOutlet UIButton *myButton;
IBOutlet UITextView *textView1;
IBOutlet UITextView *textView2;
}
@property (strong, nonatomic) IBOutlet UITextView *textView1;
@property (strong, nonatomic) IBOutlet UITextView *textView2;
@property (strong, nonatomic) UIButton *myButton;
-(IBAction)myButtonPressed;
@end
IBAction
myButtonPressed
在DetailViewController.m
是
-(IBAction)myButtonPressed{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
RootViewController *RVC = [storyboard instantiateViewControllerWithIdentifier:@"Root"];
[UIApplication sharedApplication].delegate.window.RootViewController = RVC;
}
任何人有,为什么按钮将不会表现任何想法像其他两个会?是因为我给了它IBAction
??
检查UIButton声明。它不是以正确的方式。 –