[英]Retrieving URL of a file parse.com
I'm trying to get back the url of a file I just saved. 我正在尝试取回刚刚保存的文件的URL。 However, the
getUrl()
method found in their documentation doesn't seem to work. 但是,在他们的文档中找到的
getUrl()
方法似乎不起作用。 I get the error: 我收到错误:
Property 'getUrl' not found on object of type 'PFFile *' 在'PFFile *'类型的对象上找不到属性'getUrl'
My code: 我的代码:
int count = 0;
PFObject *obj = [PFObject objectWithClassName:@"File"];
for (NSString* currentString in directoryContents){
NSString *temp2 = [temp stringByAppendingPathComponent:currentString];
PFFile *file = [PFFile fileWithName:currentString contentsAtPath:temp2];
[file saveInBackground];
count += 1;
NSString *filen = [NSString stringWithFormat:@"file%i",count];
NSLog(@"%@",filen);
[obj setObject:file forKey:filen];
NSString* url = file.getUrl();
}
[obj saveInBackground];
您希望使用文件中的 file.url
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.