I have defined a callback block for a JSON service like so:
#import "JSONResult.h"
typedef void (^JSONResultHandler)(JSONResult*);
Obviously, the JSONResult typed argument is a custom type and its header file is included where this block is defined. Why do I then get the following error?
/Users/oyvind/code/_objc/JSONService.h:22:35: Unknown type name 'JSONResult'
Are you importing your JSON service class in
JSONResulttoo? Maybe you have a circular reference problem.If you are importing the JSON service class in
JSONResultand that import is absolutely necessary, try using forward declaration to import JSONResult in your .h:Double check your imports and class names are OK too.