I started testing ECSlidingViewController and after I tried to access FirstTopViewController
I have a big trouble - because in FirstToViewController
I already have ZBarReaderDelegate implemented and all examples of delegate are not triggering any method from my delegate.
Basically I have this stuff:
#import ...MyStuff...
#import "UnderRightViewController.h"
@interface FirstTopViewController : UIViewController <RightViewDelegate, ZBarReaderDelegate>
@property (weak, nonatomic) IBOutlet UITextView *labelTotal;
@end
#import "FirstTopViewController.h"
@implementation FirstTopViewController
- (void)setTotalViewController:(UnderRightViewController*)controller didTotalChange:(NSString*)total
{
//labelTotal.text = total;
NSLog(@"I'm here!!! and received %@", total);
}
From other side I have
#import <UIKit/UIKit.h>
#import "ECSlidingViewController.h"
@class UnderRightViewController;
@protocol RightViewDelegate <NSObject>
- (void)setTotalViewController:(UnderRightViewController*)controller didTotalChange:(NSString*)total;
@end
@interface UnderRightViewController : UITableViewController
@property (nonatomic, weak) id <RightViewDelegate> delegate;
@end
#import "UnderRightViewController.h"
@interface UnderRightViewController ()
@end
@implementation UnderRightViewController
@synthesize delegate;
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[delegate setTotalViewController:self didTotalChange:@"foo"];
}
@end
I'm trying this entire day solve this puzzle but I never get setTotalViewController
fired.
Thanks in advance.
Friend you did a small mistake, when you navigate from FirstTopViewController
to UnderRightViewController at that time you need to do this in FirstTopViewController.m:-
UnderRightViewController *obj = [[UnderRightViewController
alloc] initWithNibName:@"UnderRightViewController" bundle:nil];
obj.delegate = self; // u forget to assign protocol handler
[self.navigationController pushViewController:obj animated:YES];
[obj release];