底层封装是使用了typedef定义的结构体typedef struct _NSString{xxxxxx} NSString;1. NSRange 结构体#注意结构体不是对象3种定义方式1 typedef struct _NSRange{2 int locat...
分类:
其他好文 时间:
2014-11-24 20:49:42
阅读次数:
159
注意:1.变量名和函数名不要混淆调用2.不要对文件夹进行文件的操作,没有权限3.递归调用注意初始化变量 1 // 2 // main.m 3 // CodeLineCount 4 // 5 // Created by hellovoidworld on 14-11-18. 6 // Copy...
分类:
其他好文 时间:
2014-11-24 20:49:10
阅读次数:
191
NSNumber能够包装基本数据类型称为OC对象,是因为继承了NSValue包装结构体成OC对象1.自带结构体 1 void value() 2 { 3 CGPoint point = CGPointMake(10, 10); 4 NSValue *obj = [NSValue va...
分类:
其他好文 时间:
2014-11-24 20:46:37
阅读次数:
252
A.集合的手动内存管理NSArrayaddObject: 加入的元素执行一次retainremoveObject: 被删除的元素执行一次releaseremoveAllObjects: 所有元素执行一次releaseB.ARC机制集合内存分析当一个对象被放入集合中时,会保存它的强指针当一个对象被从集...
分类:
其他好文 时间:
2014-11-24 20:46:09
阅读次数:
177
OSAL的消息队列每一个消息都包含一个消息头osal_msg_hdr_t和用户自定义的消息,osal_msg_hdr_t结构体定义如下:typedef struct{ void *next; uint16 len; uint8 dest_id;} osal_msg_hdr_t;在事件处理函数Samp...
分类:
其他好文 时间:
2014-11-24 20:48:34
阅读次数:
420
Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially...
分类:
其他好文 时间:
2014-11-24 20:46:06
阅读次数:
180
每一个Java程序员都知道日志对于任何一个Java应用程序,尤其是服务端程序是至关重要的,而很多程序员也已经熟悉各种不同的日志库如java.util.logging、Apache log4j、logback。但如果你还不知道SLF4J(Simple logging facade for Java)的...
分类:
其他好文 时间:
2014-11-24 20:45:38
阅读次数:
260
使用Class来创建实例1 // 18.通过@"Ball"创建一个Ball实例(不可以使用[[Ball alloc] init]创建)2 NSString *className = @"Ball";3 Class class = NSClassFrom...
分类:
其他好文 时间:
2014-11-24 20:46:05
阅读次数:
147
任何一个iOS应用程序都是由一个或者多个线程构成的。无论你是否显示的使用了多线程编程技术,至少有1个 线程被创建。该线程叫做”mainUI线程”,被附加到主事件处理循环中(mainrun loop)。多线程就是为了提高引用程序的工作效率!避免阻塞主线程!当我们没有用任何多线程技术的话,默认情况下,是...
分类:
其他好文 时间:
2014-11-24 20:46:06
阅读次数:
278
A. 目录管理 1 NSFileManager*manager = [NSFileManagerdefaultManager];//单例模式 2 3 // 1.获取文件属性 4 NSString *path = @"/Users/hellovoidw...
分类:
其他好文 时间:
2014-11-24 20:46:20
阅读次数:
181
状态转移方程不难想 我没想到另外还要开个数组 记录上一次的最优状态 wtf主要是另外还要开个temp数组 这样可以减少一层for循环.dp[x,y]在前x分钟我睡觉花掉了y分钟的时间 ( x>=y )dp[x,y] = dp[x-1,y-1]假如我在x这个时间点正在睡觉 那么我得到价值就是 x-1这...
分类:
其他好文 时间:
2014-11-24 20:45:59
阅读次数:
250
日期处理类定义时间间隔计算时间比较,返回其一时间格式化 1 void dateCreate() 2 { 3 //date return current time 4 NSDate *date = [NSDate date]; 5 NSLog(@"%@", date); 6 ...
分类:
其他好文 时间:
2014-11-24 20:44:20
阅读次数:
215
Periodic StringsA character string is said to have periodkif it can be formed by concatenating one or more repetitions of another string of lengthk. F...
分类:
其他好文 时间:
2014-11-24 20:45:26
阅读次数:
175
这题看别人的。就是那么诚实。http://www.cnblogs.com/zhyfzy/p/4117481.htmlB. QueueDuring the lunch break allnBerland State University students lined up in the food co...
分类:
其他好文 时间:
2014-11-24 20:44:26
阅读次数:
225
1.常用宏或函数的实现_T,_L宏:#define unsigned short L#define _T(x) __T(x)#define _TEXT(x) __T(x)#ifdef _UNICODE#define __T(x) L##x #else#define __T(x) x #endif#d...
分类:
其他好文 时间:
2014-11-24 20:44:38
阅读次数:
261
使用函数改变NSString 1 void changeStr2(NSString **str3) 2 { 3 *str3 = @"789"; 4 } 5 6 int main(int argc, const char * argv[]) { 7 @autoreleasepool ...
分类:
其他好文 时间:
2014-11-24 20:46:16
阅读次数:
191