Welcome, Guest
Username Password: Remember me

Use selected item as detailtext
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: Use selected item as detailtext

Use selected item as detailtext 1 year, 7 months ago #1

I'm using SCSelectionCell and I couldn't figure out two things that I really need to do.

1. I couldn't find a way to use the selected item as a detail text for the selectioncell. I have a lot of selection cells and I need the application to show what the user selected for each item. So that, if they selected a wrong one they can go and change it back.

2. I already mentioned this in another topic but to be safe I'm asking it here too. Once the user selected the desired cell, I need the navigation controller to go back. As I mentioned I have at least 25-30 selection cells. It becomes to annoying to use the back button everytime the user select an item.

Thanks in advance.
  • leweo
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Karma: 0

Re: Use selected item as detailtext 1 year, 7 months ago #2

1- Sensible TableView automatically shows the selection in the cell's label. Are you sure that your SCSelectionCell.displaySelection property is TRUE?

2- We already developed this as an out-of-the-box functionality and will be giving you a BETA later on today. Thanks!
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: Use selected item as detailtext 1 year, 7 months ago #3

This is the code I have used to setup the selection cell.

SCSelectionCell *ruhsatCell = [SCSelectionCell cellWithText:@"Ruhsat Sahibi"
withBoundObject:mycar
withSelectedIndexesPropertyName:@"ruhsatsahibi"
withItems:[NSArray arrayWithObjects:@"Firma", @"Kişi", nil]
allowMultipleSelection:FALSE];
 
ruhsatCell.displaySelection = TRUE;
[section1 addCell:ruhsatCell];


And this is the code for the property in the class definition of the object.

@property (nonatomic, copy) NSString *ruhsatsahibi;


Thanks for your help.
  • leweo
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Karma: 0

Re: Use selected item as detailtext 1 year, 7 months ago #4

It doesn't even remember the selected item. I'm doing something wrong, but I can't figure out what.
  • leweo
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Karma: 0

Re: Use selected item as detailtext 1 year, 7 months ago #5

You're using the wrong constructor for your property type. For properties of type NSString, your code should look like this:

 
...
SCSelectionCell *ruhsatCell = [SCSelectionCell cellWithText:@"Ruhsat Sahibi"
withBoundObject:mycar
withSelectionStringPropertyName:@"ruhsatsahibi"
withItems:[NSArray arrayWithObjects:@"Firma", @"Kişi", nil]];
[section1 addCell:ruhsatCell];
...
 
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: Use selected item as detailtext 1 year, 7 months ago #6

It didn't work. I have no idea why it doesn't work, it's just a couple lines of code.
  • leweo
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Karma: 0
  • Page:
  • 1
  • 2
Time to create page: 1.74 seconds