mercredi 13 janvier 2016

Adapter design Pattern

1.) The article states that apple use's protocols to implement the adapter pattern, after following the tutorial I am a bit confused about what the line between properly applying this design pattern and simply using a protocol is.

2.) While implementing the protocol we define it in the interface file, and after use forward declaration to declare the protocol in the same file. I got a bit lost there, if anyone can clarify that would be awesome.

Finally, I understand why having two objects with strong pointers to each other creates a retain cycle, but I don't quite fully grasp why when we are creating a delegate we need to declare it weak : (i.e. @property (weak) id delegate;).

Sorry if this is a noob question, I'm just trying to learn.

thanks

Aucun commentaire:

Enregistrer un commentaire