NativeScript / NativeScript/ios

[BUG] Problem with class names and NIBs

Open
#58 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
150
Forks
43
Avg merge
3d 10h
Merged PRs (30d)
22

Description

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'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the JavaScript snippet with the pinned iOSPhotoEditor pod under both JSC and V8, starting at PhotoEditorViewController.class() and initWithNibNameBundle. Compare how each runtime resolves the class name and bundle; done means PhotoEditorViewController loads its existing NIB under V8 without requiring a renamed NIB.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript, swift
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.