i created a Subclass Inherit from UINavigationController, and all my Navigation Controllers Inherit from this class, when the app is running the viewDidLoad is called from my class, but the VIewWillAppear is not called any one have an idea ? im adding the subclass ViewWillAppear:
//********************************************************************************************
//** viewWillAppear
//*********************************************************************************************
- (void) viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self replacePng];
self.title = @"";
}
this is the class:
//
// MyViewController.m
// Nifgashim
//
// Created by shim wi on 7/15/14.
// Copyright (c) 2014 Oded. All rights reserved.
//
#import "MyViewController.h"
@interface MyViewController ()
@end
@implementation MyViewController
@synthesize interstitial;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
sing = [singData sharedInstance];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
//******************************************************************************************** ******
//** viewWillAppear *
//**************************************************************************************************
- (void) viewWillAppear:(BOOL)animated{
if (sing.adInt == sing.adCount)
{
[self loadInterstitial];
}
else{
sing.adCount++;
}
[super viewWillAppear:animated];
}
#pragma mark GADRequest implementation
//*********************************************************
//* GADRequest implementation *
//*********************************************************
- (GADRequest *)request {
GADRequest *request = [GADRequest request];
return request;
}
#pragma mark GADInterstitialDelegate implementation
//*********************************************************
//* interstitialDidReceiveAd *
//*********************************************************
- (void)interstitialDidReceiveAd:(GADInterstitial *)interstitial {
[self.interstitial presentFromRootViewController:self];
}
#pragma mark didFailToReceiveAdWithError implementation
//*********************************************************
//* didFailToReceiveAdWithError *
//*********************************************************
- (void)interstitial:(GADInterstitial *)interstitial
didFailToReceiveAdWithError:(GADRequestError *)error {
}
//*********************************************************
//* loadInterstitial *
//*********************************************************
-(void)loadInterstitial{
self.interstitial = [[GADInterstitial alloc] init];
self.interstitial.delegate = self;
self.interstitial.adUnitID = MY_BANNER_UNIT_ID;
[self.interstitial loadRequest:[self request]];
}/*
#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