How to use captured photo? - iphone

I have the camera working in my app, but after the picture is captured and I select use, the app crashes.
How can I connect this use button and make it set a UIImageView I have created to the captured image?
EDIT
Camera is available and ready
Using two-stage rotation animation.
To use the smoother single-stage animation, this application must remove two-stage method
implementations.
Using two-stage rotation animation is not supported when rotating more than one view
controller or view controllers not the window delegate
*** ERROR: FigCreateCGImageFromJPEG returned -12905. Input (null) was 658522 bytes.
Received memory warning. Level=1
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
'+[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil'
Thanks

Take a look at Apple's PhotoPicker sample project. From the description:
The chosen image or camera photo is
displayed in a UIImageView.

Related

Game Center share achievement or leaderboard crashes on iPad iOS 8

Hello everyone I am trying to implement Game Center on my iOS8 app and have run into a crash on the iPad. I already have the achievements and leaderboards set up and can successfully hit the blue share button on the iPhone but when i press share on the iPad the GKGameCenterViewController crashes and gives me the following report:
Application Specific Information:
*** Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController
(<_UIAlertControllerActionSheetRegularPresentationController:
0x7b1480a0>) should have a non-nil sourceView or barButtonItem set
before the presentation occurs.' terminating with uncaught exception
of type NSException abort() called CoreSimulator 110.4 - Device: iPad
Retina - Runtime: iOS 8.1 (12B411) - DeviceType: iPad Retina
Any help would be appreciated thank you!
I got the same crash. When I present the GKGameCenterViewController modally, it's important I provide the sourceView, using the code in this order:
gameCenterVC.modalPresentationStyle = .Popover
gameCenterVC.popoverPresentationController?.sourceView = view!
gameCenterVC.popoverPresentationController?.sourceRect = view!.frame
presentViewController(gameCenterVC, animated: true, completion: {})
Your error reads
"reason: 'UIPopoverPresentationController [...]"
which suggests your modalPresentationStyle = .Popover.
In that case, you will need to set the source view or button bar, like the rest of the error indicates.
The instance popoverPresentationController in non-nil because...
If you created the view controller but have not yet presented it, accessing this property creates a popover presentation controller when the value in the modalPresentationStyle property is UIModalPresentationPopover
according to popoverPresentationController
I am testing on an iPad Air with iOS 9.3.
I am getting it to run without crashing [using my solution in the above post], but it does not display the game center popups or view controllers with
modalPresentationStyle = .Popover
However, I do get my view controllers and sign in pop ups when I set
modalPresentationStyle = .Fullscreen

UIImageView-TableViewCell Crash iphone

I am getting a crash while adding uiimageView in a containerView inside uitableView. I am performing lazy loading, the images loads successfully but when i scroll the table upwards, application crashes, Please guide me what i am doing wrong.
'NSInvalidArgumentException', reason: '-[UIImage superview]: unrecognized selector sent to instance
Thanks
Somewhere you're using UIImage where it should be UIImageView.

UISplitViewController with NavigationControllers (including sample code)

The easiest way to see this problem will be to run the sample project here:
http://drop.io/stackproblem
Basically, It's a uisplitviewcontroller which can be switched between 2 detail views, both of which are navigation controllers.
The problem is that it crashes with the following error:
MultipleDetailViews[8531:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Popovers cannot be presented from a view which does not have a window.'
It crashes with this error if you use the app in PORTRAIT and you navigate (still in portrait) from the first controller, to the second, to the first, to the second, and then boom CRASH using the popover controller.
One way to stop the crash is to stop lazy loading the navigation controllers and to load them fresh everytime but this isn't an option for the app I'm making.
Any ideas and I may fall in love.
Try using if (self.view.window != nil) just before the line that's causing the crash.

iPhone iOS 4.0 Camera FigCreateCGImageFromJPEG returned -1

Since I updated to 4.0, when I take a photo with my App using UIImagePickerController I get the following error output:
*** ERROR: FigCreateCGImageFromJPEG returned -1. Input (null) was 711733 bytes.
I still get the image returned and can continue as normal, but does any body know what and why I get this error. I also get the following warnings that could be related:
Using two-stage rotation animation. To use the smoother single-stage animation, this >application must remove two-stage method implementations.
Using two-stage rotation animation is not supported when rotating more than one view >controller or view controllers not the window delegate
Any information would be of great help.
Thanks in advance.
I also have problems with UIImagePickerController on iOS 4.0,
It works on simulator on 3.0 but on 4.0 i have a crash the delegate method
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
is called twice, and if i build on the phone and use camera it works ok.
Edit:
I have solved this problem long time ago by adding a global static int and when i enter the delegate method I test for that static int the I increment the value of it. And in the way the delegate is executed only once.

DrawRect in CPLayerHostingView?

0
Hi, i am using Core-plot . but when i declare the normal UIView as CPLayerHostingView,how can i handle drawRect of that view , i cant give another custom UIview name and write code in drawRect of that view?please any help to handle drawRect of CPLayerHostingView?
Put the CPLayerHostingView inside another UIView. The background from your custom UIView will show through if you use transparent fills in the graph.
Put the CPLayerHostingView inside another UIView. The background from your custom UIView will show through if you use transparent fills in the graph.
i did this but i get on exception like this Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setHostedLayer:]: unrecognized selector sent to instance 0x5d20910'