• 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
Access a private variable?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Access a private variable?


  • Subject: Access a private variable?
  • From: Alex Johnson <email@hidden>
  • Date: Thu, 14 Jul 2005 17:08:00 -0500

Hi all --

Does anyone know if it's possible to access an object's private variable?

Specifically, I want to get at <x-tad-bigger>WODisplayGroup._displayedObjects</x-tad-bigger> so I can tell how many objects match the query settings. With batching turned on, <x-tad-bigger>displayedObjects()</x-tad-bigger> only returns the current batch of objects.

The only solution I've come up with so far is:
<x-tad-bigger> </x-tad-bigger><x-tad-bigger>int</x-tad-bigger><x-tad-bigger> pp = numberOfObjectsPerBatch();
</x-tad-bigger><x-tad-bigger>int</x-tad-bigger><x-tad-bigger> pg = currentBatchIndex();
NSArray sel = selectedObjects();

setNumberOfObjectsPerBatch(</x-tad-bigger><x-tad-bigger>0</x-tad-bigger><x-tad-bigger>);
countOfQualifiedObjects = </x-tad-bigger><x-tad-bigger>new</x-tad-bigger><x-tad-bigger> Integer( displayedObjects().count() );

setNumberOfObjectsPerBatch( pp );
setCurrentBatchIndex( pg );
setSelectedObjects( sel );
</x-tad-bigger>

Thanks,

Alex Johnson

|| | ||| || | ||| | | | || || |||
\\ SITE 9 \\ SITE9.COM \\ 312.670.8469 \\

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Access a private variable?
      • From: Ricardo Strausz <email@hidden>
    • Re: Access a private variable?
      • From: Sacha Mallais <email@hidden>
  • Prev by Date: Re: WO article in MDJ
  • Next by Date: Re: Access a private variable?
  • Previous by thread: Re: WO article in MDJ
  • Next by thread: Re: Access a private variable?
  • Index(es):
    • Date
    • Thread