我正在使用FHSTwitterEngine将gif发布到twitpic.当我在iphone上有wifi或3G连接时,一切正常.但是我也希望在没有连接或上传失败时实现一些错误处理.因此,为了测试我将iphone置于飞行模式并尝试使用以下方法上传到twitpic:
id returned = [[FHSTwitterEngine sharedEngine] uploadImageToTwitPic:gif withMessage:@"message" twitPicAPIKey:@"key"];
但是当我这样做时,我立即得到以下错误:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'
然后xcode指向FHSTwitterEngine框架中的这行代码:
id parsedJSONResponse = removeNull([NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableContainers error:nil]);
关于如何解决这个问题的任何想法?