I have recently completed my first for fun app in xcode (using 3.1.2). The application is a countdown to my birthday and everything seems to work. I have tried running the app in Instruments to make sure there is no leaks or anything else wrong with it.
Running the app in Instruments shows me there are no leaks in the app, however, when looking at ObjectAlloc, I am a little confused on what is going on. When the app launches, Net Bytes, # Net and Overall Bytes continue to rise. It might be that I am not releasing certain things that I should, but I am not sure what I am doing wrong.
Here is the code for the project. Can anyone please help me?
- (void)viewDidLoad {
//sets up the fond and the labels for the text to be displayed
[counterL setFont:[UIFont fontWithName:@"Zapfino" size:20]];
[counterB setFont:[UIFont fontWithName:@"Zapfino" size:20]];
counterL.textColor = [UIColor whiteColor];
counterB.textColor = [UIColor whiteColor];
counterL.text = @"D";
counterB.text = @"A";
[super viewDidLoad];
}
int year = [dateComponents year];
int month = [dateComponents month];
int day = [dateComponents day];
int hour = [dateComponents hour];
int minute = [dateComponents minute];
int second = [dateComponents second];
/* Do Stuff here with those ints to calculate the time remaining and
change the labels based on them
@end
Nope. That all looks perfectly fine and leak-free.
(The only thing I'd say is that in the app delegate's dealloc you should call [timer invalidate] rather than [timer release]. The timer you've created is autoreleased and only retained by its run-loop, rather than by you. If you did this anywhere else it would be a problem, but since it's in the app delegate dealloc which is only called as the app is exiting it really isn't a problem.)
Maybe you could post the rest of the -updateL method.
__________________ SimCap - Simple iPhone and iPad Simulator screen capture