随笔分类 -  iOS 开发笔记(基础)

NSLog 的输出格式
摘要:%@ 对象 %d, %i 整数 %u 无符整形 %f 浮点/双字 %x, %X 二进制整数 %o 八进制整数 %zu size_t %p 指针 %e 浮点/双字 (科学计算) %g 浮点/双字 %s C 字符串 %.*s Pascal字符串 %c 字符 %C unichar %lld 64位长整数( 阅读全文

posted @ 2017-04-10 17:48 Pierce-lph 阅读(119) 评论(0) 推荐(0)

通知的使用
摘要://创建通知 [[NSNotificationCenter defaultCenter] postNotificationName:kMusicPlaybackStateChangeNotification object:musicIdentifier]; //监听通知 [[NSNotificationCenter defaultCenter] addObserver:self se... 阅读全文

posted @ 2017-04-10 17:43 Pierce-lph 阅读(154) 评论(0) 推荐(0)

单例的定义
摘要:在.h 文件中定义: 在.m 文件中定义: 阅读全文

posted @ 2017-04-10 17:25 Pierce-lph 阅读(166) 评论(0) 推荐(0)

获取cell 在collection view 中的位置
摘要:1 //求得出点击的cell在当前View的位置 2 UICollectionViewLayoutAttributes *attributes = [collectionView layoutAttributesForItemAtIndexPath:indexPath]; 3 4 CGPoint cellCenter = attributes.center; 5 CGPoint anchor... 阅读全文

posted @ 2017-04-10 17:15 Pierce-lph 阅读(487) 评论(0) 推荐(0)

导航