Question

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];

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top