ios - Failable initializer in Xcode 6.1 -


I have a custom UITableViewCel (nothing fancy) that works perfectly on Xcode 6.0. When I try to compile it with Xcode 6.1, the compiler shows the following error:

A non-flaalileizer with the phonastic initiator 'init (style: again user :)' Written 'init? '

Here is the cell's code:

  Class Main Television: UITableViewCell {override init (style: UITableViewCellStyle, reuseIdentifier: String?) {Super. Init (style: style, reuseIdentifier: reuseIdentifier) ​​self.setup ()} required init (coder aDecoder: NSCoder) {super.init (coder: aDecoder) self.setup ()} func setup () {& lt; ... and gt; ;}}  

The compiler's proposal as a solution 'init?' Promote Failure with :

  override init? (Style: UITableViewCellStyle, reuseIdentifier: string?) {Super.init (style: style, reuseIdentifier: reuseIdentifier) ​​self.setup ()} I'm a little confused  (Non) functional initial  and how should it be used and overridden? 

with SWIFT 1.1 (in Xcode 6.1) Apple Fazal Starters - Can the starters return zero instead of an example to you ? After entering init after , you can define a Fism initiator. The signature of the overseas you are attempting to override has changed between Xcode 6.0 and 6.1:

  // Xcode 6.0 init (style: UITableViewCellStyle, reuseIdentifier: String?) / / Xcode 6.1 init? To override (style: UITableViewCellStyle, reuseIdentifier: string?)  

you will need to make the same changes to your initiator, and handle the zero case Take it (alternatively by specifying) that way when creating a cell

You can read more about.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

c# - NewtonSoft JArray - how to select multiple elements with LINQ -

javascript - amcharts makechart not working -