Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve issues with fileAttributesAtPath warning?

Now I use this code:

NSDictionary* attr = [[NSFileManager defaultManager] fileAttributesAtPath:file traverseLink:YES];

and get warning:

'fileAttributesAtPath:traverseLink:' is deprecated

Who knows what to use instead?

Thanks!

like image 969
Matrosov Oleksandr Avatar asked Jan 26 '12 14:01

Matrosov Oleksandr


2 Answers

Use attributesOfItemAtPath:error: instead.

like image 130
ksh Avatar answered Nov 15 '22 09:11

ksh


use attributesOfItemAtPath:error:

NSError* error;
NSDictionary* attr = [[NSFileManager defaultManager] attributesOfItemAtPath:file error:&error];
like image 27
X Slash Avatar answered Nov 15 '22 10:11

X Slash