Dark Horse Programmer-----Read the 19th and 20th Day study summary
Key experience: In fact, these two days personally feel that as long as beginners, do not know what those concepts are. It is only by writing code that you are familiar with your code that you have a feeling that you have to write something else. This is the truth, so it is recommended that beginners first take a day to read the tutorial, a dozen to his own breath, do not want to relax the idea, naturally you also have time to reflect and write their own code.
Next, I'll summarize my study:
- understanding of Set and get
- Private Method Understanding
- Override Method Understanding
- Polymorphism Detection
- class and Power object relationship (this is the most brain),
- and self .name and _name understand that the
- constructor
- set and get have actually been replaced by @property basic functionality, but the individual feels that refactoring the set is important because the constraints on instance variables are still important, In particular, encountering an instance variable that has a relationship with another instance variable is (example: instance variable if the husband, set another instance variable to the husband's spouse, so that, in order to save an instance variable, can be done by set and get)
- Private method, the teacher said so much, I think the simple is generally placed in the implementation, and in the @interface no function or method can be called private method (I do not know whether it is correct, if not correct, please spit groove)
- reuse method is to the existing, The public method was rewritten, and I felt that it was very much used in init, and I generally thought that the refactoring method would inherit the original method (Xcode encapsulated code). But the refactoring method is different in different classes. There's a fixed way of writing
- polymorphism at first I would associate him with a reuse method, but then think about the wrong thing because polymorphism is the relationship between class and instance objects, but the reuse method is not. I think polymorphic is in Lao Tzu, the boy can be with me for money (money is can be called, not Lao Tzu's private Method)
- class and instance object, the class is equivalent to a container, the instance object is an external open interface, instance variable is derived from the class, but he is not a class, He's going to be able to invoke the properties of the class, give me the feeling class is the equivalent of a washing machine, washing machine has its own operation principle (class method), also has the roller (class property), the instance variable is the person who uses this washing machine
- and there is self.name and _name understand, They are not different when rewriting init, but in set, you can only use _name. I personally think that self_name have set up and take out two methods, but _name only take out this method
- refactoring method inside I personally think instancetype with a little more, with ID this universal pointer is not good, ID can be used in multiple methods to not easily distinguish
Dark Horse Programmer-----Read the 19th and 20th Day study summary