I am wondering if it is possible to pass an integer value I am creating in my NSUserDefaults into a UInt32 object?
So far I am creating the NSUserDefaults as below.
NSString * yourKey = @"RequestNumber";
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:[defaults integerForKey:yourKey] + 1 forKey:yourKey];
and then I am trying to pass the user defaults value into my object as below.. However I am fairly positive I am completely wrong... which is why im here :) any help would be appreciated.
UInt32 *requestNumber = [[NSUserDefaults standardUserDefaults] integerForKey:yourKey];
A UInt32 is not an object but a scalar type.
ReplyDeleteUInt32 requestNumber = [[NSUserDefaults standardUserDefaults] integerForKey:yourKey];