遇到这个问题, 本来想找现成的方案,结果半天没合适的 于是自己搞了一个,其实挺简单,给需要的朋友:
直接上代码
- (void)viewDidLoad {
[super viewDidLoad];
NSString * string = @"你好";
[self conversionCharacterInterval:4 current:string withLabel:sel...
分类:
其他好文 时间:
2015-07-28 18:37:27
阅读次数:
128
Singleton(单例模式),也叫单子模式,是一种常用的软件设计模式。在应用这个模式时,单例对象的类必须保证只有一个实例存在。代码如下:static ClassA *classA = nil;//静态的该类的实例+ (ClassA *)sharedManager{@synchronized(sel...
分类:
其他好文 时间:
2015-07-27 20:44:25
阅读次数:
117
method swizzling 修改方法函数的调用项目中用到的场景:打开页面显示的次数;用到的函数:@selector(方法名)class_getInstanceMethod(, )//返回类名下sel方法class_addMethod(, , , )//给cls添加一个新的方法,若干cls存在这...
分类:
其他好文 时间:
2015-07-27 18:16:49
阅读次数:
107
推荐android studio一个插件,可以将布局分组的 效果图: 地址:https://github.com/dmytrodanylyk/folding-plugin Installation Download latest Android File Grouping zip file here Open AS Settings, and sel...
分类:
移动开发 时间:
2015-07-27 15:10:05
阅读次数:
307
1 + (UIBarButtonItem *)itemWithIcon:(NSString *)icon highIcon:(NSString *)highIcon target:(id)target action:(SEL)action2 {3 UIButton *button = [UI...
分类:
其他好文 时间:
2015-07-27 01:51:09
阅读次数:
118
一.OC与C的对比关键字OC新增的关键字在使用时,注意部分关键字以"@"开头方法->函数定义与实现数据类型新增:BOOL/NSObject/id/SEL/block流程控制语句增强for循环for (NSString * name in NSArray){NSLog(@”%@”, name);}新增...
分类:
其他好文 时间:
2015-07-26 22:20:28
阅读次数:
188
读书笔记I/O复用使得程序能同时监听多个文件描述符,这对提高程序的性能至关重要。Linux下实现I/O复用的系统调用主要有select, poll, epoll。select:用户通过3个参数分别传人感兴趣的可读,可写及异常等事件,内核通过对这些参数的在线修改来反馈其中的就绪事件。用户每次调用sel...
分类:
系统相关 时间:
2015-07-25 16:34:42
阅读次数:
176
SEL s2 = @selector(eat:);[ani performSelector:s2 withObject:@"一块沾有粑粑的棒棒糖"];[ani performSelector:@selector(eat:andFoodName:)withObject:@"班长养的恶狗"withObj...
分类:
其他好文 时间:
2015-07-24 20:26:28
阅读次数:
122
选择器:是一种变量的类型,用于存储方法,类似于C语言的函数指针
作用:用于UI控件的点击事件
新建一个Dog的类
在Dog.m中写两个方法
#import "Dog.h"
@implementation Dog
- (void)bark{
NSLog(@"狗在叫");
}
- (void)barkToPeople:(NSString *)name{...
分类:
其他好文 时间:
2015-07-24 14:20:44
阅读次数:
106
支付宝IOS2.2.1支付将Demo中AlipaySDK.bundle AlipaySDK.framework libel.a lib crypto.a openssl Util加入到工程,在需要调用的地方加#import -(void)apily{
/*
*商户的唯一的parnter和seller。
*签约后,支付宝会为每个商户分配一个唯一的 parnter 和 sel...
分类:
移动开发 时间:
2015-07-23 14:01:07
阅读次数:
248