1 保存部分:
addAssetsGroupAlbumWithName:resultBlock:failureBlock:
Adds a new assets group to the library.
Parameters
- name
-
The name for the new group.
If name conflicts with another assets group with the same name, then the group is not created and resultBlock returns a
nil
group. - resultBlock
-
The block invoked after the add operation completes.
For a description of the block, see
ALAssetsLibraryAccessFailureBlock
. - failureBlock
-
The block to invoke if the add operation fails—for example, if the user denies access to the application.
For a description of the block, see
ALAssetsGroupFaces
.
Discussion
The name of the new asset group is name, its type is ALAssetsGroupAlbum
, and the editable
property is YES
.
This method is asynchronous. When the assets group is added, the user may be asked to confirm the application’s access to the data; the method, though, returns immediately. You should perform whatever work you want with the group in resultBlock.
If the user denies access to the application, or if no application is allowed to access the data, or if the data is currently unavailable, the failure block is called.
Availability
- Available in iOS 5.0 and later.
Declared In
ALAssetsLibrary.h