`
文章列表
从本地或网页加载图片 从本地加载图片 NSString *boundle = [[NSBundle mainBundle] resourcePath]; [web1 loadHTMLString:[NSString stringWithFormat:@"<img src='http://fei263.blog.163.com/blog/0001.png'/>"] baseURL:[NSURL fileURLWithPath:boundle]]; 从网页加载图片并让图片在规定长宽中缩小 [cell.img loadHTMLString:[NSString stri ...
UIImage保存到文件,PNG/JPEG自适应 + (BOOL)writeImage:(UIImage*)image toFileAtPath:(NSString*)aPath {          if ((image == nil) || (aPath == nil) || ([aPathisEqualToString:@""]))               return NO;          @try          {               NSData *imageData = nil;               NSString *ext ...
iPhone开发中使用的特殊URL 在iPhone中,可以直接用UIApp打开URL地址。如下所示: [ UIApp openURL: [ NSURL URLWithString:@"http://www.apple.com" ] ]; 或者 [ UIApp openURL: [ NSURL URLWithString:@"mailto:apple@mac.com?Subject=hello" ] ]; iPhone包含一些其他除了http://或者mailto:之外的URL: sms:// 可以调用短信程序 tel:// 可以拨打电话 itms:// 可 ...
iphone模拟器中的documentPath NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *realPath =[documentPath stringByAppendingPathComponent:filename]; 用这个方法后file在电脑中的路径为:当前用户/Library/Application Support/iPhone Simulator/版本号(4.1) ...
http://www.cocoachina.com/bbs/read.php?tid-73476-fpage-2.html      新浪微博验证详解
  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil];         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasHidden:) name:UIKeyboardDidHideNotification object:nil]; - (vo ...
-(void)checkboxClick:(UIButton *)btn {     btn.selected = !btn.selected; } - (void)viewDidLoad { UIButton *checkbox = [UIButton buttonWithType:UIButtonTypeCustom];         CGRect checkboxRect = CGRectMake(135,150,36,36);     [checkbox setFrame:checkboxRect];         [checkbox setImage:[UIImage im ...
http://www.cocoachina.com/bbs/simple/?
NSRange的定义 typedef struct _NSRange {   NSUInteger location;   NSUInteger length; } NSRange; NSRange是一个结构体,其中location是一个以0为开始的index,length是表示对象的长度。他们都是NSUInteger类型。 而NSUInteger类型的定义如下: #if __LP64__ || TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64 typedef unsigned l ...
1.插件首页:http://www.spket.com 2.插件名称:Spket IDE 3.更新连接(Update Site):http://www.spket.com/update/ 更新安装方法: 1.[Help]-[Software Updates]-[Find and Install...] 2.[Search for new features to install] -> [Next] 3.[New Remote Site…] Name: "什么都行,spketjs" URL: http://www.spket.com/update/--> [ ...
根据不同的系统语言使用不同的Default.png图片 首先右击Default.png, Get Info,选中General项,点击Make File Localizable,再选回General单击ADD Localization按钮.在提示输入一种语言时,键入zh_CN(表示简体中文).此时,在项目文件夹内(Finder)应该 会有zh_CN.lproj文件夹,文件夹中找到Default.png,该文件如果要改成正确的中文图片最简便的方法是:使用Finder将正确的图像复制到zh_CN.lproj文件夹中,命名也要为Default.png.  运行时要先重置模拟器才有效果.要改英文下的 ...
Key-Value Observing 快速入门 其实KVC、KVO即NSKeyValueCoding和NSKeyValueCoding的简称。 在官方文档中描述为 Key-Value Observing机制的概述 Key-Value Observing (简写为KVO):当指定的对象的属性被修改了,允许对象接受到通知的机制。每次指定的被观察对象的属性被修改的时候,KVO都会自动的去通知相应的观察者。 KVO的优点 当有属性改变,KVO会提供自动的消息通知。这样的架构有很多好处。首先,开发人员不需要自己去实现这样的方案:每次属性改变了就发送消息通知。这是KVO机制提供的最大的优点。因为这个 ...
KVO/KVC 实现机理分析 Objective-C里面的Key-Value Observing (KVO)机制,非常不错,可以很好的减少浇水代码。关于KVO的学习,可以参考文章:《Key-Value Observing快速入门》:http://www.cocoadev.cn/Objective-C/Key-Value-Observing-Quick-Start-cn.asp   Key-Valu ...
1.main() {    int a[5]={1,2,3,4,5};    int *ptr=(int *)(&a+1);     printf("%d,%d",*(a+1),*(ptr-1)); } 答:2,5      *(a+1)就是a[1],*(ptr-1)就是a[4],执行结果是2,5   &a+1不是首地址+1,系统会认为加一个a数组的偏 移,是偏移了一个数组的大小(本例是5个int)   int *ptr=(int *)(&a+1);   则ptr实际 是&(a[5]),也就是a+5 原因如下:   &am ...
http://www.cocoachina.com/bbs/read.php?tid-73476-fpage-2.html https://github.com/JimLiu/WeiboSDK        新浪微博开源代码
Global site tag (gtag.js) - Google Analytics