OC learn those things: the first OC Application

Source: Internet
Author: User

1. Steps for creating a development environment for XCode

1. In the Welcome to Xcode window, select Create a new Xcode project.

650) this. width = 650; "class =" WACImage SCX96041935 "alt =" Image "src =" https://onenote.officeapps.live.com/o/GetImage.ashx? Fi = SD2D97345DA1438C3B! 504 & C = 1w.bay-sky-wac-wshi & ak = m % 3Den % 2Dus & ObjectDataBlobId = {f6c5d10f-331d-4964-b63d-82a6bf806b83} {1} & usid = guest "_ xhe_src =" https://onenote.officeapps.live.com/o/GetImage.ashx? Fi = SD2D97345DA1438C3B! 504 & C = 1w.bay-sky-wac-wshi & ak = m % 3Den % 2Dus & ObjectDataBlobId = {f6c5d10f-331d-4964-b63d-82a6bf806b83} {1} & usid = regular "style =" max-width: 98%; margin: 3px; padding: 0px; width: 388px; height: 252px; "/>

Create a new Xcodeproject: Create a new Xcode project.

Connect to a repository: code library

Learn about using Xcode: Query Xcode User Guide documents

Go to Apple's developer portal: Visit the iOS Development Center webpage.

Open Other: select to Open another project

Recents: list of recently opened Projects

2. The Choose a template for your new project window. In The OSX group, the Application and Command Line Tool templates are displayed.

650) this. width = 650; "class =" WACImage SCX96041935 "alt =" Image "src =" https://onenote.officeapps.live.com/o/GetImage.ashx? Fi = SD2D97345DA1438C3B! 504 & C = 1w.bay-sky-wac-wshi & ak = m % 3Den % 2Dus & ObjectDataBlobId = {region} {1} & usid = Hangzhou "_ xhe_src =" https://onenote.officeapps.live.com/o/GetImage.ashx? Fi = SD2D97345DA1438C3B! 504 & C = 1w.bay-sky-wac-wshi & ak = m % 3Den % 2Dus & ObjectDataBlobId = {region} {1} & usid = require "style =" max-width: 98%; margin: 3px; padding: 0px; width: 388px; height: 262px; "/>

IOS group: Related to iOS iPhone, iPad, and iTouch Projects

OS X Group: associated with the MacOS Project

Application-Command Line Tool: Console project.

3. Coose options for your new project window.

650) this. width = 650; "class =" WACImage SCX96041935 "alt =" Image "src =" https://onenote.officeapps.live.com/o/GetImage.ashx? Fi = SD2D97345DA1438C3B! 504 & C = 1w.bay-sky-wac-wshi & ak = m % 3Den % 2Dus & ObjectDataBlobId = {region} {1} & usid = Hangzhou "_ xhe_src =" https://onenote.officeapps.live.com/o/GetImage.ashx? Fi = SD2D97345DA1438C3B! 504 & C = 1w.bay-sky-wac-wshi & ak = m % 3Den % 2Dus & ObjectDataBlobId = {region} {1} & usid = require "style =" max-width: 98%; margin: 3px; padding: 0px; width: 384px; height: 259px; "/>

Product Name: Project Name

Organization Name: Organization Name

Company Identifier: Company ID

Type: Foundation

Use Automatic Reference Counting: whether to automatically Reference the count

4. Select the directory for saving the project and click Create.

650) this. width = 650; "class =" WACImage SCX96041935 "alt =" Image "src =" https://onenote.officeapps.live.com/o/GetImage.ashx? Fi = SD2D97345DA1438C3B! 504 & C = 1w.bay-sky-wac-wshi & ak = m % 3Den % 2Dus & ObjectDataBlobId = {fd12aba2-b347-4b3c-96ab-d82e2a013953} {1} & usid = guest "_ xhe_src =" https://onenote.officeapps.live.com/o/GetImage.ashx? Fi = SD2D97345DA1438C3B! 504 & C = 1w.bay-sky-wac-wshi & ak = m % 3Den % 2Dus & ObjectDataBlobId = {fd12aba2-b347-4b3c-96ab-d82e2a013953} {1} & usid = regular "style =" max-width: 98%; margin: 3px; padding: 0px; width: 522px; height: 272px; "/>

New Folder: create a New Folder

Source Control: create a local git resource library for this project.

5. After the project is created, open the Xcode development environment. View the project structure.

650) this. width = 650; "class =" WACImage SCX96041935 "alt =" Image "src =" https://onenote.officeapps.live.com/o/GetImage.ashx? Fi = SD2D97345DA1438C3B! 504 & C = 1w.bay-sky-wac-wshi & ak = m % 3Den % 2Dus & ObjectDataBlobId = {d1f7dc6f-4a63-42e5-aa64-1c30f9209775} {1} & usid = guest "_ xhe_src =" https://onenote.officeapps.live.com/o/GetImage.ashx? Fi = SD2D97345DA1438C3B! 504 & C = 1w.bay-sky-wac-wshi & ak = m % 3Den % 2Dus & ObjectDataBlobId = {d1f7dc6f-4a63-42e5-aa64-1c30f9209775} {1} & usid = regular "style =" max-width: 98%; margin: 3px; padding: 0px; width: 171px; height: 224px; "/>

Classes: project-related Classes

Frameworks: project-related libraries

Products: compiled OC Program

6. Click the main. m file and you will see the following code in the code editing area.


// Introduce the header file # import <Foundation/Foundation. h> // main function: int main (int argc, const char * argv []) of the OC program entry {// automatically release the pool @ autoreleasepool {NSLog (@ "Hello, world! ");} Return 0 ;}

For more information, see: http://blog.csdn.net/p106786860/article/details/9317955


This article from the "peng" blog, please be sure to keep this source http://106783860.blog.51cto.com/2052874/1279115

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.