Xcode: how to know a header file is actually imported?
Posted
by
Philip007
on Stack Overflow
See other posts from Stack Overflow
or by Philip007
Published on 2012-09-22T09:27:58Z
Indexed on
2012/09/22
9:37 UTC
Read the original article
Hit count: 228
To be specific, I am using RestKit framework. I want to use a framework class category called RKObjectManager+RKTableController
in my view controller mainTVC
. Here is my #import section in mainTVC.m:
// framework headers, which should be enough
#import <RestKit/RestKit.h>
#import <RestKit/UI.h>
// my project headers, not relating to framework
#import "MainTVC.h"
#import "Photo.h"
// Do this to guarantee import does happen. But still got error, see below
#import <RestKit/RKObjectManager+RKTableController.h>
However, Xcode issue an error:
No known class method for selector 'fetchRequest:groupedBy:inContext:'
For reference, this method is a class method declared only in category header RKObjectManager+RKTableController.h
, but not in 'RKObjectManager.h`.
Also, I added -ObjC and -all_load to "other linker flags" in build settings, if that's relevant.
I suspect the error is caused by the fact that category header is not actually imported somehow. How can I verify that? Or the error is caused by other reasons that I am not aware of. What am I doing wrong?
© Stack Overflow or respective owner