xcode - 'Error' cannot be constructed because it has no accessible initializers -


not sure if error in code or glitch in xcode.

i have class (simplified version sake of clarity)

public class error {      let errors: [ (title: string, message: string)] =         [("some error title","some error message"),          ("another error title", "another error message")          ]      var errorno : int      init (_ errorno: int) {          self.errorno = errorno     }      func title () -> string {         return self.errors[self.errorno].title     }      func message () -> string {         return self.errors[self.errorno].message     } } 

in class have

if somecondition {     return error (0) } 

now strange thing... compiles , runs if let xcode sit idle few moments (not fastest computer i'm using), xcode giving me infamous red dots (with exclamation marks) error:

'error' cannot constructed because has no accessible initialisers

next each time error(0) (whatever int use in constructor)

i can compile , run again , errors dissappear , reappear

using xcode version 8.1 (8b62)

******** see comments **** additional info ********

still 1 (similar problem after renaming error apperror)

func dosomething (blah: int, test : string) -> apperror {      code     return apperror(1) } 

it compiles , runs after time error pops next func dosomething

use of undeclared type 'apperror'


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -