摘要: 1.为什么要符号化: IOS程序在真机运行程序出现crash状况时,机器会自动产生log文件,它包含了在程序crash之前的运行逻辑,分析carsh文件,有效的解决程序在真机上的问题,保证程序良好的稳定性,但是这个crash文件多数是显示出现问题的地址和一些系统的消息,无法查看程序中对应的崩溃地点。... 阅读全文
posted @ 2015-01-27 19:56 nanoCramer 阅读(744) 评论(0) 推荐(0) 编辑
摘要: ImageOptim(http://imageoptim.com/)是一个免费的图像压缩工具。iOS工程默认使用pngcrash命令来压缩图片,不过其压缩比率其实并不高。对于应用中图片资源比较多的情况,可以尝试使用ImageOptim来达到最大的图片压缩效果。ImageOptim作为一款基于Mac的... 阅读全文
posted @ 2015-01-27 19:50 nanoCramer 阅读(882) 评论(0) 推荐(0) 编辑
摘要: 当UITextField的实例执行becomeFirstResponser时,若其中含有文字时,系统默认将光标定位到最后的位置,下面的语句将光标定位到首位置。UITextField *textField = [UITextField alloc] init];textField.selectedRange = NSMakeRange(0,0); UITextView的实现类似。 阅读全文
posted @ 2013-09-26 10:11 nanoCramer 阅读(2631) 评论(0) 推荐(0) 编辑
摘要: Is there any way to detect when the backspace/delete key is pressed in the iPhone keyboard on a UITextField that is empty? Here is non-hacky and very simple with a quick subclass of UITextField.This is the best solution. Objective C is based on sub classing and this solution uses it properly to solv 阅读全文
posted @ 2013-08-29 20:02 nanoCramer 阅读(527) 评论(0) 推荐(0) 编辑
摘要: scrollsToTop小结UIScrollView是用来展示滚动的一个类。他有UITableView、UITextView等子类,scrollsToTop是UIScrollView的一个属性,主要用于点击设备的状态栏时,是scrollsToTop == YES的控件滚动返回至顶部。每一个默认的UIScrollView的实例,他的scrollsToTop属性默认为YES,所以要实现某一UIScrollView的实例点击设备状态栏返回顶部,则需要关闭其他的UIScrollView的实例的scrollsToTop属性为NO,很好理解,若多个scrollView响应返回顶部的事件,系统就不知道到底要 阅读全文
posted @ 2013-07-18 21:51 nanoCramer 阅读(2468) 评论(0) 推荐(1) 编辑
摘要: 忘记从哪里看到的这个了,不过非常有用,记录下来!// Recursively travel down the view tree, increasing the indentation level for children- (void)dumpView:(UIView *)aView atIndent:(int)indent into:(NSMutableString *)outstring{for (int i = 0; i < indent; i++) [outstring appendString:@"--"];[outstring appendFormat: 阅读全文
posted @ 2013-07-18 21:31 nanoCramer 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 1、屏幕旋转显示视图时,尽量不用单一的view去实现,将view放在viewcontroller里实现,这样可以在viewController中去添加其旋转方法,实现适配屏幕旋转。(1)支持全部方向的旋转iOS6.0需要下面三个方法,代码如下:-(BOOL) shouldAutorotateToInterfaceOrientation : (UIInterfaceOrientation) toInterfaceOrientation{ return(toInterfaceOrientation !=UIInterfaceOrientationMaskPortraitUpsideDown);}- 阅读全文
posted @ 2013-07-16 10:20 nanoCramer 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 工程中需要需要实现自定义的弹出提示框,暂时的实现方法是alloc一个view出来,以subView的方式加在底部的webView上面正中间,这样在keyboard弹出时,提示框被遮住,需要修改。既然是keyBoard引起的问题,那我们就获取keyBoard弹出的状态,如果是弹出状态,那么调整位置,使提示框能正常显示。我们在ViewDidLoad里添加下面俩个方法:[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowN 阅读全文
posted @ 2013-07-08 20:12 nanoCramer 阅读(1182) 评论(0) 推荐(0) 编辑
摘要: UItableViewCell滑动删除时,调整cell的位置大小是否显示等。CustomTableViewCell为UITableViewCell的子类,在实现文件中重写willTransitionToState方法。willTransitionToState是在cell改变显示状态的时候调用,有三种状态:typedef NS_OPTIONS(NSUInteger, UITableViewCellStateMask) { UITableViewCellStateDefaultMask = 0, //普通状态 UITabl... 阅读全文
posted @ 2013-06-17 14:28 nanoCramer 阅读(969) 评论(0) 推荐(0) 编辑
摘要: NSMutableArray *oldArray = [[NSMutableArray alloc] init]; NSDictionary *dic1 = [[NSDictionary alloc] initWithObjectsAndKeys:@"11111", @"number", @"c", @"name", nil]; NSDictionary *dic2 = [[NSDictionary alloc] initWithObjectsAndKeys:@"22222", @"n 阅读全文
posted @ 2013-06-10 15:14 nanoCramer 阅读(245) 评论(0) 推荐(0) 编辑