- 博客(8)
- 收藏
- 关注
原创 Objective-C指针、栈帧、栈
1、Objective-C的指针是用来只是对象的,例如:NSString *someString = @“The string”;这种语法基本上是照搬C语言的,声明了一个名为someString的变量,其类型为NSString* ,也就是说此变量为指向NSString的指针。所有Objective-C的对象都必须这样声明,因为对象所占内存总是分配在“堆空间(heap space)”,而
2017-11-28 15:12:18
615
1
转载 深入NSTimer(iOS)
You use the NSTimer class to create timer objects or, more simply, timers. A timer waits until a certain time interval has elapsed and then fires, sending a specified message to a target object. For e
2017-06-02 17:42:50
293
原创 视频播放器AVPlayer
1、采用AVPlayer进行封装2、通过单例视频管理类全局控制视屏的播放暂停和移除视频view3、播放视图和工具条独立封装,完全解耦4、封装独立的弹框视图,可加网络判断来是否继续播放github地址:https://github.com/Janko0/JKAVPlayer播放器使用//// ViewController.m// JKPlayer/
2017-02-21 15:00:31
31757
原创 iOS 内存分配(栈和堆)
代码示例:import "JKViewController.h"@interface JKViewController ()@end@implementation JKViewControllerint num = 1;//数据区(全局区/静态区)NSString str;//BSS区(全局区/静态区)static NSString str2 = @"string"
2017-02-21 14:57:18
2572
原创 NSString引用计数分析
NSString的引用计数比较特殊以下是创建NSString的几种方法:NSString buffer1 = @"hello world";TLog(buffer1);NSString buffer2 = [NSString stringWithString:@"hello world"];TLog(buffer2);NSString buffer3 = [[NSString
2017-02-21 14:55:57
767
原创 自定义UIButton,文字图片位置设置 例:图片在上文字在下
#importtypedefNS_ENUM(NSUInteger, JKButtonEdgeInsetsStyle) { JKButtonEdgeInsetsStyleTop,// image在上,label在下 JKButtonEdgeInsetsStyleLeft,// image在左,label在右 JKButtonEdgeI
2016-11-25 15:18:49
1169
原创 扩展UITextView占位符和清空控能
typedef NS_ENUM(NSInteger, YKTextViewMode) { YKTextViewModeNever, YKTextViewModeWhileEditing,};#import <UIKit/UIKit.h>@interface YKTextView : UITextView@property (nonatomic, strong) NSString *placehoder; // 占位文字@property (nonatomic, strong)
2016-09-26 17:40:37
593
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人