I know this is a basic delegate concept, and I should probably know the answer, but I do not.
I have a class as follows:
Is there a way to access arr? I realize it belongs to TableController, but the delegate myTableView.delegate is set to self. If I cannot access arr directly, can I access indirectly (like through the invoker?) or somehow pass it to the delegate?
I have a class as follows:
PHP:
//TableController.h
@interface TableController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
UITableView *myTableView;
//Array of strings
NSArray *arr;
}
@end
PHP:
//TableController.m
- (void)loadView {
myTableView.delegate = self;
myTableView.dataSource = self;
}
//Method for UITableViewDelegate
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath withAvailableCell:(UITableViewCell *)availableCell {
//Want to access arr here
if([arr count]) {
}
}