Reputation: 6490
How to hide my tableView which is declared in another class..
Here is my code snippet,
CRStoreView.h
@interface CRStoreView : UIView <UITableViewDelegate, UITableViewDataSource>{
....
}
@property (strong, nonatomic) IBOutlet UITableView *tblStore;
and i want to hide this tblStore
in my new class(CRNextView.m)..
I tried this but table is not getting hide,
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
NSLog(@"touchesBegan");
CRStoreView *Obj = [[CRStoreView alloc] init];
[Obj.tblStore setHidden:YES];
}
How to Solve it ?
Upvotes: 0
Views: 82
Reputation: 371
One method is to use delegates. Make CRStoreView
a delegate of the CRNextView
and call the setHidden
method from the CRNextView
on the delegate. Or you could pass the current instance of the CRStoreView
to CRNextView
and access the tableView object.
Upvotes: 1