为什么我无法在情节提要中连接 IBOutlet?

发布于 2024-12-29 13:51:39 字数 587 浏览 4 评论 0原文

我有一个 ViewController,它有几个为 UITextView 定义的 IBOutlet 属性。在故事板中,我已将视图控制器分配给自定义视图控制器。当我 cntr + 单击视图控制器时,我可以看到我的两个 IBOutlet。当我尝试将它们拖动到情节提要上的 UITextViews 时,它们不会突出显示并且无法分配。

我是 xcode 4 的新手。

以下是视图控制器中的属性定义:

@interface CreateUserViewController : UIViewController<UITextInputDelegate>

@property(nonatomic,retain) KeychainItemWrapper *keyChainWrapper;
@property(nonatomic,retain) IBOutlet UITextView *userNameTxt;
@property(nonatomic,retain) IBOutlet UITextView *passwordTxt;

这些属性是在实现中综合的。我可以毫无问题地将每个文本字段的委托分配给视图控制器。我错过了什么步骤吗?

谢谢

I have a ViewController that has a couple of IBOutlet properties defined for UITextView. In the storyboard I have assigned my viewcontroller to the custom view controller. When I cntr + click on the viewcontroller I can see my two IBOutlets. When I try to drag them to the UITextViews on the storyboard they will not highlight and cannot be assigned.

I'm new to xcode 4.

Here is the property definitions from the viewcontroller:

@interface CreateUserViewController : UIViewController<UITextInputDelegate>

@property(nonatomic,retain) KeychainItemWrapper *keyChainWrapper;
@property(nonatomic,retain) IBOutlet UITextView *userNameTxt;
@property(nonatomic,retain) IBOutlet UITextView *passwordTxt;

These properties are synthesized in the implementation. I can assign each of the textfields' delegate to the viewcontroller without a problem. Am I missing any step?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泅人 2025-01-05 13:51:39

确保您尝试连接的视图确实是 UITextView,而不是 UITextField。将它们混淆并不困难。

Make sure that the views you're trying to connect really are UITextViews and not UITextFields. It's not difficult to get them mixed up.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文