Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Syntax error in header file




On Apr 26, 2008, at 8:03 AM, Ryan Chapman wrote:

Maybe I spoke too soon. Compilation was successful but I got two warnings which are causing runtime issues.
<snip>
/Users/ryan/Downloads/QuartzLines/KCLineFactory.m:36: warning: receiver 'KCLine' is a forward class and corresponding @interface may not exist


In KCLineFactory.m you still need to:

#import "KCLine.h"
#import "KCColor.h"


Users/ryan/Downloads/QuartzLines/KCLineFactory.m:37: warning: 'NSDictionary' may not respond to '-setObject:forKey:'


The reason for this warning is that the type of "linesByColor" is NSDictionary instead of NSMutableDictionary.


I've lookup up the "forward class..." error and it seems this is caused by @class KCLine; Does anyone ever use the old C trick for Obj-C header files ?
#ifndef _STDIO_H_
#define _STDIO_H_
/* contents of stdio.h */
#endif


No. You don't need to do that as long as you use forward declarations and #import statements as has been suggested in this thread.


j o a r


_______________________________________________ Do not post admin requests to the list. They will be ignored. Objc-language mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/objc-language/email@hidden

This email sent to email@hidden
References: 
 >Syntax error in header file (From: "Ryan Chapman" <email@hidden>)
 >Re: Syntax error in header file (From: Jean-Claude Turcq <email@hidden>)
 >Re: Syntax error in header file (From: "Ryan Chapman" <email@hidden>)
 >Re: Syntax error in header file (From: "Ryan Chapman" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.