摘要:DrawInView.hDrawInView.h 1 #import <UIKit/UIKit.h> 2 3 @interface DrawInView : UIView 4 5 @property (nonatomic, retain) NSDictionary *pointsDictionary; 6 @property (nonatomic,assign) NSInteger beganCount; 7 @property (nonatomic, retain) NSMutableArray *pointsArray; 8 9 -(CGPoint) getCGPoint:(N
阅读全文
摘要:1.可以依靠两个不同的库来满足我们绘图的需要,一个库是Quartz 2D,它是Core Graphics框架的一部分;另一个库是OpenGL ES,它是跨平台的图形库。2.OpenGL ES是跨平台图形库OpenGL的简化版、OpenGL ES是OpenGL的一个子集,OpenGL ES是专为iphone之类的嵌入式系统(因此缩写为字母ES)设计的。3.Quartz是一组函数、数据类型以及对象,专门用于直接在内存中对视图或图像进行绘制。Quartz将正在绘制的视图或图像视为一个虚拟的画布,并遵循所谓的绘画者模型。4.OpenGL ES以状态机的形式实现,OpenGL ES不允许执行直接影响视图
阅读全文
摘要:(注:需要添加CoreGraphics.framework)CustomAlertViewDelegate.h文件CustomAlertViewDelegate.h1 #import <Foundation/Foundation.h>2 @class CustomAlertView;3 4 @protocol CustomAlertViewDelegate <NSObject>5 -(void) alertView:(CustomAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;6 @en
阅读全文
摘要:- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions{self.window= [[[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]]autorelease];FirstViewController*firstController=[[FirstViewControlleralloc]init];//设置标题 firstController.title=@"Fi
阅读全文
摘要:(1)创建 UIActivityIndicatorView*activityView=[[UIActivityIndicatorViewalloc]initWithFrame:CGRectMake(150,30,100,100)];(2)设置类型(activityIndicatorViewStyle) 三种类型: UIActivityIndicatorViewStyleWhiteLarge:大的白色的指示器 UIActivityIndicatorViewStyleWhite: 标准白色的指示器 UIActivityIndicatorViewStyleGray:为白色背景...
阅读全文
摘要:使用的WebService是:http://www.webxml.com.cn/WebServices/WeatherWebService.asmx其中的getWeatherByCityName函数常使用的技术有:SOAP,HTTP GET,HTTP POST三种方式(一)SOAP(简单对象访问协议)方式当你使用SOAP时,必须用到POST方式(1)SOAP 1.1以下是请求实例:POST /WebServices/WeatherWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-
阅读全文
摘要:注意一下四点:(1)loadView在每一次使用self.view这个property并且self.view为nil的时候被调用,用以产生一个有效的self.view。(2)我们可以在loadView中增加一句[super loadView]就没有问题了。但这并不是Cocoa的设计者所期望的。(3)当self.view为空时,在ViewDidLoad中使用的话会一直调用loadView。在loadView中重复使用一个为空的self.view同样也会出错,因为它一直调用。(4) 在loadView中只是为了实现View的实例化,若想要在view中添加控件则应该在viewDidLoad中调用
阅读全文
摘要:(1)创建UIWebView*myWebView=[[UIWebViewalloc]initWithFrame:CGRectMake(0,20,320,300)];(2)加载网页 NSURL*url=[NSURLURLWithString:@"http://www.google.com.hk"]; NSURLRequest*request=[[NSURLRequestalloc]initWithURL:url]; [myWebViewloadRequest:request];(3)是否与用户交互(即用户能不能控制webview) [myWebViewsetUserInter
阅读全文