2017-01-31 13 views
-1

の調整私は、フォルダやディレクトリの開示インジケーターを表示したいについて:ここではテーブルビューセル

マイcellForRowAtIndexPathメソッド:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 

DropboxCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Dropbox_Cell2"]; 

DBMetadata *metadata = [filesNames objectAtIndex:indexPath.row]; 
[cell.btnIcon setTitle:metadata.path forState:UIControlStateDisabled]; 
[cell.btnIcon addTarget:self action:@selector(btnDownloadPress:) forControlEvents:UIControlEventTouchUpInside]; 


if (metadata.isDirectory) { 
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 
    cell.btnIcon.hidden = YES; 
     NSLog(@"yes"); 
}else { 
    NSLog(@"No"); 
    cell.accessoryType = UITableViewCellAccessoryNone; 
    cell.btnIcon.hidden = NO; 
} 


NSString *sectionTitle = [newsectionTitles objectAtIndex:indexPath.section]; 
NSArray *sectionRows = [dict objectForKey:sectionTitle]; 
NSString *cellName = [sectionRows objectAtIndex:indexPath.row]; 

//cell.lblTitle.text = metadata.filename; 
cell.lblTitle.text = cellName; 
return cell; 
} 

画像やヘルプを参照してください。

データをロードし、操作するために使用された残りのクライアントのデリゲートメソッド:テーブルビューの Rest client delegate method which is used to load and manipulate data

numberOfRowsInSectionは方法: numberOfRowsInSection method of table view

+2

質問/問題は何ですか? – CW0007007

+0

あなたの質問からはっきりと分かりませんので、もう少し詳しく説明してください。 –

+0

@ CW0007007 dropboxのメタデータに表示されているフォルダまたはディレクトリの公開インジケータを表示します。私はtableviewデリゲートメソッドでそれを得ることができません。 – aditya

答えて

0

あなたは複数のセクションを返し、そうcellForRow方法変更でindexPath.rowが依存しているためセクション上でmetadata.isDirectoryセクションと行に依存するだけではない行に依存する、私はあなたを助けることを願って処理してください。