objective-c - 手机端上传图片返回data parameter is nil
PHPz
PHPz 2017-05-02 09:25:37
0
1
484

先从服务器获取七牛token,再从相册选取图片,然后转化为data格式传到七牛。上传过程序崩溃 出现 data parameter is nil 的错误

Terminating app due to uncaught exception
'NSInvalidArgumentException',
reason: 'data parameter is nil'

崩溃的地点是
七牛文件中的#import "QNUrlSafeBase64.h"

NSData *data = [QNUrlSafeBase64 decodeString:array[2]]; NSError *tmp = nil; NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&tmp]; if (tmp != nil || dict[@"scope"] == nil || dict[@"deadline"] == nil) { return nil; }
PHPz
PHPz

学习是最好的投资!

reply all (1)
阿神

Be sure to determine whether the data is empty. When the data is empty, an exception will be thrown.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!