I'm getting the error "Implicit conversion of 'int' to 'NSDictionary *' is disallowed with ARC" when I use NSFileManager - attributesOfItemAtPath.
I guess some error occurred while I'm try to knowing size of file. Is there any method to solving this problem?
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSString *fName = @"testfile";
NSFileManager *fm;
NSDictionary *attr;
fm = [NSFileManager defaultManager];
if([fm fileExistsAtPath:fName]==NO){
NSLog(@"File doesnt exist!");
return 1;
}
if([fm copyItemAtPath:fName toPath:@"newfile" error:nil]==0){
NSLog(@"Files copy Failed!");
return 2;
}
if([fm contentsEqualAtPath:@"newfile" andPath:@"newfile2"] == NO){
NSLog(@"File arent equal");
return 3;
}
if([fm moveItemAtPath:@"newfile" toPath:@"newfile2" error:nil] == NO){
NSLog(@"file rename failed");
return 4;
}
//Here
if((attr = [fm attributesOfItemAtPath:@"newfile2" error:nil] == NO)){
return 5;
}
}
return 0;
}
Thank you