事件授权(Event Delegation)dojo/on模块:on(parent element,"selector:event name",handle)注:需require 上dojo/query模块作为查询selector的引擎,dojo/on模块为减少内存占用就没有将不一定需要的dojo/...
分类:
其他好文 时间:
2015-03-12 06:22:39
阅读次数:
211
在开发ios应用的时候,我们会经常遇到一个常见的问题:在不过分耦合的前提下,controllers间怎么进行通信。在IOS应用不断的出现三种模式来实现这种通信:1.委托delegation;2.通知中心Notification Center;3.键值观察key value observing...
分类:
其他好文 时间:
2015-03-11 23:03:23
阅读次数:
234
此文章结合实际的例子很详细的讲解了什么时候适合用delegate 或 block ,此文章不太适合不太熟悉block编程的读者http://stablekernel.com/blog/blocks-or-delegation/下面一边文章是实际的例子用block的方式实现UIAlertViewhtt...
分类:
其他好文 时间:
2015-01-16 18:43:05
阅读次数:
122
Class loaders in the Application Server runtime follow a delegation hierarchy that is illustrated in the following figure and fully described inTable ...
分类:
其他好文 时间:
2014-12-25 18:08:03
阅读次数:
141
Expression-bodied 方法是C# 6.0 中另一个能简化代码的特性。我们已经对lambda表达式将funciton和delegation关联起来的这种用法很熟悉了。Expression-bodied 将lambda 表达式的这种用法扩展到了方法上。像下面代码所示,我们有一个GetTim...
1.prepareForSegue:
Now we know what the destinationViewController is we can set its data properties. To receive information back from a scene we use
delegation. Both are shown simply in the followi...
分类:
其他好文 时间:
2014-11-20 10:21:53
阅读次数:
153
Protocol简单来说就是一系列方法的列表,其中声明的方法可以被任何类实现。这中模式一般称为代理(delegation)模式。在IOS和OS X开发中,Apple采用了大量的代理模式来实现MVC中View(UI控件)和Controller(控制器)的解耦。下面我们先来看一下我们熟悉的Android中的按钮监听过程,然后再对比理解delegation。首先我建立一个很简单的Android工程,在L...
分类:
其他好文 时间:
2014-11-16 14:43:54
阅读次数:
142
如果你想给网页添加点JavaScript的交互性,也许你已经听过JavaScript的事件代理(event delegation),并且觉得这是那些发烧友级别的JavaScript程序员才会关心的什么费解的设计模式之一。事实上,如果你已经知道怎么添加JavaScript的事件处理器(event ha...
分类:
Web程序 时间:
2014-10-26 01:35:06
阅读次数:
303
代理是iOS开发中常用的设计模式。我们借助于protocol(参考博文:objective-c协议(protocol))可以很方便的实现这种设计模式。什么是代理?苹果的官方文档给了很清晰的解释:Delegation is a simple and powerful pattern in which ...
分类:
移动开发 时间:
2014-10-20 09:50:55
阅读次数:
271
【转载】iOS中delegate,notification,KVO三种模式实现通信的优缺点 原帖地址:http://blog.csdn.net/yangxt/article/details/8176636在开发iOS中,有三种模式来实现controller之间的通信: 1.委托delegation;...
分类:
移动开发 时间:
2014-10-11 18:40:35
阅读次数:
316