1. xcode 编译出来的结果放哪里去了?
第一次用xcode 编译了一个动态库,可是怎么也找不到,原来default藏到了home 下面一个Library下面的某个角落,和linux windows上的习惯很不一样,就找了一个办法把它弄到当前项目下面,这个设置是全局的,也就是以后所有的新建的工程都不要再操心了,具体的做法是:
xcode->preference->locations->Derived Data 下面的一个选择框从default改成Relative, 就这样大功告成。
2. 如何调用动态库
a. 首先确认动态库的头文件能被调用到,target->(All/Basic)->search paths->head search paths.
b. 再确认编译的时候能找到,target->(All/Basic)->search paths->library search paths.
c. 最后还要确认运行的时候(dyld)能找到,所以最好能把库放到和编译出来的binary在同一个文件夹下面,至于dyld是按照什么规则去寻找动态库的还没有查清楚。
3. 当有多个targets的时候如何编译
run stop 右边有一个button点一下
4. target membership
右边的target membership, 说明左边的文件是否属于这个target, 也就是makefile中的一些target所相关的文件的意思。
5. 如何调用静态库
静态库的调用比动态库简单很多,因为不需要运行的时候再次寻找库。
a) 添加头文件的寻找路径,和动态库一样
b)把库直接导入到到项目中就可以了
6. 怎么debug
加断点,直接run,和eclipse之类的不大一样,专门有个debug的button,但是和makefile比较一致。
7. 怎么看编译过程
用命令行,xcodebuild 看起来make很像
8. block 选择
block选择很有用,和vim的纵向选择一样的效果。
具体做法option(alt)+鼠标
9. 一些快捷键
To delete a line: Ctrl-A to go to the beginning of the line, then Ctrl-K to delete it, and another time Ctrl-K to remove the empty line. (I do not use Xcode very often, but I'm used to that in Emacs and other text inputs with Emacs-like bindings, and it seems to work in Xcode too.)
And to duplicate a line: I don't know of many programs that have a command for that, but usually I just use Copy+Paste - in Xcode it's CUA-like: Ctrl+A to go to the beginning of the line, Shift+↓ to select it, Command+C to copy and Command+*Y to paste twice (once overriding the line and once appending to it).
(from a person that types and edits text all the time, so often in different programs, and occasionally gets pissed at having to distract himself with a dumb widget while making a little correction in a text input, that he just cannot avoid remembering these sequences and habits)
...
Restart Xcode and open Xcode > Preferences > KeyBindings. Find your macro and define a shortkey :
to be continued...