摘要:svn switch --relocate http://oldPath http://newpath
阅读全文
摘要:View Code 1 @implementation UIImage (fixOrientation) 2 3 - (UIImage *)fixOrientation { 4 5 // No-op if the orientation is already correct 6 if (self.imageOrientation == UIImageOrientationUp) return self; 7 8 // We need to calculate the proper transformation to make the image upright....
阅读全文
摘要:Xcode3主题位置: Developer/Library/PrivateFrameworks/XcodeEdit.framework/Resources后缀为xccolortheme如何将Xcode3的主题转化为Xcode4的主题?1、https://gist.github.com/793006下载转换脚本,解压后将dvtcolorconvert.rb 放到桌面上.2、 将要转换的Xcode3主题也放到桌面上3、打开终端sudo gem install plistruby dvtcolorconvert.rb MyDusk.xccolortheme4、此时会在桌面上生成MyDusk.dvtc
阅读全文
摘要:Build SettingsHeader Search Paths 加入 /usr/include/libxml2
阅读全文
摘要:一、先点击链接去了解一下,或者 google一下http://code.google.com/intl/zh-CN/apis/protocolbuffers/二、protobuf的使用1、编译Protocol Buffers A.下载Protocol Buffers将下载解压后的文件存放至Applications目录下,进到ProtocolBuffers-2.2.0-Source目录看看会发现有个src目录。用命令切换至ProtocolBuffers-2.2.0-Source目录下。下载地址: http://code.google.com/p/metasyntactic/downloads/.
阅读全文
摘要:copy: ['NSString', 'NSMutableString', 'NSArray', 'NSNumber']assign: ['int', 'integer', 'BOOL', 'float', 'NSUInteger', 'NSInteger', 'double', 'uint8_t', 'uint16_t', 'uint32_t', 'int8_t&
阅读全文
摘要:一 、简述Storyboard是你可以用来定义用户界面的一种新的方式,像xib。与xib不同的是它可以同时管理多个ViewController,而且可以在Storyboard中配置ViewController 之间的跳转关系。二、Storyboard使用如果你是创建新项目,Xcode模版可以提供一个配置好的Storyboard供你使用。对于其它的应用,使用Storyboard的过程如下:1、配置应用程序Info.plist文件添加UIMainStoryboardFile ,值为storyboard的文件名。删除原来的NSMainNibFile2、像以前创建xib文件一样创建一个storyboa
阅读全文
摘要:1、图片拉伸UIImage *img = [UIImage imageNamed:@"inputbox.png"];UIImage *stretchedImage = [img stretchableImageWithLeftCapWidth:20.0f topCapHeight:10.0f];2、键盘高度 ios5 以前中文键盘高度216.0f ios5 以后中文键盘高度252.0f3、emoji小图标http://www.easyapns.com/iphone-emoji-alerts4、使用ASI时,需要引入的一些framework5、获取documents目录和资源
阅读全文
摘要:for(UIView *subview in [view subviews]) { [subview removeFromSuperview];}for(UIView *subview in [view subviews]) { if([subview isKindOfClass:[UIButton class]]) { [subview removeFromSuperview]; } else { // Do nothing - not a UIButton or subclass instance }}
阅读全文
摘要:You usually want to useNSIntegerwhen you don't know what kind of processor architecture your code might run on, so you may for some reason want the largest possibleinttype, which on 32 bit systems is just anint, while on a 64-bit system it's along.I'd stick with usingNSIntegerinstead ofi
阅读全文
摘要:Icon-72.png 72x72Icon-Small-50.png 50x50Icon-Small.png 29x29Icon-Small@2x.png 58x58Icon.png 57x57Icon@2x.png 114x114// info.plist
阅读全文
摘要:http://developer.apple.com/library/ios/#samplecode/QuartzDemo/Introduction/Intro.html
阅读全文
摘要:View Code // 渐变色 gradient CGFloat colors [] = { 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 }; CGFloat locations[] = { 0.0f,0.5f,1.0f }; CGColorSpaceRef baseSpace = CGColorSpaceCreateDeviceRGB(); CGGradientRef gradient = CGGradientCreat...
阅读全文
摘要:View Code // 画贝塞尔曲线 CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(context, 255.0f, 255.0f, 255.0f, 1.0f); CGContextMoveToPoint(context, 100.0f, 100.0f); // 端点一 CGContextSetLineWidth(context, 2.0f); // (200, 150) 控制点一 (50, 200) ...
阅读全文
摘要:View Code // 画不规则形状 CGContextRef contextRef = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(contextRef, 1.0f, 1.0f, 1.0f, 1); // 填充时用不到 CGContextSetLineWidth(contextRef, 2.0f); // 填充时用不到 CGFloat components[] = { 1.0f, 0.0f, 0.0f, 1.0f}; CGConte...
阅读全文
摘要:View Code CGContextRef context=UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(context, 1.0, 1.0, 1.0, 1.0); // If you were making this as a routine, you would probably accept a rectangle // that defines its bounds, and a radius reflecting the "rounded-ness" of the rectangle...
阅读全文
摘要:View Code // 画扇形 // 红色部分 CGContextRef contextRef = UIGraphicsGetCurrentContext(); CGFloat components[] = { 1.0f, 0.0f, 0.0f, 1.0f}; CGContextSetFillColor(contextRef, components); CGContextMoveToPoint(contextRef, 150.0f, 150.0f); CGContextAddArc(contextRef, 150.0f, 150.0f, 100.0f...
阅读全文
摘要:View Code // 实心圆 实心矩形 CGContextRef contextRef = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(contextRef, 1.0f, 1.0f, 1.0f, 1); CGContextSetLineWidth(contextRef, 2.0f); CGFloat components[] = { 1.0f, 0.0f, 0.0f, 1.0f}; CGContextSetFillColor(contextRef, components); ...
阅读全文
摘要:View Code // 画矩形和圆形(椭圆也是圆哦) CGContextRef contextRef = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(contextRef, 1.0f, 1.0f, 1.0f, 1); CGContextSetLineWidth(contextRef, 2.0f); CGContextAddRect(contextRef, CGRectMake(50.0f, 50.0f, 200.0f, 100.0f)); CGContextAddEllipseInRect...
阅读全文