Traverse folders and files using XCode

Joined
Jun 3, 2010
Messages
1
Reaction score
0
Points
1
Hi

I am a newbie in Mac and XCode development

I have an urgent requirement where i need to traverse the files and folders in the specified path given

Ex:

I have a folder "Temp" under /Users/

which should look similar to this /Users/Temp/

Under the Temp folder i have "Additional" another folder

which should look similar to this /Users/Temp/Additional/

Under the Additional folder i have 5 files (assume)
which might me something similar to this

/Users/Temp/Additional/Temp1.txt
/Users/Temp/Additional/Temp2.txt
/Users/Temp/Additional/Temp3.txt
/Users/Temp/Additional/Temp4.txt
/Users/Temp/Additional/Temp5.txt

If the input folder is set as /Users/Temp/

I should get the list of folders like Additional and the files under it

Any help would be great

Thanks
Sri
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
You want to look at NSFileManager and I think the enumeratorAtPath: method.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top