随笔分类 -  oc学习笔记

1 2 3 4 5 ··· 10 下一页

iOS MacOS 后台传BOOL值怎么接收demo,怎么打印BOOL值
摘要:先上大招 已知obj[@"showBuy"]是后台返回的Json字段BOOL类型,直接打印结果 NSLog(@"hhhkkkkkkkk:%@",[obj[@"showBuy"] boolValue] ? @"YES":@"NO"); 详细分析 在iOS开发中,如果你正在使用Objective-C(O 阅读全文

posted @ 2024-09-19 10:17 高彰 阅读(44) 评论(0) 推荐(0) 编辑

iOS macOS更新Xcode15后适配UI界面处理界面越界显示问题
摘要:直接上解决方案,亲测有效哦 iOS端 my..clipsToBounds = YES; macOS端 drawRect [self setClipsToBounds:true]; addSubview后面 [self.chartViewControll.view setClipsToBounds:t 阅读全文

posted @ 2024-03-13 17:26 高彰 阅读(109) 评论(0) 推荐(0) 编辑

一句话讲清楚Runtime和Runloop
摘要:Runtime是底层C语言API库,支持动态创建类和对象、消息发送和转发,特点是数据类型的确定由编译时推迟到运行时而且以消息方式调用方法,如通知和中央管理。 Runloop是iOS中的事件处理机制,用于接收并处理系统或应用产生的事件(如触摸事件、定时器事件、网络请求、管理自动释放缓存池等),保持应用 阅读全文

posted @ 2024-03-07 13:50 高彰 阅读(84) 评论(0) 推荐(0) 编辑

macOS 获取系统设置外观获取系统深色模式皮肤
摘要:#import "ViewController.h" - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. //控件布局 [self layoutSubViews]; 阅读全文

posted @ 2023-08-30 11:16 高彰 阅读(67) 评论(0) 推荐(0) 编辑

iOS macOS中的三大计时器(NStimer、CADisplayLink、dispatch_source_set_timer)
摘要:一、介绍 在iOS macOS中,计时器是比较常用的,用于统计累加数据或者倒计时等,例如手机号获取验证码。计时器大概有那么三种,分别是:NSTimer、CADisplayLink、dispatch_source_set_timer 二、使用 @property (strong,nonatomic)N 阅读全文

posted @ 2023-08-24 15:46 高彰 阅读(303) 评论(0) 推荐(0) 编辑

iOS macOS 删除控件 刷新ViewController或者是ViewController中的NSView
摘要:我遇到的问题是这样的:当ViewController界面或者说是ViewController中的NSView的数据或者是样式由于某个响应事件产生变化时界面需要刷新 那么解题的思路是可以直接先删除掉原有的界面就是 [self removeFromSuperview]; //或者是 [self.sonV 阅读全文

posted @ 2023-07-13 09:33 高彰 阅读(113) 评论(0) 推荐(0) 编辑

关于ios macOS:请在您的Podfile中为此目标指定平台?
摘要:执行此Pod安装后,出现以下错误: 我的PodFile: 如何解决这个问题? 增加一个平台及最低版本即可 这是macOS的,如果是iOS就是 platform :ios, '10.0' target 'TKAPIDemo_mac' do pod 'SocketRocket' end - Pod in 阅读全文

posted @ 2023-06-15 09:47 高彰 阅读(116) 评论(0) 推荐(0) 编辑

/usr/bin/git clone xxx /var/folders/hf/gjb2157j7s99712tnhwsr
摘要:升级系统后 xcode 的 pod 发生了一些错误,重新执行 pod install 不一定在哪个库 会发生如下错误 [!] Error installing QIYU_iOS_SDK[!] /usr/bin/git clone https://github.com/qiyukf/QIYU_iOS_ 阅读全文

posted @ 2023-06-15 09:42 高彰 阅读(108) 评论(0) 推荐(0) 编辑

Xcode14.3 File not found libarclite_iphonesimulator.a and libarclite_iphoneos.a
摘要:Xcode 14.3 运行项目报错File not found libarclite_iphonesimulator.a or libarclite_iphoneos.a 问题描述 升级到 Xcode14.3 后编译报错:真机运行 ld: file not found: /Applications/ 阅读全文

posted @ 2023-05-26 11:19 高彰 阅读(1449) 评论(0) 推荐(0) 编辑

iOS MacOS 系统时间(时间戳)格式化
摘要:#pragma mark -原始数据是20220608155116,加工成2022/06/08 15:51:16 -(NSString *)timeString:(NSString *)toIndexstring{ NSMutableArray *arr = [NSMutableArray arra 阅读全文

posted @ 2022-10-31 17:45 高彰 阅读(149) 评论(0) 推荐(0) 编辑

macOS NSScrollView简单使用
摘要:先看图片 这里是NSScrollView配合其他控件使用,我们这里只讲NSScrollView。 复制以下代码即可以运行 @interface ViewControl () /** 滚动显示 */ @property (nonatomic, strong) NSScrollView *scrollV 阅读全文

posted @ 2022-10-17 15:20 高彰 阅读(829) 评论(0) 推荐(0) 编辑

macOS 为什么我的NSView委托(delegate)方法没有被调用?
摘要:现在,方法未被调用,我在做什么错? 最佳答案 如果希望NSView子类接受事件,则必须实现: - (BOOL)acceptsFirstResponder { return YES; } 阅读全文

posted @ 2022-10-11 13:49 高彰 阅读(38) 评论(0) 推荐(0) 编辑

iOS macOS代理传值
摘要:说明:代理传值一般在反向传值中使用。 本贴的例子是:有A和B两个界面,要实现的效果就是先让A跳转到B,然后B中有个颜色的参数,当B跳转到A时,把这个颜色的参数传递给A,在A中利用这个颜色改变自己界面的颜色。 第1步:在发送者(界面B)中,制定协议(在.h头文件中声明) // @protocol协议名 阅读全文

posted @ 2022-10-11 11:21 高彰 阅读(53) 评论(0) 推荐(0) 编辑

macOS开发 NSSegmentedControl
摘要:先看效果 直接复制代码运行 #import "ViewController.h" @interface ViewController () ///分段控制器 @property (nonatomic, strong) NSSegmentedControl *MenuViewSegment; @end 阅读全文

posted @ 2022-10-11 09:58 高彰 阅读(163) 评论(0) 推荐(0) 编辑

macOS UI颜色
摘要:NSButton if (@available(macOS 10.14, *)) { _btnLeadershipRisingPlate.contentTintColor = NSColorFromName(@"g-appColor"); } else { NSMutableAttributedSt 阅读全文

posted @ 2022-10-10 15:13 高彰 阅读(74) 评论(0) 推荐(0) 编辑

iOS macOS 倒计时计时动作事件
摘要:/* 计时刷新数据 **/ @property (nonatomic, weak) NSTimer *timer; /* 计时 **/ @property (nonatomic, assign) int timerCount; //////////////////////////////////// 阅读全文

posted @ 2022-10-10 10:27 高彰 阅读(47) 评论(0) 推荐(0) 编辑

iOS macOS限制输入框判断输入内容
摘要:鸣谢:HiroGuo 在开发过程中,有时需要对用户输入的类型做判断,最常见是在注册页面即用户名和密码,代码整理如下: 只能为中文 -(BOOL)onlyInputChineseCharacters:(NSString*)string{ NSString *zhString = @"[\u4e00-\ 阅读全文

posted @ 2022-08-01 15:42 高彰 阅读(85) 评论(0) 推荐(0) 编辑

iOS macOS plist的基本操作
摘要://找到本地plist文件路径 //如果返回路径为空,解决方法: 在Targets -> Build Phases -> Copy Bundle Resources里面导入资源文件,运行项目 NSString *localPlistPath = [[NSBundle mainBundle] path 阅读全文

posted @ 2022-07-20 16:54 高彰 阅读(197) 评论(0) 推荐(0) 编辑

macOS NStableView的基本操作
摘要:先睹为快。看到效果在学习,进步会更快! 点击搜索后 选中请求返回项,还可以鼠标右键显示菜单栏。 这是一个简单的搜索框 + 按钮 + 列表 + 右键菜单栏 我们来看看代码 1.#import "ViewController.h" #import <Cocoa/Cocoa.h> @interface V 阅读全文

posted @ 2022-06-07 16:32 高彰 阅读(812) 评论(0) 推荐(0) 编辑

iOS macOS 回到主线程的三种方式
摘要:简单说将代码同步到主线程执行的三种方法如下:// 1.NSThread [self performSelectorOnMainThread:@selector(updateUI) withObject:nil waitUntilDone:NO]; - (void)updateUI { // UI更新 阅读全文

posted @ 2022-06-07 11:25 高彰 阅读(593) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 10 下一页
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示