Is the `id` type used often writing Objective C programs? -
i'm reading book "programming in objective c" , explained not much on id
type , didn't give much exercise on it, i'm wondering how utilize id
, if programmers of time avoid it? (since explained issues it)
i'm sure it's used, great if can mention cases solution..like real life programming cases kind of app development.
id generic object type in objective-c. can hold object.
one real world example: parsing json wont know, if root element array or dictionary. id take them both.
i utilize lot, in conjunction protocol definition: id<networkprinterprotocol>
. means should object of kind fulfill networkprinterprotocol. used defining delegates.
see wp: objective-c — dynamic typing
objective-c
No comments:
Post a Comment