• 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(2): Returns from a sheet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re(2): Returns from a sheet


  • Subject: Re(2): Returns from a sheet
  • From: Jens Bauer <email@hidden>
  • Date: Fri, 3 May 2002 22:07:09 +0100

Hi Esteban and Jim,

Please also consider that you may run into problems when translating the
OK and Cancel buttons. :)

Isn't an outlet just an opaque pointer, which can be quickly compared to
another opaque pointer ?
-I'd expect this to be just as fast as the isEqualToString solution.
Ofcourse, it would be different, if the buttons have 2 different
instances (Cocoa may even be able to keep those on the same address, this
depends on how clever the memory handling is).

On Fri, 3 May, 2002, Esteban Uribe <email@hidden> wrote:

>Oops, that should be
>[[sender stringValue] isEqualToString:buttonString]; where buttonString
>= @"OK"
>
>I prefer comparing the sender with an outlet to the button and using
>isEqualTo, it saves you the trouble of dealing with an object that might
>not respond to stringValue... or some other method.
>
>On Friday, May 03, 2002, at 06:08PM, Esteban Uribe <email@hidden>
>wrote:
>
>>You can use [sender isEqualToString:buttonString] on the sender to find
>out if its title is OK or Cancel, this is supposed to be faster than
>calling [sender isEqualTo:okButton]; where okButton is an outlet to the
>OK button.
>>
>>
>>On Friday, May 03, 2002, at 05:05PM, James Pengra <email@hidden>
wrote:
>>
>>> What is the best way to differentiate between an 'OK' button and
>>>a 'Cancel' button when closing a sheet? Should I connect the buttons
>>>to different exit procedures or is there some way to use the
>>>'returnCode' variable to distinguish between the two?


Love,
Jens

--
Jens Bauer, Faster Software.
-Let's make the World better, shall we ?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Returns from a sheet (From: Esteban Uribe <email@hidden>)

  • Prev by Date: Re: Screen capture?
  • Next by Date: Re: Returns from a sheet
  • Previous by thread: Re: Returns from a sheet
  • Next by thread: Re: Returns from a sheet
  • Index(es):
    • Date
    • Thread