小编Por*_*nel的帖子

当我拉刷新时,Xcode 表视图数据变得重复

嗨,每次我使用拉动刷新时,我的数据都会重复。例如。通过一次拉动刷新,表视图中的 5 个初始条目将增加一倍至 10 个,并在随后的拉动刷新中再添加 5 个条目。我怎样才能停止重复..我想确保只下载新项目,并且不会再次下载表中的现有数据。

\n\n
@implementation RootViewController\n@synthesize allEntries = _allEntries;\n@synthesize feeds = _feeds;\n@synthesize queue = _queue;\n@synthesize webViewController = _webViewController;\n\n#pragma mark -\n#pragma mark View lifecycle\n\n- (void)addRows {\n\n    RSSEntry *entry1 = [[[RSSEntry alloc] initWithBlogTitle:@"1"\n                                               articleTitle:@"1"\n                                                 articleUrl:@"1"\n                                                articleDate:[NSDate date]] autorelease];\n    RSSEntry *entry2 = [[[RSSEntry alloc] initWithBlogTitle:@"2"\n                                               articleTitle:@"2"\n                                                 articleUrl:@"2"\n                                                articleDate:[NSDate date]] autorelease];\n    RSSEntry *entry3 = [[[RSSEntry alloc] initWithBlogTitle:@"3"\n                                               articleTitle:@"3"\n                                                 articleUrl:@"3"\n                                                articleDate:[NSDate date]] autorelease];\n\n\n    [_allEntries insertObject:entry1 atIndex:0];\n    [_allEntries insertObject:entry2 atIndex:0];\n    [_allEntries insertObject:entry3 atIndex:0];\n\n}\n\n\n\n\n- (void)viewDidLoad {\n    [super viewDidLoad];    \n    self.title = @"Songs";\n    self.allEntries …
Run Code Online (Sandbox Code Playgroud)

xcode ios pull-to-refresh xcode6

1
推荐指数
1
解决办法
1021
查看次数

标签 统计

ios ×1

pull-to-refresh ×1

xcode ×1

xcode6 ×1