views:

106

answers:

1

Hello,

XCode is giving me a warning that I can't figure out why.

@interface SFHFKeychainUtils : NSObject {

}

+ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error;
@end

In another class I call storeUsername:andPassword:forServiceName:updateExisting:error:, see:

- (void)armazenarLogin:(NSString *)login withPassword:(NSString *)password {
    if (login != nil && password != nil) {
        NSError *error = nil;
        [SFHFKeychainUtils storeUsername:login andPassword:password forServiceName:kKeychainServiceName updateExisting:YES error:&error]; // warning here
    }
}

This is the warning:

Passing argument 3 of 'storeUsername:andPassword:forServiceName:updateExisting:error:' discards qualifiers from pointer target

But I'm passing a pointer to NSError. How do I solve this warning?

A: 

Argument 3 is serviceName, isn't it? Check its declaraion. I bet it's const.

Marvin
Thank you. You're right kKeychainServiceName was declared as const.
Felipe Cypriano

related questions