Fork me on GitHub
上一页 1 ··· 52 53 54 55 56 57 58 59 60 ··· 125 下一页

2012年3月19日

摘要: 一,关于空行A:.h中的空行1,文件说明与头文件包涵(#import)之间空1行2,头文件包涵(#import)之间,如果需要分类区别,各类别之间空1行3,头文件包涵(#import)与@class之间空2行4,@interface与@class之间空一行5,头文件{}里面,空1行开始声明对象成员,如果需要分类区别,各类别之间空1行6,{}外空1行,书写属性,如果需要分类区别,各类别之间空1行7,空1行开始写方法,如果需要分类区别,各类别之间空1行8,方法完成后,空1行@end9,如果需要声明protocal,空2行接着写。通常protocal写在@end后面,但是声明在@interface前 阅读全文
posted @ 2012-03-19 10:23 pengyingh 阅读(4424) 评论(0) 推荐(0)
摘要: 原文来自:http://www.raywenderlich.com/tutorials感谢Ray Wenderlich带头组织了这样一个团队。例子讲解详尽,从helloworld到cocos2d,Unity游戏引擎,从本地应用到网络交互,从苹果自有API到第三方库,涉及范围非常广泛。。。(Ray Wenderlich功力也足够深厚,老外就是好啊,感谢Ray Wenderlich的无私奉献)内容不断更新,目前Ray Wenderlich在招这个系列的合作者(http://www.raywenderlich.com/5037/looking-for-more-tutorial-writers),如 阅读全文
posted @ 2012-03-19 10:22 pengyingh 阅读(2755) 评论(0) 推荐(0)
摘要: iOS上如何制作自己的Framework呢?(不是静态库)请看stackoverflow上的提问:http://stackoverflow.com/questions/4065052/how-to-build-a-framework-or-library-for-other-developers-the-secure-way解决办法1,通过命令行脚本http://www.cocoanetics.com/2010/04/making-your-own-iphone-frameworks/由cocoa的Framework演变而来2,通过hack bundlehttp://www.cocoaneti 阅读全文
posted @ 2012-03-19 10:12 pengyingh 阅读(3311) 评论(0) 推荐(1)
摘要: NSString *trimmedString = [description stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; 阅读全文
posted @ 2012-03-19 10:08 pengyingh 阅读(405) 评论(0) 推荐(0)
摘要: UIWebView的唯一一个subview就是UIScrollView,不过苹果并没有提供直接的访问方式给scrollview,因此当你直接这么使用scrollview的时候uiwebview.scrollview,编译没有错误,但是运行的时候会提示[UIWebView scrollView]: unrecognized selector sent to instance因为webview的scrollview是一个苹果私有的api因此我们需要利用一些小trick来获得它的scrollview代码如下:First we will pull the UIScrollView out from t 阅读全文
posted @ 2012-03-19 10:06 pengyingh 阅读(613) 评论(0) 推荐(0)
摘要: Object-C获取自1970年以来的毫秒数NSTimeInterval time = [[NSDate date] timeIntervalSince1970];// NSTimeInterval返回的是double类型,输出会显示为10位整数加小数点加一些其他值// 如果想转成int型,必须转成long long型才够大。NSTimeIntervaltime = [[NSDate date]timeIntervalSince1970];longlongdTime = [[NSNumber numberWithDouble:time]longLongValue];// 将double转为lo 阅读全文
posted @ 2012-03-19 10:05 pengyingh 阅读(6566) 评论(0) 推荐(0)
摘要: - (void)connectionDidFinishLoading:(NSURLConnection *)connection {[connection release];NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];[responseData release];NSError *error;SBJSON *json = [[SBJSON new] autorelease];NSArray *luckyNumbers = [json o 阅读全文
posted @ 2012-03-19 10:03 pengyingh 阅读(2448) 评论(0) 推荐(0)

2012年3月17日

摘要: 通过cgcontextref来画图的时候,实现橡皮擦功能的方式有两种:1. 将画笔设置为背景色来实现橡皮擦功能。这种情况适用于当前设置context的blend mode为normal的时候,即CGContextSetBlendMode(context,kCGBlendModeNormal);此时设置背景色的代码如下:UIGraphicsBeginImageContext(drawBgView.bounds.size);// get the image[drawBgView.layerrenderInContext:UIGraphicsGetCurrentContext()];UIImage* 阅读全文
posted @ 2012-03-17 14:58 pengyingh 阅读(4551) 评论(0) 推荐(0)
摘要: 这两种都可以用来画线,前一种将整条线加入后画出,后一种对每个点进行和前一个点的连线。sample1-(void)drawLine:(YJLines*)line{intcount = [line.pointscount];CGPointaddLines[count];for(intj=0; j< [line.pointscount]; j++){CGPointpoint =CGPointFromString((NSString*)[line.pointsobjectAtIndex:j]);addLines[j].x= point.x;addLines[j].y= point.y;}CGCo 阅读全文
posted @ 2012-03-17 14:57 pengyingh 阅读(7303) 评论(0) 推荐(0)
摘要: There is no current draw context. The issue is from where you are calling the draw methods. They need to be called from a-(void) drawRectmethod or, if you'd prefer, you can draw into an image. Either way, there has to be a current draw context.必须从drawRect中触发才能取到绘画上下文。或者自定义绘画区域进行绘画。UIGraphicsBegi 阅读全文
posted @ 2012-03-17 14:46 pengyingh 阅读(989) 评论(0) 推荐(0)
上一页 1 ··· 52 53 54 55 56 57 58 59 60 ··· 125 下一页

导航