• 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: WOPopUpButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WOPopUpButton


  • Subject: Re: WOPopUpButton
  • From: Paul Lynch <email@hidden>
  • Date: Sat, 23 Jun 2007 11:34:26 +0100

The method session returns an object of type WOSession; Session is a subclass of WOSession, and so requires a typecast. As you only want to retrieve the editing context with a method defined in WOSession, the cast is not required.

Paul

On 23 Jun 2007, at 11:23, Sigurður E. Vilhelmsson wrote:

OK, a quick Java lesson required :)

What is the difference between the two, i.e. what is the top line
trying to do, that the bottom one skips?

ec = ((Session)session()).defaultEditingContext()
and
ec = session().defaultEditingContext()

Just trying not to be a code monkey, I want to understand what I am doing :)


2007/6/22, Miguel Arroz <email@hidden>:

Are you sure you are including the right include for Session?

   Anyway, you may write only ec = session().defaultEditingContext(),
without the type conversion, because the WOSession superclass has the
defaultEditingContext method.

On 2007/06/22, at 18:15, Sigurður E. Vilhelmsson wrote:

> Sorry to stray back to the original topic :P but I'm getting an error
> in my java file. I used the code from David:
>
> public NSArray allCourseDescription() {
> EOEditingContext ec = ((Session)session
> ()).defaultEditingContext();
> return EOUtilities.objectsForEntityNamed(ec,
> "CourseDescription");
> }
>
> (I figured the extra space and s in allCourseDescription s() were a
> typo)
>
> However, now I get an error complaining that "Session cannot be
> resolved to a type".

_______________________________________________ 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
References: 
 >WOPopUpButton (From: "Sigurður E. Vilhelmsson" <email@hidden>)
 >Re: WOPopUpButton (From: David LeBer <email@hidden>)
 >Re: WOPopUpButton (From: Ian Joyner <email@hidden>)
 >Re: WOPopUpButton (From: Eric Robinson <email@hidden>)
 >Re: WOPopUpButton (From: Ian Joyner <email@hidden>)
 >Re: WOPopUpButton (From: Mike Schrag <email@hidden>)
 >Re: WOPopUpButton (From: Ken Anderson <email@hidden>)
 >Re: WOPopUpButton (From: Miguel Arroz <email@hidden>)
 >Re: WOPopUpButton (From: "Sigurður E. Vilhelmsson" <email@hidden>)
 >Re: WOPopUpButton (From: Miguel Arroz <email@hidden>)
 >Re: WOPopUpButton (From: "Sigurður E. Vilhelmsson" <email@hidden>)

  • Prev by Date: Re: WOPopUpButton
  • Next by Date: Re: WOPopUpButton
  • Previous by thread: Re: WOPopUpButton
  • Next by thread: Re: WOPopUpButton
  • Index(es):
    • Date
    • Thread