incompatible integer to pointer conversion unsigned long
Hello
I have a code to create my own function but it gives me a warning:
- Incompatible integer to pointer conversion assigning to 'SMUserKey *' (aka 'unsigned long *') from 'int'
- Incompatible integer to pointer conversion sending 'SMUserKey' (aka 'unsigned long') to parameter of type 'SMUserKey *' (aka 'unsigned long *')
When I run the app, it works fine, but I dont want the warnings.
This is my .h code:
typedef NSUInteger SMUserKey;
NS_ENUM(SMUserKey) {
SMUsername = 1,
SMFirstName = 2,
SMLastName = 3,
SMFullName = 4,
SMEmail = 5,
};
This is my .m code:
-(void)awakeFromNib {
NSString *result = [SMUsergetValueForKey:SMUsername];
NSLog(@"THE RESULT: %@", result);
}
+ (NSString *)getValueForKey:(SMUserKey*)myUserKey {
NSString *myUserKeyValue = nil;
if ((myUserKey = 1)) {
myUserKeyValue = @"Username";
}
return myUserKeyValue;
}
This is the image showing the warnings:
iMac, OS X Yosemite (10.10)