Sunday, 15 January 2012

iphone - Working with the Kal calendar -



iphone - Working with the Kal calendar -

currently have implemented kal calendar within 1 of tabbarviewcontrollers , layout perfect. want create button user clicks , calendar instantly highlights current day in monthly calendar view, button "today".

the layout 1 time again perfect, lastly line of code listed below gives problems.

*** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[secondviewcontroller showandselecttoday]: unrecognized selector sent instance 0x927e6f0'

here implementation have made secondviewcontroller class superclass of uiviewcontroller.

- (void)viewdidload { kalviewcontroller *calendar = [[kalviewcontroller alloc] init]; [self.view addsubview:calendar.view]; [self addchildviewcontroller:calendar]; [[self navigationcontroller] initwithrootviewcontroller:calendar]; calendar.navigationitem.rightbarbuttonitem = [[uibarbuttonitem alloc] initwithtitle:@"today" style:uibarbuttonitemstylebordered target:self action:@selector(showandselecttoday)]; }

goal: give "today" functionality not through app delegate seperate class, secondviewcontroller.

note: holiday illustration app "today" behave holiday illustration project implements today button behaviors within app delegate.

you need store kalviewcontroller instance variable (let's assume _calendar) , implement next method in secondviewcontroller:

- (void)showandselecttoday { [_calendar showandselectdate:[nsdate date]]; }

iphone ios xcode ios6 kal

No comments:

Post a Comment