Domanda

Using Xcode 5 and Developing for iOS7 How can I capture an image add a caption and then store it within an app to be retrieved and displayed on a separate view controller within the app.

I know you set this code

- (BOOL) startCameraControllerFromViewController: (UIViewController*) controller
           usingDelegate: (id <UIImagePickerControllerDelegate,
                               UINavigationControllerDelegate>) delegate {

    if (([UIImagePickerController isSourceTypeAvailable:
             UIImagePickerControllerSourceTypeCamera] == NO)
        || (delegate == nil)
        || (controller == nil))
        return NO;


    UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
    cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;

    // Displays a control that allows the user to choose picture or
    // movie capture, if both are available:
    cameraUI.mediaTypes =
    [UIImagePickerController availableMediaTypesForSourceType:
        UIImagePickerControllerSourceTypeCamera];

    // Hides the controls for moving & scaling pictures, or for
    // trimming movies. To instead show the controls, use YES.
    cameraUI.allowsEditing = NO;

    cameraUI.delegate = delegate;

    [controller presentModalViewController: cameraUI animated: YES];
    return YES;
}

But how do I then caption the image save it a retrieve it on another view controller, would really appreciate the help.

È stato utile?

Soluzione

If i am not wrong, There is no in build property or API for adding caption in image. First you have to capture image using UIImagePickerController after capturing image use your UIViewcontroller that shows image and put there UITextfield to add caption , and then after save it.

Or You can use Overlay property of UIImagePickerController you can try with it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top