• 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: Checkbox state inside a function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checkbox state inside a function


  • Subject: Re: Checkbox state inside a function
  • From: "António P.F.Almeida" <email@hidden>
  • Date: Mon, 04 Feb 2008 20:02:33 +0000

I'm using Objective-C 2.0, in Mac Os X "Leopard" - does bindings work on it ?
Yes, I've created an NSButton, tagged it with IBOutlet and connected the outlet in IB.
I really mean "instance method"- and cannot assign value to the variable (contained in "if"-"else" statement) accordingly the checkbox is selected or not.
Must say that I never had such a problem in other languages (Java, C++) which I've used before.


Kyle Sluder wrote:

On Feb 4, 2008 7:04 AM, "António P. F. Almeida"
<email@hidden> wrote:
I want to use a checkbox to set a value to a variable accordingly its
state .

Take a look at bindings. It's designed to do precisely what you want. Barring that, you can use target/action as you seem to be doing.

That checkbox is declared in header file and working fine.

Just to clarify: you've created an NSButton ivar, tagged it with IBOutlet, and connected the outlet in IB, correct?

However, if I use it inside a function, the checkbox state is ignored
and the variable value is always assigned as that statement doesn't
exist.

This sentence doesn't really make sense. 1) I'm guessing by "function" you mean "instance method" based on the code you provide. 2) Which variable is assigned what value? 3) Statements can't "not exist". Not really sure what you meant here.

--Kyle Sluder




--
António P.F.Almeida

_______________________________________________

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: Checkbox state inside a function
      • From: "I. Savant" <email@hidden>
References: 
 >Checkbox state inside a function (From: "António P.F.Almeida" <email@hidden>)
 >Re: Checkbox state inside a function (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: Re: Updating the trash icon without NSWorkspace
  • Next by Date: Omni seeking senior coder
  • Previous by thread: Re: Checkbox state inside a function
  • Next by thread: Re: Checkbox state inside a function
  • Index(es):
    • Date
    • Thread