自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(44)
  • 资源 (1)
  • 收藏
  • 关注

原创 UIBarButtonItem 设置图片颜色变成系统蓝色解决

设置图片模式[[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"image"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(cl...

2019-07-01 11:01:35 4168

转载 打包Framework文件

https://www.jianshu.com/p/5ef5e21d887c

2019-06-21 14:49:30 220

转载 iOS事件分发

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event;- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;https://www.jianshu.com/p/c87de31b3985

2019-06-18 18:02:28 149

原创 Xcode 快捷配置

一、属性快捷呼出@property (nonatomic, copy) <#Class#> *<#name#>;然后添加到代码块,添加快捷呼出(xcode10 拖不了代码到代码块,选择代码块片段,右键create code snippet)...

2019-06-18 15:27:16 131

原创 CocoPods 构建自己的项目

一、项目创建1、GitHub上创建自己的项目并设置开源协议(忘记添加开源协议,可以添加文件再制定)2、发布release版本并设置tag二、发布到pod上1、到项目同级目录,运行pod spec create name2、编辑name.podspec文件Pod::Spec.new do |spec| spec.name = "XFPro...

2019-06-14 17:40:33 479

转载 给github已有仓库添加协议

1、首先进入你的“代码仓库”,点击"Create new file"。2、这时github的新页面上,有一个空格让你填入文件名称。在输入框输入文件名”LICENSE", 然后点击右侧Choose a license template3、出现一系列协议可供选择,选择自己想要的即可。4、点击“Commit new file”(选择提交到master,不提交到分支),这时你添加的开源协议就在...

2019-06-14 14:57:26 1050

原创 FMDB使用

+ (instancetype)sharedInstance;/** 建表 */- (void)createTableWithTableName:(NSString *)tableName;/** 插入 */- (void)insertTableName:(NSString *)tableName student:(Student *)student;/** 删除 */- (void...

2019-06-05 14:51:05 84

原创 NSTimer 防止主线程UI阻挡

1、改变model [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];2、开辟子线程@property (nonatomic, strong) NSThread *myThread;- (void)dealloc{ [self.myThread cancel];...

2019-05-07 23:03:55 321

原创 iOS NSTimer 后台继续运行

加上以下这句代码[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:nil];

2018-11-14 15:46:29 1597

原创 iOS遍历数组同时删除数组元素

1、for循环NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",@"4",nil];for (int i = 0; i &lt; arr.count; i++) { [arr removeObject:arr[i]];}2、创建中间数组NSMutableArray *arr = [...

2018-10-23 16:08:23 2952

原创 NSTimer 循环引用问题解决

1、改变target为非selfself.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self.viewModel selector:@selector(countdown:) userInfo:nil repeats:YES];2、iOS10以后提供了block实现__weak __typeof(self) w...

2018-10-23 11:53:56 723

原创 归档 解档

首先遵循 NSCoding 协议 并实现;@interface BigPerson : NSObject &lt;NSCoding&gt;@property (nonatomic, copy) NSString *name;@property (nonatomic, assign) int age;@property (nonatomic, assign) BOOL sex;@pr...

2018-10-10 15:55:43 214

原创 iOS +(void)load运行流程解析和运用总结

1、load函数只要你动态加载或者静态引用了这个类,那么load就会被执行,它并不需要你显示的去创建一个类后才会执行,同时只执行一次。2、顺序:父类 -&gt; 子类 -&gt; 同级类(同级顺序不定) -&gt; 子类+category -&gt; main -&gt; appdelegate...

2018-10-10 14:46:47 478

原创 当前界面多个TextField,代理方法中判断是哪个(每个textField都会走一遍代理)

if (textField == self.textField &amp;&amp; textField.isFirstResponder) {} 

2018-10-10 13:59:00 1270

原创 提取ipa素材

github上搜索iOS-Images-Extractor参照:https://jingyan.baidu.com/article/a501d80c224bacec630f5edc.html

2018-10-10 13:52:40 454

原创 获取App ipa包

通过App Store下载Apple Configurator 2;参照:https://www.jianshu.com/p/7710c68f38cf

2018-10-10 13:51:16 3623

原创 runtime

#import <objc/runtime.h>一、runtime 消息转发原理三次转发流程1、动态方法解析+ (BOOL)resolveInstanceMethod:(SEL)sel;+ (BOOL)resolveClassMethod:(SEL)sel;2、备用接收者- (id)forwardingTargetForSelector:(SEL)aSele...

2018-10-09 14:28:36 318

原创 Cocos2dx-3.x 新建项目

1、终端进入目录 ……/cocos2d-x-3.16/tools/cocos2d-console/bin/ 2、终端运行命令 cocos new Demo2 -p com.cocos2dx.org -l cpp -d …./codes (cocos new 项目名称 -p 包名 -l 语言 -d 生成文件位置)

2017-10-19 11:45:50 10595

原创 Cocos2dx-3.x 打包编译到Android Studio

1、有新文件增加先修改 ……/Demo/proj.android-studio/app/jni/Android.mk 文件 LOCAL_SRC_FILES := hellocpp/main.cpp \ ../../../Classes/AppDelegate.cpp \ ../../../Classes/code1

2017-10-19 10:11:56 1810

原创 Xcode7添加 .dylib静态文件

a、选择Build Phases —> Link Binary With Libraries —> + b、add Other… —> 快捷键(command + shift + G) c、输入 /usr/lib d、选择想要加入的文件

2016-07-06 15:03:15 284

原创 关于rangeOfString判断是否存在字符串bug

NSString *testStr; NSLog(@”—–>%lu,%lu”, [testStr rangeOfString:@”=”].location,[testStr rangeOfString:@”=”].length); if ([testStr rangeOfString:@”=”].location != NSNotFound) { NSLog(@

2016-05-26 14:29:38 445

原创 Hybrid 混合开发

hybrid

2016-05-24 17:14:18 485

原创 pch文件添加

添加新文件, 选择iOS-Other-PCH File 设置配置 target-Build Settings 搜索 header 选择Prefix Header 填入 工程名/**.pch

2016-05-16 17:43:21 272

原创 xib 创建view加载

CustomView *v = [[[NSBundle mainBundle] loadNibNamed:@"CustomView" owner:self options:nil]lastObject]

2016-05-16 11:05:58 220

原创 注册cell

//xib[_tabView registerNib:[UINib nibWithNibName:@"CustomCell" bundle:nil] forCellReuseIdentifier:@"cellID"]//代码[_tabView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cellID"]

2016-05-16 11:04:06 242

原创 XML文件转换成plist文件

先解析XML文件成字典,然后用字典写文件!

2016-05-16 10:10:44 503

原创 内存泄露问题

1、悬垂指针2、循环引用 <1>代理 <2>代码块 <3>NSTimer(定时器)

2016-03-10 14:03:23 183

原创 未使用的变量不报警告

__unused int a;

2016-03-10 14:00:01 2544

原创 Xcode快捷操作

1、工程导航器 command + 1~8 command + 0 开启/关闭 2、实用工具面板 command + option + 1~6 command + option + 0 开启/关闭 3、

2016-03-07 10:18:15 169

原创 使用UIAlterView时设置window问题

//取出的是当前window,是UIAlterView生成的windowUIWindow *window = [UIApplication sharedApplication].keyWindow;//取第一个window,为程序开始的windowUIWindow *window = [[[UIApplication sharedApplication] windows] firstObjec

2016-03-02 17:41:17 383

原创 复制到剪切板

UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];pasteboard.string = @"content";

2016-02-26 17:23:01 315

原创 tabbar显示原图

nav.tabBarItem.image = [[UIImage imageNamed:tabBarIcons[i]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

2016-01-18 10:07:29 342

原创 pod install 失效问题

pod install 换成 pod install –verbose –no-repo-update 这个命令,前面的命令被墙了

2016-01-14 16:40:13 228

原创 CoreAnimation学习(图层)

UIView和CALayer最大的不同是CALayer不处理用户的交互,不清楚具体的响应链于是就不能够响应事件。一个试图只有一个相关联的图层(自动创建),同时它可以支持添加无数多个子图层。CALayer的寄宿图(即图层中包含的图):layer.contents = (__bridge id)image.CGImage; //添加图片layer.contentsGravity = kCAGra

2015-12-30 11:41:29 214

原创 调用系统电话

第一种:[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://10086"]];第二种:UIWebView*callPhoneWebview =[[UIWebView alloc] init];NSURL *telURL =[NSURL URLWithString:@"tel:10086"]; //(tel

2015-12-28 14:18:16 245

原创 键盘遮挡解决

- (void)dealloc{ [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKey

2015-12-28 10:37:54 285

原创 动态更新约束

/** * 键盘即将出现 */- (void)keyboardWillShow:(NSNotification *)notif{ NSDictionary *info = [notif userInfo]; NSValue *value = [info objectForKey:UIKeyboardFrameBeginUserInfoKey]; CGSize key

2015-12-25 10:04:48 278

原创 NSDate 与 NSDateFormatter

NSDate *date = [NSDate dateWithTimeIntervalSince1970:timeValue];NSDateFormatter *formatter = [[NSDateFormatter alloc] init];[formatter setDateFormat:@"yyyy-MM-dd hh:mm:ss"];//hh代表几位01/1NSString *tim

2015-12-21 15:25:21 200

原创 设置父视图的alpha不影响子视图的

self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.7];

2015-12-17 10:49:42 452

原创 获取网络时间

{ NSURLConnection *_connection; void(^_netWorkTimeBlock)(NSString *netWorkTime);}/** * 获取网络时间 * * @param nowNetWorkTimeBlock 返回时间 / 或者无网络状态信息 */- (void)getNetworkTimeBlock:(void(^)(

2015-12-08 14:49:38 502

gif制作神器

gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器gif制作神器

2018-01-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除