Programmatically UITableView using swift

前端 未结 4 1610
广开言路
广开言路 2020-12-30 00:59

I\'m trying to create a simple tableView programmatically using swift, so I wrote this code on \"AppDelegate.swift\" :

    func application(application: UIA         


        
4条回答
  •  独厮守ぢ
    2020-12-30 01:34

    In Xcode 6 Beta 4

    Removing

    init(style: UITableViewStyle) {
        super.init(style: style)
    }
    

    will do the trick. This is caused by different initializer behavior between Obj-C and Swift. You have created a designated initializer. If you remove it, all initializers will be inherited.

    The root cause is probably in -[UITableViewController initWithStyle:] which calls

    [self initWithNibName:bundle:]
    

    I actually think this might be a bug in the way Obj-C classes are converted to Swift classes.

提交回复
热议问题