自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

解析XCode學(xué)習(xí)技巧

移動開發(fā) iOS
本文主要是來學(xué)習(xí)Xcode的技巧,通過本文的學(xué)習(xí),可以從中方便、快速的去了解xcode幾個(gè)小案例的實(shí)現(xiàn)和使用方法,先來看詳細(xì)內(nèi)容。

XCode學(xué)習(xí)技巧是本文要介紹的內(nèi)容,通過本文的學(xué)習(xí),可以從中方便、快速的去了解xcode幾個(gè)小案例的實(shí)現(xiàn)和使用方法,先來看詳細(xì)內(nèi)容。

1、更改公司名稱 (Changing the Company Name)

改變公司名稱, 當(dāng)你用Xcode新建一 Objective C 源文件的時(shí)候, 通常Xcode會自動生成底下的注釋:

  1. //  
  2. // TapDance.h  
  3. // Groovilicous  
  4. //  
  5. // Created by markd on 7/25/08.  
  6. // Copyright 2008 __MyCompanyName__. All rights reserved.  
  7. // 

markd 是你登錄Mac系統(tǒng)的名字

__MyCompanyName__ 是你定義的公司名字, 可以通過以下命令在Terminal里面進(jìn)行修改名字:

  1. defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{"ORGANIZATIONNAME" = "Length-O- Words.com";}'  
  2. Length-O- Words.com 

就是定義新的公司名稱, 你可以自己替換自己要定義的名稱.

2、Writing Your Code with a Little Help from Xcode

縮進(jìn)

先選擇一段要編輯的內(nèi)容,用鼠標(biāo)拖動選擇好后:

  1. Command(win鍵盤的Alt) + [    左縮進(jìn)  
  2.  
  3. Command + ] 右縮進(jìn)  
  4.  
  5. 右鍵 -> Re-Indent Selection 自動編排格式 

代碼自動完成

Xcode會記住很多已經(jīng)存在的名字, 你鍵入字符的時(shí)候, 它會根據(jù)自己的字典來猜測你要寫的內(nèi)容, 如果匹配成功, 直接敲Tab鍵或者回車鍵Xcode就幫你完成剩余的內(nèi)容. Escape會列出一個(gè)下拉列表, 讓你自己有更多的選擇. ctrl+/ 來定位函數(shù)的多個(gè)占位符參數(shù).

Kissing the Parentheses(括號配對)

Xcode 可以自動配對括號, 而且回自動高亮顯示.

  1. Double click one of the delimeters(")", "]", "}"), and Xcode will select the code between it and its mate. 

Mass Edit(批量編輯)

(1)快照(Snapshot)

  1. File -> Make Snapshot 建立快照  
  2. File -> Snapshots  打開快照管理器, 可以恢復(fù)之前建立的快照. 

(2)查找(Find)

Edit -> Find

3、編輯在作用域中同名變量(Edit all in Scope)

選擇要編輯的名稱

  1. Edit -> Edit all in Scope 

4、重構(gòu)(Refactor)

當(dāng)你重命名一個(gè)類的名字的時(shí)候, 相應(yīng)的文件名也被Rename. 這個(gè)功能很好用. Eclipse 有這種功能, VC的VA插件也有, 不過好像它們都不能重名文件名.

選擇要重命名的類名, 函數(shù)名等

  1. Edit -> Refactor 

注釋: 很多命令有快捷鍵, 可以利用快捷鍵加快效率, 沒用快捷鍵的, 可以在Perferences里的key buildings設(shè)置命令對應(yīng)的快捷鍵.

5、Navigating Around in Your Code

下面的快捷鍵不僅僅是適用于Xcode, 而且適用諸如TextEdit, Safari's URL bar 等等, 一般具有編輯功能的都有這張功能(在Mac中)

ctrl + A    將光標(biāo)移動到當(dāng)前光標(biāo)所在行的開始位置

