I had a similar question yesterday and I got part of my answer from there. But the thread got closed so this is kinda my follow-up question thread :)
original Q: How can I have a toolbar button/item change its date with [NSDate date]
?
original A:
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MM/dd/yyyy"];
[formatter setTimeZone:[NSTimeZone timeZoneWithName:@"UTC"]];
yourToolBarItem = [NSString stringWithFormat:@"%@", [formatter stringFromDate:[NSDat date]]];
Followup Q: I have the toolbar made directly from navigationcontroller in storyboard . How can I reach its items programaticly and change item/object at index 0 to the current date.
I can't get my head around this. I have tried loads of types with [self navigationController.ToolbarItems]
replacObjectAtIndex
but a big no for me so far.
Very helpful for any directive and help.