I am using a external library and one of my view controller is registering as delegate for a class in that framework. Now, at one place I want to execute some code on this d
Using performSelector instead of directly calling a method will remove warning for sure.
Write a new protocol that extends the old one, and conform to that, something like:
@protocol MyNewProtocol <OtherProtocol>
- (void) myCoolMethod;
@end
The property libraryController.delegate
is defined in the external library to conform to LibraryDelegate
. Try to downcast to MyExtendedDelegate
before you call the method from your extended protocol.
if ([self.libraryController.delegate conformsToProtocol:@protocol(MyExtendedDelegate)])
{
id<MyExtendedDelegate> extendedDelegate = (id<MyExtendedDelegate>)self.libraryController.delegate;
if ([extendedDelegate respondsToSelector:@selector(actionTaken)])
{
[extendedDelegate actionTaken];
}
}