iOS Seven Qiniu storage apps

Source: Internet
Author: User

Objective

Seven Qiniu storage, is a data management platform designed for developers of the mobile era, providing online hosting, transmission acceleration, and rich media cloud processing services such as images, audio and video for internet websites and mobile apps.

Seven Qiniu official website http://www.qiniu.com/, enter the developer platform, browse all the development guide, but there is no specific clear steps. Today, I tried to use the seven cloud storage file through the network. Now, record the operation steps as follows.

Preparatory work

1. Register seven Qiniu accounts.

2. Create a space.

3. Get access Key.

4. Get Secret Key.

5. Get the Official SDK (HTTPS://GITHUB.COM/QINIU/OBJC-SDK).

Import Project

1. Open Xcode to create project.

2. Import the library from the obtained official SDK, as

3. Get token

This step, the online people are very simple, in this step for a long time. Now talk about the way you use it:

1) Get the server code, compile the project, and prepare tokens for generation.

Server code Address: Https://github.com/CharsDavy/QiNiuGenertorToken

2) Import the above server code using eclipse

In the Test.java file, modify your own spatial name, Access key, and secret key. You can get tokens by running the program.

4. Uploading files using code

#import<QiniuSDK.h>... NSString Token=@"get from the server-side SDK"; Qnuploadmanager*upmanager =[[Qnuploadmanager alloc] init]; NSData*data = [@"Hello, world!."datausingencoding:nsutf8stringencoding]; [Upmanager putdata:data key:@"Hello"Token:token Complete:^ (Qnresponseinfo *info, NSString *key, Nsdictionary *resp) {NSLog (@"%@", info); NSLog (@"%@", RESP); } Option:nil]; ..
Debugging

After the project is imported, the following possible errors may occur.

1. If reported Undefined symbols for architecture x86_64: "_crc32", referenced from: , the project needs to be imported libz.dylib . (Build Phases ---Link Binary With Libraries)

2. If "_res_9_ninit", referenced from: _setup_dns_server in QNResolver.o the report, etc.,

1) The project needs to be imported libresolv.dylib or libresolv.9.dylib . ( Build Phases --- Link Binary With Libraries );
2) or ( Build Settings --- Linking --- Other Linker Flags ) add -lresolv options

3. If a Thread 1: EXC_BAD_ACCESS(code=1,address=0x180f4beb8) similar error is reported, QN set the beginning arc ( Build Phases --- Compile Sources )

4. It may be necessary to revise some of the contents, such as #import <AFNetworking/AFNetworking.h>#import "AFNetworking.h"

Summary

The above is my project in the use of seven Qiniu file cloud storage process, this article is only used to upload files, more other operating functions, please refer to the official documents.

Finally, attach a software that uses seven Cow cloud storage, source address: https://github.com/CharsDavy/MyNotes

iOS Seven Qiniu storage apps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.