代码之家  ›  专栏  ›  技术社区  ›  yozhik

具有多个参数的方法的选择器

  •  0
  • yozhik  · 技术社区  · 15 年前

    嗨,我需要为这个方法编写选择器。我该怎么做?谢谢!

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
    

    这是我需要的代码:

    UIBarButtonItem *deleteButton = [[UIBarButtonItem alloc]  initWithTitle:@"Delete User" style:UIBarButtonItemStyleBordered target:self action:@selector(my_button_click_here_is_need_a_selector:)];
    
    [toolbar setItems:[NSArray arrayWithObjects: deleteButton, nil]];
    
    1 回复  |  直到 12 年前
        1
  •  2
  •   Community Mohan Dere    9 年前

    How to pass method arguments to a selector @selector(tableView:cellForRowAtIndexPath:)

    -initWithTitle:… action

    -(IBAction)clicked;
    -(IBAction)clicked:(id)sender;
    -(IBAction)clicked:(id)sender withEvent:(UIEvent*)event;
    

    -tableView:cellForRowAtIndexPath: