1
我有一个UITableView应该在加载时显示Dropbox中文件夹的内容。我知道它通过使用日志语句从Dropbox获取数据。在从下拉框中获取数据后,我重新加载表中的数据,但它仍然不显示任何内容。请帮助iOS UITableView在Dropbox加载数据时不会显示任何内容
- (void)viewDidLoad
{
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
uploadFileButton = [[UIBarButtonItem alloc] initWithTitle:@"Upload" style:UIBarButtonItemStyleBordered target:self action:@selector(uploadFile:)];
self.navigationItem.rightBarButtonItem = self.editButtonItem;
self.navigationItem.leftBarButtonItem = uploadFileButton;
self.title = @"DropBox";
[[self restClient] loadMetadata:@"/"];
}
- (void)restClient:(DBRestClient*)client loadedMetadata:(DBMetadata*)metadata {
for (DBMetadata *file in metadata.contents) {
NSLog(@"\t%@", file.filename);
[dropBoxArray addObject:file.filename];
}
NSLog(@"%@", dropBoxArray);
[self.tableView reloadData];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [dropBoxArray objectAtIndex:indexPath.row];
NSLog(@"%@", cell.textLabel.text);
return cell;
}
谢谢你的回答,但我从2月以来没有在此工作。我问的是如何从Dropbox加载文件。谢谢。 – Slayter 2013-02-27 21:41:47