简体   繁体   English

iOS标签栏问题

[英]iOS Tab Bar question

based on the Tab Bar default project, I tried to build a program with 5 tabs. 基于标签栏默认项目,我尝试构建一个包含5个标签的程序。 This part works. 这部分有效。

On tab 2 are several labels I want to change, mostly their text. 在选项卡2上,有几个我要更改的标签,主要是文本。 I am connecting the labels to outlets like this: 我将标签连接到这样的插座:

IBOutlet UILabel* myName; IBOutlet UILabel * myName;

Now I can tell myName to do whatever I want. 现在我可以告诉myName做我想做的事。 Change text for instance. 例如更改文本。 This was working when the view was on tab 1, but now on tab 2 they contain NILL at runtime. 当视图位于选项卡1上时,此方法有效,但现在在选项卡2上,它们在运行时包含NILL。 Redid all bindings after removing all, but this seems not to be the problem. 删除所有绑定后重新绑定所有绑定,但这似乎不是问题。

How do change labels that are on the different views a tab bar loads? 如何更改选项卡栏加载的不同视图上的标签?

I am very sure that I oversee something fundamental, but I have no idea what this might be. 我非常确定我会监督一些基本的事情,但是我不知道这可能是什么。

JFYI, found the bug. JFYI,找到了错误。

A classic one: 'error sitting in fromt of screen' /Blush 一个经典的例子:“坐在屏幕中心的错误” /脸红

I didnt setup the fileowner proper for the view. 我没有为视图设置适当的文件所有者。 Thought I checked that, but seems not. 以为我检查了一下,但似乎没有。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM