I have a variable lastPostsGrabbedCounter
, an NSNumber
, that is defined below.
.h
NSNumber *lastPostsGrabbedCounter;
@property (nonatomic, retain) NSNumber *lastPostsGrabbedCounter;
.m
@synthesize postDetailViewController, lastPostsGrabbedCounter;
- (void)viewWillAppear:(BOOL)animated {
self.lastKnownLocation = [[CLLocation alloc] init];
self.lastPostsGrabbedCounter = [[NSNumber alloc] initWithInt:25];
[self showActivityViewer];
}
This .m file is a table controller in my main view. When the app is loaded this viewWillAppear
gets called, but if I navigate to another TAB and come back and I try to use the lastPostsGrabbedCounter
var, I it shows it as nil?
Why isn't it retained when I navigate away?