title: 'self' used before super.init call
body: <p>I'm new to swift and I don't understand how to initialize a class.</p>
  <p>Succeeded is initialized in the class definition as <code>false</code></p>
  <pre><code>if (succeeded &amp;&amp; (time&gt;1000)){
     errormessage += &quot;;connection slow&quot;
   }
  </code></pre>
  <p>Time is initialized as</p>
  <pre><code>time = data[3].toInt()
  </code></pre>
  <p>Where data is</p>
  <pre><code>var data = split(raw_data) {$0 == &quot;,&quot;}
  </code></pre>
  <p>And <code>raw_data</code> is a string.</p>
  <p>Class Definition:</p>
  <pre><code>class geocodeObject: NSObject {
  </code></pre>
  <p><code>init</code> definition:</p>
  <pre><code>init(lat: String,long:String,userstate:String) {
  </code></pre>
  <p>(no super init of any kind)</p>
  <p>Full code with things cut way:</p>
  <pre><code>class geocodeObject: NSObject {
      //A type to store the data from the Reverse Geocoding API
      //Not a retriever
      
      //Options
      let API_KEY_TEXAS = &quot;9e4797c018164fdcb9a95edf3b10ccfc&quot;
      let DEV_MODE = true
      //Loading status
      var succeeded = false
      var errormessage = &quot;Not Initalized&quot; //Not nesscarilly a failure, could be slow connection
      var loadstate: String?
      //Most important info
      var street: String?; var housenumber: String?; var city: String?; var zip: String?
      //Metadata
      var time: IntegerLiteralType?; var statuscode: String?; var queryid: String?; var zip4: String?
      //Other geographical data
      var entirestreet: String?; var state: String?
      init(lat: String,long:String,userstate:String) {
          //userstate: State provided by user
          //state: State provided by Reverse Geocoder
  
          var url: String?
          var extra: String?
          if DEV_MODE{
              extra = &quot;&amp;notStore=true&quot;
          }
          else{
              extra = &quot;&quot;
          }
          url = &quot;http://geoservices.tamu.edu/Services/ReverseGeocoding/WebService/v04_01/HTTP/default.aspx?lat=&quot;+lat+&quot;&amp;lon=&quot;+long+&quot;&amp;apikey=&quot;+API_KEY_TEXAS+&quot;&amp;version=4.01&quot;
          if (userstate == &quot;nil&quot;){
              url = url! + extra!
              println(&quot;if&quot;)
          }
          else{
              url = url! + &quot;&amp;state=&quot;+state!+extra!
              println(&quot;else&quot;)
          }
          
          let raw_data = retrieveurl(url!)
          var data = split(raw_data) {$0 == &quot;,&quot;}
          //data[1] is API version used.
          statuscode = data[0]; queryid = data[2]; time = data[3].toInt(); entirestreet = data[4]; city = data[5]
          state = data[6]; zip = data[7]; zip4 = data[8]
          //Do street, housenumber, errormessage, succeeded
          if (state != userstate){
              println(&quot;user state not equal to state&quot;)
          }
          var splittedstreet = split(entirestreet!){$0 == &quot; &quot;}
          housenumber = splittedstreet[0]
          street = splittedstreet[1]
          println(statuscode)
          //Error message handling
          switch String(statuscode!){
              case &quot;200&quot;:
                  errormessage = &quot;Success&quot;
              case &quot;400&quot;:
                  errormessage = &quot;Unknown API key error&quot;
              case &quot;401&quot;:
                  ...
          //Time handling
          if (succeeded &amp;&amp; (time&gt;1000)){
              errormessage += &quot;;connection slow&quot;
          }
         }
          println(&quot;/GeocodingAPIWrapper.swift/.geocodeObject.init: Not Implemented&quot;)
      }
      
  }
  </code></pre>