-1

ドキュメントディレクトリ/ NSuserdefaults以外のiosシミュレーター/デバイスで、iosアプリケーションの画像をプログラムでどこに保存できますか? デバイスのフォト アルバムに画像を保存する方法はありますか (プログラムで行う)。提案してください

4

4 に答える 4

2
UIImageWriteToSavedPhotosAlbum
Adds the specified image to the user’s Camera Roll album.

void UIImageWriteToSavedPhotosAlbum (
   UIImage  *image,
   id       completionTarget,
   SEL      completionSelector,
   void     *contextInfo
);
Parameters
image
The image to write to the Camera Roll album.
completionTarget
Optionally, the object whose selector should be called after the image has been written to the Camera Roll album.
completionSelector
The method selector, of the completionTarget object, to call. This optional method should conform to the following signature:
- (void)               image: (UIImage *) image
    didFinishSavingWithError: (NSError *) error
                 contextInfo: (void *) contextInfo;
contextInfo
An optional pointer to any context-specific data that you want passed to the completion selector.
Discussion
When used with an image picker controller, you would typically call this function within your imagePickerController:didFinishPickingMediaWithInfo: delegate method implementation.

The use of the completionTarget, completionSelector, and contextInfo parameters is optional and necessary only if you want to be notified asynchronously when the function finishes writing the image to the user’s Camera Roll or Saved Photos album. If you do not want to be notified, pass nil for these parameters.

When used on an iOS device without a camera, this method adds the image to the Saved Photos album rather than to the Camera Roll album.

Availability
Available in iOS 2.0 and later.
See Also
UISaveVideoAtPathToSavedPhotosAlbum
于 2013-09-25T08:52:34.510 に答える
0

画像を公開する必要がない場合は、Documents フォルダに保存する必要があります。ユーザーは、何の変哲もない画像がフォト アルバムに保存されることを望まないでしょう。

于 2013-09-25T09:12:24.293 に答える