问题
I am receiving the error below:
My protocol looks like this:
protocol RecorderDelegate {
func finishedRecordingWithUrl(URL: NSURL)
}
Can someone explain why self is NOT conforming to the protocol when it appears that it is?
回答1:
At the time you are setting self as reference, self does not exist. Try to set it later, let say viewDidLoad or make it lazy.
Btw make the reference on delegate weak, otherwise you are creating reference cycle and your view controller instance is never going to dealloc and will create memory leak.
来源:https://stackoverflow.com/questions/38961146/value-of-type-nsobject-viewcontroller-does-not-conform-to-specified-t