iphone上的Pull To Refresh无法按预期工作

我一直在使用这个:http://blog.leahculver.com/2010/12/iphone-pull-to-refresh.html来在我的应用程序中进行拉动刷新功能。 但我看不到文字“拉下来刷新......”,“发布刷新......”和“正在加载......”。 我所做的就是将文件复制到我的项目中,链接到QuartzCore框架,并更改了我的视图控制器的.h文件,因此它是PullRefreshTableViewController的子类。然后我添加了刷新方法。 似乎PullRefreshTableViewController中的initWithStyle方法永远不会被执行。 但我应该在我的tableViewcellForRowAtIndexPath中。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"CellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}

cell.textLabel.text = @"Text";

return cell; }
PullRefreshTableViewController.m中的initWithStyle方法:
- (id)initWithStyle:(UITableViewStyle)style {
self = [super initWithStyle:style];
if (self != nil) {
    textPull = [[NSString alloc] initWithString:@"Pull down to refresh..."];
    textRelease = [[NSString alloc] initWithString:@"Release to refresh..."];
    textLoading = [[NSString alloc] initWithString:@"Loading..."];
    NSLog(@"in");
}
NSLog(@"out");
return self; }
日志永远不会在控制台中打印出来 我真的不知道问题在哪里?     
已邀请:
有同样的问题。 想通知不是调用initWithStyle而是调用initWithCoder .... 所以要解决你的问题,请在PullRefreshTableViewController.m中插入以下代码 它就像一个魅力
-(id)initWithCoder:(NSCoder *)aDecoder{
NSLog(@"initWithCoder");
self = [super initWithCoder:aDecoder];
if (self != nil) {
    textPull = [[NSString alloc] initWithString:@"Pull down to refresh..."];
    textRelease = [[NSString alloc] initWithString:@"Release to refresh..."];
    textLoading = [[NSString alloc] initWithString:@"Loading..."];
}
return self;
}
最好的祝福     
如果您正在寻找定义文本的位置,那么它位于PullRefreshTableViewController.m的第43行 希望这会有所帮助(如果确实不忘记我的答案) M.     
尝试使用以下方法实例化PullRefreshTableViewController:
PullRefreshTableViewController *tableViewController = [[PullRefreshTableViewController alloc] initWithStyle:UITableViewStylePlain];
使用initWithSyle实例化UITableViewCell不会对UITableViewController子类产生任何影响。 另一种方法是编辑PullRefreshTableViewController类,以与initWithStyle类似的方式覆盖 - (id)init方法:     

要回复问题请先登录注册