Objective c 三个20 TTTableViewController重新加载数据

Objective c 三个20 TTTableViewController重新加载数据,objective-c,three20,Objective C,Three20,如何在TTTableViewController中重新加载数据?我试着 调用reloadData,但它不显示新数据。 我已经创建了datasource文件,它是 TTListDataSource。基本上,init函数如下所示 - (id) initWithObject:(NSArray *)objects { if (self = [super init]) { NSMutableArray *priceItems = [[[NSMutable

如何在TTTableViewController中重新加载数据?我试着 调用reloadData,但它不显示新数据。 我已经创建了datasource文件,它是 TTListDataSource。基本上,init函数如下所示

- (id) initWithObject:(NSArray *)objects { 
        if (self = [super init]) { 
                NSMutableArray *priceItems = [[[NSMutableArray alloc] init]  autorelease]; 
                for (int i = 0; i < [objects count]; i++) { 
                        [priceItems addObject: 
                         [PriceItem itemWithName: 
                                [[objects objectAtIndex:i] objectAtIndex:0] 
                                          lastDone:[[objects objectAtIndex:i] objectAtIndex:1] change:[[objects objectAtIndex:i] objectAtIndex:2]]];                                                                                           
                } 
                self.items = [NSArray arrayWithArray:priceItems]; 
        } 
        return self;  }
-(id)initWithObject:(NSArray*)对象{
if(self=[super init]){
NSMutableArray*priceItems=[[NSMutableArray alloc]init]autorelease];
对于(int i=0;i<[对象计数];i++){
[priceItems添加对象:
[PriceItemWithName:
[[objects objectAtIndex:i]objectAtIndex:0]
lastDone:[[objects objectAtIndex:i]objectAtIndex:1]更改:[[objects objectAtIndex:i]objectAtIndex:2]];
} 
self.items=[NSArray arrayWithArray:priceItems];
} 
返回自我;}
加载视图后,我开始流式传输一些数据,因此 传递给initWithObject的对象已更改,因此我在 TTTableViewController的子类,以更新数据,但 数据没有更新。对于刷新方法也不起作用。我是否需要在中实现任何其他方法 TTListDataSource的子类?

Try

[self invalidateModel];
这应该能奏效。

试试看

[self invalidateModel];

这应该可以解决问题。

invalidateModel将重建模型,这是没有效率的


尝试[TTTableViewController刷新],您的表将被重新加载。

无效模型将重建模型,这是无效的


请尝试[TTTableViewController刷新],您的表将被重新加载。

找到此问题的答案了吗?找到此问题的答案了吗?