Welcome, Guest
Username Password: Remember me

Custom Picker Cell
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: Custom Picker Cell

Custom Picker Cell 1 year, 1 month ago #1

Wondering if STV 2.0 will support custom picker for strings (arrays)? Example where using a picker to select categories like in some of the example core data projects.

Thanks!
  • chinjazz
  • OFFLINE
  • Senior Boarder
  • Posts: 48
  • Karma: 2

Re: Custom Picker Cell 1 year, 1 month ago #2

Hi Adam,

Normally, when you throw in any control into your custom cell (e.g. UITextField, UITextView, UISwitch, etc.), STV will automatically detect it and bind it to your object if you have objectBindings properly set up.

This is not the case however for a UIPickerView. This is due to several reasons, but mainly because a UIPickerView can have several columns, and thus there is no single object property that STV can automatically bind it to.

Having said that, STV 2.0 easily allows you to subclass SCControlCell, add your UIPickerView (either in code or in Interface Builder), and change the property values of the cell's bound object whenever the picker's value(s) change. Please tell me if you ever get stuck with doing this.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: Custom Picker Cell 1 year, 1 month ago #3

Hi Tarek,

Thanks for the feedback. I will give this a try, and appreciate the great support!

Best,
Adam
  • chinjazz
  • OFFLINE
  • Senior Boarder
  • Posts: 48
  • Karma: 2

Re: Custom Picker Cell 9 months, 1 week ago #4

Hi Tarek, I'm trying some custom UIPickerView items for an iPad app.

Would you mind sharing a bit of sample code showing how:

"STV 2.0 easily allows you to subclass SCControlCell, add your UIPickerView (either in code or in Interface Builder), and change the property values of the cell's bound object whenever the picker's value(s) change. "

I plan to have user generated picker cells (from preferences), and want to store the selected cell for each record.

Thanks!!!

Re: Custom Picker Cell 9 months ago #5

Hi David,

I created you a modified version of our Custom Cells sample application with a custom picker cell, please find that attached. You'll need to copy your STV files into the "Sensible TableView" folder.

Please tell me if this works well for you.
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
The following user(s) said Thank You: daviddelmonte, nishalthomasg

Re: Custom Picker Cell 9 months ago #6

brilliant, brilliant brilliant. Many thanks Tarek.. I'm sure this will be helpful to many people..

David
  • Page:
  • 1
  • 2
Time to create page: 1.57 seconds