- 博客(14)
- 资源 (1)
- 收藏
- 关注
转载 frame与bounds的区别比较
翻译文档上的 bounds是指这个view在它自己坐标系的坐标和大小 而frame指的是这个view在它superview的坐标系的坐标和大小 区别主要在坐标系这一块。 很明显一个是自己为原点的坐标系,一个是以屏幕为原点的坐标系。绝对坐标。。。相对坐标。。。比如屏幕旋转的时候就要以相对来重绘。 frame 如果一个按钮,是在表格里,按钮的frame 的坐标也是相对的,并不是相对屏幕,也就是说是
2012-10-30 15:44:05 337
转载 解析:Program received signal: “EXC_BAD_ACCESS"
在练习时,有这么段代码: CALayer *sublayer = [CALayer layer]; sublayer.backgroundColor = [UIColor blueColor].CGColor; sublayer.shadowOffset = CGSizeMake(0, 3); sublayer.shadowRadius = 5.0;
2012-10-30 14:54:25 633
转载 记录园子里的一篇有关CALayer与UIView的关系
CALayer属于Core Animation部分的内容,比较重要而不太好理解。以下是园子中看到的一篇文章的摘录:1. UIView是iOS系统中界面元素的基础,所有的界面元素都是继承自它。它本身完全是由CoreAnimation来实现的。它真正的绘图部分,是由一个CALayer类来管理。UIView本身更像是一个CALayer的管理器,访问它的跟绘图和跟坐标有关的属性,例如frame,b
2012-10-30 13:55:10 509
转载 xcode 项目代码行统计
统计Xcode项目代码行数 1、打开终端。 2、cd到你项目的路径。 3、输入下面的指令: grep -d recurse "\n" classes | wc -l classes,如果你不是默认的classes路径,改之。
2012-10-29 15:37:01 627
原创 NsOperation
所有operation objects都支持以下关键特性:支持建立基于图的operation objects依赖。可以阻止某个operation运行,直到它依赖的所有operation都已经完成。支持可选的completion block,在operation的主任务完成后调用。支持应用使用KVO通知来监控operation的执行状态。支持operation优先级,
2012-10-25 16:14:28 343
转载 iOS平台下实现不同APP之间的通信
我们可以通过UIApplication的openURL方法来实现不同app之间的通信,如下面代码所示:NSURL *myURL = [NSURL URLWithString:@"todolist://www.acme.com?Quarterly%20Report#200806231300"]; [[UIApplication sharedApplication] openURL:my
2012-10-19 16:11:17 812
原创 kvo
按照观察者模式的订阅机制,KVO 中必然有如下三个方法:A. 订阅(Subscribe)- (void) addObserver: (NSObject*) anObserverforKeyPath: (NSString*) aPathoptions: (NSKeyValueObservingOptions) optionscontext: (void*) aContext;
2012-10-19 15:27:39 314
转载 viewDidLoad, viewWillDisappear, viewWillAppear区别
viewWillAppear: Called when the view is about to made visible. Default doesnothing视图即将可见时调用。默认情况下不执行任何操作viewDidAppear: Called when the view has been fully transitioned onto the screen.Default
2012-10-19 14:55:18 320
原创 在UITableViewCell上建立UILable多行显示
- (UITableViewCell *)tableView:(UITableView *)tableViewcellForRowAtIndexPath:(NSIndexPath *)indexPath { staticNSString *CellIdentifier =@"Cell"; UITableViewCell *cell = [tableViewdequeueRe
2012-10-19 14:53:43 1666
原创 Sqlit3 简单操作
1。创建数据库并且打开- (void)open_db{ @synchronized(self){ NSArray *pathArray =NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask,YES); NSString *pat
2012-10-17 17:58:58 587
原创 block 简单使用
int minus = 7; int(^myBlock)(int) = ^(int num ){ int i = num *minus; NSLog(@"---%d",i); return i; }; int t= myBlock(10); NSLog(@"-t==%d",t); 1.int为返
2012-10-12 11:24:47 274
原创 进入后台之后程序还可以执行
UIBackgroundTaskIdentifier bgTask;判断设备是否支持后台 UIDevice* device = [UIDevicecurrentDevice];BOOL backgroundSupported = NO;if ([device respondsToSelector:@selector(isMultitaskingSupporte
2012-10-11 17:23:41 391
原创 获取当前时间
NSDateFormatter *dateFormat = [[NSDateFormatteralloc] init]; dateFormat.dateFormat =@"yyyy-mm-dd HH:mm:ss"; NSString *str = [dateFormatstringFromDate:[NSDate date]]; NSLog(@"%@",s
2012-10-11 13:42:07 294
原创 本地push通知
UILocalNotification *lcNotification = [[UILocalNotificationalloc]init]; if (lcNotification) { NSDate *newDate = [NSDatenew]; lcNotification.fireDate = [newDate dateByAddingTim
2012-10-11 10:10:01 386
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人