IPhone new project

Source: Internet
Author: User

 

                             
  1. Create a project                        
                             
  Open xcode,
Select
IPhone OS-Application
                   
                             
  There are many project templates. You can select a template that suits your needs. If you want your program to support both iPhone and iPad, create a universal project. In this way, the program will create two portals to access the branches of the iPhone and iPad based on different devices. The class files are common, the layout files are created separately. When you jump to the class, select to load different XIB files based on the device model.                
                             
  Window-based
Application: a project created using this template will automatically have
Window
Try to open
Resources
Directory
Mainwindow. XIB
File (double-click ),
   
  You can
Attempting to forward
Window
Add
Nevigationcontroller,
Or
Tabbarcontroller (
Slave
Library
Trying to hold down what you want to add
View Controller
 
 

Drag mainwindow. XIB
An attempt to square the four icons
);


 

 

//
Show main program window

 



[Windowmakekeyandvisible];


In
. H
File to define a view
Viwecontroller

1.
Iboutlet uinavigationcontroller * navigationcontroller;

2. @ property (nonatomic, retain)
Iboutlet uinavigationcontroller * navigationcontroller;

3.
Click
**
APP delegate
Icon (in the rectangle of the four icons ).
Delegate connection
View,
Control + F2,
See the custom
*
Navigationcontroller;
Click the circle on the right and drag it
Uinavigationcontroller
Window, associated successfully


//
Add view to Main Window

 


[Window
Addsubview: navigationcontroller. View];

 

[Window makekeyandvisible];

                 
   

                       
                             
                             
                             
                             
                             
                             
                             
                             
                             
                           
                             
                             
                             
View-based application:
A project created using this template will automatically have
Viewcontroller
You can add your own components directly in an attempt to facilitate single-view program development,
  Small examples that can be used to write tests                      

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.