腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
返回腾讯云官网
ShaoYL
专栏作者
举报
123
文章
146864
阅读量
39
订阅数
订阅专栏
申请加入专栏
全部文章
ios
其他
c 语言
objective-c
编程算法
xcode
存储
开源
打包
数据库
api
数据结构
sql
git
sass
缓存
ssh
微信
安全
区块链
iphone
swift
lua
react
android
汇编语言
sqlite
github
svn
访问管理
人工智能
游戏
自动化
正则表达式
gui
ui
uitableview
uitextfield
view
web
搜索文章
搜索
搜索
关闭
ETH 合约常用方法
contract Test { event NFTReceived(address operator, address from, uint256 tokenId, bytes data); function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) public returns (bytes4) { //only receive the
用户1941540
2021-07-13
1K
0
iOS Block的本质(四)
ios
typedef void (^Block)(void); struct __block_impl { void *isa; int Flags; int Reserved; void *FuncPtr; }; struct __main_block_desc_0 { size_t reserved; size_t Block_size; void (*copy)(void); void (*dispose)(void); }; struct __Block_byref_age_0 { void *__isa; struct __Block_byref_age_0 *__forwarding; int __flags; int __size; int age; }; struct __main_block_impl_0 { struct __block_impl impl; struct __main_block_desc_0* Desc; struct __Block_byref_age_0 *age; // by ref }; int main(int argc, const char * argv[]) { @autoreleasepool { __block int age = 10; Block block = ^{ age = 20; NSLog(@"age is %d",age); }; block(); struct __main_block_impl_0 *blockImpl = (__bridge struct __main_block_impl_0 *)block; NSLog(@"%p",&age); } return 0; }
用户1941540
2019-02-15
652
0
# iOS Block的本质(三)
编程算法
struct __main_block_impl_0 { struct __block_impl impl; struct __main_block_desc_0* Desc; Person *__weak person; __main_block_impl_0(void *fp, struct __main_block_desc_0 *desc, Person *__weak _person, int flags=0) : person(_weakPerson) { impl.isa = &_NSConcreteStackBlock; impl.Flags = flags; impl.FuncPtr = fp; Desc = desc; } };
用户1941540
2019-02-15
456
0
iOS Block的本质(一)
编程算法
存储
iOS Block的本质(一) 1.对block有一个基本的认识 block本质上也是一个oc对象,他内部也有一个isa指针。block是封装了函数调用以及函数调用环境的OC对象。 2.探寻block的本质 首先写一个简单的block int main(int argc, const char * argv[]) { @autoreleasepool { int age = 10; void (^block)(int, int) = ^(int a , int b)
用户1941540
2019-02-15
693
0
iOS Category 添加属性实现原理 - 关联对象
ios
typedef OBJC_ENUM(uintptr_t, objc_AssociationPolicy) { OBJC_ASSOCIATION_ASSIGN = 0, // 指定一个弱引用相关联的对象 OBJC_ASSOCIATION_RETAIN_NONATOMIC = 1, // 指定相关对象的强引用,非原子性 OBJC_ASSOCIATION_COPY_NONATOMIC = 3, // 指定相关的对象被复制,非原子性 OBJC_ASSOCIATION_RETAIN = 01401, // 指定相关对象的强引用,原子性 OBJC_ASSOCIATION_COPY = 01403 // 指定相关的对象被复制,原子性 };
用户1941540
2019-02-15
3K
0
iOS Category实现原理 (补充)
ios
void call_load_methods(void) { static bool loading = NO; bool more_categories; loadMethodLock.assertLocked(); // Re-entrant calls do nothing; the outermost call will finish the job. if (loading) return; loading = YES; void *pool = objc_autoreleasePoolPush(); do { // 1. Repeatedly call class +loads until there aren't any more // 1.调用类的 load 方法 while (loadable_classes_used > 0) { call_class_loads(); } // 2. Call category +loads ONCE // 2.调用分类的 load 方法 more_categories = call_category_loads(); // 3. Run more +loads if there are classes OR more untried categories } while (loadable_classes_used > 0 || more_categories); objc_autoreleasePoolPop(pool); loading = NO; }
用户1941540
2019-02-15
764
0
iOS Category实现原理
编程算法
// Attach method lists and properties and protocols from categories to a class. // Assumes the categories in cats are all loaded and sorted by load order, // oldest categories first. static void attachCategories(Class cls, category_list *cats, bool flush_caches) { if (!cats) return; if (PrintReplacedMethods) printReplacements(cls, cats); bool isMeta = cls->isMetaClass(); // fixme rearrange to remove these intermediate allocations method_list_t **mlists = (method_list_t **) malloc(cats->count * sizeof(*mlists)); property_list_t **proplists = (property_list_t **) malloc(cats->count * sizeof(*proplists)); protocol_list_t **protolists = (protocol_list_t **) malloc(cats->count * sizeof(*protolists)); // Count backwards through cats to get newest categories first int mcount = 0; int propcount = 0; int protocount = 0; int i = cats->count; bool fromBundle = NO; while (i--) { auto& entry = cats->list[i]; method_list_t *mlist = entry.cat->methodsForMeta(isMeta); if (mlist) { mlists[mcount++] = mlist; fromBundle |= entry.hi->isBundle(); } property_list_t *proplist = entry.cat->propertiesForMeta(isMeta, entry.hi); if (proplist) { proplists[propcount++] = proplist; } protocol_list_t *protolist = entry.cat->protocols; if (protolist) { protolists[protocount++] = protolist; } } auto rw = cls->data(); prepareMethodLists(cls, mlists, mcount, NO, fromBundle); rw->methods.attachLists(mlists, mcount); free(mlists); if (flush_caches && mcount > 0) flushCaches(cls); rw->properties.attachLists(proplists, propcount); free(proplists); rw->protocols.attachLists(protolists, protocount); free(protolists); }
用户1941540
2019-02-15
1.2K
0
KVC/KVO 本质
编程算法
2. 若没有找到Set方法,会调用对象的类方法+ (BOOL)accessInstanceVariablesDirectly;此方法返回YES时(默认返回YES),会按照_key,_iskey,key,iskey的顺序搜索成员,然后赋值。
用户1941540
2019-02-15
550
0
安卓创建第一个工具类
android
安卓创建工具类 1.运用IOC框架简化代码 注解 (Annotation):@Class 给代码看的处理代码逻辑 2. 创建自己的注解 @Target() ElementType.FIELD 放在
用户1941540
2019-01-03
631
0
EOS Dapp体验报告
其他
EOS Dapp体验报告 EOS通过并行链和DPOS的方式解决了延迟和数据吞吐量的难题。 EOS能够实现每秒百万级的处理量,而目前比特币是每秒7笔,以太坊是30-40笔,EOS的这一超强能力吊打比特币和以太。EOS能解决带宽吞吐量的问题。 EOS的出现目的是解决现有的区块链应用性能低、安全性差。 EOS不容易因为网络堵塞受到DoS攻击。EOS代币的所有权,使用户在网络带宽,存储和计算能力方面占有比例。因此,网络垃圾制造者只能消耗其EOS代币赋予其网络的比例。 CPU 耗EOS 抵押。质押少会经常CPU 不足
用户1941540
2018-12-21
503
0
区块链:定义未来金融与经济新格局
区块链
区块链:定义未来金融与经济新格局 1 区块链是什么 区块链的本质 区块链的本质是一种去中心化的记账系统,区块链与比特币之间的关系就是凯恩斯所说的记账货币与货币之间的关系,区块链是一套由信用记录以及信用记录的清算构成的体系。 共识机制与价值载体 共识机制是区块链技术的核心,它使得区块链这样一个去中心化的账本系统成为可能;而价值载体是区块链技术的潜力所在,它使得区块链技术的应用领域远不止数字货币。这两个核心因素是区块链内生能力得以扩展的关键。 价值载体共识机制的建立使得区块链这样一个去中心化的记账系统成为可
用户1941540
2018-12-21
903
0
ETH Dapp 体验报告
其他
Dapp 体验报告 Dapp是分散式的应用程序。DApp运行在去中心化的网络上,也就是区块链网络中。网络中不存在中心化的节点可以完整的控制DApp。 必须依赖合约部署,没有一个中心化的服务器托管。 对比现代web应用程序依赖的基础设施,其中存在单点故障的问题。这些单点故障包括服务器基础设施、代码库、数据库等。随着高可用性和可靠的基础设施服务商(GCP和AWS等)出现,减轻单点故障方面取得进展,但强如亚马逊,也会出现2018年初的停运,很难避免停机。 Dapp通过在多个对等节点网络上存储数据或基础架构的关键组
用户1941540
2018-12-21
914
0
自欺欺人的使用 NSTimer 销毁
ios
自欺欺人的使用 NSTimer 销毁 Demo地址 1.NSTimer是要加到runloop中才会起作用。 常见的创建timer方式 // 第一种方式 @property (nonatomic , strong) NSTimer *timer; // 默认加入当前runloop的NSDefaultRunLoopMode self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerA
用户1941540
2018-06-21
457
0
iOS逆向实战与工具使用(微信添加好友自动确认)
ios
微信
sass
ssh
iOS逆向实战与工具使用(微信添加好友自动确认) 原文链接 源码地址 WeChatPlugin-iOS Mac OS 版微信小助手(远程控制、消息防撤回、自动回复、微信多开) 一、前言 本篇主要实现在微信上自动添加好友,从而熟悉 iOS 逆向分析的过程。 ---- 二、 工具 2.1 MacBook 软件 theos 制作 Tweak 的工具 hopper disassembler 用于静态分析 usbmuxd 端口转发,可以让我们通过usb连接手机进行ssh、lldb调试等。主要使用python-
用户1941540
2018-06-21
1.9K
0
iOS 获取真机上系统动态库文件
ios
缓存
iOS 获取真机上所有系统库文件 系统动态库文件存放真机地址(/System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64) 在Mac\i
用户1941540
2018-06-21
1.5K
0
iOS开发-Runtime详解
ios
api
汇编语言
开源
iOS开发-Runtime详解 简介 Runtime 又叫运行时,是一套底层的 C 语言 API,其为 iOS 内部的核心之一,我们平时编写的 OC 代码,底层都是基于它来实现的。比如: [receiver message]; // 底层运行时会被编译器转化为: objc_msgSend(receiver, selector) // 如果其还有参数比如: [receiver message:(id)arg...]; // 底层运行时会被编译器转化为: objc_msgSend(receiver, selec
用户1941540
2018-06-21
683
0
iOS 安全
ios
安全
开源
iOS 安全 众所周知的是大部分iOS代码一般不会做加密加固,因为iOS APP一般是通过AppStore发布的,而且苹果的系统难以攻破,所以在iOS里做代码加固一般是一件出力不讨好的事情。万事皆有例外,不管iOS、adr还是js,加密的目的是为了代码的安全性,虽然现在开源畅行,但是不管个人开发者还是大厂皆有保护代码安全的需求,所以iOS代码加固有了生存的土壤。下面简单介绍下iOS代码加密的几种方式。 iOS代码加密的几种方式 1.字符串加密 字符串会暴露APP的很多关键信息,攻击者可以根据从界面获取的字符
用户1941540
2018-06-21
810
0
XCode调试器LLDB
xcode
与调试器共舞 - LLDB 的华尔兹 你是否曾经苦恼于理解你的代码,而去尝试打印一个变量的值? NSLog(@"%@", whatIsInsideThisThing); 或者跳过一个函数调用来简化程序的行为? NSNumber *n = @7; // 实际应该调用这个函数:Foo(); 或者短路一个逻辑检查? if (1 || theBooleanAtStake) { ... } 或者伪造一个函数实现? int calculateTheTrickyValue { return 9; /* 先
用户1941540
2018-06-21
1.3K
0
XCode的debug断点调试
xcode
自动化
debug 流程控制 当你通过 Xcode 的源码编辑器的侧边槽 (或者通过下面的方法) 插入一个断点,程序到达断点时会就会停止运行。 调试条上会出现四个你可以用来控制程序的执行流程的按钮。 从左
用户1941540
2018-06-21
5.1K
0
1.了解Objective-C语言
objective-c
了解Objective-C语言 ** Objective-C 语言是“消息结构”(messaging structure) 类似C++ 、Java 是“函数调用”(function calling)** // messaging structure (Objective-C) Object *obj = [Object new]; [obj performWith:parameter1 and:parameter2]; // function calling (C++) Object *obj = new
用户1941540
2018-06-21
596
0
点击加载更多
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
立即发文
Python精品学习库
代码在线跑,知识轻松学
立即查看
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
立即体验
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
立即查看
领券
问题归档
专栏文章
快讯文章归档
关键词归档
开发者手册归档
开发者手册 Section 归档