Search code examples
iphonepicker

Why does a Picker need a Datasource?


As I understand, Pickers have an Delegate class. Why's there an additional Datasource needed?


Solution

  • There is a difference between a delegate and a datasource.

    A datasource is typically used to configure what is displayed by a control. "How many rows do you have?", "What should i display in this row", etc.

    A delegate is usually used to let the controlling code know that something happened. "Hey someone selected this row.", "Hey someone started editing this row."