Weird including problems with AFNetwork? - iphone

I've just downloaded AFNetworking to try and mess with it, but i'm having weird errors on including it in my project.
I've just created an empty test project and dropped both AFNetworking and JSONKit in, and immediately i got the error "Lexical or Preprocessor Issue: 'AFNetworking/AFURLConnectionOperation.h' file not found" .
It happens in this row, but changing it to a regular import works for some reason. I could change all of them but I'm trying to understand why this is happening to begin with. I'm sure its some stupid configuration i didn't notice.
#import <AFNetworking/AFURLConnectionOperation.h> // Throws error
#import "AFURLConnectionOperation.h" // Works
Thanks ! :)
Shai

<AFNetworking/AFURLConnectionOperation.h> works if you add AFNetworking as a framework. If you added the files you have to replace the imports with just "AFURLConnectionOperation.h".

The '#import ' syntax is for framework import.
If you just drag&drop the source in your project you've to use '#import "AFURLConnectionOperation.h"'
If you want use a .framework this tutorial can help you: http://db-in.com/blog/2011/07/universal-framework-iphone-ios-2-0/

Related

Import third party C library into swift causes error "Include of non-modular header inside framework module"

This question is a continuation of a previous one I'm currently migrating this (https://github.com/emilwojtaszek/leveldb-swift) library from swift 2 to swift 3/4. Here is the link to my fork https://github.com/lu4/leveldb-swift/tree/MigrationFromSwift2ToSwift3 (please note that the target branch is MigrationFromSwift2ToSwift3)
I was able to resolve (with many thanks to #Ruslan Serebriakov) all of the issues with initial code base and check that the code is running.
However after trying to update LevelDB C code to latest master I got new type of error which I don't understand how to resolve:
Include of non-modular header inside framework module 'LevelDB.c': '/Path/to/Project/leveldb-swift-migration/vendor/leveldb/include/leveldb/export.h'
I've did some research on the internet but the issues described there seem non-related with one I've stumbled on. Here is an image of the issue
Any help is appreciated, thank you in advance!
I'm never 100% certain with mixed language frameworks. But an error like this happens in Swift projects when:
since you cannot use a Bridging Header in frameworks,
you #import a C header in the Foo-Framework.h to expose it so the Swift code, and
the header is not itself marked "Public" to the target.
"Non-modular" seems to indicate "not part of the published module interface". At least with Swift--C mixes, you can only combine both through making the C headers public; no way to import private header files there, which is weird.
Give it a shot: Since you are obviously importing the file in non-Swift code, try to locate the export.h header file in your Xcode project, open the File inspector (⌘⌥1), and ensure public visibility in the framework target:
This issue is because the SDK u are importing is not modular or u can say modulemap file is missing. So make sure modulemap file should be available inside the framework folder. Also make sure that all public headers are listed explicitly in the modulemap. This issue will be resolve 100% if module map file will be include in the third party framework.

Use of unresolved identifier 'PFQuery'

So I am following this tutorial https://www.youtube.com/watch?v=Q6qcrO8uNzU&feature=youtu.be for Parse and when defining a PFQuery variable I get this error: "Use of unresolved identifier 'PFQuery'".
Code Below:
var getMessages = PFQuery(className:"DevelopmentMessages")
How would this be fixed? Thanks in Advance! ;)
You haven't included the Parse framework in your project correctly. This is done about 7 minutes in during Part 1 of that tutorial: http://www.youtube.com/watch?v=Q6kTw_cK3zY
It is also covered in Parse's QuickStart instructions:
https://parse.com/apps/quickstart#parse_data/mobile/ios/native/existing
All you need to do is the "Install the SDK" portion but you also need to include the Parse framework's header in your Objective-C bridging header:
#import <Parse/Parse.h>
The problem might be because you might not have imported the libraries properly. Drag drop the library files into the project properly. Make sure you have added the library inside your project folder and not outside it. Sometimes it may also be the cause of the problem.
Note - Please don't forget to check the option "Copy files if needed" while dragging and dropping the library files.
Update - If you have named your project as "parse" then it will not work. So rename your project to any other name and try it.

Looks like a small error "Expected expression" but unable to find the solution

i used the project, in the below link
http://aptogo.co.uk/2011/09/opencv-framework-for-ios/
when i integrate that project in to my project or vice versa error comes up
Errors image is shown below
If i run the sample it works fine but when i want to use "OpenCVClientViewController" then it shows an error
I integrated both UIImage+OpenCV.h and UIImage+OpenCV.mm also
Thanks a lot in advance
I guess your implementation file is .m (Objective-C), although it should be .mm (Objective-C++).

unable to create new static Library out of existing source code

I'v done quite a bit of R&D on creating static libraries in iOS and came across some well written blogs. I followed this link and also this to create a static library. I have follwed the steps specified in those blogs i.e, i added all the implementation files(.m) to the static library and deleted them from the main target etc... But, i am getting around 700 erros (which is quite bizarre) when i try to build the code. i am posting a screenshot of my errors here..
Is there anything that i am missing here or doing wrong?
Please check the imported Header files.
The .m files, which have these errors, may have the same imported files.
Maybe a semi-comma or parentheses is missing or used incorrectly.

Using Three20 Library

I'm a baby iOS developer.
I really need help.
I want to use three20 library in my project and I add this library correctly.
but when I want to used it, I got a error.
for example when I write this line on top of my classes :
"#import "Three20/Three20.h"
I got this error:
Three20/Three20.h:No such file or directory
What hell is it? What can I do? I really need help as soon as possible.
Thanks
I solve my problem :).
Thanks to this site:
http://three20.info/article/2010-10-06-Adding-Three20-To-Your-Project