diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m index 7ec57b8..ee459f5 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m @@ -74,7 +74,11 @@ - (void)setDelegate:(NSObject *)delegate { _delegate = delegate; - _delegateObject = [DelegateObject createWithDelegateForAll:delegate]; + if ([delegate respondsToSelector:@selector(delegateObject)]) { + _delegateObject = [delegate performSelector:@selector(delegateObject)]; + } else { + _delegateObject = [DelegateObject createWithDelegateForAll:delegate]; + } } - (nullable instancetype)initWithPageJSON:(nullable NSDictionary *)pageJSON modulesJSON:(nullable NSDictionary *)modulesJSON requestParameters:(nullable MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegate:(nullable NSObject*)delegate { diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 1e85f04..18576ec 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -908,7 +908,11 @@ - (void)setDelegate:(NSObject *)delegate { _delegate = delegate; - _delegateObject = [DelegateObject createWithDelegateForAll:delegate]; + if ([delegate respondsToSelector:@selector(delegateObject)]) { + _delegateObject = [delegate performSelector:@selector(delegateObject)]; + } else { + _delegateObject = [DelegateObject createWithDelegateForAll:delegate]; + } } - (nullable instancetype)initWithRequestParameters:(nullable MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegate:(nullable NSObject*)delegate backgroundLoad:(BOOL)backgroundLoad { diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.m b/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.m index 84865ad..376fb5b 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.m +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.m @@ -39,7 +39,7 @@ } + (void)logWithDelegateLoadFinished:(nullable MVMCoreLoadObject *)loadObject loadedViewController:(nullable UIViewController *)loadedViewController error:(nullable MVMCoreErrorObject *)error { - if ([[MVMCoreObject sharedInstance].loggingDelegate respondsToSelector:@selector(logWithDelegateLoadFinished:loadedViewController:error:)]) { + if ([[MVMCoreObject sharedInstance].loggingDelegate respondsToSelector:@selector(logLoadFinished:loadedViewController:error:)]) { [[MVMCoreObject sharedInstance].loggingDelegate logLoadFinished:loadObject loadedViewController:loadedViewController error:error]; } }