自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(88)
  • 资源 (2)
  • 收藏
  • 关注

转载 [iOS Animation]-CALayer 绘图效率

着眼于有关_绘制_的性能问题。术语_绘图_通常在 Core Animation 的上下文中指代软件绘图(意即:不由 GPU 协助的绘图)。在 iOS 中,软件绘图通常是由 Core Graphics 框架完成来完成。但是,在一些必要的情况下,相比 Core Animation 和 OpenGL,Core Graphic

2023-03-07 14:25:38 205

转载 [iOS Animation]-CALayer 性能优化

一些动画运行慢的原因,以及如何去修复这些问题。关于绘图和动画有两种处理的方式:CPU(中央处理器)和 GPU(图形处理器)。在现代 iOS 设备中,都有可以运行不同软件

2023-03-07 14:13:42 207

原创 Sandbox - 访问带有副文件的主文件 Access sidecar files in a Mac sandboxed app

Access sidecar files in a Mac sandboxed app

2023-02-23 18:11:49 343

翻译 macOS Sandboxed app 多个程序共享 存入 Group preference的bookmark失败

Share security scoped bookmark in app group

2023-02-15 11:51:19 187

转载 只有20%的iOS程序员能看懂:详解intrinsicContentSize 及 约束优先级/content Hugging/content Compression Resistance

end@end//测试关闭Intrinsic的影响 @implementation IntrinsicView -(instancetype) init {//不兼容旧版Autoreizingmask,只使用AutoLayout //如果为YES,在AutoLayout中则会自动将view的frame和bounds属性转换为约束。} //当用户设置extendSize时,提示系统IntrinsicContentSize变化了。

2022-11-18 15:52:41 441

转载 Module与Swift库

Framework Module与Swift库

2022-10-11 10:03:56 717

原创 MacOS平台下@rpath在动态链接库中的应用

@rpath. framework 配置

2022-09-20 09:52:35 680

转载 Core Data 多线程设计

CoreData 多线程记录

2022-08-05 11:58:13 176

原创 CoreData - 查询

CoreData 学习

2022-06-22 16:52:57 321

转载 (转载)Multi-Context CoreData 之多线程环境中使用CoreData

CoreData 多线程使用

2022-06-13 09:50:16 218

原创 Build Metal-based Core Image kernels with Xcode

Apple 文档:Building a Library with Metal’s Command-Line ToolsMetal Shading Language for Core Image Kernels1. 在 Build Rules 结合 xcrun 编译生成Core Image 用的 kernel 文件*.metal: .metal 格式文件*.ci.metal: 是自定义的文件后缀格式.1.工程引入两个文件:ColorLUT_1.ci.metal 和 ColorLUT_1.ci.me

2022-03-08 16:14:02 723

原创 Xcode 相关问题

Build Settings1. Xcode 版本升级后找不到网上提到的相关配置了在学习 Metal Shading Language for Core Image Kernels时,在 Building Settings | Metal Compiler 中设置-fcikernel, 但是最新xcode 创建的项目中没有 Metal Compiler 生成选项。这时 可以选中工程文件,设置 Project Format选项:针对我的问题,更好的解决方法:Apple 课程Build Metal-

2022-03-08 16:05:17 2462

原创 开发常用命令记录(更新 ...)

查看指令集架构(是否支持arm64):lipo -info filePahte.g.:victor@Victors-Mac-mini ~ % lipo -info ~/libopencv_calib3d.4.5.4.dylibNon-fat file: ~/libopencv_calib3d.4.5.4.dylib is architecture: x86_64victor@Victors-Mac-mini ~ % lipo -info ~ /libomp.dylibArchitecture.

2021-12-07 11:41:35 1224

原创 How do you create a Shell Script target in Xcode?

Select your project in the navigatorClick “Add Target” - Choose “Other | Aggregate” for an empty TargetClick “+” - New Run Script Phase

2021-11-19 11:28:00 205

