我开始测试ECSlidingViewController并且在我尝试访问之后FirstTopViewController
遇到了一个大麻烦 - 因为FirstToViewController
我已经实现了ZBarReaderDelegate 并且委托的所有示例都没有触发我的委托的任何方法。
基本上我有这些东西:
FirstTopViewController.h
#import ...MyStuff...
#import "UnderRightViewController.h"
@interface FirstTopViewController : UIViewController <RightViewDelegate, ZBarReaderDelegate>
@property (weak, nonatomic) IBOutlet UITextView *labelTotal;
@end
FirstTopViewController.m
#import "FirstTopViewController.h"
@implementation FirstTopViewController
- (void)setTotalViewController:(UnderRightViewController*)controller didTotalChange:(NSString*)total
{
//labelTotal.text = total;
NSLog(@"I'm here!!! and received %@", total);
}
从另一边我有
UnderRightViewController.h
#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
UnderRightViewController.m
#import "UnderRightViewController.h"
@interface UnderRightViewController ()
@end
@implementation UnderRightViewController
@synthesize delegate;
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[delegate setTotalViewController:self didTotalChange:@"foo"];
}
@end
我整天都在尝试解决这个难题,但我从未被setTotalViewController
解雇。
提前致谢。