Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
487 views
in Technique[技术] by (71.8m points)

iOS 上传资源出错 Error Domain=qiniu.com Code=-5 "(null)"

iOS调用这个方法 - (void)putData:(NSData *)data

        key:(NSString *)key
      token:(NSString *)token
   complete:(QNUpCompletionHandler)completionHandler
     option:(QNUploadOption *)option

上传资源出错
提示 Error Domain=qiniu.com Code=-5 "(null)" UserInfo={error=get zone failed}


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

UserInfo={error=get zone failed}

根据你所创建的资源空间地址,创建一个 QNConfiguration 对象,设置好其中的 zone,例如:

QNConfiguration *config = [QNConfiguration build:^(QNConfigurationBuilder *builder) {
    builder.zone = [QNZone zone0];
}];

再初始化一个上传管理实例,并调用上传接口:

QNUploadManager *upManager = [[QNUploadManager alloc] initWithConfiguration:config];

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...