Fix table crash, Use modal EmulatorView

The current layout does not yet support the sliding view. The requires
and update and / or replacement of the backend library.
This commit is contained in:
TwistedUmbrella 2015-08-23 14:04:52 -04:00
parent 458492f611
commit d106f541e6
3 changed files with 14 additions and 14 deletions

View File

@ -36,7 +36,7 @@
<connections>
<outlet property="diskImage" destination="6Qh-mW-Z9j" id="kv2-En-yNt"/>
<outlet property="nameLabel" destination="Epl-iu-f5s" id="Tyn-LD-ioh"/>
<segue destination="WRM-pR-XCP" kind="push" identifier="emulatorView" id="xKH-h0-TDD"/>
<segue destination="WRM-pR-XCP" kind="modal" identifier="emulatorView" id="xKH-h0-TDD"/>
</connections>
</tableViewCell>
</prototypes>

View File

@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
@interface PathsViewController : UITableViewController
@interface PathsViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UIBarButtonItem *sidebarButton;
@property (nonatomic, strong) NSMutableArray* diskImages;

View File

@ -7,7 +7,7 @@
//
#import "PathsViewController.h"
#import "SWRevealViewController.h"
//#import "SWRevealViewController.h"
#import "EmulatorViewController.h"
#import "DiskViewCell.h"
@ -26,17 +26,22 @@
return self;
}
- (NSURL *)documents
{
return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = @"Paths";
// Set the side bar button action. When it's tapped, it'll show up the sidebar.
_sidebarButton.target = self.revealViewController;
_sidebarButton.action = @selector(revealToggle:);
// _sidebarButton.target = self.revealViewController;
// _sidebarButton.action = @selector(revealToggle:);
// Set the gesture
[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
// [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
@ -44,14 +49,9 @@
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
self.diskImages = [[NSMutableArray alloc] init];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documents = [paths objectAtIndex:0];
NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documents error:NULL];
NSArray *filters = @[[NSPredicate predicateWithFormat:@"self ENDSWITH '.chd'"],
[NSPredicate predicateWithFormat:@"self ENDSWITH '.gdi'"],
[NSPredicate predicateWithFormat:@"self ENDSWITH '.cdi'"]];
NSPredicate *compoundPredicate = [NSCompoundPredicate andPredicateWithSubpredicates:filters];
self.diskImages = [NSMutableArray arrayWithArray:[files filteredArrayUsingPredicate:compoundPredicate]];
NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:[self documents].path error:NULL];
NSPredicate *diskPredicate = [NSPredicate predicateWithFormat:@"self ENDSWITH '.chd' || self ENDSWITH '.gdi' || self ENDSWITH '.cdi' || self ENDSWITH '.CHD' || self ENDSWITH '.GDI' || self ENDSWITH '.CDI'"];
self.diskImages = [NSMutableArray arrayWithArray:[files filteredArrayUsingPredicate:diskPredicate]];
}
- (void)didReceiveMemoryWarning