/ / ios-charts: Bibliothek kann nicht in ein neues Projekt importiert werden - ios, xcode, Zusammenstellung, Linker, ios-charts

ios-charts: Bibliothek kann nicht in ein neues Projekt importiert werden - ios, xcode, Kompilierung, Linker, IOS-Charts

Ich kann mich nicht integrieren das iOS-Chart-Projekt / Bibliothek in einem benutzerdefinierten Projekt.

Hier sind die Schritte, die ich mache:

  • Öffnen Sie die Demoanwendung auf Xcode
  • Suchen Sie die Diagrammbibliothek im ursprünglichen Demo-Code

Bildbeschreibung hier eingeben

  • Klicken Sie auf im Finder anzeigen und kopieren Sie die Elemente in das neue Projekt
  • Das neue Projekt hat jetzt 2 Ziele. Ich überprüfe, ob das Ziel, das die Ansicht (ChartIn) enthält, tatsächlich mit der Bibliothek verknüpft ist. Es tut.
  • Ich kompiliere die Bibliothek (im neuen Projekt)
  • Ich kompiliere und führe dann das ChartIn aus, aber ich erhalte folgende Fehlermeldung

dyld: Bibliothek nicht geladen: @ Pfad / Diagramme.Framework / Charts referenziert von: /private/var/mobile/Containers/Bundle/Application/0C7EC6DC-94B6-4205-8E71-0F704B2A7523/ChartIn.app/ChartIn Grund: Bild nicht gefunden

Bildbeschreibung hier eingeben

Antworten:

2 für die Antwort № 1

Ich kann nur zitieren:

Um korrekt zu kompilieren:

Drag the Charts.xcodeproj to your project
Go to your target"s settings, hit the "+" under the "Embedded Binaries" section, and select the Charts.framework
Temporary workaround: Xcode 6.3.1 has a bug, where you have to build your project once before actually writing the @import line. So hit "Build" now!
@import Charts
When using Swift in an ObjC project:
You need to import your Bridging Header. Usually it is "YourProject-Swift.h", so in ChartsDemo it"s "ChartsDemo-Swift.h". Do not try to actually include "ChartsDemo-Swift.h" in your project :-)
Under "Build Options", mark "Embedded Content Contains Swift Code"

Wenn Sie für iOS 7 kompilieren möchten:

Drag the code itself (.swift files) to your project. As sadly, Swift currently does not support compiling Frameworks for iOS 7.
Make sure that the files are added to the Target membership.