I am using Twitter-OAuth framework found Here. Everything was working great until a few days ago when I upgraded XCode. Now when I try to compile this application, I get errors in the Twitter-OAuth files that say
no super class declared in #interface for 'MGTwitterXMLParser'
and Warnings that say
'MGTwitterXMLParser' may not respond to '+alloc'
If anyone knows what is going on here, I would very much appreciate some help.
Apparently the issue arose because iOS SDK 4.0 feels the need to add all sorts of entries to the Header Search Paths, Framework Search Paths and Library Search Paths in the Build Settings. I cleaned those fields out and things started working.
Chris, I don't use MGTwitterXMLParser but the first error message in your question suggest the compiler is expecting the interface declaration of MGTwitterXMLParser class to have a parent. Without that, the compiler will treat MGTwitterXMLParser as a root class like NSObject.
Does MGTwitterXMLParser.h contain something that looks like
#interface MGTwitterXMLParser:NSObject
The second error message in your question could be linked to the first as the compiler isn't able to traverse the inheritance tree of MGTwitterXMLParser to locate its the declaration of +(id)alloc.
Related
I want to use GCDAsyncSocket in Swift, but get the "unresolved identifier 'GCDAsyncSocket'" compiler error. I have imported GCDAsyncSocket.framework but I can't get rid of this error.
I'm sure you've added the framework to your bridging header. But have you checked to make sure the framework is added to the same targets as the Swift file you're trying to use it in?
I typically see this type of compiler error when I have a dependency in my Swift file that doesn't have matching targets. Pretty much the compiler can't think of a better way to tell you this.
I have an app and accompanying extension, with a cocoa touch framework in the same project containing most of the shared code. The problem I'm faced with is that the cocoapods that the framework depends on are not found when compiling the app extension. The framework target compiles just fine, but when I compile the extension target I get a bunch of 'unresolved identifier' errors.
The problem does not seem to be that the framework is not being linked as I can access classes defined within it just fine from the extension. I have looked at other questions such as this one, but nothing I've seen seems to solve my problem.
Any help would be greatly appreciated!
EDIT:
The problem was solved by creating a separate bridging header for the extension. Hope this can help someone else!
EDIT 2:
Unfortunately this solution causes the warning
Class AFHTTPRequestOperation is implemented in both path/myFramework and
path/myWidget.appex/myWidget. One of the two will be used. Which one is undefined.
An explanation of why this happens and how to avoid it would by much appreciated.
Your extension needs its own bridging header. Add one, import the cocoapod, follow this answer if you need to here, go.
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)
I try to add DDMathParser library to my project, but i get two linking errors. I'm a newbie in Objective-C programming, and it's still tricky for me.
Below there is a snapshot of the errors i get:
What should i do?
I also tried CGMathParser but i didn't manage to solve some errors i get.
I asked here, but i didn't get any feedback
Any advice?
Thanks
It looks like you've copied in the headers, but not actually linked the source files in. In other words, Xcode isn't compiling DDMathParser into your project.
This page on the DDMathParser wiki has information on what you're supposed to do: https://github.com/davedelong/DDMathParser/wiki/Adding-DDMathParser-to-your-project
I'm trying to update an app of mine to Xcode 4.2, and now it's giving me a bunch of errors in stl_vector.h, a library that is part of the built in libraries. Here is a picture of the error:
Any ideas what I'm doing wrong? I can't figure out how to fix this. I don't have permission to even edit the function that is throwing errors since it is built in.
A slight guess, since you don't give us enough information, but if OBJMaterial etc are Objective-C classes, you can't pass them by value, i.e. you always work with pointers.