定义修改传入参数的方法
+ (void)askCardType:(NSString **)askCardType
{
*askCardTpye = @"nihau"
}
调用
NSString *myStr = @"";
[self askCardType:&myStr];
一个小的注意点
如果参数可以为空的话是这样的
- (void)askCardType:(NSString * _Nullable *_Nullable)askCardType
{
*askCardType = @"nihau";
}
修改基本数据类型
- (void)setUpUI
{
[self configHeight:&height];
}
- (void)configHeight:(CGFloat *)height
{
///圆角空白高度
*height = 10 * rectScale();
}
修改或者调用也用*
如
- (void)configMotionArray:(NSMutableArray *__autoreleasing *)array fixFloor:(NSInteger *)floor
{
*array = [NSMutableArray array];
NSInteger fixedFloor = NSIntegerMax;
if (!isBlankString(self.pic1Info.url)) {
[*array addObject:self.pic1Info.url];
if (self.pic1Info.isFixed.integerValue == 1) {
*floor = 1;
}
}
}