Im new to Obj-C, and I have a class, with a variable of a class in it, and I have a function not in a class that I need to call a function of the variable of the first one from, when the first class calls the function. Thats written all wrong, but I dont know the right words so:
Root.h:
@interface Root {
UITableView *tableview;
}
@property (nonatomic,retain) UITableView *tableview;
@end
I have a function(Root is a delagate, so it gets called, and calls another function, not in any class or anything:
void Search()
{
//here I need to call a function, I dont know how. If I was in Root.m, it would be
//[self.tableview reloadData];
But here I dont know how to call it, ive tried passing Search a pointer to a function in Root.m that calls the function:
-(void) update {
[self.tableview reloadData];
}
-(void) anotherFunction {
Search(update);
or
Search(self.update);
etc but it always errors there, I also tried passing a pointer (self) to Search, and calling
[pointer.tableview reloadData];
but that errors when I run it:
unrecognized selector sent to instance 0x3detc
How Do I do it?
(sorry if this was very confusing)