Ray's playground

 
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 56 下一页

2011年2月23日

Localization(Chapter 16 of Cocoa Programming for Mac OS X)

摘要: Clearly, as you develop and localize many applications, you will develop a set of common translations. It would be handy to have an automated way to get the translated strings into a nib file. This is one of several uses for ibtool. The ibtoolcommand, which is run from the terminal, can list the cl. 阅读全文

posted @ 2011-02-23 17:41 Ray Z 阅读(150) 评论(0) 推荐(0) 编辑

Using Alert Panels(Chapter 15 of Cocoa Programming for Mac OS X)

摘要: The NSRunAlertPanel() function returns an intthat indicates which button the user clicked. There are global variables for these constants: NSAlertDefaultReturn, NSAlertAlternateReturn, and NSAlertOtherReturn. int NSRunAlertPanel(NSString *title, NSString *msg, NSString *defaultButton, NSString *alt. 阅读全文

posted @ 2011-02-23 11:44 Ray Z 阅读(218) 评论(0) 推荐(0) 编辑

Using Notifications(Chapter 14 of Cocoa Programming for Mac OS X)

摘要: PreferenceControllerCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1#import"PreferenceController.h"234@implementationPreferenceController56NSString*constBNRTableBgColorKey=@"TableBackgroundColor";7NSString*constBNREmptyDocKey= 阅读全文

posted @ 2011-02-23 11:15 Ray Z 阅读(274) 评论(0) 推荐(0) 编辑

2011年2月22日

Item 33: Use the new Modifier Only to React to Base Class Updates(Effective C#)

摘要: codeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1usingSystem;2usingSystem.Collections.Generic;3usingSystem.Linq;4usingSystem.Text;56namespaceEffectiveCSharpItem337{8classBase9{10publicvoidMagicMethod()11{12Console.WriteLine("magicmethodfr 阅读全文

posted @ 2011-02-22 21:43 Ray Z 阅读(259) 评论(0) 推荐(0) 编辑

STL Containers & Iterators part2(Chapter 4 of Thinking in C++ Vol 2)

摘要: The vector is intentionally made to look like a souped-up array, since it has array-styleindexing but also can expand dynamically. vector is so fundamentally useful that it wasintroduced in a very primitive way early in this book, and used quite regularly in previousexamples. This section will give. 阅读全文

posted @ 2011-02-22 17:22 Ray Z 阅读(262) 评论(0) 推荐(0) 编辑

User Defaults(Chapter 13 of Cocoa Programming for Mac OS X)

摘要: Every application comes with a set of defaults from the factory. When a user edits his or her defaults, only the differences between the user's wishes and the factory defaults are stored in the user's defaults database. Thus, every time the application starts up, you need to remind it of the 阅读全文

posted @ 2011-02-22 13:27 Ray Z 阅读(156) 评论(0) 推荐(0) 编辑

2011年2月21日

Item 32: Avoid ICloneable(Effective C#)

摘要: ICloneable does have its use, but it is the exception rather than rule. It’s significantthat the .NET Framework did not add an ICloneable<T> when itwas updated with generic support. You should never add support forICloneable to value types; use the assignment operation instead. Youshould 阅读全文

posted @ 2011-02-21 21:06 Ray Z 阅读(168) 评论(0) 推荐(0) 编辑

Item 31: Implement Ordering Relations with IComparable<T> and IComparer<T>(Effective C#)

摘要: IComparable and IComparer are the standard mechanisms for providingordering relations for your types. IComparable should be used for themost natural ordering. When you implement IComparable, you shouldoverload the comparison operators (<, >, <=, >=) consistently with ourIComparable order 阅读全文

posted @ 2011-02-21 20:55 Ray Z 阅读(176) 评论(0) 推荐(0) 编辑

Nib Files and NSWindowController(Chapter 12 of Cocoa Programming for Mac OS X)

摘要: PreferenceControllerCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1#import"PreferenceController.h"234@implementationPreferenceController56-(id)init7{8if(![superinitWithWindowNibName:@"Preferences"])9{10returnnil;11}1213returnself;14}1516-(void)w 阅读全文

posted @ 2011-02-21 17:25 Ray Z 阅读(258) 评论(0) 推荐(0) 编辑

2011年2月19日

Item 30: Prefer Overrides to Event Handlers(Effective C#)

摘要: When you have one function that handles one event in a derived class, theoverride is the better approach. It is easier to maintain, more likely to becorrect over time, and more efficient. Reserve the event handlers for otheruses. Prefer overriding the base class implementation to attaching an eventh 阅读全文

posted @ 2011-02-19 13:06 Ray Z 阅读(199) 评论(0) 推荐(0) 编辑

上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 56 下一页

导航