xcode interfacebuilder Objects linked to custom cl

2020-03-26 13:18发布

问题:

In Xcode(latest version) Interfacebuilder, you can link objects to code.

I have created one a class: @interface FileChangeController : NSObject

But it is not listed in custom class, in Interfacebuilder Inspector?

Do you have to do something special?

Thanks in advance Regards Christian

回答1:

You have to subclass from UI* classes for that to appear in the inspector. For example:

@interface FileChangeController : UIViewController

That should make it visible in the inspector.

Also, it will be visible only for the relevant control. That is UIViewController classes will only be visible for view controller (duh!) objects.



回答2:

First make sure that you have properly linked your view controller class to the interface builder view controller

Then using the assistant editor, you can drag the connection directly to code.