NativeScript / NativeScript/ios

[BUG] Problem with class names and NIBs

Offen
#58 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
JavaScript
Sterne
150
Forks
43
Ø Merge
3 T. 10 Std.
Gemergte PRs (30 T.)
22

Beschreibung

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'

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das JavaScript-Snippet mit dem gepinnten iOSPhotoEditor pod unter JSC und V8, beginnend bei PhotoEditorViewController.class() und initWithNibNameBundle. Vergleiche, wie jede Laufzeit den Klassennamen und das Bundle auflöst; abgeschlossen ist die Aufgabe, wenn PhotoEditorViewController sein vorhandenes NIB unter V8 lädt, ohne ein umbenanntes NIB zu benötigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
ios, javascript, swift
Bereich
mobile-dev
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.