摘要:- (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay inModes:(NSArray *)modes;- (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay;+ (void)cancelPreviousPerformRequestsWithTarget:(id)aTarget selector:(SEL)aSele
阅读全文
摘要:Uninstalling Xcode Developer ToolsTo uninstall Xcode developer tools on the boot volume along with the <Xcode> directory, from a Terminal window type:$ sudo <Xcode>/Library/uninstall-devtools --mode=allTo remove the underlying developer content on the boot volume, but leave the <Xcode
阅读全文
摘要:一个path有一个或者多个shapes,或者subpaths定义。一个subpath可以包含直线段,曲线或者都有。其可以是开的或者封闭的。subpath可以是一个简单的形状,如line,circle,rectangle,star,或者其他更复杂的形状,下图展示了我们可以创建的形状。直线可以是虚的,也可以是实的。在本篇中,将介绍如何构造path,如何stroke和paint path,以及参数影响path的表现形式。1.path的创建和path的paintingpath的创建和path的painting是独立的任务。首先创建一个path,当想要去显示时,要请求Quartz去paint。如下图,我
阅读全文
摘要:原文地址:https://developer.apple.com/library/prerelease/ios/#releasenotes/General/WhatsNewIniPhoneOS/Articles/iOS5.htmliCloud Storage APIsThe iCloud storage APIs let your application write user documents and data to a central location and access those items from all of a user’s computers and iOS devices
阅读全文
摘要:在使用UISearchBar时,将背景色设定为clearColor,或者将translucent设为YES,都不能使背景透明,经过一番研究,发现了一种超级简单和实用的方法:1[[searchbar.subviews objectAtIndex:0]removeFromSuperview];背景完全消除了,只剩下搜索框本身了。
阅读全文
摘要:最近写程序需要用到这类,研究了下,现把成果和大家分享。NSNotificationCenter是专门供程序中不同类间的消息通信而设置的,使用起来极为方便,长话短说。设置通知,就是说要在什么地方(哪个类)接受通知,一般在初始化中做。[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(test:)name:@"test"object:nil];我仅对以上参数做以说明:addObserver 这个是观察者,就是说 在什么地方接收通知; selector 这个是收到通知后,调用何种方法; na
阅读全文
摘要:这几天通过iTunes看了斯坦福大学的视频教程,学到了不少东西,给大家推荐一下:斯坦福iPhone编程课程收看次数破百万http://zx.sj.91.com/content/2009-05-18/20090518175143833.shtmlhttp://itunes.stanford.edu/其他iPhone资料:10家不错的iPhone编程资源网站http://news.weiphone.com/news/2008-12-12/10jiabucuodeiPhonebianchengziyuanwangzhan_171541.shtmliphone遊戲編程教材網站推薦今天無意中找到這個叫
阅读全文
摘要:1. 首先要明确的是,不使用pushViewController的默认动画,所以在调用这个函数时,要将animated设置为NO.2. 使用普通的来CATransition实现转换效果,代码如下: CATransition *animation = [CATransition animation]; [animation setDuration:0.3]; [animation setType: kCATransitionMoveIn]; [animation setSubtype: kCATransitionFromTop]; [animation setTimingFunction:[CA
阅读全文
摘要:来自http://blog.csdn.net/omgle/archive/2011/06/29/6574313.aspx第一部分:Push原理(以下绝大多数内容参考自、图片来自iPhone OS Reference Library)机制简介Push的工作机制可以简单的概括为下图图中,Provider是指某个iPhone软件的Push服务器。APNS是Apple Push Notification Service(Apple Push服务器)的缩写,下文统一使用该缩写。因此,整个过程可以分为三个阶段,下面用大家常用的聊天客户端BeejiveIM来说明。(BeejiveIM是一款支持多账户登录的支
阅读全文
摘要:Bells And WhistlesThe iPhone has a set of nice transition animations which makes the experience using it very pleasant. But after a while one get so used of them that one stop noticing that they are even there. But this is not necessary a bad thing. Often I think thatreallygood things doesn’t show a
阅读全文
摘要:Search and highlight text in UIWebViewSeveral iPhone Apps (like my “iCab Mobile” or “NewsTap” Apps) provide a search feature which allows to search for text in the content that is currently displayed within a UIWebView. The found occurrences of the searched text are highlighted with a yellow backgro
阅读全文
摘要:WebKit on the iPhone (Part 1)If you develop an application which should display a web page or HTML file,you can use the WebKit framework, which is part of the MacOS and also of theiPhone OS.But while on the Mac, the WebKit framework provides almost 160 public headerfiles which define even more publi
阅读全文
摘要:在info.plist文件里看看有没有“Application does not run in background”这一个key,如果没有,点最后一行,然后点这行右边的加号,你会看见最底下又变出来一行,在里面选择“Application does not run in background”,然后把钩打上
阅读全文
摘要:UIDevice *device = [UIDevice currentDevice]; return [device uniqueIdentifier];
阅读全文
摘要:NSDecimalNumber 是NSNumber的子类。
使用 [NSNumber numberWithDouble:]方法来格式我的NSNumber,但是,由于一些值比较大,我想要用科学计数法来表示。
NSDecimalNumber就提供了科学计数法的表示方法。
什么是科学计数法? 将一个数字表示成 (a×10的n次幂的形式),其中1≤a<10,n表示整数,这种记数方法叫科学记数法。 用幂的形式,有时可以方便的表示日常生活中遇到的一些较大的数,如:光的速度大约是300 000 000米/秒;全世界人口数大约是:6 100 000 000 这样的大数,读、写都很不方便,考虑到10的
阅读全文
摘要:接前一篇博文《开源框架Core Plot的使用》。 如果使用了Core Plot标准Mac安装包进行安装,使用起来有一些变化。其实,如果你注意到安装器的最后一个界面,这里已经有一个如何使用的介绍了: To add the Core Plot SDKs to an iOS Project: 1. Add to your project's .PCH file: #import 3. Open Project -> Edit Project Settings and for All Configurations : 3a. Add to Additional SDKS : (Syst
阅读全文
摘要:在多线程操作中,有一个著名的错误,叫做“Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread”,一旦出现这个错误,程序会立即crashed。
这是由于,apple不允许程序员在主线程以外的线程中对ui进行操作(Bug?)
而笔者在一次http异步操作中也出现过这个错误。当时使用了NSOperation进行了http异步请求,然后使用kvo模式注
阅读全文
摘要:由于iPhone控件的极度匮乏和自定义组件在重用上的限制,在过去的项目中我们积累了大量的“纯代码”组件——因为IB本身的限制,我们无法把这些组件封装为IB组件库(本来我们想通过分发xib文件的方式重用这些组件,但最终发现这根本不可能,苹果的Plug-in编程不支持iPhone)。 最终我们想到了静态库。虽然这仍然还是一种比较原始的复用方式,但起码我们可以隐藏组件的源代码。 下面, 我们使用iPhone静态库把自定义组件CheckButton 进行进一步的封装。(组件的实现参考前一篇博文《自定义控件复选框和单选框的实现》) 一、实现静态库 新建工程, 选择 Library 下的 “ Cocoa
阅读全文
摘要:(转)multipart form-data boundary 说明收藏原文链接:http://yefeng.javaeye.com/blog/315847含义 ENCTYPE="multipart/form-data" 说明:通过 http 协议上传文件 rfc1867协议概述,jsp 应用举例,客户端发送内容构造1、概述在最初的 http 协议中,没有上传文件方面的功能。 rfc1867 (http://www.ietf.org/rfc/rfc1867.txt) 为 http 协议添加了这个功能。客户端的浏览器,如 Microsoft IE, Mozila, Opera
阅读全文
摘要:iOS 4.3 to iOS 5.0 API Differences Added frameworks: Accounts CoreBluetooth CoreImage GLKit GSS NewsstandKit Twitter Accelerate Alpha.h Added #def VIMAGE_ALPHA_H Added vImageAlphaBlend_ARGB8888() Added vImageAlphaBlend_ARGBFFFF() Added vImageAlphaBlend_NonpremultipliedToPremultiplied_ARGB8888() Add.
阅读全文