MugunthKumar/MKNetworkKit — pull request #165 by milancermak (2012-08-09 09:41:14+00:00)
Title: A more defensive version of isEqual in MKNetworkOperation

My colleague encountered an issue with the isEqual method of MKNetworkOperation.

He customized MKNetworkOperation by adding a timeout when executing the operation so it would not hang and would get killed in some time. He used performSelector:withObject:afterDelay: and cancelPreviousPerformRequestsWithTarget:selector:object: to achieve this. It caused the MKNetworkOperation to be compared to other objects, notably UITapRecognizer (not UITapGestureRecognizer, this was some private object). As a result the uniqueIdentifier method was called on the UITapRecognizer instance and that's where our app crashed, for obvious reasons.

This patch prevents similar behavior by comparing if a given object is an instance or inherits from MKNetworkOperation class.