cocoa - How to initialize NSTableRowView subclass? -


the compiler crashses on line 3 , cant find information on nstablerowview initializers anywhere

class itemrowview: nstablerowview {     convenience override init(frame: nsrect) {         self.init(frame: frame) // exc bad access         self.draggingdestinationfeedbackstyle = nstableviewdraggingdestinationfeedbackstyle.none     } 

first, init( frame: nsrect )is designated initializer, keyword convenience wrong in place. meant call super initializer own method recursively. @ last you'll need implement required initializer init?(coder: nscoder)

the following code should going:

class itemrowview: nstablerowview {     override init(frame: nsrect) {         super.init(frame: frame) // super - not self         self.draggingdestinationfeedbackstyle = nstableviewdraggingdestinationfeedbackstyle.none     }      required init?(coder: nscoder) {         // write useful here, or leave default implementation         fatalerror("init(coder:) has not been implemented")     } } 

Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -