fix PlugIns icons not showing when installed in /Applications

This commit is contained in:
Jesús A. Álvarez 2016-05-29 00:10:48 +02:00
parent f51dc1e1c9
commit a63ba48b8a
1 changed files with 1 additions and 2 deletions

View File

@ -169,8 +169,7 @@ typedef enum : NSInteger {
cell = [tableView dequeueReusableCellWithIdentifier:@"machine" forIndexPath:indexPath];
cell.textLabel.text = [bundle objectForInfoDictionaryKey:@"CFBundleDisplayName"];
cell.detailTextLabel.text = [bundle objectForInfoDictionaryKey:@"CFBundleGetInfoString"];
NSAssert([bundle.bundlePath hasPrefix:[NSBundle mainBundle].bundlePath], @"emulator bundle is in main bundle");
NSString *iconName = [[bundle.bundlePath stringByAppendingPathComponent:@"Icon"] substringFromIndex:[NSBundle mainBundle].bundlePath.length+1];
NSString *iconName = [NSString stringWithFormat:@"PlugIns/%@.mnvm/Icon", bundleName];
cell.imageView.image = [UIImage imageNamed:iconName];
BOOL selected = [[defaults stringForKey:@"machine"] isEqualToString:bundleName];
cell.accessoryType = selected ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;