为子视图应用标头和实现文件

时间:2023-01-14 11:04:18

You can create a subview with

您可以使用创建子视图

myView *newView = [[myView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:newView];

And you have the implementation and header files for it too. However, the views don't just automatically pop up in the storyboard. How do I assign header and implementation files to a view I have added in the storyboard? I am very new to Objective-C and iOS Development, so try not to be too complicated or technical.

你也有它的实现和头文件。但是,视图不会自动弹出故事板。如何将标题和实现文件分配给我在故事板中添加的视图?我是Objective-C和iOS开发的新手,所以尽量不要太复杂或技术性。

1 个解决方案

#1


1  

In Interface Builder, drag in a Custom View, and then on the Identity Inspector for this view, in the Custom Class section, select your class.

在Interface Builder中,拖动自定义视图,然后在此视图的Identity Inspector上,在“自定义类”部分中,选择您的类。

#1


1  

In Interface Builder, drag in a Custom View, and then on the Identity Inspector for this view, in the Custom Class section, select your class.

在Interface Builder中,拖动自定义视图,然后在此视图的Identity Inspector上,在“自定义类”部分中,选择您的类。