tags:

views:

75

answers:

3

how can i fire button action event without any user action?

pls give me any sample..

A: 

If user dont want to fire action on button,why do you show button,without showing button,u can do action.I think u need dynamic code (without interface builder),the code is

 [button1 addTarget:self action:@selector(action1:) forControlEvents:UIControlEventTouchUpInside];

 -(void) action1:(id)sender;

{ } hope this will help....

Mikhail Naimy
But, above code should be situated on viewDidLoad event.
RRB
i think u may use NSNotification
Mikhail Naimy
A: 

Actually i am using tabbarcontroller. In tabbar having one view.In that tab i call one function it will open the another viewcontroller.

First * sVC = [[First alloc] initWithNibName:@"First" bundle:[NSBundle mainBundle]]; [self presentModalViewController:sVC animated:YES];

Opened viewcontrller having one button.when user click that button i want to close the view and also i want to fire the button in first tabbar view.

pls help me

Bala
@Bala: this sounds like a part of your question. Here you have posted it as an "answer". The better way is to Edit your question and add this information there. This is not the answer.
progrmr
You know the action of the other button, so you should call it directly. Or use any of the methods above.
Eiko
+1  A: 

UIButtons are subclass of UIControl. They use the sendActionsForControlEvents: method to send out events. You can call that method on the button (or control) to have the actions sent.

[theButton  sendActionsForControlEvents: UIControlEventTouchUpInside];
progrmr