Really Simple Cocoa Tips (2007)

Please download to get full document.

View again

of 35
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Similar Documents
Information Report
Category:

Software

Published:

Views: 0 | Pages: 35

Extension: PDF | Download: 0

Share
Description
1. Really Simple Cocoa Tips (But save your life!) by yllan, Sept. 13, 2007 2. Coverage Common mistakes. Handy code snippets. Tools setting / hotkey / usage.…
Transcript
  • 1. Really Simple Cocoa Tips (But save your life!) by yllan, Sept. 13, 2007
  • 2. Coverage Common mistakes. Handy code snippets. Tools setting / hotkey / usage. 目的:節省生命!
  • 3. Compile Cocoa using gcc gcc something.m -o something -framework Cocoa Save: 2 hours of try & error
  • 4. [[NSObject alloc] init] 簡寫! [NSObject new] Save: 2 secs each time
  • 5. NSString, 中文? Save: 2 hour in your life
  • 6. NSString, 中文? NSString *s = @”中文” ???? Save: 2 hour in your life
  • 7. NSString, 中文? NSString *s = @”中文” ???? Tiger 還不能 樣寫... Save: 2 hour in your life
  • 8. NSString, 中文? NSString *s = @”中文” ???? Tiger 還不能 樣寫... NSString *s = [NSString stringWithUTF8String: “中文”]; Save: 2 hour in your life
  • 9. NSString, 中文? NSString *s = @”中文” ???? Tiger 還不能 樣寫... NSString *s = [NSString stringWithUTF8String: “中文”]; 更好的辦法是放在 Localized Resource 裡! Save: 2 hour in your life
  • 10. NSLog, 中文? 猜猜 個程式的 Output 是啥: #import <Cocoa/Cocoa.h> int main() { NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSLog(@"%@", @"Hello, world."); NSLog(@"%@", [NSString stringWithUTF8String: "世界你好"]); NSLog(@"%@", [NSString stringWithUTF8String: "お元気ですが?"]); NSLog(@"%@", [NSString stringWithUTF8String: "bonjour."]); [pool release]; return 0; }
  • 11. NSLog, 中文?(續) 直接用 fprintf 或者確保包含英文 字元! Save: 5 hours of debugging
  • 12. Accessor? Xcode Script Menu! TextMate: acc stracc objacc Save: 5 mins each time tab tab tab
  • 13. 在純文字程式使用 Cocoa 畫圖 Save: 3 hours of googling
  • 14. 在純文字程式使用 Cocoa 畫圖 NSApplicationLoad() Save: 3 hours of googling
  • 15. NSImage 在迴圈中生成 Autorelease 物件讓記憶體爆 ! Save: 1 hour of debugging, 5 mins for googling
  • 16. NSImage 在迴圈中生成 Autorelease 物件讓記憶體爆 ! Save: 1 hour of debugging, 5 mins for googling
  • 17. NSImage 在迴圈中生成 Autorelease 物件讓記憶體爆 ! Save: 1 hour of debugging, 5 mins for googling
  • 18. Xcode Speedup Save: 2 secs each time
  • 19. Xcode Speedup Turn it off! Save: 2 secs each time
  • 20. Xcode Hotkey opt esc+
  • 21. Xcode Hotkey opt esc+ Auto-Complete Save: 10 secs each time
  • 22. Xcode Hotkey opt esc+ Auto-Complete ctrl .+ Cycle-Through Save: 10 secs each time
  • 23. Xcode Hotkey ctrl /+ Jump to next placeholder Save: 1.5 secs each time
  • 24. Xcode Hotkey opt shift⌘ ? = Help ⌘ opt = Jump to definition / declaration = Look up in Apple Reference Library Save: 10 secs each time
  • 25. __MyCompanyName__ ? defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{ "ORGANIZATIONNAME" = "My Company";}' or edit: /Library/Application Support/Apple/Developer Tools Save: 1 mins for googling OR 4 hours of searching your HD manually
  • 26. Interface Builder 控制元件太多?疊在一起 很難選到想要的?別忘了 有 Hierarchy View: Save: 1 min
  • 27. Interface Builder Resize: 曳時按著 Ctrl 可讓 Resize 遵守彈簧設定! Save: 30 secs each time
  • 28. Interface Builder Make Subview of... Save: 5 mins of try & error
  • 29. Interface Builder Make Subview of... Save: 5 mins of try & error
  • 30. Interface Builder Make Subview of... Save: 5 mins of try & error
  • 31. Interface Builder Hotkey 超有用! ⌘ 1∼5 Save: 3.1415926 secs each time
  • 32. FileMerge 可以比對兩個目錄的不同之處! Save: 10 minutes each time
  • 33. FileMerge 可以比對兩個目錄的不同之處! Save: 10 minutes each time
  • 34. FileMerge 可以比對兩個目錄的不同之處! Save: 10 minutes each time
  • 35. Thank You!
  • We Need Your Support
    Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

    Thanks to everyone for your continued support.

    No, Thanks
    SAVE OUR EARTH

    We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

    More details...

    Sign Now!

    We are very appreciated for your Prompt Action!

    x