Quantcast
Channel: Whether C# interfaces and objective c @prototypes are same? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by Oscar Gomez for Whether C# interfaces and objective c @prototypes are same?

$
0
0

1) I believe you are referring to protocols, formal protocols those woth the @protocol notation, are almost exactly the same as a C# interface, the diferrence ks that the protocol allows you to specify some optional methods, i.e. Some methods that you are not forced to implement.

2) A property is the equivalent of an instance variable for the class, and it can be @synthetized to automatically generate the setter and getters for this property. It can be declared atomic or non atomic, which means if the setter and getters will be performed as a singlw operation or not. It can also be declared as retain, copy or assign. Retain means that the ivar will send a retain msg to the obj in the generated setter, copy means that the setter will clone the instance and then send it a retain msg, while assign means that the value will just be assigned without a retain msg.

Hope that helps.


Viewing all articles
Browse latest Browse all 5

Trending Articles