Why am I seeing an error about _OBJC_CLASS_$_CPGraphHostingView with Core Plot? - iphone

I downloaded the Core Plot example application, but when I compile it I saw a few errors. I then added the Core Plot SDK, but in this SDK there is no class named CPGraphHostingView. Therefore, I added the class manually from this link.
However, I now see the following error:
ERROR - "_OBJC_CLASS_$_CPGraphHostingView", referenced from:
How can I work around this to get the sample application to compile?

Follow the step-by-step instructions on the Core Plot wiki and you should be fine.
Note that the SDK install is considered experimental at this time, and I know that others have reported issues with using it, so I'd recommend following the instructions for using the static library instead.

Related

How to integrate xBim in Unity?

I have installed xBim using NuGet for unity, and it is working well until I try to use the GeometryEngine to create 3D shapes:
using (IfcStore model = IfcStore.Open(filename, null))
{
var context = new Xbim3DModelContext(model);
context.CreateContext();
}
context.CreateContext(); causes an error. At first I got:
FileNotFoundException: Could not load file or assembly 'Xbim.Geometry.Engine.dll' or one of its dependencies
Which is a bit strange since I did install the geometry engine in NuGet, but then I tried to compile the DLLs for the github project here:
https://github.com/xBimTeam/XbimGeometry
And copied them into the plugins folder. Now I do not get any error message, but Unity will crash to desktop on execution of context.CreateContext();
I have been searching online, but have been unable to find any workaround. Any suggestions are appreciated.
I don't have the answer (currently also trying to use xBim in Unity), but what I found looking throught the topics listed here:
https://github.com/xBimTeam/XbimGeometry/issues?utf8=%E2%9C%93&q=unity+
is that there is not direct solution for this. The workaround, mentioned in a couple of places, is to make the conversion from .ifc to .weBIM in an small external .NET support program. See this:
https://github.com/xBimTeam/XbimGeometry/issues/109
Hope this somewhat helps. If you have another solution I would like to hear it.

Build error after updating framework xcode8

I've just converted my app to Swift 3, and as part of this I have updated the well known "Charts" framework. All of my converted code is fine and building/testing well, so I have no concerns about that.
I have embedded the binary to use the framework after unlinking the old one, cleaned the project, built the project before trying to use any framework code, and cleared derived data.
However I still get a "ChartViewDelegate" is not available, cannot
find swift declaration for this protocol.
This is odd to me, as the Charts module imports fine, and autocomplete recognised all member classes of the framework. Also, it doesn't seem to be an issue with the framework, as when implementing the framework on a "fresh" project, it works perfectly as expected.
I'm at a loss of what to try next, apart from rewriting an entire app into a fresh project where I know the framework works. The framework is an integral part of the app. Thanks!
EDIT: I have already tried cleaning/clearing derived data.
I've been having this problem recently with any frameworks I added to my project manually. I fixed this by totally removing the offending frameworks and then installing via cocoa pods.

Missing Facebook SDK for Parse using Swift

This question is a lot like this one: Parse for iOS: Errors when trying to run the app except that I am using Swift in XCode Beta 4.
Essentially, when using the Parse library my app build fails, noting that I need resources from the FacebookSDK. Downloading the SDK works, but as this question on Parse's website: https://parse.com/questions/using-the-parse-ios-sdk-without-including-the-facebook-sdk notes, it adds over 1MB that I don't use.
The former question lists "Build Settings > Other Linker Flags > remove -ObjC" as a solution, but I can't figure out how to do that in this XCode version. Any help/ other solutions?
(FYI, Another solution on that page suggests creating a FBMissingSymbols.m file, but that gives me other errors because of trying to use Objective C)
A very simple solution for this is to use the CocoaPods dependency manager. If you need help setting it up, let me know. If you'd rather not, I can gladly help you get Parse set up, as I've been using it with Swift.

Building pure Swift Cocoa Touch Framework

I'm exploring Swift with Xcode-6 and so far so good although I think the new collections need a little bit of work as I've managed to break the compiler a few times.
Problem is I'm now stuck trying to create the framework package to then use in another project. The project builds without issue and all tests pass successfully. When I go to create Archive (which I assume is what is required) I receive the error:
:0: error: underlying Objective-C module 'Sample' not found
Now I assume this has something to do with the contents of my Sample.h which tells me
// In this header, you should import all the public headers of your framework using statements like #import <Sample/PublicHeader.h>
which is fine except I have only used swift enums, structs and classes for this framework so therefore no .h files exist.
Can anyone shed some light on this one as I can't find any documentation available yet?
EDIT (7/27/2018)
The information in the answer below may no longer be accurate. Your mileage may vary.
I sat down with an engineer and asked this exact question. This was their response:
Xcode 6 does not support building distributable Swift frameworks at this time and that Apple likely won't build this functionality into Xcode until its advantageous for them to do so. Right now, Frameworks are meant to be embedded in your app's project, rather than distributed. If you watch any of the session videos or see the sample projects, this is always the arrangement. Another reason is that Swift is very new and likely to change. Thus your Swift-based framework is not guaranteed to work on the platform you originally built it on.
Slight Update
The engineer mentioned that it's not impossible to make a framework for distribution, just that it's not supported.
I was able to get past the error by going to the target for the framework and on the Build Phases tab under Headers, remove the MyFramework.h file
However I was getting the "Underlying Objective-C module not found" error when I was using a framework to share code between a containing app and an app extension, both of which were pure Swift.
Assuming you are creating a truly pure Swift module, you must disable the Objective-C Compatibility Header and any generated interface headers so the compiler doesn't go off assuming it can find an Objective-C module for the framework.
Do Not remove your public framework header. You'll get a module-map warning at link time if you do.
You might find this useful: Creation of pure swift module
In short: it's possible to make static framework, but there is one issue: it doesn't work in end user' project if "ProjectName-Swift.h" header included.
But, it works fine if you use only swift.
I think it's a bug in XCode 6, or that Apple does not allow archiving the Framework from XCode while in beta.
If you compile to profile XCode generates the framework correctly. (See the Release folder created in DerivedData)

Trouble with core-plot example folder (examples not working)

The examples are not working for me, why?
It tells me loadDocSet.scpt => Shell Script Invocation Error.
I have build an own example in my project and it works, but I can't open the examples.
The Linking and everything else for the configuration of core plot is done well.
Googled that problem but didn't find a solution till now.
It sounds like you're trying to build the documentation set instead of the proper application or framework target. In Xcode, make sure your build scheme is set to CPTTestApp-iPhone or whatever the example application is that you need to build, and not Documentation.
Based on the latest version in the Mercurial repository, the sample applications compile just fine for me when the scheme is set as I describe above.