摘要:
关于NSArray,NSMutableArray的使用与内存问题(仅个人在使用过程中体会)偶已几种方式建立说明如下:第一种:FirstArray = [[NSArray arrayWithObjects:@"a",@"b",@"c",nil] retain];NSLog(@"FirstArray%d",[FirstArray count]);NSLog(@"FirstArray%d",[FirstArray retainCount]);此方式返回的retainCount为2,程序难免会leak, 阅读全文
摘要:
/******************************************************************************************* NSArray *******************************************************************************************/ /*---------------------------创建数组------------------------------*/ //NSArray *array = [NSArray alloc] initW 阅读全文
摘要:
1. 代码CGRect rect1 = [self positionRect:sheep];CGRect rect2 = [self positionRect:cow];if (!CGRectIsNull(CGRectIntersection(rect1, rect2))) { //handle collision [sheep stopAction:jump_4ever];}2.然后 schedule 一个 1/30 或者 1/60 的 函数在里面进行检测。 阅读全文