V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  alaysh  ›  全部回复第 3 页 / 共 4 页
回复总数  66
1  2  3  4  
2023 年 5 月 19 日
回复了 eightsheep 创建的主题 OpenWrt 群晖 916+ 虚拟机 openwrt 千兆跑不满
玄学,我也遇到同样的问题
2023 年 3 月 30 日
回复了 hhhhhh123 创建的主题 程序员 aws 服务器 git 如何拉去本地内网的 git ?
g clone ssh://[email protected]:test.git 这样?
2023 年 3 月 30 日
回复了 hhhhhh123 创建的主题 程序员 aws 服务器 git 如何拉去本地内网的 git ?
服务器内网的 git ?
2020 年 11 月 27 日
回复了 Jooooooooo 创建的主题 问与答 有办法能拿到 Mac 自带 preview 打开的 pdf 的进度吗?
~/Library//Containers/com.apple.Preview/Data/Library/Preferences/com.apple.Preview.ViewState.plist
找到文件对应 Key 的 Data,用 plist 格式解开,elementIndex 就是所需的值。

#import <Foundation/Foundation.h>
#include <sys/stat.h>

NSString *persistentIdForFileURL(NSURL *url) {
NSString *persistentId;

id value;
NSError *error;
BOOL res = [url getResourceValue:&value forKey:NSURLVolumeUUIDStringKey error:&error];
if (res) {
struct stat statBuf;
int res = stat(url.fileSystemRepresentation, &statBuf);
if (res == 0) {
persistentId = [NSString stringWithFormat:@"%@.%llu", value, statBuf.st_ino];
}
else {
NSLog(@"stat error: %d", res);
}
}
else {
NSLog(@"getResourceValue error:%@", error);
}
return persistentId;
}

int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"file:///tmp/1.pdf"];
NSString *persistentId = persistentIdForFileURL(url);

NSString *path = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, true)[0];
path = [path stringByAppendingString:@"/Containers/com.apple.Preview/Data/Library/Preferences/com.apple.Preview.ViewState.plist"];
NSData *data = [NSData dataWithContentsOfFile:path];

NSError *error;
NSDictionary *propertyList = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListMutableContainers format:0 error:&error];
propertyList = propertyList[persistentId];
if (propertyList) {
data = propertyList[@"Data"];
propertyList = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListMutableContainers format:0 error:&error];
if (propertyList) {
NSLog(@"propertyList: %@", propertyList);
}
else {
NSLog(@"propertyListWithData error:%@", error);
}
}
else {
if (error) {
NSLog(@"propertyListWithData error:%@", error);
}
NSLog(@"propertyList for %@ is null", url);
}
}
return 0;
}
2020 年 9 月 2 日
回复了 iksapor 创建的主题 Apple iPhone 太旧,如何更新特定版本的 app?
iPhone 5s 以下型号最高只能 7.0.2 版本了
是这样的,当时刚出,我也发现了有爱奇艺的流量,马上卸载了
2019 年 7 月 10 日
回复了 howtodie 创建的主题 问与答 暑假想去一个城市住到开学,不想回家
首先要保证自身安全
@jzphx apple 店好像只会换对应版本的硬件,我的是港版,他说要等港版配件到才能换
我不是针对谁,我是说在座的各位都是灰友
@Livid 真理,我已经用坏了 3 块 tf 卡,一块 u 盘了
2019 年 7 月 5 日
回复了 TaurusXin 创建的主题 macOS “微信”中断了关机
微信:关什么机?继续工作!
1  2  3  4  
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   2834 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 32ms · UTC 14:21 · PVG 22:21 · LAX 06:21 · JFK 09:21
♥ Do have faith in what you're doing.