I'm not really sure what this is doing. Is dateFormatter only settable the first time?
static NSDateFormatter *dateFormatter = nil;
if (dateFormatter == nil) {
dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
}
Normally I would read that to mean, set something to nil, then check if it's nil, but if I NSLog within the condtional, it only gets called once?
Extra points if you can explain static in more depth, i know it creates a global variable (?), but thats about it.