Is there automatic initialization for attributes?
问题 I was wondering if attributes were automatically set to nil during an object's initialization or they have random values? 回答1: If this question is indicative of Objective-C, I'd say that you should initialize all values of a variable when you declare them. Explicitly initializing variables when they're declared gives you two benefits: There is no ambiguity in what the value of the variable is. Readability for others who read your code. 回答2: All instance variables are guaranteed to be