IOS 7 30-day proficient in iPhone mobile programming 12th-day test reaction poker games

Source: Internet
Author: User

Knowledge point:

(1) Image View Control

The current method is pokerImage. image = [UIImage imageNamed: @”picturename.png "];

Note: + (UIImage *) imageNamed :( NSString *) name
This method is used to search for images with supplied names in the top-level folder of application bundle. If you find the image, load it to the iPhone system to cache the image. This means that the image is (theoretically) stored in the memory as a cache, which is directly referenced to the system memory during use. If you have more images, the image cache may not respond. When using Interface Builder to create an Interface, If you directly drag UIImageView and set the image name. InterfaceBuilder uses the imageName method of the UIImage class to load images. The image is cached, resulting in large memory usage. And it cannot be released, even if the release drops UIImageView, it will not help.
Recommended:
NSString * path = [[NSBundle mainBundle] pathForResource: @ "icon" ofType: @ "png"];
MyImage = [UIImage imageWithContentsOfFile: path];

(2) Alert View Control

UIAlertView is the prompt box "class" in the UIView framework. The Code is as follows:

Note: Under the ARC mechanism, you do not need to add the release object statement.

(3) Save the time value NSDate

NSDate is the timer "class" in the Foundation framework. It is used to save the time value in OC.

+ (Id) date;

Returns the current time.

+ (Id) dateWithTimeIntervalSinceNow :( NSTimeInterval) secs;

The return value is based on the current time, and the time after secs seconds is passed.

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.