What is the difference between using the following:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *dir = [paths objectAtIndex:0];
NSString *dir2 = paths[0]; // this throws incompatible type exception
pathsis a pointer to instance ofNSArraythat you are sending theobjectAtIndex:message. The receiver returns anid.paths[0]is the memory address of the beginning of an array in pure C.[]andNSArrayare not the same thing.