0

I am extremely confused now while researching on datepicker just like the calendar app in ios.

I referred to this post, Expanding and collapsing UITableViewCells with DatePicker

and also apple's sample code https://developer.apple.com/library/ios/samplecode/DateCell/Introduction/Intro.html

One big confusion I have is that they seem to be declaring all the properties to their viewcontroller, where as I needed to create classes for the different cells and pull the IB outlets there.(i.e. I cannot declare my properties in my tableviewcontroller, if not i would receive an error about repeating content) Also, checking the apple's sample code, they do have 3 prototype cells and all without a class. (I thought that all custom cells needed a class?)

Community
  • 1
  • 1
Chris
  • 147
  • 2
  • 17
  • They only need a class if you want to make IBOutlets to them – dan May 12 '16 at 20:40
  • lets say I place the datapicker or a textfield in the custom cell, other than IB outlets, how else can you link it to the viewcontroller? Also, for the first link, he did have an IBOutlet and apparently they are all in his viewcontroller? – Chris May 12 '16 at 20:46
  • I don't see anything in the first link that suggests he is using prototype cells. You can link IBOutlets from static cells to your view controller. – dan May 12 '16 at 21:13
  • I feel so stupid. thanks for pointing me in the right direction! – Chris May 12 '16 at 21:53

1 Answers1

0

I think my misunderstanding of the above issues is due to not knowing when static cells and dynamic prototypes were used.

in the first reference, he used static cells, whereas I thought he used dynamic prototypes which became my source of confusion as my codes became very messy very quickly.

Chris
  • 147
  • 2
  • 17