11 2013 档案

摘要:#import #import @interface UIView (Shape)- (void)setShape:(CGPathRef)shape;@end#import "UIView+Shape.h"@implementation UIView (Shape)- (void)setShape:(CGPathRef)shape{ if (shape == nil) { self.layer.mask = nil; } CAShapeLayer* maskLayer = [CAShapeLayer layer]; maskLayer.path =... 阅读全文
posted @ 2013-11-29 10:41 有妄想症的猫zz 阅读(4478) 评论(0) 推荐(0) 编辑
摘要:iOS: 解决某些第三方库因为ARC不能使用的问题1、在target下面的build phases下有一个compile source,下面有很多待编译文件。可以看到一个compile flag,可以针对某些文件进行arc设置。这样,某些框架不能使用的问题不就解决了嘛。于是,在要用到的框架包含的所有.m文件后对应的compile flag处加上-fno-objc-arc,这样,就能成功在ios5项目下运行了。2、将库打包成frameworkhttp://blog.csdn.net/dean19900504/article/details/7921015http://www.cocoachina 阅读全文
posted @ 2013-11-27 17:57 有妄想症的猫zz 阅读(2306) 评论(0) 推荐(0) 编辑
摘要:UITableView 顶部能够放大的图片现在有挺多的应用在 UITableView 顶部加入图片,通过拖拽 UITableView 来实现图片的放大。对比一下腾讯出品的两款AppQQ:可展示更多的图片,向下滑动TableView,顶部的图片可以展示更多的内容,而不是局限于默认状态下可展示的默认大小。 再来看看微信的朋友圈:固定的大小,向下拖动TableView后,顶部露出了背景图片。 两种实现方式,各有各的好处。微信的效果是默认的,即什么都不用设置。这种状态下,我们可以在背景图上做文章,加个Logo之类的都可以。QQ的实现方式是我比较喜欢的,对于不需要下拉刷新的页面,又不想分配太大的空间.. 阅读全文
posted @ 2013-11-27 17:39 有妄想症的猫zz 阅读(4968) 评论(0) 推荐(1) 编辑
摘要:转自: Post by Steve VlaminckMy good friend google told me that using a custom font in iOS is “easy”. And for the most part it is, but I got tripped up in a few places.I happen to have Apples Keychain example code lying around so I’ll be using that in this example. I am also using Xcode 4.5 and focusin 阅读全文
posted @ 2013-11-26 17:00 有妄想症的猫zz 阅读(2206) 评论(0) 推荐(0) 编辑
摘要:How are you setting the images for the differentUIControlStateson the button? Are you setting a background image forUIControlStateHighlightedas well asUIControlStateSelected?UIImage *someImage = [UIImage imageNamed:@"SomeResource.png"];[button setBackgroundImage:someImage forState:UIContro 阅读全文
posted @ 2013-11-22 17:27 有妄想症的猫zz 阅读(10873) 评论(1) 推荐(0) 编辑
摘要:#import ...CABasicAnimation *rotationAni = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];rotationAni.toValue = [NSNumber numberWithFloat:M_PI*2];rotationAni.duration = 0.5;rotationAni.cumulative = YES;rotationAni.repeatCount = 10000;[indicatorView.layer addAnimation:rotat 阅读全文
posted @ 2013-11-22 16:25 有妄想症的猫zz 阅读(1371) 评论(0) 推荐(0) 编辑
摘要:NSURL *url = nil; if ([[[UIDevice currentDevice] systemVersion] intValue] >= 7.0) { //iOS7 使用旧的网址跳转到 App Store 是一个 blank 页,所以判断下设备系统版本,如果是iOS7之后的,则跳转到 App 的详情页 url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/cn/app/id%@?mt=8", appId]]; }else{ ... 阅读全文
posted @ 2013-11-15 14:25 有妄想症的猫zz 阅读(3129) 评论(0) 推荐(0) 编辑
摘要:原帖链接:http://stackoverflow.com/a/9063469首先确定下项目的 Build Settings 是否已经设置过宏定义 DEBUG,如何看呢?点击 Build Settings ,然后在搜索框里输入‘macros’如果已经设置过,在 Preprocessor Macros 的 Debug 后面会有 DEBUG=1,如果没有,就手动设置下。接下来就可以这样做了#ifdef DEBUG //do sth.#else //do sth.#endifhttp://stackoverflow.com/a/9063682一般Apple已经为我们设置好了 DEBUG ... 阅读全文
posted @ 2013-11-15 13:46 有妄想症的猫zz 阅读(26198) 评论(0) 推荐(1) 编辑
摘要:http://m.freemyapps.com/share/url/516b7a9e 阅读全文
posted @ 2013-11-12 14:36 有妄想症的猫zz 阅读(264) 评论(0) 推荐(0) 编辑
摘要:转自:http://www.open-open.com/lib/view/open1332904495999.html 阅读全文
posted @ 2013-11-08 18:13 有妄想症的猫zz 阅读(130) 评论(0) 推荐(0) 编辑
摘要:转自:http://blog.csdn.net/cjopengler/article/details/7045638anchor point 究竟是怎么回事? 之所以造成不容易理解的是因为我们平时看待一个图片是 以图片的中心点 这一个维度来决定图片的位置的。而在cocos2d中决定一个 图片的位置是由两个维度 一个是 position 也就是图片的中心点 另外一个是anchor point。只要我们搞清楚他们的关系,自然就迎刃而解。他们的关系是这样的:actualPosition.x = position.x + width*(0.5 - anchor_point.x);acturalPosi 阅读全文
posted @ 2013-11-08 13:03 有妄想症的猫zz 阅读(360) 评论(0) 推荐(0) 编辑
摘要:将swf文件拖进浏览器即可。 阅读全文
posted @ 2013-11-06 17:14 有妄想症的猫zz 阅读(345) 评论(0) 推荐(0) 编辑
摘要:stackoverflow两种办法,一是使用比较成熟的svn客户端,二是使用终端。以下为终端方法:假设已经通过Xcode->Preferences->Accounts将repository: http://myserver.me.com/svn/ 添加到Xcode中。创建一个新项目:$HOME/IOS/Projects/MyProject关闭项目,为了避免对svn有影响,可能需要完全退出Xcode打开终端,并进入到项目目录cd $HOME/IOS/Projects把项目添加到svn上svn import-m "New Import"MyProject/ http 阅读全文
posted @ 2013-11-06 15:41 有妄想症的猫zz 阅读(9101) 评论(0) 推荐(0) 编辑