I have a path to file contained in an NSString. Is there a method to get its file size?
If you want only file size with bytes just use,
unsigned long long fileSize = [[[NSFileManager defaultManager] attributesOfItemAtPath:yourAssetPath error:nil] fileSize];
NSByteCountFormatter string conversion of filesize (from Bytes) with precise KB, MB, GB ... Its returns like 120 MB
or 120 KB
NSError *error = nil;
NSDictionary *attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:yourAssetPath error:&error];
if (attrs) {
NSString *string = [NSByteCountFormatter stringFromByteCount:fileSize countStyle:NSByteCountFormatterCountStyleBinary];
NSLog(@"%@", string);
}