
iphone
snn1410
这个作者很懒,什么都没留下…
展开
-
overview of the TableView API
1、Table View A table view itself is an instance of the UITableView class. This class declares methods that allow you toconfigure the appearance of the table view—for example, specifying t原创 2012-04-20 15:03:45 · 573 阅读 · 0 评论 -
iphone读取和写入文件内容--仅供学习
http://blog.sina.com.cn/s/blog_5ccfd2d50100u04g.html原创 2012-04-14 17:17:01 · 866 阅读 · 0 评论 -
NSMUtableArray 转换为NSMutableString
问题: NSMutableArray *array = [[NSMUtableArray alloc]initwithObjects :@"苹果",@“菠萝”,@“香蕉”,@“西瓜”,@“橘子”,nil];然后我定义一个NSMutableString *string 我想将array里面的内容放以@“苹果,菠萝,香蕉,西瓜,橘子”的方式到string里面,应该怎么处理呢?转载 2012-04-17 11:45:40 · 1262 阅读 · 0 评论 -
iphone获取通讯录所有属性
ABAddressBookRef addressBook = ABAddressBookCreate();//获得所有联系人的信息 CFArrayRef results = ABAddressBookCopyArrayOfAllPeople(addressBook); for(int i = 0; i { ABRecordRef转载 2012-04-14 17:38:13 · 809 阅读 · 0 评论 -
获取本地通讯录的所有联系人的信息
//获取本地通讯录的所有联系人的信息:-(void)showAllPeopleContacts{ ABAddressBookRef ab=ABAddressBookCreate(); NSArray *arrTemp=(NSArray *)ABAddressBookCopyArrayOfAllPeople(ab); NSMutableArray *arr原创 2012-04-25 14:08:15 · 1672 阅读 · 0 评论 -
UIButton详解--转
转自: http://blog.youkuaiyun.com/jb80400812/article/details/6614184创建UIButtonUIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];btn.frame = CGRectMake(30, 360, 90, 35);转载 2012-03-07 15:05:39 · 1600 阅读 · 0 评论 -
UIPopoverController的使用
UIPopoverController的使用1、初始化UIPopoverController UIPopoverController *popover = [[UIPopoverController alloc]initWithContentViewController:navigationController]; //必须是个 ViewCon转载 2012-03-16 11:37:07 · 2054 阅读 · 0 评论 -
UIButton按钮用法
UIButton按钮用法:UIButton *goButton = [UIButtonbuttonWithType:UIButtonTypeRoundedRect];//UIButtonTypeRoundedRect ** [goButtonsetTitle:@"Go!"forState:UIControlStateNormal]; [goButtonsi原创 2012-03-24 10:43:05 · 707 阅读 · 0 评论 -
uipopoverviewController
http://www.raywenderlich.com/1063/ipad-for-iphone-developers-101-custom-input-view-tutorial原创 2012-03-16 14:09:31 · 1119 阅读 · 0 评论 -
iphone 读写文件
- (void)readWritePlist:(BOOL)readonly{//get the documents directory:NSArray *paths =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);NSString *documentsDirect转载 2012-03-13 17:06:49 · 460 阅读 · 0 评论 -
comparison between rand() and arc4random()
今天在iPhone开发过程中,遇到一个需要生成随机数的问题。很快rand()和arc4random()都进入了考虑范围,但选择的时候感觉有点为难。之前的时候可能没有思索就随便挑一个用了,不过这次良心发现不能太随便了。rand() 和arc4random()到底应该如何取舍呢?调查了下,发现下文很好地解答了这个问题。在iPhone中有几个内嵌的随机数发生器,很多人的第一反应可能就是在调用如下函数转载 2012-03-13 16:07:57 · 639 阅读 · 0 评论 -
显示被隐藏掉的用户文件夹下的library资源库
在终端中输入:chflags nohidden ~/Library/想让它隐藏的话,输入: chflags hidden ~/Library终端程序的默认位置在——实用工具里面。转载 2012-03-09 11:33:48 · 1338 阅读 · 0 评论 -
视频教程
网易公开课iphone开发视频教程http://v.163.com/special/opencourse/iphonekaifa.html很不错的iphone开发视频教程http://plter.com/?cat=40武汉玉科技http://www.youku.com/playlist_show/id_5293158.htmlhttp://hi.baidu.com/whso转载 2012-03-09 15:29:11 · 439 阅读 · 0 评论 -
通讯录下载(恢复数据到手机上面)
遍历从webservice,服务器上面的json文件中数据---解析json字符串---:-(void)parseJsonKit:(NSString *)jsonString{ NSArray *array=[jsonStringobjectFromJSONString]; NSLog(@"yunPanCounts=%d",[arraycount]原创 2012-04-25 14:14:20 · 1194 阅读 · 0 评论 -
iphone通讯录AddressBook.framework和AddressBookUI.framework的应用
通讯录中联系人相关的应用iPhone提供了两个框架:AddressBook.framework和AddressBookUI.framework,使用这两个框架我们可以在程序中访问并显示iPhone数据库中的联系人信息。1.AddressBookUI显示部分AddressBookUI中提供了和联系人显示信息相关的一些Controller,有四个:ABPeoplePic转载 2012-04-14 16:18:59 · 1165 阅读 · 0 评论 -
NSData 和 NSString\ Byte数组 \ UIImage
1. NSData 与 NSStringNSData-> NSStringNSString *aString = [[NSString alloc] initWithData:adataencoding:NSUTF8StringEncoding]; NSString->NSDataNSString *aString = @"1234abcd";N转载 2012-04-14 09:18:27 · 689 阅读 · 0 评论 -
ios删除文件
[代码] ios删除文件view sourceprint?1NSFileManager *defaultManager;2defaultManager = [NSFileManager defaultManager];3转载 2012-05-02 10:56:42 · 2946 阅读 · 0 评论 -
split分割字符串
NSArray* arr=[@"asd;asdasd;dfd;gd;s;as;daf"componentsSeparatedByString:@";"];2 for (int i=0; i3 NSString* str=[arr objectAtIndex:i];原创 2012-05-02 10:51:24 · 942 阅读 · 0 评论 -
NSString找到字符串的位置
NSString *str = [NSString alloc]init];str = @"1234567890";NSRange r ;r = [str rangeOfString : textview.text];if(r.location != NSNotFound){ NSLog(@"found at location = %d, length = %d"原创 2012-05-02 10:49:41 · 1293 阅读 · 0 评论 -
IOS读取.plist文件
NSString *path = [[NSBundle mainBundle]pathForResource:@"文件名" ofType:@"plist"];//文件数据类型是arrayNSArray *array = [NSArray arrayWithContentsOfFile:path];//文件数据类型是dictionaryNSDictionary *dictionary原创 2012-05-02 10:12:02 · 1321 阅读 · 0 评论 -
NSString拼接字符串
NSString* string; // 结果字符串02NSString* string1, string2; //已存在的字符串,需要将string1和string2连接起来03 04//方法1.05转载 2012-05-02 09:57:41 · 135328 阅读 · 10 评论 -
componentsJoinedByString 和 componentsSeparatedByString 的方法的区别
将string字符串转换为array数组 NSArray *array = [Str componentsSeparatedByString:@","];==反向方法将array数组转换为string字符串 NSString *tempString = [mutableArray componentsJoinedByString:@","];-原创 2012-04-17 16:33:47 · 23076 阅读 · 0 评论 -
iphone读取文件的时候出现的问题
在做iphone读取文件的时候发现问题:二进制数据能够得到,但是将二进制数据转换为string类型的时候,得到的string为nil代码:NSData *data = [NSDatadataWithContentsOfFile:path]; NSLog(@"data=%@",data); NSString *fileContents = [原创 2012-04-17 10:56:02 · 1174 阅读 · 0 评论 -
iOS SDK: 使用NSUserDefaults
原文:http://mobile.tutsplus.com/tutorials/iphone/nsuserdefaults_iphone-sdk/本文展示如何使用NSUserDefaults类存储和改变应用程序设置。我们将创建Contact应用程序用于存放用户指定的图片和联系人信息。什么是NSUserDefaults?NSUserDefaults类用于保存应用程序设置和属性以及用户原创 2012-04-28 14:15:08 · 555 阅读 · 0 评论 -
为视图加边框
iPhone开发应用为视图加边框是本文要介绍的内容,主要来介绍视图中的一个有趣的案例,实现给视图加边框的效果,不多说,直接来看详细内容讲解。通过层(layer),可以给视图增加边框和圆角等。比如类似下面的效果,如图:写法:- (void)loadView { [[UIApplication sharedApplication] setStatusBarHidden:转载 2012-04-28 14:12:26 · 602 阅读 · 0 评论 -
NSUserDefaults
NSUserDefaultsNSUserDefaults类提供了一个与默认系统进行交互的编程接口。NSUserDefaults对象是用来保存,恢复应用程序相关的偏好设置,配置数据等等。默认系统允许应用程序自定义它的行为去迎合用户的喜好。你可以在程序运行的时候从用户默认的数据库中读取程序的设置。同时NSUserDefaults的缓存避免了在每次读取数据时候都打开用户默认数据库的操转载 2012-04-28 14:16:17 · 1317 阅读 · 0 评论 -
计算两个时间相距离多少
//得到当前日期 CFAbsoluteTime currTime=CFAbsoluteTimeGetCurrent(); CFGregorianDate currenttDate=CFAbsoluteTimeGetGregorianDate(currTime,CFTimeZoneCopyDefault());//得到要提醒的日期 CFGregorian转载 2012-04-14 09:20:45 · 639 阅读 · 0 评论 -
为导航条添加按钮
UIBarButtonItem *infoButton = [ [UIBarButtonItemalloc]initWithTitle:@"about"style:UIBarButtonItemStyleDone target:self action:@selector(showMessage:)]; sel原创 2012-03-09 14:41:32 · 554 阅读 · 0 评论 -
NSMutableURLRequest 发送同步请求get方法
/* NSMutableURLRequest get method方式获取数据 */-(void)getMethod{ [UIApplicationsharedApplication].networkActivityIndicatorVisible =YES; //NOTE with this way, cookie is send automatical原创 2012-03-24 11:19:39 · 4774 阅读 · 0 评论 -
ASIHttpRequest 下载服务器上面的文件
.h 头文件#import @interface ViewController : UIViewController@property (retain, nonatomic) IBOutlet UIProgressView *progressView;/*简单的download代码*/-(IBAction)goURL;原创 2012-03-24 10:53:10 · 767 阅读 · 0 评论 -
获取选中TableViewCell的index
获取选中TableViewCell的index 关键词:获取选中TableViewCell的index,确定button所在cell的index在这个例子中,当改变picker值的时候,Cell中的值也跟着改变。以前就一直很纠结怎么获取选中的Cell,看过这个例子后,真是豁然开朗呀!这个例子里用到了一个方法:indexPathForSelectedRow,用这个转载 2012-03-01 10:59:28 · 3300 阅读 · 0 评论 -
实现多选
你已经知道,表格单元可以通过accessoryType属性,显示一个对号标记的附件。当用户选中一个单元格时,表格代理的didSelectRowAtIndexPath方法会被调用。这个方法是UITableViewDelegate协议的一部分。在你的代理中加入这个方法,并且对需要的单元格设置对号附件,就可以为你的表格增加对多选的支持:- (void)tableView:(UITableView *转载 2012-03-01 10:44:22 · 891 阅读 · 0 评论 -
UIActionSheet API referrence
NextUIActionSheet Class ReferenceInherits fromUIView :UIResponder : NSObjectConforms toNSCoding (UIView)UIAppearance (UIView)UIAppearanceContainer (UIView)N转载 2012-02-22 09:45:06 · 1190 阅读 · 0 评论 -
在iphone程序中调用 电话,短信,网页,邮件功能
邮件:[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://roamer@me.com"]];电话[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://911110"]];sms[[UI转载 2012-02-27 13:58:24 · 549 阅读 · 0 评论 -
iphone ios 用xcode4.2开发 访问web service的功能
http://blog.youkuaiyun.com/remote_roamer/article/details/7003984注意:关于iphone连接webservice还不太懂,只能先参考下别人的东西,大家一起分享下把转载 2012-02-27 13:53:22 · 696 阅读 · 0 评论 -
iphone获得当前系统时间
NSCalendar *calendar = [[NSCalendaralloc]initWithCalendarIdentifier:NSChineseCalendar];//NSGregorianCalendar/*NSGregorianCalendar NSChineseCalendar];NSJapaneseCalendar...*/ N原创 2012-02-27 15:06:11 · 1065 阅读 · 0 评论 -
如何在Mac Xcode下使用SVN(部分)
url:http://www.ylmf.net/mac/tips/201010207350_2.html转载 2012-02-27 14:03:46 · 558 阅读 · 0 评论 -
配置svn第一次提交时可能要用终端里面手动输入程序
sun-ningnings-MacBook:~ sunningning$ svn import /用户/sunningning/文稿/aaa.pages svn://xx.xx.com:12099/androidDeelOrder -m"223" --username sunningning注意:sunningning -- 本机的用户原创 2012-02-27 14:11:50 · 1818 阅读 · 0 评论 -
调用删除方法UITableView deleteRowsAtIndexPaths的时候就挂掉
//ios 3.0.马上做deleteAtIndexPaths的动作 [tableView beginUpdates]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationRight]; [tableView原创 2012-02-24 14:00:18 · 24793 阅读 · 0 评论 -
关于XCode 4中读取Plist文件为什么会读出空数据
关于XCode 4中读取Plist文件本文介绍的是关于XCode 4中读取Plist文件,主要是通过代码来实现内容的需求,内容是通过代码来实现,来看详细内容。AD: 关于XCode 4中读取Plist文件是本文要介绍的内容,主要介绍的是plist文件图和来获取,内容不多,主要是通过代码来实现。不多说,先来看详细内容。1. 添加plist文件转载 2012-02-24 13:32:37 · 2006 阅读 · 0 评论