On Jul 10, 2012, at 5:01 PM, Erik Stainsby <[email protected]> wrote:
> where -[RSRule loadFromPlugin:] copies the values to the rule. This requires > however that RSRule #imports the RSPlugin header. > > I also would like to maintain symmetry by having RSPlugin import the values > of RSRule, for purposes of round-tripping to the UI (plugin reps the UI for a > rule instance). Obviously, this would require RSPlugin to #import RSRule's > header. Xcode doesn't like this one bit. You need to #import the other class's header in the .m file, but not in the .h file. There you can just declare it like "@class RSRule;". That should be enough to avoid circular #imports (and by the way, greatly reduce the number of #imports in your headers, which is good for reducing build times.) About the only times you need to #import another header are if it declares the superclass of an @interface, or a protocol you're implementing, or some typedef or enum that's used in the API. —Jens _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
