从不同的 ViewController 获取按钮标签的值
这似乎很微不足道,但不知何故我无法让它工作。我有 2 个带有 tableView 作为内容的 Popover 控制器,还有一个带有一些按钮的 UIViewController。 我正在从 PopoverController 的 didSelectRoxAtIndexPath 函数设置按钮的标题之一。这很好用。现在我想将此按钮标题传递给第二个 PopoverController,但似乎无法使其工作;字符串返回 NULL。目前我正在使用:
h file:
NSString *myString;
@property(nonatomic,retain)NSString *myString;
m file:
@synthesize myString;
在 viewDidLoad:
MyAppViewController *appV = [[MyAppViewController alloc]initWithNibName:@"MyAppViewController" bundle:nil];
self.myString = appV.buttonOne.currenTitle;
This seems to be quite trivial but somehow I can't get it to work. I have 2 Popover Controllers with a tableView as contents, and I have a UIViewController with some buttons.
I'm setting one of the button's title from the PopoverController's didSelectRoxAtIndexPath function. This works nicely. Now I would like to pass this button title to the second PopoverController but can't seem to get this to work; the string returns a NULL. Currently I'm using:
h file:
NSString *myString;
@property(nonatomic,retain)NSString *myString;
m file:
@synthesize myString;
in viewDidLoad:
MyAppViewController *appV = [[MyAppViewController alloc]initWithNibName:@"MyAppViewController" bundle:nil];
self.myString = appV.buttonOne.currenTitle;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在显示第二个
UIPopoverController
之前设置此属性。Try setting setting this property before displaying the second
UIPopoverController
.