Cannot Call Value of Non-Function Type 'Nshttpurlresponse' Alamofire Objectmapper

Alamofire: Cannot call value of non-function type 'NSHTTPURLResponse?'

If this is, as you say, working fine in the other file a couple of suggestions come to mind.

  • Mark the class you are extending as public. (Swift classes are internal by default.)
  • Open the document inspector pane on the right of your class, make sure your target membership includes the target you are compiling for.

Let me know if your issue still persists and I will investigate further.

Cannot call value of non-function type '((UInt) - Data?)!' with Alamofire 4

I do see one issue with the line in question. Try not using the raw value of the enum like so:

let stringValue = value as! String
multipartFormData.append(data: stringValue.data(using: .utf8)!, name: key)

Class subscript cannot call value of non-function type

You need to use square brackets for subscript. This works in the playground:

class Grid {
var nodes: [[Int]] = [[1],[2],[3]]

subscript(row: Int, column: Int) -> Int {
get {
return self.nodes[row][column]
}
}
}

let grid = Grid()
let node = grid[0, 0] // node == 1

Swift 2 syntax error: Cannot call value of non-function type 'Int'

count is the swift 1.2 way,
in swift 2.0 use myString.characters.count (any array can be counted that way)

so:

extension String {
func size()->Int{
return self.characters.count
}
}

Xcode error: 'Cannot assign to value: function call returns immutable value' in table views

It should be:

places[indexPath.row]["name"] as! String

As the type is Any and you need to specify it as String, since label expects Strings.



Related Topics



Leave a reply



Submit