已经存在一个类B,怎样声明一个类A,里面有一些成员类型分别有
long
string
list< B >
上面的这些类型,然后我不知道怎么去声明,对应的类型是什么 ?
还有一些比如copy,retain,strong等是什么类型用什么???
ios开发小白求教,Xcode9用objective-c怎样声明和实现一个类
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
1条回答 默认 最新
YoungFreeGod 2017-12-06 02:30关注创建一个新的类B然后在里面声明就行
.h文件如下
#import@interface CBTestController : UIViewController
/**
创建string类型
/
@property(nonatomic,strong)NSString customString;
/**
创建可变数组(list)
/
@property(nonatomic,strong)NSMutableArray customMutableArray;
/**
创建 float类型
*/
@property(nonatomic,assign)float f;
@end本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报