摘要: - (NSString *)intervalSinceNow: (NSString *) theDate{ NSString *timeString=@""; NSDateFormatter *format=[[NSDateFormatter alloc] init]; [format setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSDate *fromdate=[format dateFromString:theDate]; NSTimeZone *fromzone = [NSTimeZone systemTimeZo 阅读全文
posted @ 2014-02-08 09:48 菜鸟程序猿 阅读(4916) 评论(0) 推荐(0)
摘要: //改变图片颜色- (UIImage *)imageWithColor:(UIColor *)color{UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale);CGContextRefcontext = UIGraphicsGetCurrentContext();CGContextTranslateCTM(context, 0, self.size.height);CGContextScaleCTM(context, 1.0, -1.0);CGContextSetBlendMode(context, kCGBlend 阅读全文
posted @ 2014-02-08 09:34 菜鸟程序猿 阅读(306) 评论(0) 推荐(0)
摘要: NSMutableArray *array = [[NSMutableArray alloc]initWithArray: [self.navigationController viewControllers]]; // 删除栈中的一个viewcontroller [array removeObjectAtIndex:2]; // 清掉栈中的所有viewcontroller并跳到指定viewcontroller [array removeAllObjects]; pxViewController *px = [[pxViewController alloc]init... 阅读全文
posted @ 2014-02-07 17:49 菜鸟程序猿 阅读(268) 评论(0) 推荐(0)
摘要: XMPPRoom *room; // 初始化房间 XMPPRoomCoreDataStorage *rosterstorage = [[XMPPRoomCoreDataStorage alloc] init]; if (rosterstorage==nil) { NSLog(@"nil"); rosterstorage = [[XMPPRoomCoreDataStorage alloc] init]; } roomJID = [XMPPJID jidWithString:roomName]; room = [[XMPPRoom alloc] ... 阅读全文
posted @ 2014-02-07 14:56 菜鸟程序猿 阅读(1739) 评论(0) 推荐(0)
摘要: addressBookHelper.h#import enum { ABHelperCanNotConncetToAddressBook, ABHelperExistSpecificContact, ABHelperNotExistSpecificContact};typedef NSUInteger ABHelperCheckExistResultType;@interface addressBookHelper : NSObject// 添加联系人// name -> 联系人姓名// phoneNum -> 电话号码// label -> 电话号码的标... 阅读全文
posted @ 2014-01-24 16:19 菜鸟程序猿 阅读(1717) 评论(0) 推荐(0)
摘要: NSMutableString *groupName = [[NSMutableString alloc]init]; for (int i = 0; i< addedFriendArray.count; i++) { (i==0)?:[groupName appendString:@","]; NSString *name = [[addedFriendArray objectAtIndex:i] name]; [groupName appendString:name]; } NSLog(@"groupName is%@",gro... 阅读全文
posted @ 2014-01-20 10:29 菜鸟程序猿 阅读(133) 评论(0) 推荐(0)
摘要: [[NSNotificationCenter defaultCenter] postNotificationName:@"postCity" object:pro];[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cityCallBack:) name:@"postCity" object:nil];- (void)cityCallBack:(NSNotification *)notification{ if (nil != notification.ob 阅读全文
posted @ 2014-01-15 19:55 菜鸟程序猿 阅读(527) 评论(0) 推荐(0)
摘要: [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:2] animated:YES];或for (UIViewController *controller in self.navigationController.viewControllers) { if ([controller isKindOfClass:[你要跳转到的Controller class]]) { [self.navigationController ... 阅读全文
posted @ 2014-01-15 19:36 菜鸟程序猿 阅读(381) 评论(0) 推荐(0)
摘要: // 展开动画- (void)beginAnimations{ CGContextRef context = UIGraphicsGetCurrentContext(); [UIView beginAnimations:nil context:context]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:0.6];//动画时间长度,单位秒,浮点数 myView.frame = CGRectMake(0, 0, 320, 110); ... 阅读全文
posted @ 2014-01-13 19:55 菜鸟程序猿 阅读(1326) 评论(0) 推荐(0)
摘要: + (BOOL) judgeRange:(NSArray*)conditionArr Password:(NSString*)password{ NSRange range; BOOL result =NO; for(int i=0; i",@"?",@"/",@"、", nil]; NSString* result1 = [NSString stringWithFormat:@"%d",[self judgeRange:termArray1 Password:password]]; NSString* 阅读全文
posted @ 2014-01-11 15:19 菜鸟程序猿 阅读(450) 评论(0) 推荐(0)