0

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!

RayJ
  • 87
  • 1
  • 7

1 Answers1

0

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
  • 74,769
  • 26
  • 128
  • 150