У меня есть табличное представление с ячейками прототипа.Pulltorefresh работает только один раз не раз
У меня следующий код в моем методе viewDidLoad,
_refreshControl = [[UIRefreshControl alloc]init];
[_refreshControl addTarget:self action:@selector(refreshData) forControlEvents:UIControlEventValueChanged];
UITableViewController *tableViewController = [[UITableViewController alloc] init];
tableViewController.tableView = _tblView;
tableViewController.refreshControl = _refreshControl;
Ниже мой метод RefreshData ....
-(void)refreshData
{
[_request getApproveStatutoryMapping];
UITableViewController *tableViewController = [[UITableViewController alloc] init];
tableViewController.tableView = _tblView;
[_tblView reloadData];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MMM d, h:mm a"];
NSString *title = [NSString stringWithFormat:@"Last update: %@", [formatter stringFromDate:[NSDate date]]];
NSDictionary *attrsDictionary = [NSDictionary dictionaryWithObject:[UIColor whiteColor]
forKey:NSForegroundColorAttributeName];
NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:title attributes:attrsDictionary];
tableViewController.refreshControl.attributedTitle = attributedTitle;
[tableViewController.refreshControl endRefreshing];
}
Проблема заключается в том, что
- отнесенныйТитайм не является visi ble
- Вытягивание для обновления работает только один раз, и если я вытащу его снова, это не сработает. Почему это так?