Sharon Watinsan
Sharon Watinsan

Reputation: 9850

Application crashes when taking photo

1.) My applicatio crashes with the following error message ;

Multi-tasking -> Device: YES, App: YES
2012-05-15 22:14:04.401 ProOne[1720:607] Received memory warning. Level=1
2012-05-15 22:14:08.556 ProOne[1720:607] -[__NSArrayM pickerController]: unrecognized selector sent to instance 0x1e7e90
2012-05-15 22:14:08.758 ProOne[1720:607] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM pickerController]: unrecognized selector sent to instance 0x1e7e90'

Here's the code

onImageClick: function () {
           navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
                                       destinationType: Camera.DestinationType.DATA_URL,
                                       sourceType : Camera.PictureSourceType.CAMERA, 
                                       allowEdit : false, 
                                       encodingType: Camera.EncodingType.JPEG, 
                                       targetWidth: 500, 
                                       targetHeight: 500 
                                       }); 

           function onSuccess(imageData) {
           var image = Ext.getCmp('myImageId');
           image.setSrc("data:image/jpeg;base64," + imageData);
           }

           function onFail(message) {
           alert('Failed because: ' + message);

           }
           }

2.) How do i display the image taken in a View ?

Upvotes: 1

Views: 374

Answers (1)

Titouan de Bailleul
Titouan de Bailleul

Reputation: 12949

My first idea would be to lower the quality parameters to 25, event though I think and iPhone 4 has enough memory to handle 50.

Also, could you try to use FILE_URI instead of DATA_URL and see if it works.

Hope this helps

Upvotes: 1

Related Questions