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 ...
随机推荐
- 录制用户的音频,视屏 navigator.mediaDevices.getUserMedia
google 文档 HACKS 文档 相关代码 获取本地的音频 <input type="file" accept="audio/*" capture=& ...
- solus 系统 - 编译安裝 ibus-rime 中文输入法(附:小鹤双拼双形配置文件)
編譯方法參見官網 - https://github.com/rime/home/wiki/RimeWithIBus 安装依赖:列出几个可能用到的命令 #安裝cmake gcc等开发工具 sudo eo ...
- shell参数扩展
http://zuyunfei.com/2016/03/23/Shell-Truncate-File-Extension/
- bytes和str的区别与转换
bytes和str的区别 1.英文 b'alex'的表现形式与str没什么两样 2.中文 b'\xe4\xb8\xad'这是一个汉字在utf-8的bytes表现形式 3.中文 b'\xce\xd2'这 ...
- 初级ai思维导图,基础人工智能设计图
2017年2月8日09:35:46 仅供代码和逻辑设计图纸,只提供一个参考设计,后面可能会更新具体实施说明
- sql里的ROW_NUMBER() OVER是啥意思?
是一个分析函数,生成一个排序列select row_number(XX) over(partition by XXX order by XX [desc/asc]) frou table;partit ...
- httpclient发送接受请求
需要注意三部分,request和参数的处理,响应数据.与请求相关的dll是System.Net. 核心代码: private string Post(string requestUrlString, ...
- linux fix the superblock by dumpe2fs fsck
It seems that you have a bad superblock. To fix this: Firstly, boot into a live CD or USB Find out y ...
- Delphi 打开网址
1. 通过iexplore.exe打开:ShellExecute(0, 'open', 'iexplore.exe', PChar('http://www.100xuekao.com'), '', S ...
- AVD启动报错:Running an x86 based Android Virtual Device (AVD) is 10x faster
1.cmd窗口中输入emulator -avd test 启动AVD时报错: Running an x86 based Android Virtual Device (AVD) is 10x fast ...