Extra Argument Userinfo in Call

Extra argument 'userinfo' in call CLLocation

Modify code for that:

dispatch_async(dispatch_get_main_queue(), { () -> Void in
NSNotificationCenter.defaultCenter().postNotificationName(SOCurrentLocationDidChangeNotification, object: nil, userInfo: ["kSOLocationKey" : currentLocation])
})

Extra Argument In A Call

According to the document:

- Data Request - Simple with URL string

// Alamofire 3

Alamofire.request(.GET, urlString).response { request, response, data, error in
print(request)
print(response)
print(data)
print(error)
}

// Alamofire 4

Alamofire.request(urlString).response { response in // method defaults to `.get`
debugPrint(response)
}

So you need to remove .GET argument

Extra argument 'completion' in call

You had an extra argument in your method's signature and some erroneous braces.

@IBAction func createAccount (_ sender: AnyObject) {
Auth.auth().createUser(withEmail: emailField, password: passwordField) { (user, error) in
if error != nil {
print("Can't Create User")
} else {
if let user = user {
self.userUid = user.user.uid
}
}
self.uploadImg()
}
}

Extra argument Swift?

You are probably trying to use a Swift 1.x call with a Swift 2.x compiler.

Swift went through a large change between 1 and 2, now the method (and most others that report errors) throws an exception instead of passing in an error argument.

The current documentation shows the signature as:

 class func JSONObjectWithData(_ data: NSData,
options opt: NSJSONReadingOptions) throws -> AnyObject

To see how to hand exceptions look at the documentation.

extra argument in call when creating NSManagedObjectModel

The mapping closure takes an URL as argument and returns the model,
so the signature should be

(url: NSURL) -> NSManagedObjectModel

And

NSManagedObjectModel(contentsOfURL: url!); // errors here

is wrong because url is not an optional here. On the other hand,
NSManagedObjectModel(contentsOfURL: url) returns an optional
which needs to be unwrapped.

Putting it together:

func createModels(test: [NSURL]) -> [NSManagedObjectModel]  {
let newData = test.map {
(url: NSURL) -> NSManagedObjectModel in
return NSManagedObjectModel(contentsOfURL: url)!
}
return newData
}

or with shorthand parameter notation:

func createModels(test: [NSURL]) -> [NSManagedObjectModel]  {
let newData = test.map {
NSManagedObjectModel(contentsOfURL: $0)!
}
return newData
}


Related Topics



Leave a reply



Submit