Я создал два класса viewController, так что один является суперклассом другого. У меня есть переменная nsstring в суперклассе, к которой я должен получить доступ в подклассе, пожалуйста, объясните мне, как это сделать. Вот мой код
@interface Superclass : UIViewController{
NSString *message
}
@property(nonatomic,retain)NSString *message;
-(id)init;
@end
@implementation Superclass
@synthesize message;
-(id)init{
{
[super init];
message=@"Hello";
return self;
}
@interface Subclass : Superclass{
}
@end
@implementation Subclass
- (void)viewDidLoad {
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Alert" message:self.message delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alert show];
[alert release];
[super viewDidLoad];
}
Моя подсказка, но без сообщения.