[BUG] Problem with class names and NIBs
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- ios, javascript, swift
- 领域
- mobile-dev
调研方向
在 JSC 和 V8 下使用固定版本的 iOSPhotoEditor pod 重现 JavaScript 代码片段,从 PhotoEditorViewController.class() 和 initWithNibNameBundle 开始。比较每个 runtime 如何解析类名和 bundle;当 PhotoEditorViewController 能够在 V8 下加载其现有的 NIB,且不需要重命名 NIB 时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I'm using a POD that has Swift code and XIBs for controllers. This is the pod that I'm using:
pod 'iOSPhotoEditor', :git => 'https://github.com/PeterStaev/photo-editor.git', :commit => '5f90ae8f937e1bf4ef3c46d0fda5fef715c7a5de'
When running with JSC (iOS runtime 6.5.2) When I do:
console.log(PhotoEditorViewController);
I get
function iOSPhotoEditor.PhotoEditorViewController() {
[native code]
}
Which is correct and name so when I try to load the controller with the NIB it works. Here is the code that creates the view controller with the NIB:
const bundle = NSBundle.bundleForClass(PhotoEditorViewController.class());
const viewController = PhotoEditorViewController.alloc().initWithNibNameBundle("PhotoEditorViewController", bundle);
With the v8 runtime seems all the classes are renamed. When I try the same log with the new runtime i get:
function _TtC14iOSPhotoEditor25PhotoEditorViewController() { [native code] }
Since the class is renamed the creation of the viewcontroller fails, as the XIB isn't named accordingly. The exact error is:
CONSOLE ERROR: Error: Could not load NIB in bundle: 'NSBundle </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework> (loaded)' with name 'PhotoEditorViewController'
- 主要语言
- JavaScript
- 星标
- 150
- 派生
- 43
- 平均合并
- 3 天 10 小时
- 30 天内合并 PR
- 22
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NativeScript/ios 的其他 Issue
-
难度 5/5 一周以上 新手友好度 38/100
NativeScript/ios#459 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
NativeScript/ios#445 ·
-
难度 3/5 3-5 天 新手友好度 66/100
NativeScript/ios#414 ·
-
question
难度 4/5 3-5 天 新手友好度 34/100
NativeScript/ios#364 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
NativeScript/ios#355 ·
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
avniproject/avni-client#2135 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
难度 2/5 1-3 小时 新手友好度 72/100
bevyengine/bevy-website#2595 ·
-
ecosystem wording
难度 1/5 1 小时以内 新手友好度 90/100
matrix-org/matrix.org#3649 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
vadimdemedes/ink#1029 ·