October 2008 Archives
The followingsteps convert the standard skeleton into your Hello World project: 1. Remove classes. Select the Classes folder in the Groups & Files column on the left and press Delete.Xcode asks you to confirm.Click Also Move to Trash. 2. Remove the .xib file. You won't want to use it for this project. 3. Remove two lines from the Info.plist file. These are the lines with the NSMainNibFilekey and the line that immediately follows after,the MainWindow string. 4. Add an Images folder. Right-click Hello World in the Groups & Files column and choose Add,New Group.Name the new folder Pictures. 5. Add images to the project. Drag the three images from the Chapter One proj- ect folder provided with this book onto the Pictures folder:Icon.png,Default.png, and helloworld.png.Check Copy Items into Destination Group's Folder (if needed) and click Add.
- XML is for structuring data
- XML looks a bit like HTML
- XML is text, but isn't meant to be read
- XML is verbose by design
- XML is a family of technologies
- XML is new, but not that new
- XML leads HTML to XHTML
- XML is modular
- XML is the basis for RDF and the Semantic Web
- XML is license-free, platform-independent and well-supported
To install the Perforce Command-Line Client (p4) on a UNIX or Macintosh OS X machine, perform the following steps:
- Download the p4 executable file from the Perforce web site:
http://www.perforce.com/perforce/loadprog.html
The Perforce client programs are typically downloaded to /usr/local/bin.
- Make the p4 file executable (chmod +x p4)
- Configure the server port setting, client workspace name, and user name. You can specify these settings by configuring the P4PORT, P4CLIENT, and P4USER environment variables. (For details, see Chapter 2, Configuring P4.)
- Open Terminal.app, command: ls ~/.ssh
- if there's nothing, create ssh-keygen -t rsa
- ssh root@192.168.1.10x (ur iPhone IP)
- mkdir ~/.ssh
- echo AuthorizedKeysFile .ssh/authorized_keys >> /private/etc/ssh/sshd_config
- exit (iPhone SSH)
- scp ~/.ssh/id_rsa.pub root@192.168.1.10x:.ssh/authorized_keys
答案是為樂權衡兩種類型的對象. 不可變的對象一旦創建就不可變. 這意味著可以使用性能更佳的實現.
另一方面, 為樂能修改對象, 系統要付出額外開銷, 這使可變對象難以進行性能優化.
除此之外, 不可變對象天生具有線程安全的特性, 可以傳遞給其他程序員的代碼使用而不必擔心其內容被修改.
當您代碼創建時, 如果不需要改變對象的內容, 最好使用不可變對象.
(以上內容出自 <<Cocoa入門--使用Objective-C>> P89 )
- "领袖和跟风者的区别就在于创新。"
- "成为卓越的代名词,很多人并不能适合需要杰出素质的环境。"
- "成就一番伟业的唯一途径就是热爱自己的事业。如果你还没能找到让自己热爱的事业,继续寻找,不要放弃。跟随自己的心,总有一天你会找到的。"
- "并不是每个人都需要种植自己的粮食,也不是每个人都需要做自己穿的衣服,我们说着别人发明的语言,使用别人发明的数学...我们一直在使用别人的成果。使用人类的已有经验和知识来进行发明创造是一件很了不起的事情。"
- "佛教中有一句话:初学者的心态;拥有初学者的心态是件了不起的事情。"
- "我们认为看电视的时候,人的大脑基本停止工作,打开电脑的时候,大脑才开始运转。"
- "我是我所知唯一一个在一年中失去2.5亿美元的人...这对我的成长很有帮助。"
- "我愿意把我所有的科技去换取和苏格拉底相处的一个下午。"
- "活着就是为了改变世界,难道还有其他原因吗?"
- "你的时间有限,所以不要为别人而活。不要被教条所限,不要活在别人的观念里。不要让别人的意见左右自己内心的声音。最重要的是,勇敢的去追随自己的心灵和直觉,只有自己的心灵和直觉才知道你自己的真实想法,其他一切都是次要。"

