Getting an error when dismissing a view controller, not seen anything like it before, and not much about it on the internet.
heres the error: * Assertion failur
In the target view controller define delegate and protocol:
@class TargetVC;
@protocol TargetVCDelegate
-(void)dismissTargetVC:(TargetVC*)vc;
@end
@interface TargetVC : UIViewController
@property (nonatomic, weak) id delegate;
@end
when you done the job at the target view controller call the delegate:
if( [self.delegate respondsToSelector:@selector(dismissTargetVC:)])
{
[self.delegate dismissTargetVC:self];
}
The implementation of the delegate protocol should be:
-(void)dismissTargetVC:(TargetVC*)vc
{
[vc dismissViewControllerAnimated:YES completion:nil];
// you can get relevant data from vc as you still hold reference to it in this block
// your code ...
}