uiimagepickercontroller - 获取从照片库中选择的图像的名称 [英] uiimagepickercontroller - get the name of the image selected from photo library

查看:180
本文介绍了uiimagepickercontroller - 获取从照片库中选择的图像的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将图像从我的iPhone / iPod touch上传到我的在线存储库,我已成功从相册中选择图像,但我遇到一个问题,我想知道图像的名称,如image1.jpg或类似的东西。我怎么知道所选图像的名称。

I am trying to upload the image from my iPhone/iPod touch to my online repository, I have successfully picked the image from Photo Album but i am facing one problem i want to know the name of the image such as image1.jpg or some thing like that. How i would know the name of the picked image.

推荐答案

我想知道确切的图像名称不会成为问题,而是为获取的图像获取唯一名称将解决您的目的这样您就可以在服务器上传图像并通过其名称跟踪它。可能这可以帮到你

I guess knowing the exact image name would not be an issue rather getting a unique name for the picked image would solve your purpose so that you can upload the image on server and track it via its name. May be this can help you

NSMutableString *imageName = [[[NSMutableString alloc] initWithCapacity:0] autorelease];

CFUUIDRef theUUID = CFUUIDCreate(kCFAllocatorDefault);
if (theUUID) {
    [imageName appendString:NSMakeCollectable(CFUUIDCreateString(kCFAllocatorDefault, theUUID))];
            CFRelease(theUUID);
}
[imageName appendString:@".png"];

从Picker中选择图像后,您可以生成唯一名称并将其指定给Picked图像。
干杯

After you pick the image from Picker you can generate a unique name and assign it to the Picked image. Cheers

这篇关于uiimagepickercontroller - 获取从照片库中选择的图像的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