I’ve defined my custom method ( -(void)loadXML {} ) into my appDelegate.
Now I’d like to use it in severals viewControllers; Right now I’m using local NSDate objects.
NSDate *todayDate = [NSDate date];
NSString *XMLUrl = @"http://localhost/MyApp/GetXML?&aDate=";
NSString *urlString = [NSString stringWithFormat:@"%@%@", XMLUrl, todayDate];
tbxml = [[TBXML alloc] initWithURL:[NSURL URLWithString:urlString]];
instead of ‘todayDate’ I’d like to have ‘selectedDate’; also how I add a bool to my method, need to have some conditions into my method?
Here’s what you can do:
And for your benefit, I’m showing you how to use a NSDateFormatter and a generic C ternary conditional.
I hope this helps you out!