Fork me on GitHub
上一页 1 ··· 112 113 114 115 116 117 118 119 120 ··· 125 下一页

2012年2月7日

摘要: 1.绘图总结:绘图前设置:CGContextSetRGBFillColor/CGContextSetFillColorWithColor //填充色CGContextSetRGBStrokeColor/CGContextSetStrokeColorWithColor //笔颜色CGContextSetLineWidth //线宽度绘图后设置:注: 画完图后,必须先用CGContextStrokePath来描线,即形状后用CGContextFillPath来填充形状内的颜色.2.常见图形绘制:CGContextFillRect/CGContextFillRectsCGContextFillEll 阅读全文
posted @ 2012-02-07 20:42 pengyingh 阅读(553) 评论(0) 推荐(0)
摘要: 1、如果在程序中想对某张图片进行处理的话(得到某张图片的一部分)可一用以下代码:UIImage *image = [UIImageimageNamed:filename];CGImageRef imageRef = image.CGImage;CGRect rect =CGRectMake(origin.x, origin.y,size.width, size.height);CGImageRef imageRefRect =CGImageCreateWithImageInRect(imageRef, rect);UIImage *imageRect = [[UIImagealloc]init 阅读全文
posted @ 2012-02-07 20:36 pengyingh 阅读(597) 评论(0) 推荐(0)
摘要: iPhone开发 - 常用库 这里总结了iPhone开发者开发过程中可能需要的一些资源如何用Facebook graphic api上传视频:http://developers.facebook.com/blog/post/532/Keychain保存数据封装:https://github.com/carlbrown/PDKeychainBindingsController对焦功能的实现:http://www.clingmarks.com/?p=612自定义圆角Switch按件:https://github.com/domesticcatsoftware/DCRoundSwitch弹出窗口Fo 阅读全文
posted @ 2012-02-07 20:34 pengyingh 阅读(845) 评论(0) 推荐(2)
摘要: 磨刀不误砍柴工。作为手机应用开发者,你需要向应用商店提交应用审核,迅速通过审核可以让你抢占先机。对苹果iOS应用开发者来说尤其如此。苹果应用商店的审核近乎吹毛求疵,下面这些清单可以让你知道苹果会在哪些地方找茬。基本要点首先,你的应用程序:- 不能导致手机故障(比如崩溃或屏幕问题)- 长时间/过度使用之后反应仍然很快- 应用内的所有价格信息中不能用固定值代替可变变量- 不要使用任何SDK里面的私人API- 不要使用任何SDK文档里面没有列出的功能- 不要提及用户设备上不存在的硬件功能- 如果需要网络连接,在没有网络的情况下要告知用户- 不要(过度)模仿任何本地应用程序- 不要(过度)山寨某个本地 阅读全文
posted @ 2012-02-07 20:30 pengyingh 阅读(173) 评论(0) 推荐(0)
摘要: 加密:1 NSString* encodeURL(NSString *string)2 {3 NSString *newString = NSMakeCollectable([(NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)string, NULL, CFSTR(":/?#[]@!$ &'()*+,;="<>%{}|\\^~`"), CFStringConvertNSStringEncodingToEncoding 阅读全文
posted @ 2012-02-07 20:20 pengyingh 阅读(307) 评论(0) 推荐(0)
摘要: 更改cell选中的背景 UIView *myview = [UIView alloc] init]; myview.frame = CGRectMake(0, 0, 320, 47); myview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"0006.png"]; cell.selectedBackgroundView = myview;在数字键盘上添加button://定义一个消息中心[NSNotificationCenter defaultCenter] addObs.. 阅读全文
posted @ 2012-02-07 20:12 pengyingh 阅读(155) 评论(0) 推荐(0)
摘要: NSNumber+ (NSNumber *)numberWithInt:(int)value;+ (NSNumber *)numberWithDouble:(double)value;- (int)intValue;- (double)doubleValue;NSNumber可以将基本数据类型包装起来,形成一个对象,这样就可以给其发送消息,装入NSArray中等等。NSNumber * intNumber=[NSNumbernumberWithInt:100];NSNumber *floatNumber=[NSNUmbernumberWithFloat:100.00];int i=[intNu 阅读全文
posted @ 2012-02-07 20:03 pengyingh 阅读(1796) 评论(0) 推荐(0)
摘要: 1. NSString转化为UNICODE String:(NSString*)fname = @“Test”;char fnameStr[10];memcpy(fnameStr, [fname cStringUsingEncoding:NSUnicodeStringEncoding], 2*([fname length]));与strcpy相比,memcpy并不是遇到'\0'就结束,而是一定会拷贝完n个字节2. NSString 转化为 char *NSString * str= @“Test”;const char * a =[str UTF8String];3.char 阅读全文
posted @ 2012-02-07 20:01 pengyingh 阅读(101869) 评论(0) 推荐(0)
摘要: iPhone文件系统:创建、重命名以及删除文件NSFileManager中包含了用来查询单词库目录、创建、重命名、删除目录以及获取/设置文件属性的方法(可读性,可编写性等等)。每个程序都会有它自己的沙盒,通过它你可以阅读/编写文件。写入沙盒的文件在程序的进程中将会保持稳定,即便实在程序更新的情况下。如下所示,你可以在沙盒中定位文件目录://对于错误信息NSError *error;// 创建文件管理器NSFileManager *fileMgr = [NSFileManagerdefaultManager];//指向文件目录NSString *documentsDirectory= [NSHo 阅读全文
posted @ 2012-02-07 18:52 pengyingh 阅读(1788) 评论(0) 推荐(0)
摘要: 1 TodoViewController *contentViewController = [[TodoViewController alloc] init]; 2 3 UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:contentViewController]; 4 5 navigationController.contentSizeForViewInPopover = CGSizeMake(100, 100); //内容大... 阅读全文
posted @ 2012-02-07 17:51 pengyingh 阅读(162) 评论(0) 推荐(0)
上一页 1 ··· 112 113 114 115 116 117 118 119 120 ··· 125 下一页

导航