tags:

views:

42

answers:

2
NSDictionary *attributes = nil ;
*attributes = [filemanager attributesOfItemAtPath:path error:nil] ;

fails with " ... error: incompatible types in assignment"

yet

NSDictionary *attributes = [filemanager attributesOfItemAtPath:path error:nil] ;

works.

My question is how to break the one line of code that works into two lines of code that works.

+3  A: 
*attributes = [filemanager attributesOfItemAtPath:path error:nil] ;

Delete that '*' from the start of the line. You don't need it. Correct will be:

attributes = [filemanager attributesOfItemAtPath:path error:nil] ; // no '*' before attributes
taskinoor
Thanks :-) I changed the code to
kjtl
*attributesPointer = [filemanager attributesOfItemAtPath:path error:nil] ;attributesPointer = [filemanager attributesOfItemAtPath:path error:nil] ;
kjtl
A: 
NSDictionary *attributes;
attributes = [filemanager attributesOfItemAtPath:path error:nil];
synced