Hello I am using dropbox api and displaying meta data from dropbox account..
I want to differentiate files and folders from loaded data..because I want to show next level if there is folder and if there is file I don’t want to show next View
my code to load data
- (void)restClient:(DBRestClient*)client loadedMetadata:(DBMetadata*)metadata {
[self.metaArray release];
self.metaArray = [[NSMutableArray alloc]init ];
for (DBMetadata *child in metadata.contents) {
NSString *folderName = [[child.path pathComponents] lastObject];
[self.metaArray addObject:folderName];
}
[self.tableView reloadData];
[self.activityIndicator stopAnimating];
}

According to the Dropbox Developer Docs the metadata includes a property called
is_dirwhich should allow you to determine whether the particular item is a directory or not.Looking at the header of
DBMetaDatait is indeed exposed as a propertySo you can just do a simple test like so
With regards pushing views based on whether or not an entry is a directory, you could subclass
UITableViewCelland add anisDirectoryproperty. Instead of adding just the name toself.metaArrayyou could add a dictionary containing both the name and the value ofisDirectory. Then in your table view datasource where you populate the cells you’d set theisDirectoryproperty of theUITableViewCellbased on the same property in the appropriate dictionary from the array. Finally, in the table view delegate method- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPathyou can get the selected cell using the
indexPathand then test theisDirectoryproperty and based on it’s value take the appropriate action.Hope this helps.