Xcode: CKAsset in CloudKit
<p>in my Code below, </p>

<pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *localPath = [[paths objectAtIndex: 0] stringByAppendingPathComponent: @"temporary.png"];
    NSLog(@"local path=%@", localPath);
    [UIImagePNGRepresentation(self.scriptPicture.image) writeToFile:localPath atomically:YES];
    //[opData.scripts writeToFile:localPath atomically:YES];
    if ([[NSFileManager defaultManager] fileExistsAtPath:localPath]) {
        NSLog(@"file is exist");
        NSURL *fileurl=[NSURL URLWithString:localPath];
        CKAsset *myfile=[[CKAsset alloc] initWithFileURL:fileurl];
        //postRecrod[@"scriptPicture"]=myfile;
        [postRecrod setObject:myfile forKey:@"scriptPicture"];
}
</code></pre>

<p>error will occur in the line of "<code>CKAsset *myfile=[[CKAsset alloc] initWithFileURL:fileurl];</code>"
error message is below: </p>

<blockquote>
  <p>Terminating app due to uncaught exception
  'NSInvalidArgumentException', reason: 'Non-file URL'</p>
</blockquote>

<p>I don't know how to solve this and search web all night long, but no help.
Please help me ! I am a code beginner !</p>