Is there anyway I can look at the size of a file the application creates in bytes then store that number to use later? OR is there any way I can tell if an object in an NSArray is empty, I've tried everything, but it just doesn't work!
+3
A:
Use NSFileManager class' method
- (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error
The size key in the returned dictionary is defined as
NSString * const NSFileSize;
So for an example
NSError *error = nil;
NSDictionary *attributes = [[NSFileManager defaultManager]
attributesOfItemAtPath:@"/path/to/file" error:&error];
if (!error) {
NSNumber *size = [attributes objectForKey:NSFileSize];
}
nduplessis
2009-11-08 00:34:12
A:
is there any way I can tell if an object in an NSArray is empty
Ask the object.
Peter Hosey
2009-11-08 03:02:25