Search code examples
iosdelegatesuiimagepickercontrollernsobject

why can NSObject class be delegate to UIImagePickerController for instance?


i need explanation of how could NSObject Class be a delegate to any controller although NSObject is not a controller !?


Solution

  • The only requirement for a class to be a delegate for a particular class is to implement the protocol required. It doesn't depend upon its inheritance chain. It could be uiviewcontroller, uitableviewcontroller or simply the NSObject.

    If your class confirms to the required protocol then its a fair candidate to be the delegate.