- 博客(19)
- 资源 (1)
- 收藏
- 关注
原创 runtime
((void(*)(id,SEL))objc_msgSend)(currentController,@selector(fillAllMoney));
2016-02-29 15:02:03 211
原创 画图片
`- (void)rotateTapped:(id)sender { UIImage *currentImage = _imageView.image; CGImageRef currentCGImage = currentImage.CGImage;CGSize originalSize = currentImage.size;CGSize rotatedSize = CGS
2016-02-29 11:25:44 281
原创 打开其他应用程序
//在配置文件添加:URL types(NSArray)->URL Schemes(NSArray):my app; URL(NSString):@"任意"NSURL *url = [NSURL URLWithString:@"myapp://"]; [[UIApplication sharedApplication]openURL:url];
2016-02-26 16:29:48 288
原创 下载
2. /Documents/。使用该路径放置关键数据,也就是不能通过App重新生成的数据。该路径可通过配置实现iTunes共享文件。可被iTunes备份。(现在保存在该路径下的文件还需要考虑iCloud同步)3. /Library/。该路径下一般保存着用户配置文件。可创建子文件夹。可以用来放置您希望被备份但不希望被用户看到的数据。该路径下的文件夹,除Caches以外,都会被iTunes备份。4. /
2016-02-25 17:02:04 336
转载 一行代码实现 归档解档
源地址:http://www.jianshu.com/p/fed1dcb1ac9f一、变量声明为便于下文讨论,提前创建父类Biology以及子类Person:Biology:@interface Biology : NSObject{ NSInteger *_hairCountInBiology;}@property (nonatomic, copy) NSString *intro
2016-02-25 16:38:01 945
原创 runtime 增加实例变量
能否向编译后得到的类中增加实例变量?能否向运行时创建的类中添加实例变量?为什么?不能向编译后得到的类中增加实例变量;能向运行时创建的类中添加实例变量;解释下:因为编译后的类已经注册在 runtime 中,类结构体中的 objc_ivar_list 实例变量的链表 和 instance_size 实例变量的内存大小已经确定,同时runtime 会调用 class_setIvarL
2016-02-24 16:43:29 1262
原创 数组排序
NSArray *temp; [temp sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) { NSDictionary *temp1 = obj1; NSDictionary *temp2 = obj2; if (temp2[@"addti
2016-02-24 14:46:06 284
原创 CABaseAnimation
animationWithKeyPath的值: transform.scale = 大小 transform.scale.x = 宽的缩放比例 transform.scale.y = 高的缩放比例 transform.rotation.z = 平面图的旋转 opacity = 透明度 margin zPosition bac
2016-02-23 18:04:35 403
原创 scrollview中圆角处理
//滚动中一直处理圆角会阻塞UI,可设置下面的属性// 使视图渲染内容被缓存起来,[self.layer setShouldRasterize:YES];[self.layer setRasterizationScale:[UIScreen mainScreen].scale];
2016-02-18 11:44:36 1410
原创 navigationController
//设置页面有上拉手势的时候隐藏导航栏,快速下拉则显示导航栏self.navigationController.hidesBarsOnSwipe = YES;//设置页面有单击事件的时候隐藏导航栏,再次点击显示导航栏self.navigationController.hidesBarsOnTap = YES;
2016-02-17 14:08:24 321
原创 NSDate
fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@”en_US”];//默认 typedef CF_ENUM(CFIndex, CFDateFormatterStyle) { // date and time format styles kCFDateFormatterNoStyle = 0, // 无输出
2016-02-17 11:45:31 245
原创 tabbar ios
tabBar图片被tintColor填充问题解决:nav.tabBarItem.image = [[UIImageimageNamed:@“barImage”]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];nav.tabBarItem.selectedImage [[UIImag imageNamed:@"barImgaeSe
2016-02-17 11:44:14 239
原创 scrollview自定义pageEnable
#pragma mark <UIScrollViewDelegate>- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { _startY = scrollView.contentOffset.y;}- (void)scrollViewDidEndDragging:(UIScrollView *)scrollV
2016-02-17 11:41:51 3444
原创 获取对象的属性名、属性值、属性特性,协议列表
unsigned int count; objc_property_t *properties = class_copyPropertyList([self class], &count); for (int i =0; i < count; i ++) { const char *propertyName =property_getName(propertie
2016-02-17 11:37:46 720
原创 round、ceil、floor
extern float ceilf(float); extern double ceil(double); extern long double ceill(long double);extern float floorf(float); extern double floor(double); extern long double floorl(longdouble);extern fl
2016-02-16 14:25:07 286
原创 绘制渐变色
//添加坐标的坐标点 UIBezierPath * pathtemp=[[UIBezierPath alloc] init]; [pathtemp moveToPoint:CGPointMake(10, 100)]; [pathtemp addLineToPoint:CGPointMake(50, 90)]; [pathtemp addLineToPoint:
2016-02-16 11:18:00 404
原创 抓取crash
@try { NSString *str = [NSNullnull]; NSLog("%zi",str.length); } @catch (NSException *exception) { NSString *msg = [NSStringstringWithFormat:@"name:%@
2016-02-01 14:50:31 254
iOS 10.3 disk image
2017-05-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人