IPhone's first application (tag ios xcode4 Mac objective-C cocoa)

Source: Internet
Author: User

1. Create a project named slider:

Open xcode:

Select create a new xcode project:

Select single view application:


Fill in the product name Project name, company identifier company ID, class prefix,

The key is: select the iPhone for the device family, then select next, and select the location to store after next!

Project complete: Open the mainstoryboard. storyboard file:



Please refer to the objects on the right. I pulled a round rect button and a text field. For example, I added a method to the button. The method is simple, right-pull the button to testviewcontroller on the right. h file, it will automatically generate the method, and then you are in testviewcontroller. the implementation method in the M file is as follows:

-(Ibaction) Hello :( ID) sender {static int I = 0; label. TEXT = [nsstring stringwithformat: @ "renhaili % d", I]; // converts an integer to a string I ++ ;}

The running result is as follows:


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.