ios - In Objective-C, how to decide which initializer is the designated one? -


i read material says designated initializer "most complete" initializer in initializer list.

but example in uiview initwithframe:(cgrect)frame , initwithcoder:(nscoder*)adecode both take 1 parameter, how decide one's uiview's designated initializer?

when haves access source, can recognize designated initializer 1 calls super init while others call 1 either directly or indirectly - assuming author follows convention. might use ns_designated_initializer macro make explicit (read more here). when don't have access source code, case apple's classes, need tell somehow - luckily in class references - e.g. can see in reference uiview initwithframe: designated initializer.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -