@selector() in Swift?

后端 未结 23 2541
清酒与你
清酒与你 2020-11-21 15:24

I\'m trying to create an NSTimer in Swift but I\'m having some trouble.

NSTimer(timeInterval: 1, target: self, selector: test(), us         


        
23条回答
  •  再見小時候
    2020-11-21 16:01

    For future readers, I found that I experienced a problem and was getting an unrecognised selector sent to instance error that was caused by marking the target func as private.

    The func MUST be publicly visible to be called by an object with a reference to a selector.

提交回复
热议问题