• 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
Working around SBObject limitations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Working around SBObject limitations


  • Subject: Working around SBObject limitations
  • From: Fritz Anderson <email@hidden>
  • Date: Wed, 4 Nov 2009 13:11:43 -0600

I've deduced that the SBObject subclasses derived from an application's sdef are completely dynamic, and you can't implement categories on them, and you can't send +class to them. Am I right?

Is there a way to work around these limitations? The application I'm targeting implements -parent in several classes, and the return value is polymorphic. For instance an AppFolder's parent can be another AppFolder, but at the top of the chain, it's the AppApplication. I want to exclude the AppApplication from my traversal of the chain.

for (id curr = [self parent]; [curr isKindOfClass: [AppFolder class]]; curr = [curr parent]) {
[returnedMutableArray insertObject: curr atIndex: 0];
}


1. The test in this for statement doesn't link, because the AppFolder's class doesn't appear in my object code. Is there a workaround for this?

2. It would be nice to put the above code into a -folderPath method in my own category of the SBObject subclass AppFolder. Again, the absence of the dynamic class from my object code prevents my implementing a category (am I right?). Is there a workaround for this? (I imagine it could be done by monkeying with the runtime, but I'd rather not if there's an easier way.)

	— F

_______________________________________________

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: Working around SBObject limitations
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Best pattern for similar objects with differences
  • Next by Date: Re: Should I learn CoreData for this project?
  • Previous by thread: Re: Best pattern for similar objects with differences
  • Next by thread: Re: Working around SBObject limitations
  • Index(es):
    • Date
    • Thread