JSPatch解析
defineClass('JPViewController', {
handleBtn: function(sender) {
var tableViewCtrl = JPTableViewController.alloc().init()
self.navigationController().pushViewController_animated(tableViewCtrl, YES)
}
}) defineClass('JPTableViewController : UITableViewController <UIAlertViewDelegate>', ['data'], {
dataSource: function() {
var data = self.data();
if (data) return data;
var data = [];
for (var i = ; i < ; i ++) {
data.push("cell from js " + i);
}
self.setData(data)
return data;
},
numberOfSectionsInTableView: function(tableView) {
return ;
},
tableView_numberOfRowsInSection: function(tableView, section) {
return self.dataSource().length;
},
tableView_cellForRowAtIndexPath: function(tableView, indexPath) {
var cell = tableView.dequeueReusableCellWithIdentifier("cell")
if (!cell) {
cell = require('UITableViewCell').alloc().initWithStyle_reuseIdentifier(, "cell")
}
cell.textLabel().setText(self.dataSource()[indexPath.row()])
return cell
},
tableView_heightForRowAtIndexPath: function(tableView, indexPath) {
return
},
tableView_didSelectRowAtIndexPath: function(tableView, indexPath) {
var alertView = require('UIAlertView').alloc().initWithTitle_message_delegate_cancelButtonTitle_otherButtonTitles("Alert",self.dataSource()[indexPath.row()], self, "OK", null);
alertView.show()
},
alertView_willDismissWithButtonIndex: function(alertView, idx) {
console.log('click btn ' + alertView.buttonTitleAtIndex(idx).toJS())
}
});(function(){try{\ndefineClass('JPViewController', {\n handleBtn: function(sender) {\n var tableViewCtrl = JPTableViewController.__c(\"alloc\")().__c(\"init\")()\n self.__c(\"navigationController\")().__c(\"pushViewController_animated\")(tableViewCtrl, YES)\n }\n})\n\ndefineClass('JPTableViewController : UITableViewController <UIAlertViewDelegate>', ['data'], {\n dataSource: function() {\n var data = self.__c(\"data\")();\n if (data) return data;\n var data = [];\n for (var i = 0; i < 20; i ++) {\n data.__c(\"push\")(\"cell from js \" + i);\n }\n self.__c(\"setData\")(data)\n return data;\n },\n numberOfSectionsInTableView: function(tableView) {\n return 1;\n },\n tableView_numberOfRowsInSection: function(tableView, section) {\n return self.__c(\"dataSource\")().length;\n },\n tableView_cellForRowAtIndexPath: function(tableView, indexPath) {\n var cell = tableView.__c(\"dequeueReusableCellWithIdentifier\")(\"cell\") \n if (!cell) {\n cell = require('UITableViewCell').__c(\"alloc\")().__c(\"initWithStyle"
JSPatch解析的更多相关文章
- jspatch功能解析
一.三个模型: 1.补丁:运行时结构维护模型: 2.通信模型 3.解释模型:运行时 二.js.oc分层解释调用 js模块与oc模块的关系 1.oc调用js的配置信息完成配置: 2.oc运行时重定位到j ...
- 【腾讯Bugly干货分享】JSPatch 成长之路
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/579efa7083355a9a57a1ac5b Dev Club 是一个交流移动 ...
- IOS热更新-JSPatch实现原理+Patch现场恢复
关于HotfixPatch 在IOS开发领域,由于Apple严格的审核标准和低效率,IOS应用的发版速度极慢,稍微大型的app发版基本上都在一个月以上,所以代码热更新(HotfixPatch)对于IO ...
- JSPatch 实现原理详解
原文地址https://github.com/bang590/JSPatch/wiki/JSPatch-%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86%E8%AF%A6%E8 ...
- JSPatch一些容易犯错的地方
JSPatch一些自己使用后的发现: 1.JS不区分整数和浮点数.解析字典以后的value不需要通过 floatValue等方法转换,而是自动就转换成对应的数据类型. 2.nil在JSPatch中 不 ...
- 全面谈谈Aspects和JSPatch兼容问题
1. 背景 Aspects 和 JSPatch 是 iOS 开发中非常常见的两个库.Aspects 提供了方便简单的方法进行面向切片编程(AOP),JSPatch可以让你用 JavaScript 书写 ...
- JSPatch实现原理详解<二>
本文转载至 http://blog.cnbang.net/tech/2855/ 距离上次写的<JSPatch实现原理详解>有一个月的时间,在这段时间里 JSPatch 在不断地完善和改进, ...
- JSPatch - 基本使用和学习
介绍 JSPatch是2015年由bang推出的能实现热修复的工具,只要在项目中引入极小的JSPatch引擎,就可以用 JavaScript 调用和替换任何 Objective-C 的原生方法,获得脚 ...
- 【原】Android热更新开源项目Tinker源码解析系列之三:so热更新
本系列将从以下三个方面对Tinker进行源码解析: Android热更新开源项目Tinker源码解析系列之一:Dex热更新 Android热更新开源项目Tinker源码解析系列之二:资源文件热更新 A ...
随机推荐
- MySQL语言 数据库练习题分解。
一. 设有一数据库,包括四个表:学生表(Student).课程表(Course).成绩表(Score)以及教师信息表(Teacher).四个表的结构分别如表1-1的表(一)~表( ...
- css3---2D效果 ---3D效果
CSS3边框: CSS3圆角:border-radius(**px 或 **%) 属性——创建边框线的圆角 CSS3盒子阴影:box-shadow属性——创建阴影 box-shadow:30px 0p ...
- opencv中 int main(int argc,char* argv[])详解
opencv中 int main(int argc,char* argv[])详解 argc是命令行总的参数个数 argv[]是argc个参数,其中第0个参数是程序的全名,以后的参数 ...
- 关于使用 Spring 发送简单邮件
这是通过Spring 框架内置的功能完成简单邮件发送的测试用例. 导入相关的 jar 包. Spring 邮件抽象层的主要包为 org.springframework.mail. 它包括了发送电子邮件 ...
- invariant theory 不变量理论
https://baike.baidu.com/item/不变量理论/9224903?fr=aladdininvariant theory 一组几何元素由 k个参数组成的向量 P1表示.若 T为某一变 ...
- [skill] mmap / fwrite / write linux磁盘读写的分层结构
转自:http://www.cnblogs.com/zhaoyl/p/5901680.html 看完此文,题目不言自明.转自 http://blog.chinaunix.net/uid-2710571 ...
- Python多线程中阻塞(join)与锁(Lock)的使用误区
参考资料:https://blog.csdn.net/cd_xuyue/article/details/52052893 1使用两个循环分别处理start和join函数.即可实现并发. threads ...
- nodemcu使用心得1
1.简介 最近迷上了性价比超高的模块nodemcu,它是基于esp8266-12E的非常易用的模块.他可以用lua语言编程,带有丰富的库. 2.硬件 1)esp8266-12E单元模块原理图 经本人实 ...
- 洛谷P4587 神秘数 [FJOI2016] 主席树
正解:主席树 解题报告: 先放下传送门QAQ 首先可以先思考如果只有一组询问,怎么解决 可以这么想,最开始一个数也麻油的时候能表示的最大的数是0嘛 然后先排个序,按顺序每次新加入一个数x,设加入这个数 ...
- webpack浅析~
1.webpack打包原理: 把所有依赖打包成一个 bundle.js 文件,通过代码分割成单元片段并按需加载. 2.webpack的优势: ①.webpack 是以 commonJS 的形式来书写脚 ...