Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Hello you can set the property <code>"tag"</code> on button to identify it</p> <p>Uncomment </p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; } </code></pre> <p>And type : </p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; self.button.tag = 100001; self.button2.tag = 100002; } </code></pre> <p>then turn in <strong>DatePickerModalExampleViewController.h</strong><br> <code>(IBAction)buttonPressed</code> <strong>to</strong> <code>(IBAction)buttonPressed:(id)sender;</code></p> <p>Then turn in <strong>DatePickerModalExampleViewController.m</strong></p> <p><code>-(IBAction)buttonPressed</code> <strong>to</strong> <code>-(IBAction)buttonPressed:(id)sender</code></p> <p>and in <strong>DatePickerModalExampleViewController.m</strong> this method could be like that :</p> <pre><code> -(IBAction)buttonPressed:(id)sender { switch(((UIButton*)sender).tag) { case 100001 NSLog(@"Button 1 was pressed"); DatePickerViewController *datePickerViewController =[DatePickerViewController alloc] initWithNibName:@"DatePickerViewController" bundle:nil]; datePickerViewController.delegate = self; [self presentModalViewController:datePickerViewController animated:YES]; [datePickerViewController release]; break; case 100002 : NSLog(@"Button 2 was pressed"); // some code break; } } </code></pre> <p>As you use the interfacebuilder I'm not friend with it but you must relink your actions I'm writting from my PC so without xcode some code can contains syntax error be carreful. but it's the main idea.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload