I have a tableview method:
- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
that declares: NSInteger row = [indexPath row]; with the above method in the file TableView.m and I want to use the value of ‘row’ in another file called SecondView.m and I do not know how to allow the value of row to be used in the other file and make it public for the whole project to us it – I want to use it in an if statement in another file.
Thanks a lot!
If the scope of the variable you want to use is limited to inside one of your methods, you cannot use it outside.
You’ll have to make it a member variable and query it from an instance of the class.
other class: