|
//
// myAskCenterHomeController.m
// ThePaperHD
//
// Created by scar1900 on 15/3/30.
// Copyright (c) 2015年 scar1900. All rights reserved.
//
#import "myAskCenterHomeController.h"
#import "MLNavigationController.h"
#import "myAskCenterController.h"
#import "topicContentController.h"
@interface myAskCenterHomeController ()<myAsksCenterDelegate>
@property(nonatomic, strong)MLNavigationController *navigationController;
@property(nonatomic, strong)myAskCenterController *homeVC;
@end
@implementation myAskCenterHomeController
@synthesize delegate;
@synthesize isNeenHold;
- (void)viewDidLoad {
[super viewDidLoad];
// [MobClick event:@"16"];//【需求】统计-iPad(BUG:4571)
// Do any additional setup after loading the view.
self.view.backgroundColor =[UIColor clearColor];
self.homeVC = [[myAskCenterController alloc]init];
self.homeVC.myAsksCenterDelegate =self;
[self addChildViewController:self.homeVC];
self.navigationController = [[MLNavigationController alloc]initWithRootViewController:self.homeVC];
self.navigationController.view.backgroundColor = [UIColor clearColor];
self.navigationController.view.frame = self.view.bounds;
[self.view addSubview:self.navigationController.view];
[self addChildViewController:self.navigationController];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pushToDetailContent:) name:PUSHTODETAILCONTENT object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pushToTopicInfoContent:) name:PUSHTOTOPICDETAILCONTENT object:nil];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.isNeenHold = NO;
}
- (void)pushToDetailContent:(NSNotification*)noti {
self.isNeenHold = YES;
NSDictionary *dic = noti.userInfo;
id data = dic[@"data"];
if ([self.delegate respondsToSelector:@selector(goToContent:)]) {
[self.delegate goToContent:data];
}
}
-(void)askCenterToHomeTopic:(TopicInfoBO *)topic user:(userBO *)user{
if ([self.delegate respondsToSelector:@selector(gotoTopicInfo:user:)]) {
[self.delegate gotoTopicInfo:topic user:user];
}
}
-(void)pushToTopicInfoContent:(NSNotification *)noti{
NSDictionary *dic = noti.userInfo;
id data = dic[@"data"];
TopicInfoBO *topic = (TopicInfoBO *)data;
userBO *user = dic[@"user"];
if ([self.delegate respondsToSelector:@selector(gotoTopicInfo:user:)]) {
[self.delegate gotoTopicInfo:topic user:user];
}
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:[TPUserDefault instance].msgMark];
[dic setValue:@(0) forKey:@"questionMark"];
[dic setValue:@(0) forKey:@"attendMark"];
[TPUserDefault instance].msgMark = dic;
if ([self.delegate respondsToSelector:@selector(hasAppearMyAskCenter)]) {
[self.delegate hasAppearMyAskCenter];
}
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)gotoGambitInfo:(commentObjectVO *)comment{
if ([self.delegate respondsToSelector:@selector(gotoGambit:)]) {
[self.delegate gotoGambit:comment];
}
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
|