问题标签 [alasset]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
7051 浏览

ios - 使用类型表达式初始化 'void(^)(struct ALAssetsGroup *, BOOL *)' 的不兼容块指针类型

我在 SO 上看到几个人已经成功地使用了这个代码。但是我得到了不兼容的块指针错误:

初始化不兼容的块指针类型

带有类型的表达式

有什么提示吗?(用完整的代码编辑)

在此处输入图像描述

0 投票
1 回答
1350 浏览

iphone - ELCImagePickerController 不允许访问用户位置

我在我的应用程序中使用了 ELCImagePickerController。但是当我们第一次启动我们的应用程序并在图片库上时,它会要求访问用户位置,如果我们不允许访问用户位置,那么它会在 UIAlertView 中给出错误并且它不会显示图片库。

但在那之后,如果我们去设置应用程序 -> 位置服务 -> [打开开关以访问我们的应用程序的位置] 然后启动应用程序 -> 进入图库页面 -> 我们可以在我们的应用程序中显示图片库。

所以我的问题是,我们如何使用 ELCImagePickerController 显示图像库,并为我们的应用程序关闭位置服务,或者用户不允许访问我们的应用程序的位置。ELCImagePickerController 可在此链接下载

然后找到 ELCAlbumPickerController.m 文件然后转到 View Did Load 然后当用户位置访问关闭时这会导致错误警报,

0 投票
1 回答
312 浏览

objective-c - 触发核心位置警报

我正在使用 AssetsLibrary 访问 IOS 上的照片卷中的图像。每当应用程序尝试使用 AssetsLibrary 时,就会弹出 CoreLocation 警报,要求用户授权应用程序使用位置服务。我了解这是强制性的,因为 ALAsset 包含位置信息。我的问题是,当用户单击“否”时,我无法弄清楚如何继续。如果用户未授予对位置服务的访问权限,如何确定是否已授予授权,以及是否有办法再次触发授权请求。

请帮忙,

阿诺

0 投票
4 回答
11369 浏览

iphone - 如何使用 URL 检查 ALAsset 是否仍然存在

我有一个包含 ALAsset url 的数组(不是完整的 ALAsset 对象)所以每次我启动我的应用程序时,我都想检查我的数组,看看它是否仍然是最新的......

所以我尝试了

但是assetData总是为零

谢谢帮助

0 投票
5 回答
12199 浏览

iphone - 等待assetForURL块完成

我想等待这段代码执行后再继续,但是由于这些块是异步调用的,我不知道该怎么做???

0 投票
0 回答
849 浏览

iphone - ALAssetPropertyLocation 始终无效

我正在尝试从用户从 iPhone 库中选择的照片和视频中获取位置信息。我正在使用一个自定义图像选择器,它使用 ALAssetsLibrary 来读取照片和视频。

我正在尝试使用以下方式获取位置信息ALAssetPropertyLocation

location总是出现在日志中

我试过查看myAsset.defaultRepresentation.metadata房产和 GPS 位置但仅用于照片。对于视频myAsset.defaultRepresentation.metadatanil.

任何帮助将不胜感激!

更新

看来这里的这个人也有类似的问题。但它只发生在他的 3GS 上,而在 iPhone 4 上没有问题。我目前正在 iPhone 4 上进行测试,但仍然得到无效的位置信息。

0 投票
2 回答
3301 浏览

iphone - iphone:NSDATA dataWithContentsOfURL 返回 null

我在通过获取 NSData[NSData dataWithContentsOfURL: url]并给我一个空对象时遇到问题,其中 url 是 NSURL 从defaultRepresentation资产中获取的。NSURL 中的 url 是:

资产库://asset/asset.JPG?id=1000000366&ext=JPG

我去了其他论坛,他们谈到了文件网址之类的东西......我必须将网址转换为文件路径吗?

但是我可以在视图上显示 ALAsset 的缩略图。

有谁知道为什么我得到空的 NSData 对象?

0 投票
2 回答
1563 浏览

iphone - RootViewController - tableView:cellForRowAtIndexPath - Load image from assetsLibrary

StackOverflow friends and colleague programmers,

My RootViewController (a flowerTableView on a view) should display cell's with title, subtitle and an image thumbnail (loaded from the camera roll). A very basic table I guess.

All content is stored in 'Core Data' but the images are stored as imagePaths to the camera roll. Example: flower.imagePath = assets-library://asset/asset.JPG?id=1000000002&ext

Using the code at the bottom everything should run smoothly but it doesn't . When starting the App the title's and subtitle's are shown, but the images are not. When I press a cell, which display's the detail view, and pop back again to the main view the image for this specific cell is shown.

When I press 'Show All', a button on a toolbar which executes the following code

and reloads the table, all the beautiful flowers are now shown.

Why didn't the flowers be displayed the first time? Is this a caching problem?

When debugging this code the string: 'This debug string was logged after this function was done' was logged after loading the table on starting the app, not after pressing 'Show All' This means that all images are loaded from the camera roll successfully but attached to the cell after the cell was displayed and therefore not shown.

The same line is printed as intended when pressing 'Show All'

Hope someone can tell me what's going on here and even better, what to change in my code to make this work. I'm stuck at the moment...

Thank for helping me out! Edwin

:::THE CODE:::

0 投票
2 回答
2294 浏览

cocoa-touch - 尝试从assetForURL:resultBlock 中分配__block ALAsset 时出错:

我正在尝试创建一种方法,该方法将为给定的资产 url 返回一个 ALAsset。(我需要稍后上传资产,并希望在结果块之外使用结果。)

问题是assetToReturn给出了一个EXC_BAD_ACCESS。

如果我尝试从块内部分配指针,会有问题吗?我看到了一些块的例子,但它们总是使用简单的类型,比如整数等。

0 投票
1 回答
1086 浏览

objective-c - ALAsset URL 已从 iOS 4.3 更改为 5.0?

我有一个应用程序,我可以在其中拍照并将它们存储到相机胶卷中。我保存了生成的 ALAsset 的 URL,以便以后可以重新加载这些特定图像。

在我升级到 iOS 5.0 之前,这似乎工作正常。

现在,当我尝试加载资产时,我总是得到 nil 。我列举了整个相机胶卷,检查了那里的图像的 URL,实际上这些 URL 似乎不同。即,我能够使用 URL 保存(并重新加载)资产:'assets-library://asset/asset.JPG?id=1000001124&ext=JPG'。但是,现在它已经不存在了。事实上,现在所有的资产 URL 都更长了,例如:'assets-library://asset/asset.JPG?id=6BDB93FD-B94C-4F77-9ABD-26F34F06B429&ext=JPG'(也许现在更独特了?)

无论如何,还有其他人看过这个吗?我错过了什么吗?我所有的旧保存文件现在都没有用了吗?有没有办法从旧网址映射到新网址?我应该采取不同的方法吗?我不想发布它,然后发现我(和我的用户)的 URL 已经全部更改了......

想法?