@property (nonatomic, copy) void(^doTransferMsg)(NSString *_msg);
- (IBAction)transferText:(UIButton *)sender {
if (_doTransferMsg) {
_doTransferMsg(@"hello there");
_doTransferMsg = nil;
}
[self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)LoadDetailView:(UIButton *)sender {
[ibTextLabel setText:nil];
DetailViewController *_curDetail = [[DetailViewController alloc] initWithNibName:@"DetailViewController"
bundle:nil];
[_curDetail setDoTransferMsg:^(NSString *_msg) {
dispatch_async(dispatch_get_main_queue(), ^{
[ibTextLabel setText:_msg];
});
}];
[self.navigationController pushViewController:_curDetail
animated:YES];
[_curDetail release];
}