摘要: 本文转载自lyzaily@126《[原创]Xcode使用入门》Xcode是一个款强大的IDE开发环境,就像你在写Windows程序时需要VS2005一样 需要要Xcode为你写Mac程序提供环境。因此,如果你要成为Mac 程序的开发者,灵活运用Xcode工具是你必须做的第一步。1) 我们写程序时常常在源文件的头部添加copyright声明以及公司名称等等;而Xcode在创建文件时已经帮我们做了绝大部分工作,我们可能需要修改一 下公司名称,因为xcode给不知道我们公司名称,它不可能预知一切,所以需要我们自己通过设置来告诉它。那么我们如何做到这一点呢?因为xcode中没 有有关公司名称的占位符, 阅读全文
posted @ 2013-03-28 17:19 李伯波 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 1.添加addressbook.framework2.在需要的源文件中#import <AddressBook/AddressBook.h>#import <AddressBookUI/AddressBookUI.h>3.开始粘代码: //get all people info from the address book ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook);//这是个 阅读全文
posted @ 2013-03-28 17:10 李伯波 阅读(184) 评论(0) 推荐(0) 编辑
摘要: NSLog的格式如下所示: %@ 对象 %d, %i 整数 %u 无符整形 %f 浮点/双字 %x, %X 二进制整数 %o 八进制整数 %zu size_t %p 指针 %e 浮点/双字 (科学计算) %g 浮点/双字 %s C 字符串 %.*s Pascal字符串 %c 字符 %C unichar %lld 64位长整数(long long) %llu 无符64位长整数 %Lf 64位双字 阅读全文
posted @ 2013-03-28 17:03 李伯波 阅读(99) 评论(0) 推荐(0) 编辑
摘要: -(void)testJson{ SBJSON *jsonWriter = [[SBJSON new] autorelease]; NSArray* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys: @"10",@"age",@"wsx",@"name", nil], nil]; NSString *actionLinksStr = [jsonWriter stringWithObject:acti 阅读全文
posted @ 2013-03-28 16:59 李伯波 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 摘自 : http://www.helmsmansoft.com/index.php/archives/1552NSNotificationCenter负责程序内的通知的监听和发送,而Darwin Notification Center负责程序间的通知的管理。 要想监听所有程序内的通知,只需要在addObserver方法里面的name属性设为nil即可:[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(trackNotifications:) name:nil object:n... 阅读全文
posted @ 2013-03-28 16:51 李伯波 阅读(154) 评论(0) 推荐(0) 编辑