views:

31

answers:

1

I'm curious if there's a way to search for files in the iPhone's directory ( the location is irrelevant).

I am wanting to load in addresses from text files. The thing is additional files may be added and I want to dynamically be able to find the files and load in the data without hardcoding the file names to load in.

Thanks a bunch!

A: 

You want:

NSError *error;
[[NSFileManager defaultManager] contentsOfDirectoryAtPath:myPath error:&error]

It returns an array of NSString objects for each file in the given directory.

Kendall Helmstetter Gelner
Perfect! Thank you.