Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/118.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在UIViewController中显示数据_Ios - Fatal编程技术网

Ios 在UIViewController中显示数据

Ios 在UIViewController中显示数据,ios,Ios,我需要在UIView中显示姓名、位置、地点、电话号码。 我没有使用主情节提要 我有一个UIViewcontroller类 示例此处上载了演示图像。请检查 ListViewController.swift和ListViewController.xib文件 如何做?首先删除您的MainStoryboard文件,然后从infoPlist中删除MainStoryboard。然后将您的ListViewController作为AppDelegate中的rootViewController,如下所示: fu

我需要在UIView中显示姓名、位置、地点、电话号码。 我没有使用主情节提要

我有一个UIViewcontroller类

示例此处上载了演示图像。请检查

ListViewController.swift和ListViewController.xib文件
如何做?

首先删除您的
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我需要在没有主情节提要的情况下完成这项工作。