Вопрос

I would like to make a universal project that works both on iPhone and iPad. According to the docs, in order to have a different xib file for the iPad, all I have to do is to create a new xib file and name it with a ~ipad extension.

WhereamiViewController.h 
WhereamiViewController.m   
WhereamiViewController.xib
WhereamiViewController~ipad.xib

It works infact. However I need to bind the controls on the new ~ipad.xib to the same instance variables and methods on WhereamiViewController.h. But how do I achieve this?

How do I set the File's Owner of the new xib to that existing header file?

Это было полезно?

Решение

Same way you do it in your first xib...

Click on File's Owner > Identity Inspector tab > Custom Class : WhereamiViewController

Другие советы

I hope your looking to add XIB file for IPad and same .h and .m file which is already existed for IPhone. check below picture to connect your file's owner enter image description here once finished according to picture connect your view to file's owner view reference. Then you can give all components reference as you like.

do in this way

File's Owner > Identity Inspector tab > Custom Class : your class name

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top