代理模式是常用的java设计模式,他的特征是代理类与委托类有同样的接口,代理类主要负责为委托类预处理消息、过滤消息、把消息转发给委托类,以及事后处理消息等。代理类与委托类之间通常会存在关联关系,一个代理类的对象与一个委托类的对象关联,代理类的对象本身并不真正实现服务,而是通过调用委托类的对象的相关方法,来提供特定的服务。
按照代理的创建时期,代理类可以分为两种。
静态代理:由程序员创建或特...
分类:
编程语言 时间:
2014-08-05 19:25:50
阅读次数:
339
首先说按比例缩放,这是在Interface Builder中无法设置的内容。而在代码中,使用NSLayoutConstraint类型的初始化函数中的multiplier参数就可以非常简单的设置按比例缩放。同时也可以设置不同NSLayoutAttribute参数来达到意想不到的效果,比如“A的Widt...
分类:
其他好文 时间:
2014-08-05 18:57:29
阅读次数:
188
嗯,直接上代码!!!!这是.h文件的#import @interface UIView (AboutKeyboard)@property (nonatomic) CGFloat moveDistince;@property (nonatomic) UIView *moveView;/* *指定一.....
分类:
移动开发 时间:
2014-08-05 18:46:39
阅读次数:
275
有时,我们会需要用到自己定义的一些查询方法,可以按照下面几步进行。1. 定义一个包含该方法的接口Interface UserRepositoryCustom {public void someCustomMethod(User user);}2. 定义实现class UserRepositoryIm...
分类:
编程语言 时间:
2014-08-05 18:30:09
阅读次数:
228
GDI+的基本概念GDI+的常用对象,包括Graphics、Font、Brush、Pen等对象的创建和使用常用图形的绘制Color结构、Point结构和Rectangle结构1.GDI+的概念GDI+是GDI(Graphics Device Interface,图形设备接口)的改进产品。2.GDI+...
分类:
其他好文 时间:
2014-08-05 18:19:39
阅读次数:
239
以下内容是在学习Spring-Data-mongoDB中的Spring Data Repositories时做的一些笔记。备忘!感觉学习还是看官方的资料比较透彻一些。Spring Data Repositories目的:减少重复的持久化代码。常用的几个repository interface,Rep...
分类:
编程语言 时间:
2014-08-05 18:08:49
阅读次数:
234
Create an interface called Sortable in a package called sortPack. It should have one method compare which takes an Object as a parameter and returns a...
分类:
其他好文 时间:
2014-08-05 15:43:29
阅读次数:
316
此@interface部分为类扩展(extension)。其被设计出来就是为了解决两个问题的其一,定义类私有方法的地方。其二,实现public readonly,private readwrite的property(意思是在h头文件中定义一个属性对外是readonly的,但在类的内部希望是可读写的,...
分类:
移动开发 时间:
2014-08-05 15:26:29
阅读次数:
227
When you define a new interface, you are defining a new reference data type. You can use interface names anywhere you can use any other data type name...
分类:
其他好文 时间:
2014-08-05 15:23:49
阅读次数:
231
1,@class seatObject;typedef void (^touchButtom) (seatObject *);@interface seatObject : UIView{}@property (nonatomic ,strong)touchButtom block;@end2,@i...
分类:
其他好文 时间:
2014-08-05 15:18:59
阅读次数:
138