I am working on a gist: PasteboardWatcher.swift in which I invoked a NSTimer object like this:
func startPolling () {
// setup and start of timer
timer = NSTimer.scheduledTimerWithTimeInterval(2, target: self, selector: Selector("checkForChangesInPasteboard"), userInfo: nil, repeats: true)
}
where definition of checkForChangesInPasteboard
function is:
func checkForChangesInPasteboard() {
// definition continues..
}
I don't want to expose function checkForChangesInPasteboard
to other classes, therefore I want to mark it as private but for some reason when I do so, it throws below exception:
-[PasteboardWatcher.PasteboardWatcher checkForChangesInPasteboard]: unrecognized selector sent to instance
If I don't mark it as private it works perfectly.
Is there any way I can keep this method as private, hiding it from other classes?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…