
Objective-C
文章平均质量分 67
Victor张
这个作者很懒,什么都没留下…
展开
-
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 · 2576 阅读 · 1 评论 -
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 · 574 阅读 · 0 评论 -
形如:%2$@, %1$@, %2$d, %1$d 的占位符
%1$@%2$@%1$d%2$d一段OC代码, 其他语言也类似NSString *total = @"10";NSString *sub = @"3";NSString *enStr = @"%@ of %@";NSString *chStr = @"%2$@ 个中的 %1$@ 个"; NSString *egLishString = [NSString str...原创 2020-03-05 09:59:33 · 1943 阅读 · 0 评论 -
Objective-C 数组
文章目录1. 二维数组声明1. 二维数组声明 People *p00 = [[People alloc]initWithName:@"00"]; People *p01 = [[People alloc]initWithName:@"01"]; People *p02 = [[People alloc]initWithName:@"02"]; ...原创 2019-06-28 14:32:10 · 587 阅读 · 0 评论 -
swift / Objective-C - 单例
创建一个完整的单例:#import "SearchDelegate.h"@interface SearchDelegate() <NSCopying,NSMutableCopying>@endstatic SearchDelegate *sharedSearchDelegate = nil;@implementation SearchDelegate+ (inst...原创 2019-07-29 17:29:41 · 401 阅读 · 0 评论 -
OC / Swift / Xcode - 怎么私有化init 方法(禁止调用init方法生成对象)
Is it possible to make the -init method private in Objective-C?NS_UNAVAILABLE - (instancetype)init NS_UNAVAILABLE;This is a the short version of the unavailable attribute. It first appeared in ...转载 2019-10-09 17:23:42 · 2762 阅读 · 0 评论