我已將自定義方法(-(void)loadXML {}
)定義到我的appDelegate中。 現在我想在幾個viewController中使用它;現在我使用本地NSDate對象。NSDate作爲customMethod中的參數
NSDate *todayDate = [NSDate date];
NSString *XMLUrl = @"http://localhost/MyApp/GetXML?&aDate=";
NSString *urlString = [NSString stringWithFormat:@"%@%@", XMLUrl, todayDate];
tbxml = [[TBXML alloc] initWithURL:[NSURL URLWithString:urlString]];
而不是'todayDate'我想要'selectedDate';還有我如何在我的方法中添加一個bool,需要在我的方法中添加一些條件?
如何存儲'selectedDate'?而關於'開機'...你是什麼意思?你想在應用程序啓動時調用你的方法嗎? – makaron
' - (void)loadXML:(NSDate *)selectedDate {}'?? – beryllium
@makaron:對不起,我輸入錯了,我的意思是bool不能啓動;現在我的應用程序調用了一個方法來解析todayDate中的xml,但我使用(Si-Calendar)[https://github.com/voidparadox/Si-Calendar]並想從日曆中選擇日期解析xml –