У меня есть два класса. И мне нужно вызвать метод из другого класса для reloadData UITabelView on View. Вот мой код:Objective-C public method и self
FullDescriptionView.h
#import <UIKit/UIKit.h>
UITableView *maintable;
@interface FullDescriptionView : UIViewController <UIAlertViewDelegate>
{
NSInteger heightcell;
}
+(void)refreshmaintable;
-(IBAction)done:(id)sender;
@property (nonatomic) UITableView *maintable;
@end
FullDescriptionView.m
+(void)refreshmaintable
{
[maintable reloadData]; // Don't reload
//I need [self.maintable reloadData]; this work but don't debug ERROR!!!
}
CellThird.m
...
else if(mainsegment.selectedSegmentIndex==1)
{
[FullDescriptionView refreshmaintable];
}
...
Что вы хотите сделать? –
@AnoopVaidya Мне нужно перезагрузить UITableView на виду из другого класса. – Zuhan
Использование NSNotification –