原创 Getting info about parent process that launched us

https://developer.apple.com/forums/thread/115369Q:I’m currently using “ProcessInformationCopyDictionary” to fetch @“ParentPSN”, and then “ProcessInformationCopyDictionary” again to fetch the parent’s bundle id and what-not. This is deprecated. What can.

2021-09-29 18:09:31 163

转载 unsigned long与unsigned long long 在windows和linux中位数的区别

转载: https://www.cnblogs.com/wizardface/archive/2012/02/02/2335843.html最近要写一些hvm虚拟机windows调用xen中hypercall的代码,发现一个问题就是unsigned long在windows中和linux中代表的位数不同,因此想调查一下。使用测试程序:#include <stdio.h>int main(){ printf("unsigned long long: %d\n", si.

2021-06-29 10:49:48 2114 1

转载 macos: Clearing the quarantine extended attribute from downloaded applications

Apple doc: 在 Mac 上安全地打开 AppWhen I’m packaging an application for deployment, I normally download the latest version from the vendor. If it’s a drag-and-drop install, where the application is a self-contained bundle, it will get the com.apple.quarantine .

2021-06-11 09:57:47 141

原创 macos / xcode 快捷的将选中的文本注释掉(/* ... */)

参考: stackoverflow使用Automator 创建service打开Automator, 选择 Quick Action勾选 Output replaces selected text在左侧Library搜索 AppleScript, 双击Run AppleScript代码如下:on run {input, parameters} repeat with anInput in input if "/*" is in anInput then set input t.

2021-06-08 18:16:56 270

原创 swift 类型继承协议后,方法调用规则测试

