Hi,
I'm having trouble converting an object to a BOOL. In my window
controller, I'm observing the model keyPath isDirty which is a BOOL.
version 1
- (void) observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
On 12/11/2008, at 11:08 AM, Andre Masse wrote:
I'm having trouble converting an object to a BOOL. In my window
controller, I'm observing the model keyPath isDirty which is a BOOL.
BOOL is not an object type. You need to use [myObject boolValue] to
get a BOOL.
--
Rob Keniger
[ [ change objectForKey:NSKeyValueChangeNewKey ] boolValue ]?
it's an object, not a bool, it prints as a bool because the object knows
it's a bool, but you are just testing the object pointer which isn't 0x00
Andre Masse wrote:
Hi,
I'm having trouble converting an object to a BOOL. In my
On 12 Nov 2008, at 12:08 pm, Andre Masse wrote:
Hi,
I'm having trouble converting an object to a BOOL. In my window
controller, I'm observing the model keyPath isDirty which is a BOOL.
version 1
- (void) observeValueForKeyPath:(NSString *)keyPath
From: Andre Masse [EMAIL PROTECTED]
To: Cocoa Developers cocoa-dev@lists.apple.com
Sent: Tuesday, November 11, 2008 5:08:20 PM
Subject: BOOL madness
Hi,
I'm having trouble converting an object to a BOOL. In my window controller,
I'm
observing the model keyPath isDirty which is a BOOL
Thanks a lot, this the method I was looking for.
Andre Masse
On Nov 11, 2008, at 20:11, Rob Keniger wrote:
BOOL is not an object type. You need to use [myObject boolValue] to
get a BOOL.
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
On Nov 11, 2008, at 8:08 PM, Andre Masse wrote:
I'm having trouble converting an object to a BOOL. In my window
controller, I'm observing the model keyPath isDirty which is a BOOL.
version 1
- (void) observeValueForKeyPath:(NSString *)keyPath
I was looking everywhere for BOOL methods conversion and couldn't find
any. Now I know why: BOOL is not an object type. Not sure how I could
have found [myObject boolValue] though... Now that I know about it, I
searched the documentation reference and found that is a method
implemented by
Thanks for pointing that out. I'll check the archives.
Andre Masse
On Nov 11, 2008, at 20:28, Jim Correia wrote:
I know this isn't the question you asked, nor the root of the
problem you are having, but by way of saving you future pain, that
is not the correct way to write an -
For the sake of followers of this thread and after having read the
archives, here's the final version:
static NSString *GHMainWindowControllerIsDirtyObservingContext;
...
- (void) observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
On Tue, Nov 11, 2008 at 8:36 PM, Andre Masse [EMAIL PROTECTED] wrote:
I was looking everywhere for BOOL methods conversion and couldn't find any.
Now I know why: BOOL is not an object type. Not sure how I could have found
[myObject boolValue] though... Now that I know about it, I searched the
Thanks a lot for the doc pointer.
Andre Masse
On Nov 11, 2008, at 21:12, Michael Ash wrote:
Key-Value Observing is built on top of Key-Value Coding, and KVC is
documented to box non-object scalars using NSNumber and NSValue:
12 matches
Mail list logo