#import "JonyViewController.h"
@interface JonyViewController ()
//显示结果
@property (weak, nonatomic) IBOutlet UILabel *result;
@property (assign, nonatomic) NSMutableString *str1;
//监听按钮按
- (IBAction)btn:(UIButton *)sender;
@end
@implementation JonyViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)btn:(UIButton *)sender {
[_str1 appendString:@"wocao"];
NSLog(@"%@",_str1);
NSMutableString *str = [[NSMutableString alloc] init];
[str appendString:@"wocap"];
NSLog(@"%@",str);
}
@end
红色代码为什么为空 |