在我的 .h 文件中,我有:
#import <UIKit/UIKit.h>
@interface untitled : UIViewController
{
NSMutableString * sResults;
}
@property (nonatomic,retain) NSMutableString * sResults;
@end
在我的 .mi 中有:
#import "untitled.h"
@implementation untitled
@synthesize sResults;
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
sResults = [[NSMutableString alloc] initWithString:@"Hello"];
[sResults appendString:@" World"];
}
@end
每当我检查 sResults 时,它都会显示“超出范围”.. 我做错了什么?