一个非常好的注册机实现代码,而且市场流行的 istar menu 的。importCocoaextensionString{funcMD5Numeric()->String?{letdata=(selfasNSString).dataUsingEncoding(NSUTF8StringEncodin... Read More
posted @ 2014-12-04 10:50 夏了′夏天 Views(441) Comments(0) Diggs(0) Edit
是你吗?希望看过之后的男孩女孩都能共勉。我最近一直关注一个男孩子的微博。是我原来的学生,九零后高中生。大约三个月前,他写着:感谢老天让我遇到你,一辈子的爱。半个月后他失恋了。大约两个月前,他又写道:这一次我肯定你才是我的最爱,非你不娶。半个月后他又失恋了。大约一个月前,他声明:给我个机会证明你是我一... Read More
posted @ 2014-11-18 14:49 夏了′夏天 Views(130) Comments(0) Diggs(0) Edit
转载自:http://www.cocoachina.com/applenews/devnews/2014/0107/7667.html09年的一篇文章,比较深入地阐述了KVO的内部实现。KVO是实现Cocoa Bindings的基础,它提供了一种方法,当某个属性改变时,相应的objects会被通知到... Read More
posted @ 2014-11-10 20:54 夏了′夏天 Views(123) Comments(0) Diggs(0) Edit
+ (UIImage*)createImageWithColor:(UIColor*)color{ CGRectrect=CGRectMake(0.0f,0.0f,1.0f,1.0f); UIGraphicsBeginImageContext(rect.size); CGContextRefcont... Read More
posted @ 2014-11-10 19:08 夏了′夏天 Views(127) Comments(0) Diggs(0) Edit
从网页加本体图片-NSString*boundle=[[NSBundlemainBundle]resourcePath];[web1loadHTMLString:[NSStringstringWithFormat:@"<imgsrc='http://fei263.blog.163.com/blog/0001.png'/>"]baseURL:[NSURLfileURLWithPath:boundle]];从网页加载图片并让图片在规定长宽中缩小[cell.imgloadHTMLString:[NSStringstringWithFormat:@&qu Read More
posted @ 2013-04-24 22:03 夏了′夏天 Views(154) Comments(0) Diggs(0) Edit
//创建一个基于位图的图形上下文并指定大小为CGSizeMake(200,400)UIGraphicsBeginImageContext(CGSizeMake(200,400));//renderInContext呈现接受者及其子范围到指定的上下文[self.view.layerrenderInContext:UIGraphicsGetCurrentContext()];//返回一个基于当前图形上下文的图片UIImage*aImage=UIGraphicsGetImageFromCurrentImageContext();//移除栈顶的基于当前位图的图形上下文UIGraphicsEndImag Read More
posted @ 2013-04-24 21:57 夏了′夏天 Views(104) Comments(0) Diggs(0) Edit
UIAlertView*theAlert=[[[UIAlertViewalloc]initWithTitle:@"Atention"message:@"I'maChinese!"delegate:nilcancelButtonTitle:@"Cancel"otherButtonTitles:@"Okay",nil]autorelease];[theAlertshow];UIImage*theImage=[UIImageimageNamed:@"loveChina.png"];theIma Read More
posted @ 2013-04-24 21:54 夏了′夏天 Views(114) Comments(0) Diggs(0) Edit
// 自定义 cell- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *identifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWit Read More
posted @ 2012-12-15 17:19 夏了′夏天 Views(200) Comments(0) Diggs(0) Edit
天去文思创新面试,考官问了我一个简单的实现,即:自己编写strcpm的实现,IBM曾经也考过写strcpy原型,这几个函数在面试的时候经常被考到,很具有代表性,突然被问起还真有点措手不及呢。现在记下供大家学习和以后温习:(下面的程序经本人通过)1、Strcat函数原型如下:char *strcat(char *strDest, const char *strScr) //将源字符串加const,表明其为输入参数{ char * address = strDest; //该语句若放在assert之后,编译出错 assert((strDest != NULL) && (strScr Read More
posted @ 2012-07-26 14:30 夏了′夏天 Views(193) Comments(0) Diggs(0) Edit
一,c++函数的返回分为以下几种情况1)主函数main的返回值:这里提及一点,返回0表示程序运行成功。2)返回非引用类型:函数的返回值用于初始化在跳用函数出创建的临时对象。用函数返回值初始化临时对象与用实参初始化形参的方法是一样 的。如果返回类型不是引用,在调用函数的地方会将函数返回值复制给临时对象。且其返回值既可以是局部对象,也可以是求解表达式的结果。3)返回引用:当函数返回引用类型时,没有复制返回值。相反,返回的是对象本身。二,函数返回引用1,当函数返回引用类型时,没有复制返回值。相反,返回的是对象本身。先看两示例,示例1如下:conststring&shorterString(c Read More
posted @ 2012-07-24 16:19 夏了′夏天 Views(197) Comments(0) Diggs(0) Edit