문제

i created an navigationitem rightBarButtonItem in the following code and I would like to trigger its event programmatically ( just like click the bar button ). search everywhere but can't find how to do it. does anyone know the method? thx a lot.


    UIBarButtonItem *reloadbutton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(Action1:)];
 self.navigationitem.rightBarButtonItem = reloadbutton;
 [reloadbutton release];
 
도움이 되었습니까?

해결책

Since you already have an action method that you're using with the button, you can just call the method yourself; for example,

 [self Action1:self.navigationItem.rightBarButtonItem];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top