Fork me on GitHub

2012年2月6日

摘要: 首先在UIViewController的-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation方法中设置设备要支持的deviceOrientation;在UIViewController的-(void)willRotateToInterfaceOrientation(UIInterfaceOrientation)toInterfaceOrientationduration:(NSTimeInterval)duration或者-(void)willAnimateRotat 阅读全文
posted @ 2012-02-06 00:20 pengyingh 阅读(12860) 评论(0) 推荐(0)
摘要: UIView *view = [[[[[UIApplication sharedApplication] windows] objectAtIndex:1] subviews] lastObject];//获得某个window的某个subViewNSInteger index = 0;//用来给保存的png命名for (UIView *subView in [view subviews]) {//遍历这个view的subViewsif ([subView isKindOfClass:NSClassFromString(@"UIImageView")] || [subView 阅读全文
posted @ 2012-02-06 00:19 pengyingh 阅读(201) 评论(0) 推荐(0)
摘要: 1. Animation Classes RoadmapCore Animation provides an expressive set of animation classes you can use in your application:CAAnimationis the abstract class that all animations subclass.CAAnimationadopts theCAMediaTimingprotocol which provides the simple duration, speed, and repeat count for an anima 阅读全文
posted @ 2012-02-06 00:15 pengyingh 阅读(446) 评论(0) 推荐(0)
摘要: (3)Adopting the CAAction ProtocolTheCAActionprotocol defines how action objects are invoked. Classes that implement theCAActionprotocol have a method with the signaturerunActionForKey:object:arguments:.When the action object receives therunActionForKey:object:arguments:message it is passed the actio 阅读全文
posted @ 2012-02-06 00:14 pengyingh 阅读(286) 评论(0) 推荐(0)
摘要: Core Animation provide an abstract animation interface that allows animations to run on a separate thread, independent of your application's run loop. Once an animation is configured and starts, Core Animation assumes full responsibility for running it at frame rate.Core Animation classes can be 阅读全文
posted @ 2012-02-06 00:13 pengyingh 阅读(540) 评论(0) 推荐(0)

2012年2月5日

摘要: CATransitionCATransitionis an Objective-C wrapper for creating view transitions. As of 3.1.2, there are 11 types of transitions. 4 of them are SDK-compatible, but are the most boring ones. The following shows all 11 types of transition from picture "A" to "B" at 40%. The subtypes 阅读全文
posted @ 2012-02-05 23:55 pengyingh 阅读(16014) 评论(1) 推荐(2)
摘要: 在写一个基于iphone的应用,主要是用来播放视频的.但是提交给苹果审核的时候却遭到百般刁难.尤其是关于在3G网络上播放视频流的限制: 9.4 Video streaming content over a cellular network longer than 10 minutes must use HTTP Live and include a baseline 64 kbps audio-only HTTP Live stream 也罢,想想也是,在移动互联网直接播放一个几十M上百M的文件也确实是太浪费有限的流量了.难道说在互联网上直接下载整个文件,而不管会不会看完就不浪费流量了吗... 阅读全文
posted @ 2012-02-05 19:33 pengyingh 阅读(969) 评论(0) 推荐(0)
摘要: 虽然mac不如ubuntu感觉open,但是系统感觉还是挺好用的.用了小半年了,积累了几个不可缺少的经验,记录一下(因为头两周用的时候又忘记了.). 1.修改机器名 mac安装完成以后会默认将你的机器设成"rainbird's Macbook Pro"之类的名字.这个本身看着就不爽,如果这台机器是别人先用你再用的话,就想把它改掉了.如果你想改计算机名的话,直接去"系统设置"->"共享"里改计算机名(Computer Name)就好了.这样大家在网络邻居里看到的你的名字就可以了. 对于大多数用户来说到这里就完事了.但是对于 阅读全文
posted @ 2012-02-05 19:26 pengyingh 阅读(222) 评论(0) 推荐(0)
摘要: 据说去年年底互联网刷票市场异常火爆.也是在那个时候笔者受朋友委托帮着投几千票提高一下人气.一直对php操作网页很感兴趣没有机会练手,正好试一试. 一路过五关斩六将,到最后的ip限制这里算是给卡住了.更换代理竟然不好使,这可如何是好?因为笔者在家里上网用的是3G无线网卡.无意间发现这东东每次断开后再连接获得的ip竟然是不一样的!而且后来经过笔者验证三十秒断一次,断了四千多次竟然获得的ip都带重复的.哥就郁闷了,头两天不是还说ip地址分配完了么,咋分到无线网卡上的这么多呢? 刚开始那会儿笔者干了件很郁闷的事儿.我的程序是这么写的:投票,然后休息5秒,然后判断网络连接是不是正常,如果... 阅读全文
posted @ 2012-02-05 19:25 pengyingh 阅读(483) 评论(0) 推荐(0)
摘要: Reachability是苹果官方给的检查网络状态的库,想必每个基于网络的应用都会用它来检查网络状态吧,当然笔者也不例外.可是正当自信满满的我,用这个库用的不亦乐乎的时候,突然发现我写的基于网络的程序工作的不是那么流畅了,尤其是仔细检查以后确定是因为用了Reachability的时候,一下子觉得的不可理喻,这瞬间的落差让前一分钟还在美滋滋的认为"写程序是艺术,用程序是享受"的我情何以堪?这种情况就是:连接到了Wifi,但是并不能上网.这时候用Reachability检查会认为设备处在wifi情况下(没错,好像就是wifi环境下),如果这时候你相当然的认为可以正常上网而去获取 阅读全文
posted @ 2012-02-05 19:07 pengyingh 阅读(1270) 评论(0) 推荐(1)

导航