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: