iPhone开发部分总结_3_

来源:互联网 发布:淘宝客里的返利管理 编辑:程序博客网 时间:2024/05/01 20:49

1.取主屏幕尺寸Frame

CGRect  rectFrame = [[UIScreenmainScreen]bounds];


2.取资源路径的另一种方法(加载WebView)

[plain] view plaincopyprint?
  1. NSString *mainBundleDirectory=[[NSBundle mainBundle] bundlePath];  
  2. NSLog(@"bundlePath_:%@",mainBundleDirectory);  
  3. NSString *realPath=[mainBundleDirectory stringByAppendingPathComponent:resourceName];  
  4. NSLog(@"resourceName:%@",realPath);  
  5.   
  6. NSURL *url=[NSURL fileURLWithPath:path];  
  7. NSURLRequest *request=[NSURLRequest requestWithURL:url];  
  8. aWebView.scalesPageToFit=YES;  
  9. [aWebView loadRequest:request];  


3.ABPeoplePickerNavigationController

通讯录,允许用户从通讯录选择一个联系人或从地址簿中得到相关信息


4.NSOperation和NSOperationQueue

使用NSOperation和NSOperationQueue在后台线程中处理任务的方法


5.iPad下设置UITableView背景颜色

tableView.backgroundView = nil;设置后可对其背景颜色进行修改


6.关闭全部软键盘方法

[view endEditing:NO];view是其它视图类的父视图

原创粉丝点击