【发布时间】:2010-01-10 23:21:13
【问题描述】:
我尝试将 NSString 从一个视图传递到另一个视图,但我不起作用。我在 SecondViewController 中设置了一个 NSString 作为属性
@property (assign) NSString * wert1;
当我在 FirstViewController 上按下按钮加载 SecondViewController 时,我尝试传递 NSString:
SecondViewController *Second = [[SpinViewController alloc] initWithNibName:nil bundle:nil];
Second.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"black.png"]];
[Second setWert1:texteingabe1]; //HERE <<<<
Second.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:Second animated:YES];
[Second release];
在 SecondViewController 中我做了这个:
NSLog(@"%@",wert1);
但是 NSLog 只是说:(null)。为什么?
感谢您的帮助,对不起我的英语不好。
【问题讨论】:
标签: iphone objective-c xcode