开发者

cocos2d and restkit crash on request

trying to get used to restkit at the moment and im having an issue getting it to work within a cocos2d template project. All my restkit code works fine if i create a standard viewcontroller project without any cocos2d but when i try add it to my cocos2d project it crashed in the same place everytime

- (NSString*)cacheKey {
if (_method == RKRequestMethodDELETE) {
    return nil;
}
NSString* compositCacheKey = [NSString stringWithFormat:@"%@-%d-%@", self.URL, _method, [_URLRequest HTTPBody]];
return [compositCacheKey MD5];

it crashes on the return call above within RKRequest.m.

anyone had any issues working with both restkit and cocos2d together? if开发者_运维百科 its even possible and what i need to look out for to make it work? any help is appreciated


Your code is probably unable to find the MD5 method because the NSString+MD5.m file was not linked.

If you followed the setup instructions for RestKit correctly, you should have added "-ObjC -all_load" to the "Other Linker Flags" setting in your project Build Settings.

If you are missing this setting, add it.

Now click on the target you are trying to build, and go to its Build Settings. Search again for the "Other Linker Flags" setting, and give it a value of $(inherited).

Now do a clean recompile and your requests should work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