- (void)readStr1:(NSString**)str1 andStr2:(NSString**)str2
{
NSString *s1 = @"1";
NSString *S2 = @"2";
*str1 = [s1 copy];
*str2 = [S2 copy];
}
//下面是调用方法:
NSString *s1 = nil;
NSString *s2 = nil;
[self readStr1:&s1 andStr2:&s2];
//下面是打印日志
NSLog(@"s1 %@ s2 %@",s1,s2);
//下面是输出结果:
s1 1 s2 2
时间: 2024-10-25 20:30:42