Suddenly whim, want to write some technical aspects of things, did iOS also for several years, simply write an iOS development technology blog, I hope someone can use.
Start with the creation of a Hellow world project today.
One: First open Xcode and then click creat a new Xcode Project
Then select single View application and click Next
The product name here is the name of the project below two is the company's name and logo, can be modified according to their own circumstances, the following language after Xcode 6 began to support Swift here we choose Objective-c, Device is the target device we are developing, here we choose the iphone click Next and our project is built.
We can see the following interface
Here the role of the various documents I do not explain for the time being, we will slowly explain their role.
Two: Modify the code to complete our first application
Click on the viewcontroller.m file in the left file bar to find
1 -(void) viewdidload {2 [Super Viewdidload]; 3 // additional setup after loading the view, typically from a nib. 4 }
Add code becomes
- (void) viewdidload {[Super viewdidload]; [Self.view Setbackgroundcolor:[uicolor Blackcolor]; UILabel* Hellowoldlab = [[UILabel alloc]initwithframe:cgrectmake ( -, -, -, -)]; Hellowoldlab.text=@"Hello World"; Hellowoldlab.textcolor=[Uicolor Whitecolor]; Hellowoldlab.font= [Uifont fontwithname:@"Helvetica"Size -. f]; [Self.view Addsubview:hellowoldlab]; //additional setup after loading the view, typically from a nib.}
Then click the Run button in the top right corner
Take a look at the running results.
Congratulations, you've finished your first iphone app.
iOS Development Primer (i): Creating a Project