I am slightly confused as I am using this piece of code;
NSArray *dirContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/Volumes/" error:nil];
int arraysize = sizeof dirContents;
to get an array of the contents of the "Volumes" direcoty, however when I output the array size it says that the array has 8 entries when there are only 4 files in that directory? This wouldn't be a problem but since I am using a for loop as soon as I get to;
NSString *volume1 = [dirContents objectAtIndex:4];
(4 being the value in the for loop) the application crashes and refuses to launch?
Thanks for any help
sizeof dirContentstells you that the pointer "dirContents" is eight bytes long. Has absolutely nothing to do with the array itself.