0

我刚刚将restkit升级到0.10.2。我在这段代码中有一个错误:

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/browse/authentication/#", address]];

RKRequest *request = [RKRequest requestWithURL:url delegate:self];
request.forceBasicAuthentication = YES;
request.username = [loginField text];
request.password = [passwordField text];
[request send];

错误:

[RKRequest setForceBasicAuthentication:]: unrecognized selector sent to instance 0x348420
 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RKRequest setForceBasicAuthentication:]: unrecognized selector sent to instance 0x348420'

升级 restkit 后我没有更改任何代码。谢谢!

编辑:标题

4

1 回答 1

0

通过这样做解决了代码完成错误Product->Hold down option button->"Clean Build Folder":)

于 2012-10-03T10:16:07.653 回答