这是我的简单测试:
func testInitWithResponseAsDictionaryAndStatusFalse() {
let operation = WLMockRequestOperation()
operation.responseObject = "asdsa" //here is an error
}
错误是:
线程1:EXC_BAD_ACCESS(代码= 1,地址= 0x0)
这是我的WLMockRequestOperation
课程:
class WLMockRequestOperation: AFHTTPRequestOperation {
var myOverridenResponseObject: AnyObject?
override var responseObject: AnyObject? {
get {
return myOverridenResponseObject
}
set {
myOverridenResponseObject = newValue
}
}
}