iOS 上传云端代码

来源:互联网 发布:oracle数据库建表语句 编辑:程序博客网 时间:2024/05/18 04:03

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

       NSURL *localURL = ...; // url of document to transfer to iCloud 

       NSString *name = [localURL lastPathComponent]; 

       NSURL *iCloudURL = [iCloudDocumentsURL URLByAppendingPathComponent:name]; 

       NSError *error = nil;

       [[[NSFileManager alloc] init] setUbiquitous:YES

                                         itemAtURL:localURL 

                                    destinationURL:iCloudURL

                                             error:&error]; // move the document

});

1 0
原创粉丝点击