[size=x-large][color=red]本站最新网址:[url]http://www.helmsmansoft.com [/url] 欢迎关注[/color][/size]
- (void)viewDidLoad
{
NSFileManager *fileManager = [[NSFileManager defaultManager] init];
everyTitle = [[NSMutableArray alloc] init];
NSArray *filePaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *filePath = [filePaths objectAtIndex:0];
// NSLog(@"%@",filePath);
NSDirectoryEnumerator *direnum = [fileManager enumeratorAtPath:filePath];
// NSMutableArray *array = [[NSMutableArray alloc] init];
NSString *fileName;
while ((fileName = [direnum nextObject])) {
if([[fileName pathExtension] isEqualToString:@"pdf"]){
NSArray *strings = [fileName componentsSeparatedByString:@"."];
NSString *fileTitle = [strings objectAtIndex:[strings count]-2];
[everyTitle addObject:fileTitle];
}
}
uiController = [[UIViewController alloc] init];
[uiController setTitle:@"目录"];
navController = [[UINavigationController alloc] initWithRootViewController:uiController];
navController.view.frame = CGRectMake(0, 0, 320, 460);
[self.view addSubview:navController.view];
self.uiController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:self action:@selector(tableUpdata)];
//
self.uiController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"刷新列表" style:UIBarButtonItemStyleBordered target:self action:@selector(tableUpdata)];
tableView *tableViews = [[tableView alloc] initWithStyle:UITableViewStylePlain];
tableViews.view.frame = CGRectMake(0, 45, 320, 460);
[tableViews theValue:everyTitle];
[self.view addSubview:tableViews.view];
// [tableViews release];
}