I've been trying to really understand delegates but am stuck on the purpose/reason one would want to use them. I understand how to implement them, use them, etc. but what it seems to me that assigning self.delegate = someObject
is just syntactic sugar for using someObject
For example, I could use the delegate approach and do the following:
self.delegate = someObject;
// Maybe we do some additional stuff here
[self.delegate doSomething];
But couldn't I also just do:
[someObject doSomething]
I know delegation is nice because it lets you communicate between objects of different classes. I guess my issue is I don't see why you can't do this without delegation while not exposing the entire classes to the respective objects. My guess is I am missing something to do with OOP concepts here. Is it a DRY thing?