如何?
·H
@property (nonatomic, strong) NSNumber *seasonRoundN;
@property (nonatomic, strong) NSString *seasonRound;
的.m
_weMeetAgain = [NSNumber numberWithInt:13];
_seasonRound = [NSString stringWithFormat:_weMeetAgain]; // incompatible :S
应该更好地查看参考文献:(以下答案)
_weMeetAgain = [NSNumber numberWithInt:17];
_seasonRound = [NSString stringWithFormat:@"%@", _weMeetAgain];
帮助:P,谢谢。
答案 0 :(得分:5)
[NSString stringWithFormat:@"%d", [_weMeetAgain intValue]]
答案 1 :(得分:5)
只需使用NSNumber实例方法stringValue。
_seasonRound = [_weMeetAgain stringValue];