The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

johncch (1) [Avatar] Offline
#1
Hello,

In chapter 5, figure 5.15 you added an Image Picker Controller into the xib file. However, I don't see the Image Picker Controller in Xcode 4.6. Was it removed at some point?
bear.cahill (22) [Avatar] Offline
#2
Re: Image Picker Controller
Yes, it was removed recently. Here's some code to do it programmatically...

In your interface declaration:

UIImagePickerController *ipController;
UIPopoverController *poController;

In your implementation - pass in a UIImagePickerControllerSourceType: NOTE: This is using ARC so there's no autorelease, etc.

-(void)showIPControllerWithSourcesmilieUIImagePickerControllerSourceType)sourceType
{
ipController = [[UIImagePickerController alloc] init];
[ipController setSourceType:sourceType];
[ipController setDelegate:self];

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
poController = [[UIPopoverController alloc] initWithContentViewController:ipController];
CGSize size = CGSizeMake(320, 260);
[poController setPopoverContentSize:size];
CGRect rect = CGRectMake(130, 130, 5, 5);
[poController presentPopoverFromRect:rect inView:self.btnProfilePic permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
else
[self presentViewController:ipController animated:YES completion:nil];
}

I hope this helps!
arronlee (3) [Avatar] Offline
#3
Re: Image Picker Controller
Hi, Johncch.
I wonder whether the code offered by Bear helps or not?

UIImagePickerController *ipController;
UIPopoverController *poController;

In your implementation - pass in a UIImagePickerControllerSourceType: NOTE: This is using ARC so there's no autorelease, etc.

-(void)showIPControllerWithSourcesmilieUIImagePickerControllerSourceType)sourceType
{
ipController = [[UIImagePickerController alloc] init];
[ipController setSourceType:sourceType];
[ipController setDelegate:self];

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
poController = [[UIPopoverController alloc] initWithContentViewController:ipController];
CGSize size = CGSizeMake(320, 260);
[poController setPopoverContentSize:size];
CGRect rect = CGRectMake(130, 130, 5, 5);
[poController presentPopoverFromRect:rect inView:self.btnProfilePic permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
else
[self presentViewController:ipController animated:YES completion:nil];
}



Or you can google it and select some fine Imaging Processing SDK whose way of processing is simple and fast to help you with the related image processing work. It will be better if the Imaging Toolkit you select is totally manual and can be customized by users according to our own favors. Remember to check its free trial package first if possible. I hope you success. Good luck.



Best regards,
Arron