Assignment makes the pointer out of the whole without casting

I do not understand what the problem is! after I compile it, always show me: "assignment makes a pointer from a whole without an actor" I do not know what the problem is! Please let me, thanks.

SAVE

NSUserDefaults *percentChecker = [NSUserDefaults standardUserDefaults]; [percentChecker setInteger:0 forKey:percentCheckerSaveKey]; 

LOAD

 NSUserDefaults *percentChecker = [NSUserDefaults standardUserDefaults]; NSString *percentString; //Alert! percentString = [percentChecker integerForKey:percentCheckerSaveKey]; 
+1
source share
1 answer

This is exactly what he tells you. percentString is a pointer, but integerForKey: returns an integer. Assigning this integer to a pointer makes "a pointer from a whole without cast." Why are you storing an integer and trying to load it later as a string?

+2
source

Source: https://habr.com/ru/post/1485377/


All Articles