Если область действия переменной, которую вы хотите использовать, ограничена одним из ваших методов, вы не можете использовать его снаружи.
Вам нужно будет сделать ее переменной-членом и запросить ее у экземпляра класса.
@interface MyTable{
NSInteger row; //Member variable
}
@property (nonatomic, assign) NSInteger row; //Making it a property allows it to be accessed from other classes
@end
...
@implementation
@synthesize row; //Used in conjunction with @property
....
- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
...
row = [indexPath row]; //sets the variable you want to use
...
}
....
@end
другой класс:
[myTable row]; //Use the variable