摘要: 在XCode 4.2中,有两种方法来打开NSZombie。常用方法一方法一:添加环境变量, 在菜单中,选择Product->Edit Schema, 选择Run (App Name), 在Arguments下面的Environment Variables中,添加NSZombieEnabled, Value值为YES。方法二:打开Diagnostics, 同样在菜单中选择Product -> Edit Schema, 选择Run (App Name), 在Diagnostics下,打开Memory Management下的Enable Zombie Objects. 阅读全文
posted @ 2013-06-13 22:26 yw415 阅读(286) 评论(0) 推荐(0)
摘要: UIImageJPEGRepresentation()在二次加载同一个文件时会出现问题 原因是在加载图片时使用了[UIImage imageWithContentsOfFile:(NSString *)]方法 这似乎会使文件一直处于打开状态 所以会使UIImageJPEGRepresentation()方法出错 解决的办法是NSData * data=[NSData dataWithContentsOfFile:imgPath];UIImage * img=[UIImage imageWithData:data];这样加载图片 阅读全文
posted @ 2013-04-23 19:34 yw415 阅读(363) 评论(0) 推荐(0)
摘要: 使用[UIViewsetAnimationDidStopSelector:@selector()]方法指定的委托函数有时候无法调用 原因是没有指定delegate使用[UIViewsetAnimationDelegate:self]方法指定委托便可以了 阅读全文
posted @ 2013-04-13 15:56 yw415 阅读(134) 评论(0) 推荐(0)
摘要: -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{ if([touch.view isKindOfClass:[PhotoSelectData class]]) { return NO; } returnYES;} 阅读全文
posted @ 2013-04-13 15:52 yw415 阅读(274) 评论(0) 推荐(0)
摘要: 必要属性一个TableView来显示选择项一个bool属性来判断Tableview是否露出来一个NSInteger属性来指示被选项的索引一个viewController容器来作为滑动试图一个viewController容器作为上一个被选中的滑动视图一个方法用来指定滑动效果并改变bool属性参考例子 PanList 阅读全文
posted @ 2013-03-30 21:05 yw415 阅读(193) 评论(0) 推荐(0)
摘要: 在父级视图中实现-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{ return (toInterfaceOrientation==UIInterfaceOrientationPortrait);}-(BOOL)shouldAutorotate{ returnNO;}-(NSUInteger)supportedInterfaceOrientations{ returnUIInterfaceOrientationMaskPortrait;}便可以锁定屏幕为... 阅读全文
posted @ 2013-03-30 20:08 yw415 阅读(327) 评论(0) 推荐(0)
摘要: 不要在layoutSubView中 初始化cell内部的空间 因为layoutSubView方法有时会出乎意料的被系统自动调用 产生很多奇怪的bug 阅读全文
posted @ 2013-03-30 17:45 yw415 阅读(147) 评论(0) 推荐(0)
摘要: 想给rootViewControll添加view 直接【self.window addsubview:】便可以 但是要在[self.window makeKeyAndVisible]后调用 否则新加入的view 不响应任何事件 阅读全文
posted @ 2013-03-30 17:42 yw415 阅读(129) 评论(0) 推荐(0)