ShareKit missing file - iphone

I have a perfect functioning app in xcode 4.
As soon as I add the frameworks and the shk folder to my project
I get 6 errors, first of them;
#import </usr/include/objc/objc-class.h> file not found
I tried this
iPhone - ShareKit , SHK.m giving the compiler error for FileNot Found
but still the same...
Regards
Mirza

Are you using xcode 4.3? if yes then just replace
#import </usr/include/objc/objc-class.h>
this with
#import <objc/runtime.h>

Related

Parse errors when code written in xcode 4.5 run in xcode 4.2

I am new in iphone application development. I have written a code in xcode 4.5 and the code is working fine there. I copied that code and pasted it in xcode 4.2, cleaned it and when i build it i get lots of parse errors. Some of the errors are; missing #end, illegal interface qualifier,expected an objective-c directive,expected identifier or '(' etc.And most of these errors are in AppDelegate.m file. I am totally clueless what to do. Please help me out. Thanks.
Open your AppDelegate.m file, and scroll down at the end of file simply write #end at the last line.

"Reachability.h" "Reachability.m gives an Apple mach-o linker error while adding them

I am creating an iPhone application, and I am using RestKit api to connect to the server. I am facing a problem whenever I add the Reachability.m and Reachability.h into the second UIViewController of the project. I tried making a new .m file in Xcode4 and now I get an Apple macho-linker (id) error on all tabst. I added it to the first UIViewcontroller it works normally, but when I try to add it to any other forms I receive this error.
Have you added the SystemsConfigurations.Framework to your project? Apples reachability package requires the SystemConfigurations.Framework to be added before it can be used.
Also if you are using ARC (Automatic ReferenceCounting), ensure you have disabled ARC for that particular file. Do this by going to build phases, compile sources, then double clicking Reachability.m and entering -fno-objc-arc to disable ARC
Solved it by importing ONLY "Reachability.h" not "Reachability.h" and "Reachability.m"
Try adding CFNetwork.framework.

Lexical or Preprocessor Issue error (UIKit/UIKit.h file not found)

I've read the other question in regards to lexical and preprocessor issues and I've tried to use what helped solve their problems. Unfortunately, none of those solutions have helped rectify the problem. This error came out of nowhere and I'm not sure what I can do, other than what read, to fix this. Please help!
Here is the code in which I get the error:
#import <UIKit/UIKit.h>
#interface scanshootViewController : UIViewController
<UINavigationControllerDelegate, UIImagePickerControllerDelegate>
{
IBOutlet UIImageView *imageView;
UIImagePickerController *imagePicker;
}
#property (nonatomic, retain) UIImageView *imageView;
-(IBAction) btnClicked:(id) sender;
#end
Try removing the "Derived Data" folder for your app - you can find it in the Projects tab of the organizer. One you get there in the finder, close the project in Xcode, delete the folder, reopen the project, and try to build. If that does not do it close project, remove every directory in your project file that starts with your userID (or just rename them), reopen, rebuild.
EDIT: a few more suggestions
1) Look at the Target's "Use Standard System Header Directory Searching" and make sure its YES.
2) In your .pch file, you should have something like:
#import <Availability.h>
#ifndef __IPHONE_4_0
#warning "This project uses features only available in iOS SDK 4.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
Try adding "Hello" on a line by iteslf under OBJC to verify that when you build, you get here (and get a fatal error) - this will prove whether OBJC is defined.
3) Create a totally new project - iOS one view. Make sure it builds and runs (if not Xcode is frogged). Then open that project Build Settings along side your projects', and look line by line top see what is different.
4) If all else fails, move your project to a different directory, create a new one, then add all the files back into the new project. This is obviously the worst possible solution.
Got to the Frameworks Folder at your project, right click at UIKit.Framework > show in finder.
If the Headers folder is empty that means that you don't have the correct files, I just realized that some Clean Apps remove .h files from your computer (... yes, believe it or not);
Solution:
1) Copy the entire iPhoneOS.platform & iPhoneSimulator.platform folders from other XCode Installation
2) Reinstall XCode (ups...)
I was having the same issue with a framework target, building for iOS. I solved this by setting the "Base SDK" in my build configs to something reasonable.
I encountered the same problem. The cause was that I accidentally set the "Base SDK" in "Build Settings" to "Current OS X" instead of "Latest iOS". When I set it back to "Latest iOS" the build error disappeared.
FWIW, I had a similar issue trying to improve some code found on github.
I did not understand why it could not find UIColor and could not #import <UIKit/UIKit.h> until I realized it was building for OSX, not for iOS!!!
So I put this at the beginning of the .h file:
#import "TargetConditionals.h"
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
#import <UIKit/UIKit.h>
#define HXColor UIColor
#else
#import <Cocoa/Cocoa.h>
#define HXColor NSColor
#endif
#interface HXColor (HexColorAddition)
HTH

XCode 4.3 import a nested header error: no such file or directory

I'm running into a nasty issue trying to import a header from a project that is embedded in my main project. What is the proper way to import RKJSONParserJSONKit.h indicated below?
I'm trying :
#import "RestKit/Support/RKJSONParserJSONKit.h"
but Xcode cannot find that file.
Just do #import "RKJSONParserJSONKit.h", no need to include /ResKit/Support/
you have to import the JSONKit
#import <RestKit/JSONKit.h>
if you have a problem with importing it as above try to load the kit by
#import "RestKit/Code/Support/Parsers/JSON/RKJSONParserJSONKit.h"
but you should add a copy of the RKParser.h into your project
I ended up just copying the required files over from the sample project over to the main project. A very hasty choice, but spending hours debugging header search paths is not my favorite thing to do in Xcode :/

Problem importing QuartzCore framework into Xcode project

I am using Xcode 4.
I am trying to import the QuartzCore framework into my Xcode project but I get the following compilation error:
/Users/sabobin/Desktop/PlayingCard/PlayingCard/PlayingCardViewController.m:10:26:
error: Quartz/Quartz.h: No such file
or directory
file://localhost/Users/sabobin/Desktop/PlayingCard/PlayingCard/PlayingCardViewController.m:
error: Lexical or Preprocessor Issue:
'Quartz/Quartz.h' file not found
I navigated to the project target, and selected the Build Phases tab, and then added QuartzCore.framework to the Link Binary With Libraries section.
I then used the following import statement in my view controllers implementation file:
#import <Quartz/Quartz.h>
Does anyone have any ideas?
Thanks in advance.
It should have
#import <QuartzCore/QuartzCore.h>
The correct line is #import <QuartzCore/QuartzCore.h>.
It may help you.
#import<QuartzCore/QuartzCore.h>
I am wondering What made you write #import <Quartz/Quartz.h> When the framework you are importing is QuartzCore.
So the correct one as already pointed out by others is #import<QuartzCore/QuartzCore.h>
You no longer need to import QuartzCore as of iOS 7, since it is already included when you "import UIKit".
Should use
#import <QuartzCore/QuartzCore.h>
after importing the QuartzCore.framework from Link Binary With Libraries under Build phase in Xcode.