سؤال

I'm new to Objective-C.

I have a Class that has several properties that need to be initialised to default values. It is not guaranteed that these properties will necessarily be used in the lifetime of an instance.

Would you recommend initialising to default values in the designated initialiser or using custom getter methods to lazily initialise the values?

هل كانت مفيدة؟

المحلول

lazy instantiation is a core concept with objective-c and is used often.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top