随笔分类 - ios
ios wrriting from work!
摘要:CocoaPods
阅读全文
摘要://设置线的宽度CGContextSetLineWidth(ctx, 12);//设置线的连接处 (拐点)CGContextSetLineJoin(ctx,kCGLineJoinRound)/* Line join styles. */ enum CGLineJoin { kCGLineJoinMiter, kCGLineJoinRound,//圆滑的 kCGLineJoinBevel }; //设置线的端点CGContextSetLineCap(ctx, kCGLineCapButt); 设置 线的端点样式enum CGLineCap { kCGLineCapButt,...
阅读全文
摘要:父视图 和子视图的关联只有当父视图 userInteractionEnabled=YES; 是其子视图才可响应userInteractionEnabled=NO代表不接受响应UIView的默认值时YES UIview的子类 的默认值要根据具体的api。
阅读全文
摘要:或者在有statusbar情况下UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])
阅读全文
摘要://模拟器上 (快10 倍)2013-02-09 17:44:46.091 Fuel Monitor[10185:15203] ------------------2013-02-09 17:44:46.092 Fuel Monitor[10185:15203] date::2013-02-09 09:44:45 +00002013-02-09 17:44:46.092 Fuel Monitor[10185:15203] date::2013-02-09 09:44:46 +00002013-02-09 17:44:46.093 Fuel Monitor[10185:15203] [NSDat
阅读全文
摘要:1. .h 文件中1) @class 引入 NSSet* 类型的外键也要引入2) 添加对应的属性@property (nonatomic, retain) NSString * 外键属性名;2. . m文件中1)#import "外键的className.h"2)添加对应的@dynamic外键属性名;
阅读全文
摘要:1.需求主线现弄清晰 (便于数据库的创建,确保正确的外键关系)
阅读全文
摘要:1.如何定义一个应用之间调用的ios 本地URL一下博客详解http://www.cnblogs.com/supercheng/archive/2012/11/05/AppInvoke.html2. 检测 定义的URL是否可以连接NSLog(@"isOK:%d",[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"TheURLDefinedByYou://"]] );
阅读全文
摘要:- (NSIndexPath *) tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath {return sourceIndexPath.section == proposedDestinationIndexPath.section ? proposedDestinationIndexPath : source
阅读全文
摘要:一 . Plain类型的:做法cell 的backgroupView 是设置的 57 pix,在此基础上 在方法willDisplayCell 中cell.backgroundView添加一个高为55Pix的view 作为背景这样就有了 2pix的 cell 下边框了-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ return 57.0;}-(void)tableView:(UITableView *)tableView willDisplayCell.
阅读全文
摘要:UIWebView*webView =[[UIWebView alloc] initWithFrame:CGRectMake(10,10,200,200)];NSURL *targetURL =[NSURL URLWithString:@"http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebView_Class/UIWebView_Class.pdf"];NSURLRequest*request =[NSURLRequest requestWithURL:targetURL
阅读全文
摘要:UITextField-IOS开发摘自:http://www.myeducs.cn/sys/IOS/UITextFieldIOS-kaifa.htm//初始化textfield并设置位置及大小 UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)];//设置边框样式,只有设置了才会显示边框样式 text.borderStyle = UITextBorderStyleRoundedRect;typedef enum { UITextBorderStyleNone, UITextBor..
阅读全文
摘要:使用IOS的CoreData进行存储很方便,CoreData已经帮我们做了很多基础的工作,一般情况下没必要自己操作数据库了。在开发中修改了实体模型,可能会遇到schema incompatibility的错误,这是因为修改了数据结构,要进行数据迁移。其实很多简单的情况,不用这么麻烦,Coredata提供了轻量级的自动数据迁移,比如以下三个情况会自动进行:1.简单的增加一个字段2.把一个必填字段改为可选字段3.把可选字段改为必填字段(但一定要定义默认值)怎样开启自动迁移的功能?分三步1.在App delegate类里修改persistentStoreCoordinator方法- (NSPersi
阅读全文
摘要:button的初始化有两种一种是动态创建UIButton *button1 = [UIButton alloc]initWithFrame:CGRectMake(0, 0, 80, 50)];接下来设置button属性另一种是静态创建UIButton *button2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];设置button2的frame
阅读全文
摘要:不错的博文NSBundle介绍http://blog.sina.com.cn/s/blog_8c87ba3b0100t89v.html大家可以看一下NSLog(@"ios 应用发布后 .app 应用文件 路径::%@",[NSBundle mainBundle] ); NSLog(@"ios 应用发布后 .app 应用包(文件) 的详细信息::%@",[[NSBundle mainBundle] infoDictionary]);[[NSBundle mainBundle]infoDictionary] 返回的是一个数据字典内容如下:(XX1 为当前应用
阅读全文
摘要:解决5.0 以下版本自定义 navigationBar 背景图片原因:在5.0 以下的api 中没有提供setBackgroundImage:(UIImage*)backgroundImage forBarMetrics:(UIBarMetrics)barMetrics 方法this method in 5.x api:- (void)setBackgroundImage:(UIImage *)backgroundImage forBarMetrics:(UIBarMetrics)barMetrics __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0
阅读全文
摘要:推荐相关不错的文章1.http://www.189works.com/article-34872-1.html(详细介绍UIImagePickerController类)2.http://xyyk.iteye.com/blog/838038主要讲解[popoverControllerpresentPopoverFromRect:selectRectinView:self.viewpermittedArrowDirections:UIPopoverArrowDirectionAnyanimated:YES]; 这个方法UIImagePickerController类照相以及从相册中取得相片1.
阅读全文
摘要:UIActionSheet类 在 iphone和ipad 中有很大的不同主要区别:显示规则不同iphone中直接从下推出ipad中在UIPopoverController 中显示的详细我也不都说了 下面的连接有详细的介绍:http://blog.sina.com.cn/s/blog_7b758d4d0100xvn3.html
阅读全文
摘要:AVFoundation.framwork框架 :用于播放音频文件1. 导入框架 (省略)2. 类中引入框架#import "AVFoundation/AVFoundation.h"3. 声明AVAudioPlayer 声音文件播放类NSString *path = [[NSBundle mainBundle] pathForResource:@"chooseplayer"ofType:@"mp3"]; NSError *error; if ([[NSFileManager defaultManager] fileExistsAtPa
阅读全文
摘要:if ([UIImagePickerControllerisSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {相机可用}
阅读全文