Created
July 23, 2013 05:47
-
-
Save jontelang/6060125 to your computer and use it in GitHub Desktop.
ad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "_own_/Preferences5/Preferences.h" | |
@interface PathCell : PSTableCell <PreferencesTableCustomView,UIGestureRecognizerDelegate> | |
{ | |
NSArray * directoryContents; | |
} | |
@end | |
@implementation PathCell | |
- (id)initWithSpecifier:(PSSpecifier *)specifier | |
{ | |
self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell" specifier:specifier]; | |
if (self) | |
{ | |
self.backgroundColor = [UIColor redColor]; | |
NSError * error; | |
directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"Library/XPasscode/" error:&error]; | |
NSLog(@"%@",directoryContents); | |
for (int i = 0; i < [directoryContents count]; i++) | |
{ | |
UILabel *l = [[UILabel alloc] initWithFrame:CGRectMake(0,i*50,320,50)]; | |
l.text = [directoryContents objectAtIndex:i]; | |
l.textAlignment = NSTextAlignmentCenter; | |
UITapGestureRecognizer* tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]; | |
[l addGestureRecognizer:tap]; | |
[tap release]; | |
[self addSubview:l]; | |
} | |
} | |
return self; | |
} | |
- (float)preferredHeightForWidth:(float)arg1 | |
{ | |
// Return a custom cell height. | |
return [directoryContents count] * 50; | |
} | |
-(void)handleTap:(UITapGestureRecognizer *)sender | |
{ | |
NSLog(@"%@",sender); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment