Closed stephencelis closed 10 years ago
Yeah, you're right. As there is even no warning about this danger documented, this is a bad idea. I try to avoid method swizzling, as it feels not like a solution, more then a workaroud... and it has potential to introduce a lot more side-effects... but sometimes it's the last resort. Probably we could use KVO or NSNotificationCenter instead.
NSNotificationCenter or KVO's definitely the way to go if it's possible. Didn't know offhand if there were notifications or observable keys for the hooks.
See #28. :wink:
+[MRNavigationBarProgressView progressViewForNavigationController:] wraps the navigation controller delegate (if set), at runtime, with an MRMessageInterceptor. If, however, the delegate is set to something else after this occurs, the MRMessageInterceptor instance is deallocated and can cause crashes when accessed.
Probably want to hook into methods via swizzling instead of juggling delegates around to avoid this.