ctrl + E    將光標(biāo)移動到當(dāng)前光標(biāo)所在行的結(jié)束位置

ctrl + T    交換當(dāng)前光標(biāo)所在為止的詞和此詞的上一個(gè)詞的位置.(就是互換倆個(gè)詞)

ctrl + K    刪除當(dāng)前光標(biāo)所在位置到當(dāng)前行結(jié)尾處

ctrl + D    相當(dāng)于鍵盤的Delete按鍵, 刪除后面一個(gè)字符.

6、書簽(Bookmarks)

Edit -> Add Bookmarks (Alt + D)

In the Groups & Files pane,   你能找到Bookmarks, 里面的你可以點(diǎn)擊.Xcode Keyboard Shortcuts

  1. ⌘ 表示: Command(Alt)  
  2. ⇧表示: Shift  
  3. ⌥ 表示: Win  
  4. Control表示:Ctrl  
  5. Keystroke                      Description  
  6. ⌘⇧E                             Expand the editor  
  7. ⌘[                                  Shift the code block to the left  
  8. ⌘]                                  Shift the code block to the right  
  9. Tab                                Accept a completion  
  10. Esc                                Show the completion menu  
  11. Control-.                        (period) Cycle through the completions  
  12. Shift-control-.                (period) Cycle backward through the completions  
  13. Control-/                        Move to the next completion placeholder  
  14. Command-control-S    Make a snapshot  
  15. Control-F                     Move the cursor forward  
  16. Control-B                       Move the cursor backward  
  17. Control-P                   Move the cursor to the previous line  
  18. Control-N                   Move the cursor to the next line  
  19. Control-A                       Move the cursor to the beginning of the line  
  20. Control-E                   Move the cursor to the end of the line  
  21. Control-T                 Transpose the characters adjacent to the cursor  
  22. Control-D                 Delete the character to the right of the cursor  
  23. Control-K                 Delete the line  
  24. Control-L                 Center the cursor in the text editor  
  25. ⌘⌥D                          Show the Open Quickly window  
  26. ⌘⌥↑                                 Open the counterpart file  
  27. ⌘D                                 Add a bookmark  
  28. Option–double-click                 Search in documentation  
  29. ⌘Y                                 Run the program with the debugger  
  30. ⌘⌥P                                 Continue (in the debugger)  
  31. ⌘⌥O                                 Step over  
  32. ⌘⌥I                                 Step into  
  33. ⌘⌥T                                 Step out  

小結(jié):解析XCode學(xué)習(xí)技巧的內(nèi)容介紹完了,希望通過本文的學(xué)習(xí)對你有所幫助!

責(zé)任編輯:zhaolei 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2011-07-20 14:31:56

XCode User Scrip 腳本

2011-08-19 15:16:41

XCodeUserScripts腳本

2011-07-19 15:55:09

Xcode Interface Builder

2013-04-18 10:19:40

iOS開發(fā)Xcode調(diào)試

2011-08-04 18:09:32

Xcode 技巧 文檔

2010-03-05 13:46:12

Android編程學(xué)習(xí)

2011-08-08 17:05:02

XCode UserScript 腳本

2014-03-12 09:52:17

XcodeCode Snippe

2011-07-26 17:47:13

2011-08-10 14:00:22

XcodeUIWebView視頻

2011-08-18 10:17:21

Xcode4Xcode

2011-07-28 14:06:52

XCode XCode 3.2

2012-05-21 10:13:05

XCode調(diào)試技巧

2013-03-29 13:17:53

XCode調(diào)試技巧iOS開發(fā)

2011-07-25 15:42:38

Xcode Vim

2011-08-01 17:31:25

Xcode開發(fā) Cocoa

2011-08-01 10:41:59

Xcode 條件編譯

2011-08-01 09:26:51

Xcode Xcode 4 Instrument

2011-07-06 14:32:52

Mac XCode

2011-08-09 17:36:34

Xcode 4App
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號