/**
* 策略模式:针对同一命令(或行为),不同的策略做不同的动作
* 商品促销
* 本类为:收取现金的类
*
* @author stone
*/
public interface ICashSuper {
double acceptCash(double money);
}
/**
* 正常收取现金
* @author stone
*
*/
public ...
分类:
编程语言 时间:
2014-10-10 19:17:14
阅读次数:
148
//@"123456789" 转换后 @"123,456,789"
@interface NSString (num)
- (NSString *)money;
@end
@implementation NSString (num)
- (NSString *)money{
NSNumberFormatter *numFormat = [[NSNumberForma...
分类:
移动开发 时间:
2014-10-10 19:06:04
阅读次数:
140
.h#import @interface RootViewController : UIViewController{ UIImageView *imageView;}.m- (void)viewDidLoad{ [super viewDidLoad]; // Do any add...
分类:
Web程序 时间:
2014-10-10 17:21:44
阅读次数:
305
接口
1、概念
初期理解,可以认为是一个特殊的抽象类
当抽象类中的方法都是抽象的,那么该类
可以通过接口的形式来表示。
class用于定义类
interface用于定义接口。
2、接口定义
1,接口中常见定义:常量,抽象方法。
2,接口中的成员都有固定修饰符(默认,可不写)。
常量:public static final
...
分类:
编程语言 时间:
2014-10-10 13:52:04
阅读次数:
168
看到官方的一个例子不错,这里留记。
#import
@interface NSMutableArray (variadicMethodExample)
- (void) appendObjects:(id) firstObject, ...; // This method takes a nil-terminated list of objects.
@end
@implementat...
分类:
移动开发 时间:
2014-10-10 13:32:54
阅读次数:
227
The real problem with concurrency occurs when tasks that are executing in parallel begin to interface with each other. This can happen in such a subtl...
分类:
其他好文 时间:
2014-10-10 01:52:23
阅读次数:
167
1、定义接口 使用interface来定义一个接口。接口定义同类的定义类似,也是分为接口的声明和接口体,当中接口体由常量定义和方法定义两部分组成。定义接口的基本格式例如以下:[修饰符] interface 接口名 [extends 父接口名列表]{[public] [static] [final]....
分类:
编程语言 时间:
2014-10-10 00:03:01
阅读次数:
332
更改协议成block,运行,设置一个头文件person.h#import @interface Person : NSObject@property (nonatomic, copy) void (^brak)(void); //声明void类返回void的block类型的brak,@propert...
分类:
其他好文 时间:
2014-10-09 23:34:48
阅读次数:
194
1首先创建一个模型类,一定要遵守NSCoding协意。@interface Contact : NSObject @property (nonatomic, copy) NSString *name;@property (nonatomic, copy) NSString *phone;@endim...
分类:
其他好文 时间:
2014-10-09 22:49:51
阅读次数:
240
4.3.ipmitool - utility for controlling IPMI-enabled devices4.3.1.ipmitool4.3.1.1.ubuntu确定硬件是否支持 IPMI neo@monitor:~$ sudo dmidecode |grep -C 5 IPMI[...
分类:
其他好文 时间:
2014-10-09 20:46:37
阅读次数:
267