• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Can I split an implementation file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I split an implementation file?


  • Subject: Re: Can I split an implementation file?
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Thu, 27 Nov 2008 15:07:23 +0100


You can learn more about category in the Obj-C language guide:

http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_6_section_3.html


Le 27 nov. 08 à 15:04, Matt Gough a écrit :

Yes, something like this should do you

In file MyObj.h
@interface MyObj : NSObject{
Foo* _foo;
}
-(Foo) foo;
-(void) setFoo:(Foo)aFoo;
-(void) solveWorldFinancialCrisis;

@end;

In file MyObj+GetSetters.m:

#import "MyObj.h"
@implementation MyObj (GetSetters)
-(Foo) foo
{....}

-(void) setFoo:(Foo)aFoo
{....}

@end

In file MyObj.m:

#import "MyObj.h"
@implementation MyObj

-(void) solveWorldFinancialCrisis
{
// Good luck with this one :)
}
@end


Matt On 27 Nov 2008, at 14:30, Greg Robertson wrote:

One of my implementation files is getting kind of long and I would
like to split it into two.

I have a lot of custom getters and setters and I was wondering if
there was a way I could put them in a separate file but keep a common
interface file?

Can I do that?

What is the syntax for doing this?


Thanks


Greg _______________________________________________
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Can I split an implementation file?
      • From: "Greg Robertson" <email@hidden>
References: 
 >Can I split an implementation file? (From: "Greg Robertson" <email@hidden>)
 >Re: Can I split an implementation file? (From: Matt Gough <email@hidden>)

  • Prev by Date: Re: Can I split an implementation file?
  • Next by Date: [MEET] Aachen CocoaHeads TODAY (November 27, 2008)
  • Previous by thread: Re: Can I split an implementation file?
  • Next by thread: Re: Can I split an implementation file?
  • Index(es):
    • Date
    • Thread