测试代码:protocol TheProtocol { func method1() func method3()}extension TheProtocol { func method1() { print("Called method1 from TheProtocol") } func method2() { print("Called method2 from TheProtocol") } f

2021-05-25 10:54:16 134

原创 macos 自定义main函数,CustomApplication、CustomAppDelegate

原文: http://www.voidcn.com/article/p-pjjwbveg-bvw.html在XCode中创建一个新的 Cocoa项目给我一个AppDelegate.swift文件,如下所示:import Cocoa@NSApplicationMainclass AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var window: NSWindow!}The @NSApplicationMa.

2021-05-12 14:54:09 435

原创 iOS/macOS - Customize the NSApplication/UIApplication

– OC项目中自定义 application 类macOSStep 1: 创建自己的类:CustomApplicationStep 2: 更改info.plist 文件中 Principal class 配置的类名为 CustomApplication :iOSStep 1: 创建自己的类:CustomApplicationStep 2: main 方法中传入自定义类的名称:– swift 项目中自定义 application 类macOSStep 1: 创建自己的类:ACD

2021-05-12 14:24:02 270

转载 Cocoa开发之APP开机自启动

原文: http://www.skyfox.org/cocoa-sandbox-app-launch-at-login.htmlmacOS app 开机自启动虽然有很多种方法,但是在需要上架APPStore的情况下,访问沙盒外的文件会被拒绝.苹果官方提供了两种方式: Service Management framework 和 shared file listThere are two ways to add a login item: using the Service Management .

2021-05-12 11:11:47 446

原创 Xcode使用xcconfig文件配置环境

参考:Apple Doc: Add a build configuration (xcconfig) fileApple Doc: Configuration Settings File (xcconfig) formathttp://liumh.com/2016/05/22/use-xcconfig-config-specific-variable/#xcode-targetBuild Setting 的继承关系 (转载)

2021-05-11 15:58:50 154

转载 The Unofficial Guide to xcconfig files(copy 为防止原文丢失)

General InformationOne of the least documented aspects of the configuration process are xcconfig files. As of this writing there seem to be no documents provided by Apple that explain how to use xcconfigs or why they exist. A xcconfig file is used as a su

2021-04-30 14:09:43 165

转载 通过ServiceManagement注册LaunchdDaemon

在OSX开发与系统密切相关的软件,经常会使用到高权限的操作,让整个程序都以高权限执行显然是不合适的,通过将高权限的任务封装到独立的子程序,按需要进行调用是比较合理的做法。而常见的做法是通过注册LaunchdDaemon,便可轻松实现开机启动、长驻后台、高权限的需求。注册LaunchdDaemon的常用方法是通过launchd工具去load一个与Daemon程序相关的标准的plist文件,这个过程一般放在PKG的安装脚本中完成,但当前越来越多的软件摒弃了PKG的打包方式,而是直接选择了打包成app,这样确实

2021-04-06 09:23:40 254

转载 在 macOS 中如何使用 XPC 实现跨进程通讯?

以防丢失,转载自: http://davidleee.com/2020/07/20/ipc-for-macOS/如侵权,联系删除最近需要在 Electron 项目上引入一个比较吃性能的大头功能,因为已经用 Objective-C 实现过一套稳定且性能也可接受的带 UI 方案了,所以计划看看能不能将这套现成的方案直接用到 Electron 里。但想要这么做就必须解决原生 UI 与 Electron 通讯的问题,再进一步,能不能让 Electron 以多进程的方式调起这个大头功能的 Demo 以节省掉绝.

2021-04-02 11:30:34 2449

原创 获取系统空闲时间(空闲了多久)

// 鼠标,键盘事件重置// 不包括视频播放public func SystemIdleTime() -> Double? { var iterator: io_iterator_t = 0 defer { IOObjectRelease(iterator) } guard IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceMatching("IOHIDSystem"), &iterator) =

2021-03-30 16:00:28 438

原创 Close other apps in sandbox mode

参考: https://developer.apple.com/forums/thread/122020当启用 sandbox 时, 无法直接 kill 掉别的进程,需要在 .entitlements 文件中配置信息。测试@IBAction func killAction(_ sender: Any) { let runingApps = NSRunningApplication.runningApplications(withBundleIdentifier:.

2021-03-11 10:39:15 165

转载 使用Gitee+Hexo搭建个人博客

记录自:咻咻ing:使用Gitee+Hexo搭建个人博客如侵权请联系删除为何使用Gitee而不是GitHub目前国内访问GitHub速度慢,还可能被墙,所以Gitee来构建个人博客。Gitee类似国内版的GitHub,访问速度有保证。环境要求GitNodeJs默认你已经安装了Git 和 NodeJS (推荐使用cnpm)传送门:(Git安装教程) (Nodejs安装教程) (cnpm使用教程)开始搭建安装Hexo打开 shell 终端,输入命令npm install -g h.

2021-02-26 11:06:38 293

原创 macOS - Cocoa开发之沙盒机制及访问Sandbox之外的文件

原文地址:http://www.skyfox.org/cocoa-macos-sandbox.htmliOS默认并且只能读写对应的沙盒目录。OSX自从10.6系统开始引入沙盒机制,规定发布到Mac AppStore的应用,必须遵守沙盒约定。沙盒对应用访问的系统资源,硬件外设,文件,网络,XPC,都做了严格的限制,这样能防止恶意的App通过系统漏洞,攻击系统,获取控制权限,保证了OSX系统的安全。沙盒相当于给每个App一个独立的空间。要获取自己空间之外的资源必须获得授权。macOS APP不需要上.

2021-02-26 10:30:28 2108

原创 macOS 文件ID

let url = URL.init(fileURLWithPath: "/Users/victor/Pictures/redeyes")var fileID: String? = nillet values = try url.resourceValues(forKeys: .init(arrayLiteral: .fileResourceIdentifierKey))print(values.fileResourceIdentifier)即使改变了 “/Users/victor/Pictur

2021-02-25 10:25:43 117

原创 Xcode 环境变量

官方文档:Xcode Build System GuideBuild Settings referenceVariableExampleVariableExamplePATH“/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin”LANGen_US.US-ASCIIIPHONEOS_DEPLOYME.

2021-01-19 17:26:10 582

原创 Xcode 动态库的设置

最近项目开发新的功能,要在主应用中嵌入一个子程序:(本文暂不涉及如何嵌入子程序)主程序和子程序引用同一个framework,出现了重复,这会导致程序比较大。为了解决此问题,学习了解了下xcode动态库设置1. 首先我在子程序中移除嵌入的framework2. 因为公用framework,所以我觉得将该framework嵌入大SharedFrameworks路径下比较合适注: 路径是可以自定义的,我在该Demo中将其放在~/***MainApp.app/Contents/SharedFram

2021-01-11 17:26:39 1639

原创 macOS: 使用 UserDefaults 进行进程间通信

代码:阶段1Step 1: 首先创建两个工程一个主工程**MainPrj: 发送消息一个Hub工程: 接受消息Step 2: 为两个添加相同的group id

2020-12-30 12:30:50 438

原创 VMware Fusion Player 个人免费版

首先注册VMware Fusion Player 账号 并激活。https://my.vmware.com/web/vmware/evalcenter?p=fusion-player-personal#tab_register2. 下载软件,https://my.vmware.com/group/vmware/downloads/info/slug/desktop_end_user_computing/vmware_fusion/12_0获取软件安装需要的licensehttps://m.

2020-12-10 17:01:30 14175 4

原创 java中静态方法中为什么不能使用this、super和直接调用非静态方法

这个要从java的内存机制去分析,首先当你New 一个对象的时候,并不是先在堆中为对象开辟内存空间,而是先将类中的静态方法(带有static修饰的静态函数)的代码加载到一个叫做方法区的地方,然后再在堆内存中创建对象。所以说静态方法会随着类的加载而被加载。当你new一个对象时,该对象存在堆对内存中,this关键字一般指该对象,但是如果没有new对象,而是通过类名调用该类的静态方法也可以。程序最终都是在内存中执行,变量只有在内存中占有一席之地时才会被访问,类的静态成员(静态变量和静态方法)属于类本身,在类加载的

2020-11-20 16:13:22 5842 3

原创 Xcode 条件断点笔记

1. 判断Selector(NSString*)NSStringFromSelector(selector) == @“zoomIn:”

2020-08-27 18:03:43 1087

原创 KVC 方法: keyPathsForValuesAffectingValueForKey: 在 CIFilter中的应用

关于CIFilter 的 KVC 方法:keyPathsForValuesAffectingValueForKey:/// KVC, 返回能触发对应输入参数 key 的 其他key的集合。 override class func keyPathsForValuesAffectingValue(forKey key: String) -> Set<String> { // 根据测试发现 super.keyPathsForValuesAffectingValue 会

2020-08-07 10:15:51 664

原创 Swift - 学用 数组 Array

文章目录遍历数组方法效率比较遍历数组方法效率比较//var hhArr = Set<Int>.init()////for i in 0..<1000000 {// hhArr.insert(i)//}var hhArr: Array<Int> = [Int].init(repeating: 12, count: 1000000)//forin 遍历var stratTime = CACurrentMediaTime()for num in hhAr

2020-06-19 10:26:44 242

原创 macOS: 凸显约束冲突

#if DEBUGUserDefaults.standard.set(true, forKey: "NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints")#elseUserDefaults.standard.set(false, forKey: "NSConstraintBasedLayoutVisualizeMutual...

2020-06-19 10:11:30 367 1

Block Comment.workflow.zip

macos / xcode 快捷的将选中的文本注释掉(/* ... */)

2021-09-09

Metal中译文.zip

Metal指南中英文,Metal渲染语言中英文: MetalShadingLanguageGuide.pdf; metalGuide翻译.pdf; Metal-Shading-Language-Specification.pdf; Metal_Shading_Language_Guide翻译.pdf

2019-12-13

空空如也

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

TA关注的人

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