Well here is the code I wrote to display the UIImagePickerController in the camera source. I just declared myPhotopicker in the header for the property and saved it. Synthesize it in the main code file. Then, having typed the collector, I wrote the code below:
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
if (myPhotopicker==nil) {
myPhotopicker = [[UIImagePickerController alloc] init];
myPhotopicker.delegate = self;
}
myPhotopicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:myPhotopicker animated:NO];
}
After calling it, there are several things that strangely happen to the application.
Sometimes, when many applications are running in the background (iPhone4), the application will not be able to load the camera and disable the application. Although it will load CameraRoll / PhotoAlbums without any problems.
If the camera image can load (when fewer applications are running in the background), clicking the โCancelโ button on the camera screen will load the application (where the Default.png image is displayed quickly and back to the main page - for example, when we launched the application).
I tried to find out this problem, but not sure what to do ... pls help .. Thanks.
source
share