博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2013年3月17日

摘要: a. 判断点是否再某MutablePathRef路径里-(void)viewDidLoad{[superviewDidLoad];CGMutablePathRefpathRef=CGPathCreateMutable();CGPathMoveToPoint(pathRef,NULL,4,4);CGPathAddLineToPoint(pathRef,NULL,4,8);CGPathAddLineToPoint(pathRef,NULL,10,4);CGPathAddLineToPoint(pathRef,NULL,4,4);CGPathCloseSubpath(pathRef);CGPoint 阅读全文

posted @ 2013-03-17 14:38 酸梅拯救地球 阅读(204) 评论(0) 推荐(0)

2013年3月14日

摘要: 1、随机数的使用1)、arc4random() 比较精确不需要生成随即种子 使用方法 : 通过arc4random() 获取0到x-1之间的整数的代码如下: intvalue=arc4random()%x; 获取1到x之间的整数的代码如下: intvalue=(arc4random()%x)+1; 2)、CCRANDOM_0_1() cocos2d中使用 ,范围是[0,1] 使用方法: float random = CCRANDOM_0_1() * 5; //[0,5] CCRANDOM_0_1() 取值范围是[0,1] 3)、random() 需要初始化时设置种子 使用方法: srandom 阅读全文

posted @ 2013-03-14 16:42 酸梅拯救地球 阅读(166) 评论(0) 推荐(0)

摘要: 1.When a gesture recognizer recognizes its specified gesture, it sends an action message to its target. To create a gesture recognizer, you initialize it with a target and an action.Often, the target object is the view’s view controller.ypically, you create a gesture recognizer in your view controll 阅读全文

posted @ 2013-03-14 11:32 酸梅拯救地球 阅读(212) 评论(0) 推荐(0)

2013年2月1日

摘要: myAnimation.animationImages = myArray;myAnimation.animationDuration = 0.7;myAnimation.animationRepeatCount = 1;[myAnimation startAnimating]; 这里,myAnimation类型是UIImageView. 由于功能需要,想取当前Animation的image.通过网上各种资料,目测不能实现.http://stackoverflow.com/questions/3351857/uiimageview-startanimating-how-do-you... 阅读全文

posted @ 2013-02-01 18:01 酸梅拯救地球 阅读(201) 评论(0) 推荐(0)

摘要: Fromthe documentation of-[NSArray indexOfObjectIdenticalTo:]:Return ValueThe lowest index whose corresponding array value is identical toanObject. If none of the objects in the array is identical toanObject, returnsNSNotFound.andNSNotFoundis defined as:enum{NSNotFound=NSIntegerMax};and 2147483647 = 阅读全文

posted @ 2013-02-01 15:05 酸梅拯救地球 阅读(301) 评论(0) 推荐(0)

2013年1月30日

摘要: 1.commitAnimations类方法被调用后,讲动画发送到一个独立的和应用程序的主时间循环分离的线程中执行动画.2.缺省情况下,当前运行的动画会执行完成.但setAnimationBeginsFromCurrentState:类方法传入YES会停止当前正在执行的动画,而使新动画在当前状态立刻执行.3.关于隐藏视图 a.通过视图的hidden属性可以隐藏视图(会同时隐藏其内嵌的所有子视图). b.该试图仍然会保留在视图层次中,会参与自动尺寸调整好其他布局操作. c.如果被隐藏的视图是当前第一响应者,则该视图会自动放弃器响应者的状态,但是目标作为第一响应者的时间仍然会传递给隐藏视图.4.关. 阅读全文

posted @ 2013-01-30 17:42 酸梅拯救地球 阅读(179) 评论(0) 推荐(0)

摘要: 1.-(void)willPresentAlertView:(UIAlertView *)a;ertView{UILabel *title = [alertView valurForKey:@"_titleLabel"];title.font = [UIFont fontWithName:@"Arial" size:18];[title setTextColor:[UIColor whiteColor];UILabel *body = [alertView valueForKey:@"_bodyTextLabel"];body.fon 阅读全文

posted @ 2013-01-30 13:55 酸梅拯救地球 阅读(353) 评论(0) 推荐(0)

2013年1月28日

摘要: 在ViewDidLoad 中取storyboard中UIImageView容器的frame,发现都是0,0,0,0 而在viewDidAppear中取能得到正常值 , ViewDidLoad 的机制? 阅读全文

posted @ 2013-01-28 15:57 酸梅拯救地球 阅读(99) 评论(0) 推荐(0)

2013年1月21日

摘要: 1.The tab bar controller creates and manages the tab bar view and also manages the view controllers that provide the content view for each mode.2.Each content view controller is designated as the view controller for one of the tabs in the tab bar view.3.The tab bar controller has its own container v 阅读全文

posted @ 2013-01-21 16:04 酸梅拯救地球 阅读(195) 评论(0) 推荐(0)

摘要: 1.Outlets may be considered private to the defining class; if you prefer, you can hide the property declarations a class extension. For example:// MyClass.h@interface MyClass : MySuperclass@end// MyClass.m@interface MyClass ()@property (weak) IBOutlet MyView *viewContainerSubview;@property (strong) 阅读全文

posted @ 2013-01-21 13:22 酸梅拯救地球 阅读(172) 评论(0) 推荐(0)