自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

iOS開發(fā)之file列表查看

移動開發(fā) iOS
本文為大家介紹了iOS開發(fā)中的file列表查看,新手所寫的程序分享給大家,希望對51CTO的各位網(wǎng)友有所幫助,如果有什么意見歡迎交流。

哈哈,我是新手,下面為大家介紹一下在iOS開發(fā)中的如何實現(xiàn)file列表查看。

查看根目錄下的文件列表

  1. NSArray *leveList= 
  2.  [[[NSFileManager alloc]init] contentsOfDirectoryAtPath: [NSHomeDirectory() stringByAppendingPathComponent:@""]                                                                          error:nil]; 
  3.   for (NSString *str in leveList) { 
  4.      NSLog(@"levelList:%@",str); 
  5.  } 
  6.  NSLog(@"count:%d",[leveList count] ); 

文件列表結(jié)果如下:

  1. 2013-06-14 16:18:14.513 helloword[853:c07] levelList:Documents 
  2. 2013-06-14 16:18:14.533 helloword[853:c07] levelList:helloword.app 
  3. 2013-06-14 16:18:14.534 helloword[853:c07] levelList:Library 
  4. 2013-06-14 16:18:14.535 helloword[853:c07] levelList:tmp 
  5. 2013-06-14 16:18:14.537 helloword[853:c07] count:4 

查看Library文件列表

  1.         NSArray *leveList= 
  2.       [[[NSFileManager alloc]init] contentsOfDirectoryAtPath: [NSHomeDirectory() stringByAppendingPathComponent:@"Library"]                                                                          error:nil]; 
  3. for (NSString *str in leveList) { 
  4.           NSLog(@"Library:%@",str); 
  5.       } 
  6.       NSLog(@"count:%d",[leveList count] ); 

結(jié)果如下:

  1. 2013-06-14 16:26:49.475 helloword[1040:c07] Library:Caches 
  2. 2013-06-14 16:26:49.478 helloword[1040:c07] Library:Preferences 
  3. 2013-06-14 16:26:49.480 helloword[1040:c07] count:2 

 

責任編輯:閆佳明 來源: apkbus
相關推薦

2014-07-21 14:49:35

iOSUILabel

2014-07-23 13:17:53

iOSUITextField

2017-02-15 09:25:36

iOS開發(fā)MQTT

2011-08-11 16:50:04

iOSTwitter

2011-08-02 11:07:42

iOS開發(fā) UIWebView

2013-04-12 15:53:39

2014-08-08 10:12:44

IRC

2013-07-25 15:15:26

iOS開發(fā)學習iOS全局變量

2013-07-25 15:19:23

iOS開發(fā)學習Xcode打包framiOS開發(fā)

2013-04-11 16:08:50

iOS開發(fā)技巧積累

2011-08-02 11:30:41

iOS開發(fā) 郵件發(fā)送

2013-07-23 07:34:54

iOS開發(fā)學習適配iphone5

2012-01-18 13:46:37

ARCiOS

2011-08-02 09:22:41

iOS iPhone

2014-04-08 17:35:24

iOS 7彈簧式列表

2013-12-17 11:04:10

iOS開發(fā)傳感器

2013-07-29 05:01:31

iOS開發(fā)iOS開發(fā)學習按鈕拖動和點擊

2017-12-25 14:59:47

APP架構iOS協(xié)議

2013-07-24 16:47:23

iOS開發(fā)學習iOS協(xié)議代理傳值

2013-12-17 15:32:20

iOS開發(fā)NewsstandKi
點贊
收藏

51CTO技術棧公眾號