Incompatible pointer types assigning to 'NSMutableArray *' from 'NSArray *'
来源:互联网 发布:手机淘宝领取淘金币 编辑:程序博客网 时间:2024/06/14 08:24
1. 问题
Incompatible pointer types assigning to 'NSMutableArray *' from 'NSArray *'
2.解决办法
NSArray转NSMutableArray
NSArray * array;
NSMutableArray* MutArray = [[NSMutableArray alloc]init];
方法A:
MutArray = [array mutableCopy];
方法B:
NSMutableArray* MutArray= [NSMutableArray initWithArray:array];
3. NSMutableArray转NSArray
NSArray *array= [MutArray copy];
0 0
- incompatible pointer types assigning to 'nsmutablearray ' from 'nsarray '
- Incompatible pointer types assigning to 'NSMutableArray *' from 'NSArray *'
- Incompatible pointer types assigning to 'id<>' from 'Class'
- incompatible pointer types assigning to 'int *' from 'char'
- incompatible integer to pointer conversion assigning to
- Incompatible integer to pointer conversion assigning to 'NSInteger *' (aka 'long *') from 'int'
- incompatible integer to pointer conversion assigning to 'BOOL * _Nonnull' (aka 'bool *')from 'int'
- gf-complete报错error: incompatible types when assigning to type '__m128i' from type 'int'
- Incompatible pointer types returning 'NSArray *' from a function with result type 'xxx *'
- Assigning to 'id<UINavigationControllerDelegate,UIImagePickerControllerDelegate>' from incompatible
- Assigning to ‘id<UINavigationControllerDelegate,UIImagePickerControllerDelegate>’ from incompatible
- Assigning to ‘id<UINavigationControllerDelegate,UIImagePickerControllerDelegate>’ from incompatible
- assigning to id from incompatible type
- Assigning to 'id<QMapViewDelegate>" from incompatible type "view control * const_strong"
- Assigning to 'id<UITextViewDelegate>' from incompatible type 'HBComposeViewController *const __stron
- Assigning to ‘id<UIWebViewDelegate>’ from incompatible type 'xxxViewController *const __strong'
- IOS Assigning to 'id<UITabBarControllerDelegate>' from incompatible type...
- Assigning to ‘ d<xxxxDelegate>' from incompatible type ‘xxViewController *const __strong'
- 92. Reverse Linked List II
- poj 2226 hungary(铺木板)
- Services 综合介绍
- HDU 1003 DP
- assert
- Incompatible pointer types assigning to 'NSMutableArray *' from 'NSArray *'
- 安装配置树莓派的最佳工具——NOOBS
- 通用漏洞提交格式说明
- 温故知新--servlet(二)web.xml注册servlet
- 【Unity5】出现地形错误的解决办法,Terrain error
- 玩转树莓派Raspberry Pi 篇一:入门篇
- 继承类的类型
- 从Android源码角度对Handler,MessageQueue,Looper之间消息传递工作原理的理解
- 【iOS开发】关于UIView总结与UIButton使用