2013年3月19日

摘要: Delegate模式并没有标准定义,也没有标准行为,所以在不同的地方使用的方式也不一样,C#中Delegate就是一个方法,而Cocoa中Delegate是一个对象(或者说adopt了某个protocol的对象),下面的一句话描述还比较贴切:A delegate is an object that’s given an opportunity to react to changes in another objector influence the behavior of another object.It stores a reference to another object, its d 阅读全文
posted @ 2013-03-19 19:35 做个不善的人 阅读(585) 评论(0) 推荐(0)
 
摘要: Target-action is a design pattern in which an object holds the information necessary to send a message to another object when an event occurs. The stored information consists of two items of data: an action selector, which identifies the method to be invoked, and a target, which is the object to rec 阅读全文
posted @ 2013-03-19 17:31 做个不善的人 阅读(1332) 评论(0) 推荐(1)
 
摘要: DialogDialog是application modal的,意味着如果没有结束这个Dialog,那用户将无法对这个application做任何操作。SheetsSheets是document modal的,意味着如果没有结束这个sheet,那用户将无法对这个Document或者这个window进行任何操作。什么是啥使用Sheets:需要一个针对某个document的特定dialog时,比如saving, printing。Cocoa的NSSavePanel和NSPrintPanel将其自身present为sheets。某个不创建document的单窗口应用需要一个dialog时,一个单窗口 阅读全文
posted @ 2013-03-19 16:15 做个不善的人 阅读(284) 评论(0) 推荐(0)