So I suspect this to be a project problem as opposed to a code problem. I am still relatively new to xcode. I am trying to access the ABAddressBook libraries and have included them in the project alright.
![alt text][1][1]: http://i.stack.imgur.com/lBaW0.png
Now when I try to say import "ABAddressBook.h", it doesn't know what I am talking about. Is there anything else I need to do to get that set up? Thanks!
Try
#import <AddressBook/AddressBook.h>
#import <AddressBookUI/AddressBookUI.h>
You have to import two frameworks one is the
AddressBook and the other is AddressBookUI and then you have to import those files into your viewController subclass file and you are done
Related
I'm trying to import my speech recognition framework into my project. Sadly my project is in Swift and speech rec is in objc. I don't see a problem with this. I have created a bridging header file before importing the framework and compiled to make sure it has no errors. Then I dragged the framework into my project. Got a successful compile again. Now I type this in my header file:
#ifndef Bridging_Header_h
#define Bridging_Header_h
#import "SpeechKit/SpeechKit.h"
#endif
And then I get the error: "SpeechKit/SpeechKit.h" file not found
I have tried reimporting the framework. Deleting and making a new header file etc. Nothing seems to work. I don't get why it's not picking up the header files from the framework.
Does anyone have any ideas? All help would be greatly appreciated.
Thank you so much.
Try #import "SpeechKit.h" or #import <SpeechKit/SpeechKit.h> instead #import "SpeechKit/SpeechKit.h"
use #import <SpeechKit/SpeechKit.h> in bridging header and don't forget to place import SpeechKit in your swift file
It seems this has been asked before, however I have not found an answer that works for me.
Setup: I am currently creating two static library, that are used in a project. So lets say I have Project, Liba and Libb. Project links to both Liba and Libb, Libb has an import tag for Liba. Project does not directly use Liba, but I have it in the workspace because I have read that we are not supposed to have a library directly link another library. Surprisingly this all works. Where I run into issues is that I want Libb to also use StackMob. For some reason Libb can't find StackMob.h when importing. I have added the Stackmob library to my workspace in a similar way I have for my other libraries.
Here are the relevant code snippets of each class.
Project.h
#import "Libb/Libb.h"
#interface project
{
Libb* _libb;
}
#end
Project.m
#implementation Project
{
_libb = [[Libb alloc] init];
}
#end
Libb.h
#class Liba
#class StackMob
#interface Libb
{
Liba* _liba;
}
#end
Libb.m
#import "Liba/Liba.h"
#import "Stackmob.h" //This is where I get the error. I have also tried "StackMob/StackMob.h"
#implementation Libb
{
//Code here....
}
Thanks for the help. If you need me to clarify, please ask. I realize some of the code I provided is not necessary, but I thought it may help understanding how I have things setup.
Add $(SRCROOT)/../StackMob/Headers to Header Search Paths in build settings to allow the project to find the header files.
i want to use this header #import < AVFoundation/AVCaptureDevice.h > in theos tweak, but i get this error:
AVFoundation/AVCaptureDevice.h: not such file or directory
i also add the AVFoundation framework to the makefile.
if i do #import < AVFoundation/AVFoundation.h> work fine, but i need this header AVCaptureDevice.h
help!
EDIT: My apologies, I completely missed the lower part of your post for some reason.
Just import the whole AVFoundation framework. It will include the AVCaptureDevice header for you.
For Theos projects, you need to add the frameworks to your makefile.
Look for this line (if it doesn't exist, add it manually):
*YOUR_PROJECT_NAME*_FRAMEWORKS
There's where you add any public framework you want to use. Suppose your app is called "myVideo" and you want to add the AVFoundation framework, you would do this:
myVideo_FRAMEWORKS = AVFoundation
As an additional piece of info, if you wanted to add more frameworks you do this:
myVideo_FRAMEWORKS = AVFoundation UIKit
i have develop one app in ios4.0. in which i implementing the code of SMS and it works great but when i run in ios 5 it get me error like did not find MFMessageComposeViewControllerDelegate protocol whereas i am already imported MessageUI/MessageUI.h , MessageUI/MFMailComposeViewController.h.
Please help me...
Just add the Message Framework imports:
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>
Remove the MessageUI framework from your build settings and add it again
I have found a solution. just change the deployment target of your project to 4.0 and it works..
I'm trying to use the open source STHorizontalPicker library to implement a horizontal picker to my project but when importing the .m and .h files from GitHub to my project I'm getting multiple errors when compiling.
Does it require any special implementation?
I'm simply copying the .h and .m and adding to the project. Error are like : property 'cornerRatius' cannot be found in forward class object 'CALayer'...
Do I have to import some class to those files ?
Thnaks in advice.
Do I have to import some class to those files?
Yes, you'll need Quartz.
#import <QuartzCore/QuartzCore.h>