上次FM API SIG_ABRT错误

时间:2011-05-29 18:00:52

标签: objective-c ios4 http-post last.fm

我在Last FM API的FMCallback类中的此方法的else中的一行中收到SIG_ABRT错误。

- (void)fire {
if(_identifier == nil) {
    [_target performSelector:_selector withObject:_userInfo];
} else {
    [_target performSelector:_selector withObject:_identifier withObject:_userInfo];
}
}

控制台输出显示:

2011-05-29 13:52:24.533 QueryTesting[6918:707] +[LastFM loginCallback:data:]: unrecognized selector sent to class 0x19550
2011-05-29 13:52:24.625 QueryTesting[6918:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[LastFM loginCallback:data:]: unrecognized selector sent to class 0x19550'

这是什么意思?我没有根据我的要求发送足够的信息吗?

编辑: 以下是创建FMEngine的代码(api key x'd out):

+ (void)logUserInWithUsername:(NSString *) username andPassword:(NSString *) password {

FMEngine *fmEngine;
fmEngine = [[FMEngine alloc] init];
NSString *authToken = [fmEngine generateAuthTokenFromUsername:username password:password];
NSDictionary *urlDict = [NSDictionary dictionaryWithObjectsAndKeys:username, @"username", authToken, authToken, _LASTFM_API_KEY_, @"XXXXXXXXXXXXXXXX", nil, nil];
[fmEngine performMethod:@"auth.getMobileSession" withTarget:self withParameters:urlDict andAction:@selector(loginCallback:data:) useSignature:YES httpMethod:POST_TYPE];    
}

- (void)loginCallback:(NSString *)identifier data:(id)data {
// data is either NSData or NSError
NSLog(@"Got Data (%@): %@", identifier, data);
}

1 个答案:

答案 0 :(得分:1)

您已定义了-[LastFM loginCallback:data:]方法,而不是+[LastFM loginCallback:data:]