【发布时间】:2017-07-26 00:05:56
【问题描述】:
这是我在 xcode 中添加新视图控制器的原始问题;
Adding a View Controller in Xcode?
这是我观察到的代码,它加载到 Xcode 中的一个新项目中,用于查看 controller.h/m 文件
.h
@interface ViewController : UIViewController
{
}
@end
.m
@interface ViewController ()
@end
@implementation ViewController
但是当我添加一个新类时;我注意到没有“UIViewController”对象,而是有一个 NSOBject。
.h
@interface Newclass : NSObject
@end
.m
@implementation Newclass
@end
我的问题;要成功以编程方式访问 x 代码故事板中的新视图控制器,是否必须将新的自定义 .m/.h 文件格式化为 UIViewController 或是否重要。
【问题讨论】:
标签: ios objective-c xcode