2012年10月9日

iphone中获取两个矩形的相交区域

摘要: 转自:http://sdlqhjk.iteye.com/blog/1067560//definiton a rectCGRect rect1 = CGRectMake(0.0f, 0.0f, 320.0f, 480.0f);//获取2个矩形的相交区域rect = CGRectIntersection(rect, bounds);//create smaller or bigger rect(have same center)CGRect rect2 = CGRectInset(rect, 32.0f, 32.0f);//CGRect and NSStringNSString *string = 阅读全文

posted @ 2012-10-09 09:18 kiao295338444 阅读(266) 评论(0) 推荐(0) 编辑

ios, iphone , objective C 随机数

摘要: Objective-C 没有提供相关的函数生成随机数,不过C供了rand(), srand(), random(), srandom(), arc4random(),randomize()几个函数。要引用头文件#include<stdlib.h> 其中,random()和randomize()函数的使用的方法分别与rand()和srand()函数的使用方法对应类似。arc4random()不用seedintrand(void);voidsrand(unsignedintn);randomize();arc4random();intrandom(void);voidsrandom(u 阅读全文

posted @ 2012-10-09 09:15 kiao295338444 阅读(310) 评论(0) 推荐(0) 编辑

导航