Wednesday, 15 February 2012

ios - Detecting selected cell using SWTableViewCell -


I have applied the SWTableView class from

I

This is working fine, but I do not know How to get value when clicking on cell objects when exposed buttons

This is how I perceive object on cellForRowAtIndexPath method:

  NSString * date = [self stringValueOfDictionaryObject: (ID) [[Historical fielding objectindex: indexpath.ro] valueify: @ "date"]];  

I have added three buttons that show how the user swipe the cell. To add the button I need, to get the value of the selected row object. Mainly, when I need to retrieve the click string date on the button "more"

it has the DidTriggerRightUtilityButtonWithIndex method

  - (zero) swipeableTableViewCell:. (SWTableViewCell *) cell didTriggerRightUtilityButtonWithIndex: (NSInteger) index {switch (index) {case 0: {// more button is pressed UIActionSheet * shareActionSheet = [[UIActionSheet alloc] initWithTitle: @ "Share" Representative: cancelButtonTitle zero: @ "Cancel" DestructiveButtonTitle: Zero OtherButtonTitles: @ "Share on Facebook", @ "Share on Twitter", Zero]; [Share Action Sheet Show Inview: Self. Weave]; [Cell hide failures] break; } Case 1: {// other button is pressed UIActionSheet * shareActionSheet = [[UIActionSheet alloc] initWithTitle: @ "Share" Representative: cancelButtonTitle zero: otherButtonTitles zero: "Cancel" destructiveButtonTitle @ "Share on Facebook", @ "Share on twitter", zero]; [Share Action Sheet Show Inview: Self. Weave]; [Cell hide failures] break; } Case 2: {// Delete button is pressed NSIndexPath * cellIndexPath = [self.tableView indexPathForCell: cell]; [Self.tableView deleteRowsAtIndexPaths: @ [cellIndexPath] withRowAnimation: UITableViewRowAnimationLeft]; break; } Default: Break; }}  

I have solved it like this:

  NSLog (@ "INDEXPATH =% @", [self stringVoloxoxbox object: (ID) [[Historical Services ObjectIndex: Cellindexpath.ro]  

I now retrieve an object value from the selected row I can ...


No comments:

Post a Comment