objective-c – iOS5上的UIImagePickerController内存泄漏

objective-c – iOS5上的UIImagePickerController内存泄漏,第1张

概述我正在我的应用程序中使用UI ImagePickerController在iOS5& XCode4.2,内存泄漏,我不知道为什么我得到这个泄漏你能请给我答案. 和我的代码: -(void)createImagePicker {_picker = [[UIImagePickerController alloc] init];_picker.sourceType = UIImagePickerC 我正在我的应用程序中使用UI ImagePickerController在iOS5& XCode4.2,内存泄漏,我不知道为什么我得到这个泄漏你能请给我答案.

和我的代码:

-(voID)createImagePicker {_picker = [[UIImagePickerController alloc] init];_picker.sourceType = UIImagePickerControllerSourceTypeCamera;_picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;_picker.allowsEditing = YES;_picker.showsCameraControls = NO;_picker.cameraDevice = UIImagePickerControllerCameraDeviceRear; _picker.delegate = self;_picker.wantsFullScreenLayout = YES;}

和vIEwWillApper方法:

-(voID)vIEwWillAppear:(BOol)animated{    [super vIEwWillAppear:animated];    [[NSNotificationCenter defaultCenter] addobserver:self selector:@selector(closeCamerabutton:) name:@"ShowMainVIEw" object:nil];    [self createImagePicker];    [m_cameraOverlayVIEw setBackgroundcolor:[UIcolor clearcolor]];    [self presentModalVIEwController:_picker animated:NO];    _picker.cameraOverlayVIEw = m_cameraOverlayVIEw;    [cameraimgVIEw setHIDden:YES];    [filterVIEw setHIDden:YES];    m_cameraOverlayVIEw.hIDden = NO;    cameraSelectedbutton.hIDden = NO;    cancelbutton.hIDden = YES;    selectbutton.hIDden = YES;    for (ID Object in [scrollvIEw subvIEws])    {        if([Object isKindOfClass:[UIbutton class]])        {            [Object removeFromSupervIEw];        }    }    [m_toolbarImage setFrame:CGRectMake(0,427,320,55)];    [cameraSelectedbutton setFrame:CGRectMake(128,432,86,44)];    [m_cancelbutton setFrame:CGRectMake(10,434,82,40)];    [m_cancelbutton setTitle:@"Close" forState:UIControlStatenormal];    [m_cancelbutton setBackgroundImage:[UIImage imagenamed:@"menu-bar-button.png"] forState:UIControlStatenormal];    [m_cancelbutton setTitlecolor:[UIcolor colorWithRed:110/256.0 green:52/256.0 blue:28/256.0 Alpha:1.0] forState:UIControlStatenormal];    [cancelbutton setFrame:CGRectMake(120,35,35)];    [selectbutton setFrame:CGRectMake(184,35)];    }
解决方法 无论是否使用ARC,这似乎是iOS 5中UIImagePickerController的一个问题.

我有一个使用xcode 3.2.5为iOS 4开发的应用程序,当从图书馆拍摄或选择照片时,仪器显示没有泄漏(在运行iOS 4.1的设备上测试).在运行iOS 5.1的设备上测试的相同代码如上所述泄漏.

我知道这不是一个答案,但问题似乎比原来的问题更广泛.

总结

以上是内存溢出为你收集整理的objective-c – iOS5上的UIImagePickerController内存泄漏全部内容,希望文章能够帮你解决objective-c – iOS5上的UIImagePickerController内存泄漏所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1051561.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存