拍照时应用程序崩溃

时间:2012-05-15 16:46:15

标签: cordova sencha-touch extjs sencha-touch-2

1。)我的应用程序因以下错误消息而崩溃;

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'

这是代码

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.。)如何显示在View中拍摄的图像?

1 个答案:

答案 0 :(得分:1)

我的第一个想法是将质量参数降低到25,虽然我认为事件和iPhone 4有足够的内存来处理50。

此外,您是否可以尝试使用FILE_URI而不是DATA_URL,看看它是否有效。

希望这有帮助