Some trivia in objective-c 01 (update)

Source: Internet
Author: User

  1. Can you send a message to CGRect? The answer is no, can only send messages to Objective-c object,CGRect is a struct, so no! define several concepts

    receiver(message receiver): Pointer to the object that executes the method

    selector(selector): Method name to execute method

    Arguments (argument): A value passed to a method as a variable

    [self.view setbackgroundcolor:RED];

  2. Point and pixels concepts: the width and height of the values used in our development are points, and the size of the points is related to the device resolution, depending on how many pixels the screen shows a point. Retina screen (here in 4s for example) a point is two pixels high and two pixels wide. Non-retina a point is a pixel wide and a pixel high.

    "In contrast with iphone4s and iphone3gs, red means 4s, blue means 3gs"

    Screen Size: 3.5 " 3.5"

    Resolution:640*960 320*480 ( refers to how many pixels the monitor can display )

    Pixel density:326ppi 163ppi (number of dots per inch)

    number of physical pixel points: 320*480 320*480

    Logical pixel vs. physical pixel conversion :1pt = 2px 1pt = 1px

  3. Give an example of avoiding a reference loop. Each UIView object has a Superview property that, when added to another view as a child view, creates a corresponding inverse association, and this Superview property is a weak application!

  4. Run Loop: The iOS app Qidong starts a run cycle, and the job of running the loop is to listen for events, such as touch, and when the event occurs, the run loop will find the appropriate treatment for the appropriate time. Control will return to the run loop again only when the method has finished executing. When the app returns control to the run loop, the run loop first checks for a view that has no pending redraw (that is, the view of the setneeddisplay message received in the current loop).

  5. View Redraw

  6. The Uiscrollerview object can be used to manage views that are suitable for views that are larger than the screen, which has an important property:Contentsize, which tells Uiscrollerview the "framing" range.

    Contentsize height is set to screen height, width is set to half and twice times of screen, what happens separately ...

  7. Two methods of view controller initialization: Code +nib

  8. When does the Loadview method call? (The default Loadview method automatically handles the view hierarchy contained in the nib file when the view controller needs to load view && view nil)

    What is the mechanism of bread here? (Lazy Loading)



Some trivia in objective-c 01 (update)

Related Article

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.