I was looking at this question.
One of the answers shows how to use blocks to pass data backwards view the prepareForSegue
method. My understanding is t
sent data backward
declare block
in your secondViewController.h
file
@property (nonatomic, copy)void(^myBlock)(NSString *);
call block wherever you need to pass data from .m file of secondViewController
myBlock(@"this will displayed in firstViewController");
3.import above .h
file in your firstViewController
.m
file
and define your block
as
secondViewController *ref =[[secondViewController alloc ]init];
ref.myBlock =^void(NSString *data)
{
self.labelOffirstviewcontroller=data;
};