iphone - Should repeated use of the camera crash an app? -


I have an app that creates a slideshow from user images. They can catch with their library or take a picture. I have found that the use of grabbing an image from the library is fine. But repeated use of taking a picture causes uncertain behavior. I have been getting accidents but mostly what happens "didFinishPickingMediaWithInfo", which spoils things after seeing a reloading.

I have a leak and after each picture is taken it is being released properly. I am resizing the image and saving it in the data base. Is there any other happening in this situation? Did the camera not call it often? Is

This combination is not consistent, it takes a picture, removes the camera and , Then user A, B or C (they are done for selection on many things), they can take another picture, remove the camera and release it. ..atc ... and this happens many times when they complete all data entry.

After selecting the camera, I call this code. . I'm not releasing the image picker in dealloc method

  - (minus) openCamera {if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) {imagePicker = [[UIImagePickerController alloc] init]; ImagePicker.delegate = self; ImagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; [Self-Present Model View Controller: Animated Picture Picture: Yes]; [Image publication]; }  

}

camera after Lee went photo "USE" I re-image based on the original shape I call the following code for this image

  - (zero) imagePickerController :. (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info {UIImage * tempCameraImage = [information objectForKey: @ "UIImagePickerControllerOriginalImage"]; [Picker Dismodal Moodle Controller Permission: Yes]; CGFloat original style = tempCameraImage.size.width * tempCameraImage.size.height; NSLog (@ "original size% F", original size); If (original size> 2500000.0) {CGSize size = tempCameraImage.size; CGRact-rect = CGRactam (0.0, 0.0, .23 * size. Width, .23 * size.); UIGraphicsBeginImageContext (rect.size); [TempCamera image drawInRect: rect]; TheImage = UIGraphicsGetImageFromCurrentImageContext (); UIGraphicsEndImageContext (); CGFloat totalSize = theImage.size.width * theImage.size.height; NSLog (@ "final camera size% f", total size); [Resize camera]; Return; } And {CGSize size = tempCameraImage.size; CGRCact RECAD = CGRTech (0.0, 0.0, .27 * size wide, .27 * size. HEIGHT); UIGraphicsBeginImageContext (rect.size); [TempCamera image drawInRect: rect]; TheImage = UIGraphicsGetImageFromCurrentImageContext (); UIGraphicsEndImageContext (); CGFloat totalSize = theImage.size.width * theImage.size.height; NSLog (@ "final camera size% f", total size); [Resize camera]; Return; }  

}

  - (minus) resizeImageCamera {if (editingImage1) {NSManagedObject * image = [NSEntityDescription insertNewObjectForEntityForName: @ "image" inManagedObjectContext: slideshow . ManagedObjectContext]; Slideshow.image = image; [Image Set Value: Image Foreca: @ "Image"]; CGSize size = theImage.size; CgCRR RECODE = CGRactMake (0.0, 0.0, .15 * size. Wide, .15 * size. High); UIGraphicsBeginImageContext (rect.size); [Iiimize drawrectact: rect]; Slideshow.thumbnailImage1 = UIGraphicsGetImageFromCurrentImageContext (); UIGraphicsEndImageContext (); [Self-finishing image]; Return; }  

}

  - (void) End Camera Image {if (Editing Image 1) {keyInt = @ "2"; [EditedObject setValue: keyInt forKey: @ "script1"]; PictureView.alpha = 0; Self.navigationItem.rightBarButtonItem = Zero; EditedFieldKey = @ "line2Int"; EditedFieldName = NSLocalizedString (@ "line2Int", @ "name line for display 2"); Self.title = editedFieldName; LinePicker.hidden = NO;  

}

I think I am doing a lot for this image. If I have to delay that helps? Put in a couple of


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -