动态代理这个名词就不用多说了,是经典的二十三种设计模式中的一种。代理模式也不多说,现在聊聊动态代理的方式。 第一种方式是JDK自带方式,原理是在程序运行时,运用反射机制动态创建而成,不过它有一个先决条件就是被代理对象必须是实现某个接口的对象才能代理。看代码: public interface...
分类:
编程语言 时间:
2014-06-25 23:15:21
阅读次数:
300
java用 @interface Annotation{ } 定义一个注解 @Annotation,一个注解是一个类。@Override,@Deprecated,@SuppressWarnings为常见的3个注解。注解相当于一种标记,在程序中加上了注解就等于为程序加上了某种标记,以后,JAVAC编....
分类:
编程语言 时间:
2014-06-25 21:37:54
阅读次数:
319
一、下载ZBarSDK, 加入到工程中。二、配置TARGETS和PROJECT三、设置Link Binary With Libraries四、 .m文件#import "MQMainViewController.h"#import "ZBarSDK.h"@interface MQMainViewCo...
分类:
其他好文 时间:
2014-06-25 20:48:23
阅读次数:
322
继上一章,使用CoreLocation框架获取了当前设备的位置,这一章介绍地图的使用.
首先,导入框架
#import
@main代码示例
main.h
#import
#import
// 引用地图协议
@interface HMTMainViewController : UIViewController
@end
ma...
分类:
其他好文 时间:
2014-06-25 19:46:54
阅读次数:
149
下面是代码,注释也写得比较清楚:
//
// HttpDemo.h
// MyAddressBook
//
// Created by hherima on 14-6-23.
// Copyright (c) 2014年 chinasofti. All rights reserved.
//
#import
#import
@interface HttpDemo : NSObjec...
分类:
其他好文 时间:
2014-06-25 00:07:58
阅读次数:
190
iOS Dev (59) 高度自适应的UITextView
作者:阿锐 地址:http://blog.csdn.net/prevention
-
如下 _inputTextView 为一个 UITextView 实例。首先要设置它的 delegate,然后要在你的头文件的 interface 声明中加上 UITextViewDelegate。
_inputTextView.delegate...
分类:
移动开发 时间:
2014-06-24 22:57:40
阅读次数:
275
简单思路:实例一个UIScrollView,在scrollView上添加两个UIView, 为scrollView添加观察者,观察scrollView的contentOffset属性.当偏移量改变时,改变UIView视图的坐标.示例代码:@interface RootViewController (...
分类:
其他好文 时间:
2014-06-24 13:35:15
阅读次数:
297
我们来看Interfaces ofport: OpenFlow port number for this interface. type: system: An ordinary network device, e.g. eth0 on Linux. internal: A simulated ne...
分类:
其他好文 时间:
2014-06-24 12:23:51
阅读次数:
316
en
conf t
vlan id
end
conf t
inter rang gi 0/0/1-x
switchport access vlan id
no shutdown
exit
(config)#interface range gigabitEthernet 1/0/23-24
(config-if-range)#switchport mode trunk
(con...
分类:
其他好文 时间:
2014-06-22 14:12:59
阅读次数:
421
需要写入的对象必须实现NSCoding protocol
Person.h
#import
#import "Face.h"
@interface Person : NSObject
@property (nonatomic, strong) NSString *personId;
@property (nonatomic, strong) NSString *n...
分类:
其他好文 时间:
2014-06-22 08:00:31
阅读次数:
216