[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.

Bewertung

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

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.

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'
Vorherrschende Sprache
JavaScript
Sterne
150
Forks
43
Ø Merge
3 T. 10 Std.
Gemergte PRs (30 T.)
22

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus NativeScript/ios

Alle Issues in NativeScript/ios

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

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