我的应用程序快速使用故事板。启动文件后,我的应用程序启动初始视图控制器,我已经设置了入口点。但突然我的应用程序在启动屏幕后没有出现初始视图控制器。但是如果我将入口点设置为另一个视图控制器,它会出现。第一个viewcontroller viewdidload
和所有其他UITableView
委托和数据源在Idebug运行但是屏幕没有来它只是保持在我的启动文件上。
这是什么原因?请帮我。 感谢
更新
import UIKit
class SubscriptionViewController: UIViewController,UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tblSettings: UITableView!
@IBOutlet weak var vwTitle: UIView!
var mutableDictionary :[String]=["Business","News","Sports","Entertainment","Crime","Politics"]
var imageView = UIImageView.init(frame: CGRectMake(0, 0, 20, 20))
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
tblSettings.backgroundColor=UIColor.clearColor()
tblSettings.delegate=self
tblSettings.dataSource=self
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return mutableDictionary.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("SettingsCell") as! SettingsTableViewCell!
if cell == nil
{
//tableView.registerNib(UINib(nibName: "UICustomTableViewCell", bundle: nil), forCellReuseIdentifier: "UICustomTableViewCell")
tableView.registerClass(SettingsTableViewCell.classForCoder(), forCellReuseIdentifier: "SettingsCell")
cell = SettingsTableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "SettingsCell")
}
cell.backgroundColor=UIColor.clearColor()
// Custom view options
let image=UIImage.init(named: "SettingsUnChecked")
imageView.image=image
cell.accessoryType = UITableViewCellAccessoryType.None
cell.accessoryView = imageView//UIButton(frame: CGRectMake(0, 0, 20, 20))
cell.accessoryView!.backgroundColor = UIColor.clearColor()
if let label = cell.lblName{
label.text = mutableDictionary[indexPath.row]
label.textColor=UIColor.whiteColor()
}
return cell
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}