VLCLocalServerFolderListViewController.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. /*****************************************************************************
  2. * VLCLocalServerFolderListViewController.m
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2013 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Felix Paul Kühne <fkuehne # videolan.org>
  9. * Pierre SAGASPE <pierre.sagaspe # me.com>
  10. *
  11. * Refer to the COPYING file of the official project for license.
  12. *****************************************************************************/
  13. #import "VLCLocalServerFolderListViewController.h"
  14. #import "MediaServerBasicObjectParser.h"
  15. #import "MediaServer1ItemObject.h"
  16. #import "MediaServer1ContainerObject.h"
  17. #import "MediaServer1Device.h"
  18. #import "VLCLocalNetworkListCell.h"
  19. #import "VLCAppDelegate.h"
  20. #import "VLCPlaylistViewController.h"
  21. #import "UINavigationController+Theme.h"
  22. #import "VLCDownloadViewController.h"
  23. #import "WhiteRaccoon.h"
  24. #import "NSString+SupportedMedia.h"
  25. #import "VLCStatusLabel.h"
  26. #define kVLCServerTypeUPNP 0
  27. #define kVLCServerTypeFTP 1
  28. @interface VLCLocalServerFolderListViewController () <UITableViewDataSource, UITableViewDelegate, WRRequestDelegate, VLCLocalNetworkListCell, UISearchBarDelegate, UISearchDisplayDelegate>
  29. {
  30. /* UI */
  31. UIBarButtonItem *_backButton;
  32. /* generic data storage */
  33. NSString *_listTitle;
  34. NSArray *_objectList;
  35. NSMutableArray *_mutableObjectList;
  36. NSUInteger _serverType;
  37. /* UPNP specifics */
  38. MediaServer1Device *_UPNPdevice;
  39. NSString *_UPNProotID;
  40. /* FTP specifics */
  41. NSString *_ftpServerAddress;
  42. NSString *_ftpServerUserName;
  43. NSString *_ftpServerPassword;
  44. NSString *_ftpServerPath;
  45. WRRequestListDirectory *_FTPListDirRequest;
  46. NSMutableArray *_searchData;
  47. UISearchBar *_searchBar;
  48. UISearchDisplayController *_searchDisplayController;
  49. }
  50. @end
  51. @implementation VLCLocalServerFolderListViewController
  52. - (void)loadView
  53. {
  54. _tableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UITableViewStylePlain];
  55. _tableView.backgroundColor = [UIColor colorWithWhite:.122 alpha:1.];
  56. _tableView.delegate = self;
  57. _tableView.dataSource = self;
  58. _tableView.rowHeight = [VLCLocalNetworkListCell heightOfCell];
  59. self.view = _tableView;
  60. }
  61. - (id)initWithUPNPDevice:(MediaServer1Device*)device header:(NSString*)header andRootID:(NSString*)rootID
  62. {
  63. self = [super init];
  64. if (self) {
  65. _UPNPdevice = device;
  66. _listTitle = header;
  67. _UPNProotID = rootID;
  68. _serverType = kVLCServerTypeUPNP;
  69. _mutableObjectList = [[NSMutableArray alloc] init];
  70. }
  71. return self;
  72. }
  73. - (id)initWithFTPServer:(NSString *)serverAddress userName:(NSString *)username andPassword:(NSString *)password atPath:(NSString *)path
  74. {
  75. self = [super init];
  76. if (self) {
  77. _ftpServerAddress = serverAddress;
  78. _ftpServerUserName = username;
  79. _ftpServerPassword = password;
  80. _ftpServerPath = path;
  81. _serverType = kVLCServerTypeFTP;
  82. }
  83. return self;
  84. }
  85. - (void)viewDidLoad
  86. {
  87. [super viewDidLoad];
  88. if (_serverType == kVLCServerTypeUPNP) {
  89. NSMutableString *outResult = [[NSMutableString alloc] init];
  90. NSMutableString *outNumberReturned = [[NSMutableString alloc] init];
  91. NSMutableString *outTotalMatches = [[NSMutableString alloc] init];
  92. NSMutableString *outUpdateID = [[NSMutableString alloc] init];
  93. [[_UPNPdevice contentDirectory] BrowseWithObjectID:_UPNProotID BrowseFlag:@"BrowseDirectChildren" Filter:@"*" StartingIndex:@"0" RequestedCount:@"0" SortCriteria:@"+dc:title" OutResult:outResult OutNumberReturned:outNumberReturned OutTotalMatches:outTotalMatches OutUpdateID:outUpdateID];
  94. [_mutableObjectList removeAllObjects];
  95. NSData *didl = [outResult dataUsingEncoding:NSUTF8StringEncoding];
  96. MediaServerBasicObjectParser *parser = [[MediaServerBasicObjectParser alloc] initWithMediaObjectArray:_mutableObjectList itemsOnly:NO];
  97. [parser parseFromData:didl];
  98. } else if (_serverType == kVLCServerTypeFTP) {
  99. if ([_ftpServerPath isEqualToString:@"/"])
  100. _listTitle = _ftpServerAddress;
  101. else
  102. _listTitle = [_ftpServerPath lastPathComponent];
  103. [self _listFTPDirectory];
  104. }
  105. self.tableView.separatorColor = [UIColor colorWithWhite:.122 alpha:1.];
  106. self.view.backgroundColor = [UIColor colorWithWhite:.122 alpha:1.];
  107. self.title = _listTitle;
  108. _searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
  109. _searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:_searchBar contentsController:self];
  110. _searchDisplayController.delegate = self;
  111. _searchDisplayController.searchResultsDataSource = self;
  112. _searchDisplayController.searchResultsDelegate = self;
  113. _searchBar.delegate = self;
  114. self.tableView.tableHeaderView = _searchBar; //this line add the searchBar on the top of tableView.
  115. _searchData = [[NSMutableArray alloc] init];
  116. [_searchData removeAllObjects];
  117. }
  118. - (BOOL)shouldAutorotate
  119. {
  120. UIInterfaceOrientation toInterfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
  121. if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone && toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
  122. return NO;
  123. return YES;
  124. }
  125. #pragma mark - Table view data source
  126. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  127. {
  128. return 1;
  129. }
  130. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  131. {
  132. if (tableView == self.searchDisplayController.searchResultsTableView)
  133. return _searchData.count;
  134. else {
  135. if (_serverType == kVLCServerTypeUPNP)
  136. return _mutableObjectList.count;
  137. return _objectList.count;
  138. }
  139. }
  140. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  141. {
  142. static NSString *CellIdentifier = @"LocalNetworkCellDetail";
  143. VLCLocalNetworkListCell *cell = (VLCLocalNetworkListCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  144. if (cell == nil)
  145. cell = [VLCLocalNetworkListCell cellWithReuseIdentifier:CellIdentifier];
  146. if (_serverType == kVLCServerTypeUPNP) {
  147. MediaServer1BasicObject *item;
  148. if (tableView == self.searchDisplayController.searchResultsTableView)
  149. item = _searchData[indexPath.row];
  150. else
  151. item = _mutableObjectList[indexPath.row];
  152. if (![item isContainer]) {
  153. MediaServer1ItemObject *mediaItem;
  154. NSInteger mediaSize = 0;
  155. if (tableView == self.searchDisplayController.searchResultsTableView)
  156. mediaItem = _searchData[indexPath.row];
  157. else
  158. mediaItem = _mutableObjectList[indexPath.row];
  159. if (![mediaItem size]) {
  160. NSRange end = [mediaItem.duration rangeOfString:@"."];
  161. NSString *timeString =[mediaItem.duration substringWithRange:NSMakeRange(0, end.location)];
  162. NSArray *arrayTime = [timeString componentsSeparatedByString:@":"];
  163. NSInteger hours = [[arrayTime objectAtIndex:0] integerValue];
  164. NSInteger minutes = [[arrayTime objectAtIndex:1] integerValue];
  165. NSInteger seconds = [[arrayTime objectAtIndex:2] integerValue];
  166. mediaSize = [mediaItem.bitrate integerValue] * ((hours * 60 * 60) + (minutes * 60) + seconds);
  167. }
  168. else
  169. mediaSize = [mediaItem.size integerValue];
  170. [cell setSubtitle: [NSString stringWithFormat:@"%0.2f MB (%@)", (float)(mediaSize / 1e6), mediaItem.duration]];
  171. [cell setIsDirectory:NO];
  172. cell.isDownloadable = YES;
  173. if (![mediaItem.albumArt isEqualToString:NULL]) {
  174. NSData* imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:mediaItem.albumArt]];
  175. UIImage* image = [[UIImage alloc] initWithData:imageData];
  176. [cell setIcon:image];
  177. }
  178. else
  179. [cell setIcon:[UIImage imageNamed:@"blank"]];
  180. cell.delegate = self;
  181. } else {
  182. [cell setIsDirectory:YES];
  183. [cell setIcon:[UIImage imageNamed:@"folder"]];
  184. }
  185. [cell setTitle:[item title]];
  186. } else if (_serverType == kVLCServerTypeFTP) {
  187. NSMutableArray *ObjList = [[NSMutableArray alloc] init];
  188. [ObjList removeAllObjects];
  189. if (tableView == self.searchDisplayController.searchResultsTableView)
  190. [ObjList addObjectsFromArray:_searchData];
  191. else
  192. [ObjList addObjectsFromArray:_objectList];
  193. cell.title = [ObjList[indexPath.row] objectForKey:(id)kCFFTPResourceName];
  194. if ([[ObjList[indexPath.row] objectForKey:(id)kCFFTPResourceType] intValue] == 4) {
  195. cell.isDirectory = YES;
  196. cell.icon = [UIImage imageNamed:@"folder"];
  197. } else {
  198. cell.isDirectory = NO;
  199. cell.icon = [UIImage imageNamed:@"blank"];
  200. cell.subtitle = [NSString stringWithFormat:@"%0.2f MB", (float)([[ObjList[indexPath.row] objectForKey:(id)kCFFTPResourceSize] intValue] / 1e6)];
  201. cell.isDownloadable = YES;
  202. cell.delegate = self;
  203. }
  204. }
  205. return cell;
  206. }
  207. #pragma mark - Table view delegate
  208. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
  209. {
  210. cell.backgroundColor = (indexPath.row % 2 == 0)? [UIColor blackColor]: [UIColor colorWithWhite:.122 alpha:1.];
  211. }
  212. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  213. {
  214. if (_serverType == kVLCServerTypeUPNP) {
  215. MediaServer1BasicObject *item;
  216. if (tableView == self.searchDisplayController.searchResultsTableView)
  217. item = _searchData[indexPath.row];
  218. else
  219. item = _mutableObjectList[indexPath.row];
  220. if ([item isContainer]) {
  221. MediaServer1ContainerObject *container;
  222. if (tableView == self.searchDisplayController.searchResultsTableView)
  223. container = _searchData[indexPath.row];
  224. else
  225. container = _mutableObjectList[indexPath.row];
  226. VLCLocalServerFolderListViewController *targetViewController = [[VLCLocalServerFolderListViewController alloc] initWithUPNPDevice:_UPNPdevice header:[container title] andRootID:[container objectID]];
  227. [[self navigationController] pushViewController:targetViewController animated:YES];
  228. } else {
  229. MediaServer1ItemObject *item;
  230. if (tableView == self.searchDisplayController.searchResultsTableView)
  231. item = _searchData[indexPath.row];
  232. else
  233. item = _mutableObjectList[indexPath.row];
  234. MediaServer1ItemRes *resource = nil;
  235. NSEnumerator *e = [[item resources] objectEnumerator];
  236. NSURL *itemURL;
  237. while((resource = (MediaServer1ItemRes*)[e nextObject])){
  238. APLog(@"%@ - %d, %@, %d, %lld, %d, %@ (%@)", [item title], [resource bitrate], [resource duration], [resource nrAudioChannels], [resource size], [resource durationInSeconds], [resource protocolInfo], [item uri]);
  239. itemURL = [NSURL URLWithString:[item uri]];
  240. }
  241. if (itemURL && ([itemURL.scheme isEqualToString:@"http"] || [itemURL.scheme isEqualToString:@"rtsp"] || [itemURL.scheme isEqualToString:@"rtp"] || [itemURL.scheme isEqualToString:@"mms"] || [itemURL.scheme isEqualToString:@"mmsh"])) {
  242. VLCAppDelegate* appDelegate = [UIApplication sharedApplication].delegate;
  243. [appDelegate openMovieFromURL:itemURL];
  244. }
  245. }
  246. } else if (_serverType == kVLCServerTypeFTP) {
  247. NSMutableArray *ObjList = [[NSMutableArray alloc] init];
  248. [ObjList removeAllObjects];
  249. if (tableView == self.searchDisplayController.searchResultsTableView)
  250. [ObjList addObjectsFromArray:_searchData];
  251. else
  252. [ObjList addObjectsFromArray:_objectList];
  253. if ([[ObjList[indexPath.row] objectForKey:(id)kCFFTPResourceType] intValue] == 4) {
  254. NSString *newPath = [NSString stringWithFormat:@"%@/%@", _ftpServerPath, [ObjList[indexPath.row] objectForKey:(id)kCFFTPResourceName]];
  255. VLCLocalServerFolderListViewController *targetViewController = [[VLCLocalServerFolderListViewController alloc] initWithFTPServer:_ftpServerAddress userName:_ftpServerUserName andPassword:_ftpServerPassword atPath:newPath];
  256. [self.navigationController pushViewController:targetViewController animated:YES];
  257. } else {
  258. NSString *objectName = [ObjList[indexPath.row] objectForKey:(id)kCFFTPResourceName];
  259. if (![objectName isSupportedFormat]) {
  260. UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"FILE_NOT_SUPPORTED", @"") message:[NSString stringWithFormat:NSLocalizedString(@"FILE_NOT_SUPPORTED_LONG", @""), objectName] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:nil];
  261. [alert show];
  262. } else
  263. [self _openURLStringAndDismiss:[_FTPListDirRequest.fullURLString stringByAppendingString:objectName]];
  264. }
  265. }
  266. [tableView deselectRowAtIndexPath:indexPath animated:NO];
  267. }
  268. #pragma mark - FTP specifics
  269. - (void)_listFTPDirectory
  270. {
  271. if (_FTPListDirRequest)
  272. return;
  273. _FTPListDirRequest = [[WRRequestListDirectory alloc] init];
  274. _FTPListDirRequest.delegate = self;
  275. _FTPListDirRequest.hostname = _ftpServerAddress;
  276. _FTPListDirRequest.username = _ftpServerUserName;
  277. _FTPListDirRequest.password = _ftpServerPassword;
  278. _FTPListDirRequest.path = _ftpServerPath;
  279. _FTPListDirRequest.passive = YES;
  280. [_FTPListDirRequest start];
  281. }
  282. - (NSString *)_credentials
  283. {
  284. NSString * cred;
  285. if (_ftpServerUserName.length > 0) {
  286. if (_ftpServerPassword.length > 0)
  287. cred = [NSString stringWithFormat:@"%@:%@@", _ftpServerUserName, _ftpServerPassword];
  288. else
  289. cred = [NSString stringWithFormat:@"%@@", _ftpServerPassword];
  290. } else
  291. cred = @"";
  292. return [cred stringByStandardizingPath];
  293. }
  294. - (void)_downloadFTPFile:(NSString *)fileName
  295. {
  296. NSURL *URLToQueue = [NSURL URLWithString:[[@"ftp" stringByAppendingFormat:@"://%@%@/%@/%@", [self _credentials], _ftpServerAddress, _ftpServerPath, fileName] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
  297. [[(VLCAppDelegate*)[UIApplication sharedApplication].delegate downloadViewController] addURLToDownloadList:URLToQueue fileNameOfMedia:nil];
  298. }
  299. - (void)_downloadUPNPFile:(NSURL *)url fileNameOfMedia:(NSString*) fileName;
  300. {
  301. fileName = [[fileName stringByAppendingString:@"."] stringByAppendingString:[[url absoluteString] pathExtension]];
  302. [[(VLCAppDelegate*)[UIApplication sharedApplication].delegate downloadViewController] addURLToDownloadList:url fileNameOfMedia:fileName];
  303. }
  304. - (void)requestCompleted:(WRRequest *)request
  305. {
  306. if (request == _FTPListDirRequest) {
  307. NSMutableArray *filteredList = [[NSMutableArray alloc] init];
  308. NSArray *rawList = [(WRRequestListDirectory*)request filesInfo];
  309. NSUInteger count = rawList.count;
  310. for (NSUInteger x = 0; x < count; x++) {
  311. if (![[rawList[x] objectForKey:(id)kCFFTPResourceName] hasPrefix:@"."])
  312. [filteredList addObject:rawList[x]];
  313. }
  314. _objectList = [NSArray arrayWithArray:filteredList];
  315. [self.tableView reloadData];
  316. } else
  317. APLog(@"unknown request %@ completed", request);
  318. }
  319. - (void)requestFailed:(WRRequest *)request
  320. {
  321. UIAlertView * alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@"ERROR_NUMBER", @""), request.error.errorCode] message:request.error.message delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:nil];
  322. [alert show];
  323. APLog(@"request %@ failed with error %i", request, request.error.errorCode);
  324. }
  325. #pragma mark - VLCLocalNetworkListCell delegation
  326. - (void)triggerDownloadForCell:(VLCLocalNetworkListCell *)cell
  327. {
  328. if (_serverType == kVLCServerTypeUPNP) {
  329. MediaServer1ItemObject *item;
  330. if ([self.searchDisplayController isActive])
  331. item = _searchData[[self.searchDisplayController.searchResultsTableView indexPathForCell:cell].row];
  332. else
  333. item = _mutableObjectList[[self.tableView indexPathForCell:cell].row];
  334. MediaServer1ItemRes *resource = nil;
  335. NSEnumerator *e = [[item resources] objectEnumerator];
  336. NSURL *itemURL;
  337. while((resource = (MediaServer1ItemRes*)[e nextObject])){
  338. itemURL = [NSURL URLWithString:[[item uri] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
  339. }
  340. if (![[item uri] isSupportedFormat]) {
  341. UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"FILE_NOT_SUPPORTED", @"") message:[NSString stringWithFormat:NSLocalizedString(@"FILE_NOT_SUPPORTED_LONG", @""), [item uri]] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:nil];
  342. [alert show];
  343. } else {
  344. [self _downloadUPNPFile:itemURL fileNameOfMedia:[item title]];
  345. [cell.statusLabel showStatusMessage:NSLocalizedString(@"DOWNLOADING", @"")];
  346. }
  347. }else if (_serverType == kVLCServerTypeFTP) {
  348. NSString *objectName;
  349. NSMutableArray *ObjList = [[NSMutableArray alloc] init];
  350. [ObjList removeAllObjects];
  351. if ([self.searchDisplayController isActive]) {
  352. [ObjList addObjectsFromArray:_searchData];
  353. objectName = [ObjList[[self.searchDisplayController.searchResultsTableView indexPathForCell:cell].row] objectForKey:(id)kCFFTPResourceName];
  354. } else {
  355. [ObjList addObjectsFromArray:_objectList];
  356. objectName = [ObjList[[self.tableView indexPathForCell:cell].row] objectForKey:(id)kCFFTPResourceName];
  357. }
  358. if (![objectName isSupportedFormat]) {
  359. UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"FILE_NOT_SUPPORTED", @"") message:[NSString stringWithFormat:NSLocalizedString(@"FILE_NOT_SUPPORTED_LONG", @""), objectName] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:nil];
  360. [alert show];
  361. } else {
  362. [self _downloadFTPFile:objectName];
  363. [cell.statusLabel showStatusMessage:NSLocalizedString(@"DOWNLOADING", @"")];
  364. }
  365. }
  366. }
  367. #pragma mark - communication with playback engine
  368. - (void)_openURLStringAndDismiss:(NSString *)url
  369. {
  370. VLCAppDelegate* appDelegate = [UIApplication sharedApplication].delegate;
  371. [appDelegate openMovieFromURL:[NSURL URLWithString:url]];
  372. }
  373. #pragma mark - Search Display Controller Delegate
  374. - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
  375. {
  376. MediaServer1BasicObject *item;
  377. NSInteger listCount = 0;
  378. [_searchData removeAllObjects];
  379. if (_serverType == kVLCServerTypeUPNP)
  380. listCount = _mutableObjectList.count;
  381. else if (_serverType == kVLCServerTypeFTP)
  382. listCount = _objectList.count;
  383. for (int i = 0; i < listCount; i++) {
  384. NSRange nameRange;
  385. if (_serverType == kVLCServerTypeUPNP) {
  386. item = _mutableObjectList[i];
  387. nameRange = [[item title] rangeOfString:searchString options:NSCaseInsensitiveSearch];
  388. } else if (_serverType == kVLCServerTypeFTP)
  389. nameRange = [[_objectList[i] objectForKey:(id)kCFFTPResourceName] rangeOfString:searchString options:NSCaseInsensitiveSearch];
  390. if (nameRange.location != NSNotFound) {
  391. if (_serverType == kVLCServerTypeUPNP)
  392. [_searchData addObject:_mutableObjectList[i]];
  393. else
  394. [_searchData addObject:_objectList[i]];
  395. }
  396. }
  397. return YES;
  398. }
  399. - (void)searchDisplayController:(UISearchDisplayController *)controller didLoadSearchResultsTableView:(UITableView *)tableView
  400. {
  401. if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
  402. tableView.rowHeight = 80.0f;
  403. else
  404. tableView.rowHeight = 68.0f;
  405. tableView.backgroundColor = [UIColor blackColor];
  406. }
  407. @end