初歩的な質問: 特定の文字列を生成し、それを別のビュー コントローラーのテキスト ウィンドウに表示するプログラムを作成しています。コードが実際に NSLog コマンドを使用して文字列を生成することを確認するためにテストを行っており、コードが意図したとおりに機能していることを確認しています。何らかの理由でView Controllerを介して転送されず、その理由がわかりません。何か助けはありますか?コードのスニペットを次に示します。
CreateStoryViewController.m
- (IBAction)makeStory:(id)sender
{
StoryLine *myStory =[[StoryLine alloc] init];
[myStory setStory];
self.story = myStory.plot;
NSLog(@"story is %@", self.story);//this is generating the correct story string
self.displayStoryController = [[BIDDisplayStoryViewController alloc] initWithNibName:@"DisplayStoryView" bundle:nil];
[self.view insertSubview:self.displayStoryController.view atIndex:1];
}
DisplayStoryViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
BIDCreateStoryViewController *newStory = [[BIDCreateStoryViewController alloc] init];
NSLog(@"newStory.story is %@",newStory.story);//this generates null message
self.storyDisplay.text = newStory.story;
}