Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. - (void)viewDidLoad
  2. {
  3. self.tableView.allowsMultipleSelectionDuringEditing = YES;
  4. self.tableView.delegate = self;
  5. self.tableView.dataSource = self;
  6. self.tableView.alpha = 0.0f;
  7. [self.tableView registerNib:[UINib nibWithNibName:@"VirtualFileTableViewCell" bundle:[NSBundle mainBundle]]
  8. forCellReuseIdentifier:VirtualFileTableViewCellReuseID];
  9. }
  10. - (void)viewDidAppear:(BOOL)animated
  11. {
  12. [super viewDidAppear:animated];
  13.  
  14. self.tableView.contentInset = UIEdgeInsetsMake([self.topLayoutGuide length], 0.0f, [self.bottomLaoyout guide length], 0.0f);
  15. self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake([self.topLayoutGuide length], 0.0f, [self.bottomLaoyout guide length], 0.0f);
  16. [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:NO];
  17.  
  18. [UIView animateWithDuration:0.5f animations:^{
  19.  
  20. self.tableView.alpha = ( self.viewType == ViewTypeList ? 1.0f : 0.0f );
  21.  
  22. } completion:^(BOOL finished) {}];
  23. }
  24. - (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  25. {
  26. static NSString * CellIdentifier = VirtualFileTableViewCellReuseID;
  27. VirtualFileTableViewCell * cell = (VirtualFileTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
  28.  
  29. cell.sizeLabel.text = @"5 KB";
  30.  
  31. return cell;
  32. }
  33.  
  34. self.tableView.contentInset = UIEdgeInsetsMake([self.topLayoutGuide length], 0.0f, [self.bottomLaoyout guide length], 0.0f);
  35. self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake([self.topLayoutGuide length], 0.0f, [self.bottomLaoyout guide length], 0.0f);
  36.  
  37. - (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  38. {
  39. static NSString * CellIdentifier = VirtualFileTableViewCellReuseID;
  40.  
  41. if(virtualFileTableViewCellObj == nil)
  42. {
  43. virtualFileTableViewCellObj= (VirtualFileTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
  44.  
  45. }
  46.  
  47.  
  48. virtualFileTableViewCellObj.sizeLabel.text = @"5 KB";
  49.  
  50. return virtualFileTableViewCellObj;
  51. }
  52.  
  53. self.tableView.delegate = self;
  54. self.tableView.dataSource = self;
  55.  
  56. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  57. {
  58. static NSString *CellIdentifier = @"albumListCell";
  59. VirtualFileTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  60. if (cell == nil)
  61. {
  62. cell = (VirtualFileTableViewCell *) [[[NSBundle mainBundle] loadNibNamed:@"VirtualFileTableViewCell" owner:self options:nil] lastObject];
  63. }
  64. return cell;
  65. }
  66.  
  67. static NSString *CellIdentifier = @"albumListCell";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement