- 博客(16)
- 收藏
- 关注
原创 ios isa 指针相关
在 ios 开发中,类也是一个对象,我们称之为类对象,所有对象中,包含实例对象和类对象,都含有一个isa 指针。实例对象的isa指针, 指向他的类对象,类对象的isa 指针, 指向他的元类。系统判断一个对象属于哪个类,也是通过这个对象的isa指针的指向来判断。对象中的成员变量,存储在对象本身,对象的实例方法,存储在他的isa 指针所指向的对象中,即:减号方法,存储在类对象中,类方法,存储在类对象...
2019-06-09 18:10:48
287
原创 ios 代码支持cocoapod spec写法
Pod::Spec.new do |s|s.name = "QTcocoapodsTest" # 项目名称s.version = "0.0.1" # 版本号 与 你仓库的 标签号 对应s.license = "MIT" # 开源证书s.summary = "私人pod代码" # 项目简介...
2019-03-13 18:08:32
266
原创 iOS 时间计算
获取6个月之后的时间NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *comps = nil; ...
2018-07-18 17:15:58
450
原创 ios 购物车商品下落动画
属性: @property (nonatomic,strong) NSMutableArray *animationLayers;@property (nonatomic,assign) BOOL isNeedNotification;@property (nonatomic,assign) BOOL isAnimating;方法:
2018-01-15 11:09:20
426
原创 ios 强制改变某一页面屏幕方向
- (void)viewWillAppear:(BOOL)animated{ UIInterfaceOrientation*orientation =UIInterfaceOrientationLandscapeLeft;// 屏幕方向参数 SEL selector = NSSelectorFromString(@"setOrienta
2017-10-26 09:06:54
691
原创 iOS 截取当前视图
UIGraphicsBeginImageContext(self.imageBackgroundView.bounds.size); //currentView 当前的view 创建一个基于位图的图形上下文并指定大小为 [self.imageBackgroundView.layerrenderInContext:UIGraphicsGetCurrentCont
2017-02-13 15:13:14
300
原创 ios笔记 可视化编程字体大小适配
创建个UIButton类目, 名字叫AutoFontSize;.h文件代码#import #import /** * button */@interface UIButton (AutoFontSize)@end/** * Label */
2016-10-22 14:56:58
391
原创 iOS笔记 js 交互
今天碰到了js调用oc oc调用js的需求 为了方便查阅, 记录一下js 调用OC #import - (void)webViewDidFinishLoad:(UIWebView *)webView{ JSContext *context=[webViewvalueForKeyPath:@"documentView.webView.m
2016-08-09 09:46:30
220
原创 iOS笔记 runtime Method Swizzle 方法交换//
//方法交换- (void)awakeFromNib{ Method one =class_getInstanceMethod([selfclass], NSSelectorFromString(@"viewDidLoad")); Method two =class_getInstanceMethod([selfcla
2016-07-29 15:29:09
295
原创 iOS笔记 页面切换 CATransition Animation动画
CATransition *animaton = [CATransitionanimation];// 声明 animaton.duration =0.7; // 动画时长 animaton.type =@"rippleEffect"; // 动画类型 animaton.subtype =kCATransitionFromLeft
2016-07-23 14:26:37
250
原创 iOS笔记监听键盘状态 获取键盘高度
在viewdidload注册消息, 调用 registerForKeyboardNotifications 方法- (void) registerForKeyboardNotifications{ [[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(ke
2016-07-21 10:37:30
571
转载 iOS 笔记 精确计算 NSDecimalNumber
今天因为出现了 str 转float 的误差问题, 接触到了NSDecimalNumber这个类, 在别人那里找来了一些现成的笔记, 记录一下 /**由于NSDecimalNumber能够存储很大的值(大到38位 x 10^+/-128)。这样进行一些大数值运算时也很方便,但是直接使用C的标量值会比通过NSDecimalNumber更快,所以需要慎重选择该方法。通常来说,这只在集
2016-07-12 16:28:07
288
原创 iOS 开发笔记
1 获取当前ViewController UIViewController *appRootVC = [UIApplicationsharedApplication].keyWindow.rootViewController; UIViewController *topVC = appRootVC; if (topVC.presented
2016-07-11 15:22:12
164
原创 iOS开发 正则表达式
正则表达式是通过特定的语法来查找指定字符串中的符合要求的子串,比如在一串数字中找到电话号,多用于图文混排正则表达式基本语法:简单几个例子1.@"abc" : 在目标字符串中查找内容为 @"abc"的字串2.@"[abc]": 在目标字符串中查找内容为 @"a" 或者 @"b" 或者 @"c"的字串3.@"[0-9]": 在目标字符串中查找内容为 数字的字串 如@"1", @"2
2016-06-30 17:07:15
443
转载 iOS笔记 常用代码
1.磁盘总空间大小+ (CGFloat)diskOfAllSizeMBytes{ CGFloat size = 0.0; NSError *error; NSDictionary *dic = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirect
2016-06-30 15:19:52
350
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人