NSMutableString 总是“超出范围”?
在我的 .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 时,它都会说“超出范围”..我做错了什么?
in my .h file i have:
#import <UIKit/UIKit.h>
@interface untitled : UIViewController
{
NSMutableString * sResults;
}
@property (nonatomic,retain) NSMutableString * sResults;
@end
In my .m i have:
#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
Whenever i check sResults it says "Out of scope".. what am i doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
Try this: