Skip to content

Instantly share code, notes, and snippets.

View jkyin's full-sized avatar
💭
I may be slow to respond.

Jack Yin jkyin

💭
I may be slow to respond.
View GitHub Profile
#!name=Skip Proxy Lists
#!desc=跳过部分应用的代理检测
[General]
skip-proxy = %APPEND% www.baidu.com,yunbusiness.ccb.com,wxh.wo.cn,gate.lagou.com,www.abchina.com.cn,gmcc.net, 10086.cn
## www.baidu.com:网上国网、多看阅读、顺丰金融、广东农信、丰云行、中国银行缤纷生活、通信行程卡app
## yunbusiness.ccb.com:建行生活
## wxh.wo.cn:沃小号
May 2 14:28:59 yinxiaoyude-iPhone-X kernel(Sandbox)[0] <Error>: Sandbox: Facebook(17321) deny(1) file-map-executable /Library/MobileSubstrate/DynamicLibraries/RHRevealLoader.dylib
May 2 14:28:59 yinxiaoyude-iPhone-X kernel(AppleMobileFileIntegrity)[0] <Notice>: AMFI: '/Library/MobileSubstrate/DynamicLibraries/RevealServer': unsuitable CT policy 0x20 for this platform/device, rejecting signature.
May 2 14:28:59 yinxiaoyude-iPhone-X kernel(AppleMobileFileIntegrity)[0] <Notice>: AMFI: '/Library/MobileSubstrate/DynamicLibraries/RevealServer': unsuitable CT policy 0x20 for this platform/device, rejecting signature.
May 2 14:28:59 yinxiaoyude-iPhone-X Facebook(RHRevealLoader.dylib)[17321] <Notice>: Failed, error: dlopen(/Library/Frameworks/RevealServer.framework/RevealServer, 2): no suitable image found. Did find:
/Library/Frameworks/RevealServer.framework/RevealServer: code signature invalid for '/Library/Frameworks/RevealServer.framework/RevealServer'
/Library/Frameworks/RevealServer.framework/RevealServ
@jkyin
jkyin / crash.swift
Last active February 28, 2018 02:26
crash code
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
private lazy var hotStockTableView: UITableView = {
let tableView = UITableView()
print("hotStockTableView ======> \(tableView) \n")
tableView.delegate = self
tableView.dataSource = self
// Here cause crash.
tableView.tableFooterView = UIView() // if comment this line, everthing is ok.
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
@jkyin
jkyin / PSPDFModernizer.c
Created June 21, 2016 07:26 — forked from steipete/PSPDFModernizer.c
Retrofitting containsString: on iOS 7
#import <Foundation/Foundation.h>
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
@interface NSString (PSPDFModernizer)
// Added in iOS 8, retrofitted for iOS 7
- (BOOL)containsString:(NSString *)aString;
@end
@jkyin
jkyin / xcode_ramdisk.sh
Created March 11, 2016 15:56 — forked from derjohng/xcode_ramdisk.sh
Create a RAM disk for using with XCode, with Umount disks method
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
@jkyin
jkyin / AFURLRequestSerialization.m
Created October 10, 2015 10:01
AFNetworking POST 大量中文字符崩溃
/**
Returns a percent-escaped string following RFC 3986 for a query string key or value.
RFC 3986 states that the following characters are "reserved" characters.
- General Delimiters: ":", "#", "[", "]", "@", "?", "/"
- Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="
In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow
query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/"
should be percent-escaped in the query string.
- parameter string: The string to be percent-escaped.
@jkyin
jkyin / archive_ipa.sh
Last active August 27, 2015 03:30 — forked from fabb/archive_ipa.sh
Script to archive an ipa from commandline - depends on xctool
#!/bin/bash
set -x
cd ${0%/*}/..
# codesigning and choosing of provisioning profile is configured via project settings and is dependent of build config
: ${BUILD_NUMBER:?"Need to set BUILD_NUMBER"}
WORKSPACE=<yourworkspace>.xcworkspace

SecItemCopyMatching

返回一个或多个匹配查询搜索的 keychain 项目,或者拷贝指定 keychain 项目的属性。

声明:OSStatus SecItemCopyMatching ( CFDictionaryRef query, CFTypeRef *result );

此函数有两个参数:

从 Xcode 6 开始,Apple 开始在标准架构中弃用 armv7s 架构,具体差异请看下图。

Xcode 5.1.1:

Xcode 6.1:

armv7s 架构指的是用于 iPhone 5 和 5C 等这些设备上的 A6 处理器。

原文地址

上一篇教程里,你学到了如何创建一个可复用的按钮控件。然而,对于开发者如何简单方便地来复用的话效果还不是非常明显。

一种共享它的方式就是直接提供源码文件。然而,这不是特别优雅。有可能你不想共享代码的实现细节。此外,开发者可能不想看见所有的东西,因为它们只是想继承一部分代码到自己的代码库里。

另一种方式是把你的代码编译成静态库来让开发者添加到他们的项目中去。然而这要求你来提供公共头文件,这样显得非常的笨拙。

你需要有一种简洁的方式来编译你的代码,并且它还要方便的共享和在多个项目间复用。你需要用什么方式来打包静态库并且它的头文件在一个文件里,然后只需要把这个文件添加到工程里就能立即开始使用。