9. The 9-palace Algorithm

Source: Internet
Author: User

9. The 9-palace Algorithm

# Jiugongge computing ideas
-Use the index of the control to calculate the row number and column number of the control.
-Use the column number to calculate the x value of the control.
-Use the row number to calculate the y value of the control.

# HUD
-Other statements: Indicator, cover, and mask
-Translucent HUD practices
-Set the background color to a translucent color.

# Scheduled tasks
-Method 1: performSelector

'''Objc
// Automatically call self's hideHUD method after 1.5s
[Self defined mselector: @ selector (hideHUD) withObject: nil afterDelay: 1.5];
'''
-Method 2: GCD

'''Objc
Dispatch_after (dispatch_time (DISPATCH_TIME_NOW, (int64_t) (1.5 * NSEC_PER_SEC), dispatch_get_main_queue (), ^ {
// Automatically execute the code in the block after 1.5s
Self. hud. alpha = 0.0;
});
'''
-Method 3: NSTimer

'''Objc
// Automatically call self's hideHUD method after 1.5s
[NSTimer scheduledTimerWithTimeInterval: 1.5 target: self selector: @ selector (hideHUD) userInfo: nil repeats: NO];
// If repeats is YES, it means that the self hidHUD method is called every 1.5s.
'''

# FAQs
-A. m file in the project cannot be used.
-Check: Build Phases-> Compile Sources
-A Resource file (such as plist and audio) in the project cannot be used.
-Check: Build Phases-> Copy Bundle Resources

# Model
-What is a model?
-Objects used to store data
-Generally, some pure objects directly inherited from NSObject
-Some internal attributes are provided to store data.

# What are the possibilities of invisible controls?
-The width or height is actually 0.
-Incorrect position (for example, it is a negative number or a large number that has exceeded the screen)
-Hidden = YES
-Alpha <= 0.01
-No background color or content is set.
-The text color may be the same as the background color.

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.