Pull To Refresh on iphone not working as expected

Posted by Kleemann on Stack Overflow See other posts from Stack Overflow or by Kleemann
Published on 2011-02-06T21:23:40Z Indexed on 2011/02/09 7:25 UTC
Read the original article Hit count: 168

Filed under:
|
|

I have been using this: http://blog.leahculver.com/2010/12/iphone-pull-to-refresh.html to make the pull to refresh function in my app. But I cant see the text "Pull down to refresh...", "Release to refresh..." and "Loading...".

All I've done is copy the files into my project, link against QuartzCore framework, and changed the .h file of my view controller so it is a subclass of PullRefreshTableViewController. Then I added the refresh method.

Is seems that the initWithStyle method in PullRefreshTableViewController never is executed. But i should be, in my 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; }

The initWithStyle method from the PullRefreshTableViewController.m:

- (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; }

The logs are never printed in the console

I really cant see where the problem is ?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about xcode