develooper Front page | perl.macosx | Postings from September 2010

Re: BOOL returned from Objective-C does not getted mapped properly(always true)

From:
Sherm Pendley
Date:
September 18, 2010 16:29
Subject:
Re: BOOL returned from Objective-C does not getted mapped properly(always true)
Message ID:
AANLkTinaVs4-ehVkv4H6arEabuOq=V7OyuxFKKcd1phq@mail.gmail.com
On Sat, Sep 18, 2010 at 7:07 PM, Sherm Pendley <sherm.pendley@gmail.com> wrote:
> On Sat, Sep 18, 2010 at 3:32 AM, Thilo Planz <thiloplanz@googlemail.com> wrote:
>
>> Any idea on how I can fix or workaround this issue?
>
> One workaround is to assign a tag to the relevant controls in
> Interface Builder, and compare it like this:
>
>  if ($sender->tag() == $self->{'thisButton'}->tag()) {
>    ...
>  }
>
> Tags are 32-bit values, so this bug doesn't bite them.

Another possibility is to use a bit mask to ignore the additional bytes:

  if ($sender->isEqual($self->{'thisButton'}) & 0xf) {
    ...
  }

sherm--

-- 
Cocoa programming in Perl:
http://camelbones.sourceforge.net



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About