05 2013 档案
摘要:非常简单,定义一个动画就行了,直接上代码 CATransition* transition = [CATransition animation]; transition.type = kCATransitionPush;//可更改为其他方式 transition.subtype = kCATransitionFromTop;//可更改为其他方式 [self.navigationController.view.layeraddAnimation:transition forKey:kCATransition]; [self.navigationControlle...
阅读全文
摘要:在init方法里注册这两个通知 [[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(keyboardwasShown:) name:UIKeyboardDidShowNotificationobject:nil]; [[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(keyboardwasHidden:) name:UIKeyboardDidHideNotificationobject:nil];别忘了在dea.
阅读全文
摘要:原文地址http://blog.sina.com.cn/s/blog_884e78b20100u0pp.html第一种:CGContextRef context = UIGraphicsGetCurrentContext();[UIView beginAnimations:nil context:context];[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];[UIView setAnimationDuration:kDuration];//动画时间[UIView setAnimationTransition:UIViewAn
阅读全文
摘要:用于自定义cell中每行内容不同时,获取行高 //这里width固定,就是动态获取行高 CGSize fitLabelSize = CGSizeMake(320, MAXFLOAT); //height固定,获取行宽 CGSize fitLabelSize = CGSizeMake(MAXFLOAT,30); NSString *labelString = nil; CGSize labelSize = [labelString sizeWithFont:self.labelString.font constrainedT...
阅读全文
摘要://获取view的controller- (UIViewController *)viewController { for (UIView* next = [self superview]; next; next = next.superview) { UIResponder *nextResponder = [next nextResponder]; if ([nextResponder isKindOfClass:[UIViewController class]]) { return (UIViewController *)nextResponder; } ...
阅读全文
摘要:大致就是自定义一个BlockButton继承UIButton,然后在里面用addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents这个方法触发block,代码很简单,不多说了BlockButton.h@class BlockButton;typedef void (^TouchButton)(BlockButton*);@interface BlockButton : UIButton@property(nonatomic,copy)TouchButton block;@end
阅读全文
摘要:NSArray *originalArray = @[@"1",@"21",@"12",@"11",@"0"]; //block比较方法,数组中可以是NSInteger,NSString(需要转换) NSComparator finderSort = ^(id string1,id string2){ if ([string1 integerValue] > [string2 integerValue]) { return (NSComparisonResult)NSOrderedDesc
阅读全文
摘要:原文地址http://blog.csdn.net/nono_love_lilith/article/details/7696533通信加解密基本算是每个涉及到用户信息的客户端都会用到的一个技术。一般我们可能就做简单的防篡改和密文加密。很多时候做一个加密只不过是一个小小的心理安慰吧了,因为纯粹的从安全角度来说,安全性真的不高。对于一些手机支付以及银联的客户端,我看到有用的证书什么来实现。因为没做过,所以也不是太了解。这边就说下最简单的加密方案。一:MD5数字摘要。准确来说,MD5不能叫做加解密,因为它不可逆性。一般我们理解的加解密是能加密,然后解密的。MD5只是根据数据生个一个校验码,然后对于数
阅读全文

浙公网安备 33010602011771号