【cocos2dx+Lua】IOS中使用ImagePicker死机问题
来源:互联网 发布:网络交流环境定义 编辑:程序博客网 时间:2024/05/21 12:32
这周哆哆全脑的项目用到让玩家选择头像,需要打开照片的问题。安卓也遇到一堆坑,另外的文章会说,这篇先说说IOS中死机的问题。
找了网上别人的代码,自己修改了一下。
代码非常简单:
UIImagePickerController *_imagePickerController;
self._imagePickerController = [[UIImagePickerControlleralloc]init];
self._imagePickerController.delegate =self;
self._imagePickerController.allowsEditing =YES;
self._imagePickerController.sourceType =UIImagePickerControllerSourceTypePhotoLibrary;
[selfpresentViewController:self._imagePickerControlleranimated:NOcompletion:nil];
就这几行代码居然死机了,开始寻找问题
1、ios10以后需要开启权限
之前做功能也发现了,ios10以后有些功能需要开启权限,所以很快的找到这个问题,在info.plist中增加权限
2、UIImagePickerController需要retain
@property (strong,nonatomic)UIImagePickerController *_imagePickerController;
在AppController.mm中增加以下代码
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
returnUIInterfaceOrientationMaskAll;
}
- 【cocos2dx+Lua】IOS中使用ImagePicker死机问题
- cocos2dx-Lua中出现的问题
- cocos2dx中protobuf的lua使用
- cocos2dx-lua sqlite3使用
- cocos2dx lua中使用自定义类以及tolua++的使用
- cocos2dx lua中使用自定义类以及tolua++的使用
- 关于cocos2dx-lua版本中游戏时间显示问题
- cocos2dx中c++向lua传string的问题
- cocos2dx lua ios glview 截图
- STM8s使用中遇到的死机问题的排除
- cocos2dx引擎中lua使用加密sqlite数据库
- cocos2dx lua中使用class实现继承api中的类
- [cocos2dx]cocos2dx3.x+lua中使用物理引擎
- cocos2dx 3.x以上版本 lua中使用protobuf
- 如何在cocos2dx中使用Lua创建自定义
- ImagePicker
- ImagePicker
- cocos2dx + lua 开发问题一堆
- 数据类型
- 运算符
- 子系统类加载分析情况(中间件是weblogic)
- 数据库连接局域网中的另一台数据库
- c语言的函数
- 【cocos2dx+Lua】IOS中使用ImagePicker死机问题
- 编译错误理解
- viewpager导航页
- 统计指定目录下,指定文件后缀的文件代码行数,并排序
- 冒泡排序和插入式排序
- 递归简单使用
- Python 开发者节省时间的 10 个方法
- NGNIX 配置一个服务器上80端口绑定多个域名多个网站
- java数组