摘要: - (void)sendSMS:(NSString *)bodyOfMessage recipientList:(NSArray *)recipients{ MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease]; if([MFMessageComposeViewController canSendText]) { controller.body = bodyOfMessage; controller.recipients = reci... 阅读全文
posted @ 2012-07-26 15:38 chivas 阅读(271) 评论(0) 推荐(0) 编辑
摘要: sqlite3使用简介一.使用流程要使用sqlite,需要从sqlite官网下载到三个文件,分别为sqlite3.lib,sqlite3.dll,sqlite3.h,然后再在自己的工程中配置好头文件和库文件,同时将dll文件放到当前目录下,就完成配置可以使用sqlite了。使用的过程根据使用的函数大致分为如下几个过程:sqlite3_open()sqlite3_prepare()sqlite3_step()sqlite3_column()sqlite3_finalize()sqlite3_close()这几个过程是概念上的说法,而不完全是程序运行的过程,如sqlite3_column()表示的 阅读全文
posted @ 2012-07-11 22:07 chivas 阅读(3562) 评论(0) 推荐(1) 编辑
摘要: "归档"是指另一种形式的序列化,对模型对象进行归档的技术可以轻松将复杂的对象写入文件,然后再从中读取他们,只要在类中实现的每个属性都是基本数据类型或都是符合NSCoding协议的某个类的实例,你就可以对你的对象进行完整归档。 阅读全文
posted @ 2012-07-11 00:24 chivas 阅读(828) 评论(0) 推荐(0) 编辑
摘要: 最普通动画: //开始动画[UIView beginAnimations:nil context:nil]; //设定动画持续时间[UIView setAnimationDuration:2];//动画的内容frame.origin.x += 150;[img setFrame:frame];//动画结束[UIView commitAnimations]; 连续动画:一个接一个地显示一系列的图像NSArray *myImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"myImage1.png"], [UIIma 阅读全文
posted @ 2012-06-08 15:07 chivas 阅读(88513) 评论(0) 推荐(0) 编辑
摘要: iPhone SDK提供了三个类来管理位置信息:CLLocation CLLocationManager 和 CLLHeading(不常用)。除了使用GPS来获取当前的位置信息外,iPhone也可以基于WiFi基站和无线发射塔来获得位置信息。GPS的精度 最高,可以精确到米级别,但是也最耗电。------------CLLocationCLLocation类代表一个位置信息,其中还包括了方向和速度。比如我在长安街188号以5公里/小时的速度往西走。CLLocation具有下面的属性和方法:@property CLLocationCoordinate2D coordinate; //以经度和纬度 阅读全文
posted @ 2012-06-05 11:44 chivas 阅读(9142) 评论(1) 推荐(0) 编辑
摘要: 转载http://hua397.iteye.com/blog/11812991.背景色:(http://stackoverflow.com/questions/2259929/iphone-navigationbar-custom-background)网上说用category给UINavigationBar重写drawRect:@implementationUINavigationBar(CustomImage)- (void)drawRect:(CGRect)rect { UIImage*image = [UIImageimageNamed: @"NavigationBar.pn 阅读全文
posted @ 2012-06-01 15:17 chivas 阅读(691) 评论(0) 推荐(0) 编辑
摘要: UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,0,0)];这个frame是初设的,没关系,后面还会重新设置其size。[label setNumberOfLines:0];NSString *s = @"string......";UIFont *font = [UIFont fontWithName:@"Arial" size:12];CGSize size = CGSizeMake(320,2000);CGSize labelsize = [s sizeWithFont: 阅读全文
posted @ 2012-05-31 22:56 chivas 阅读(6633) 评论(0) 推荐(0) 编辑
摘要: 一、UILabel(1)初始化UILabelC代码 UILabel*scoreLabel=[[UILabelalloc]initWithFrame:CGRectMake((self.bounds.size.width/2),0.0,150.0,43.0)];scoreLabel.textAlignment=UITextAlignmentCenter;scoreLabel.text=@"我是Ad";scoreLabel.textColor=[UIColorwhiteColor];scoreLabel.backgroundColor=[UIColorblackColor];sc 阅读全文
posted @ 2012-05-31 22:55 chivas 阅读(2269) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/pkukevin/article/details/6681217http://www.cocoachina.com/bbs/read.php?tid=368960,关于初始化使用ImageNamed方法,类方法,系统有缓存autorealease使NSData的话,系统不会有缓存,这样作者可以很好的控制系统内存1.等比率缩放- (UIImage *)scaleImage:(UIImage *)image toScale:(float)scaleSize{UIGraphicsBeginImageContext(CGSizeMake(image.size. 阅读全文
posted @ 2012-05-27 13:43 chivas 阅读(7706) 评论(1) 推荐(1) 编辑
摘要: NSCoding协议声明了两个方法:-(void)encodeWithCoder:(NSCoder *)aCoder 是将对象写入到文件中-(id)initwithCoder:(NSCoder *)aDecoder 是将文件中数据读入到对象中-(id)copyWithZone:(NSZone *)Zone 是将对象复制方法 阅读全文
posted @ 2012-05-25 13:29 chivas 阅读(272) 评论(0) 推荐(0) 编辑