Ios 在UIViewController中显示数据
我需要在UIView中显示姓名、位置、地点、电话号码。 我没有使用主情节提要 我有一个UIViewcontroller类 示例此处上载了演示图像。请检查 ListViewController.swift和ListViewController.xib文件Ios 在UIViewController中显示数据,ios,Ios,我需要在UIView中显示姓名、位置、地点、电话号码。 我没有使用主情节提要 我有一个UIViewcontroller类 示例此处上载了演示图像。请检查 ListViewController.swift和ListViewController.xib文件 如何做?首先删除您的MainStoryboard文件,然后从infoPlist中删除MainStoryboard。然后将您的ListViewController作为AppDelegate中的rootViewController,如下所示: fu
如何做?首先删除您的
MainStoryboard
文件,然后从infoPlist
中删除MainStoryboard
。然后将您的ListViewController
作为AppDelegate
中的rootViewController
,如下所示:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
let listViewController = ListViewController().init(nibName:"ListViewController", bundle:nil) as ListViewController
self.window?.rootViewController = listViewController
self.window?.makeKeyAndVisible()
return true
}
然后在
.xib
中设计您的视图,您可以从中获得帮助,显示您的代码。@ShabbirAhmad我已经尝试过,但没有得到values@ShabbirAhmad如何解决问题为什么不使用UIViewController和故事板?用代码写每件事对于理解来说都要好得多,但对于刚开始的人来说要困难得多。@MartinMuldoon我需要在没有主情节提要的情况下完成这项工作。