使用覆盖对象在属性上执行EXC BAD ACCESS

时间:2015-09-01 14:11:29

标签: ios swift

这是我的简单测试:

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
        }
    }
}

0 个答案:

没有答案