Dark Horse Programmer-----Read the 19th and 20th Day study summary

Source: Internet
Author: User

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:

    1. understanding of Set and get
    2. Private Method Understanding
    3. Override Method Understanding
    4. Polymorphism Detection
    5. class and Power object relationship (this is the most brain),
    6. and self .name  and _name understand that the
    7. constructor
    8. 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)
    9. 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)
    10. 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
    11. 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)
    12. 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
    13. 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
    14. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.