I read the doc's tonight on NSDocumentDirectory and they had this example bellow. I am confused as to why it is creating an NSArray? the instance variable is 'paths' and looking at other material when you define paths you use NSStrings.
The next line does create an NSString pointer which points to the first index of the paths array, why an array? Is it not a normal file directory? Must everything be stored in an array before it can be stored in the NSDocumentDirectory?
The next line does create an NSString pointer which points to the first index of the paths array, why an array? Is it not a normal file directory? Must everything be stored in an array before it can be stored in the NSDocumentDirectory?
Code:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];