2010-09-28 6 views
0
NSDictionary *attributes = nil ; 
*attributes = [filemanager attributesOfItemAtPath:path error:nil] ; 

échoue avec "... erreur: types incompatibles dans l'affectation"Briser une ligne de code Objective-C en deux

encore

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

œuvres.

Ma question est comment casser la ligne de code qui fonctionne dans deux lignes de code qui fonctionne.

Répondre

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

Supprimez ce '*' du début de la ligne. Vous n'en avez pas besoin. Correct sera:

 
attributes = [filemanager attributesOfItemAtPath:path error:nil] ; // no '*' before attributes 
+0

Merci :-) J'ai changé le code pour –

+0

* attributesPointer = [filemanager attributesOfItemAtPath: erreur de chemin: nil]; attributesPointer = [gestionnaire de fichiers attributesOfItemAtPath: erreur de chemin: nil]; –

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