1

I am working on Apple Swift Programming . I am taking a variable that is initialised in ViewDidLoad( ) method. But it shows an error like "*Class ABc has no initializer *" . After much searching about this, I got a suggestion to use init() method to initialise the variable which you want use. Yet still, I am getting an error like this .enter image description here

I am not able to make out where am I going wrong here. Kindly guide me on this. Thanks in advance.

1
  • Super.init isn't called before returning from initializer pretty much clear Commented Jun 16, 2014 at 11:36

1 Answer 1

7

Super.init isn't called before returning from initializer

Error is pretty much clear. You are not calling the super class init(). But for UIViewController you should use any designated initialzer i guess. Try to use init(coder aDecoder: NSCoder!)

 init(coder aDecoder: NSCoder!)
    {
        super.init(coder: aDecoder)
        // Your intializations
    }
Sign up to request clarification or add additional context in comments.

4 Comments

I have add this method but it given the error like "super.init isn't called before returning from initializer" What is mean of this error and how i can this error.
like init(coder aDecoder: NSCoder!) { // Your intializations super.init(coder: aDecoder) }
this doesn't answer the question
@botbot Have you asked any question here? Then how do you say it doesn't?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.