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

Re: NSObjectController HELP


  • Subject: Re: NSObjectController HELP
  • From: Vince Ackerman <email@hidden>
  • Date: Sun, 6 Jun 2004 08:59:26 -0700

So, in the simple case of my TeleoObj model object which my controller
is observing, when I change the values using accessor methods, why
don't my bound textEditBoxes update too? What do I need to do
differently to make this work? The -init method sets up and allocs the
variables and this is reflected in my bound textEditBoxes on startup,
but nothing changes after that as my model changes. Here's my model
object:

// ----- TeleoObj.h --------
@interface TeleoObj : NSObject
{

NSMutableString * netStatusUSBBox;
BOOL netDigInBox;
float targetNSBox;
}
- (void)setNetStatusUSBBox:(NSString*)newString;
- (NSString*)netStatusUSBBox;
- (void)setTargetNSBox:(float)newTarget;
- (float)targetNSBox;
-(void)setNetDigInBox:(BOOL)newDigIn;
-(BOOL)netDigInBox;
@end

// ----- TeleoObj.m --------
#import "TeleoObj.h"

@implementation TeleoObj
- (void)setNetStatusUSBBox:(NSString*) newString
{
[ netStatusUSBBox setString:newString ];
}
- (NSString*) netStatusUSBBox
{
return netStatusUSBBox;
}
- (void)setTargetNSBox:(float)newTarget
{
targetNSBox = newTarget;
}
- (float)targetNSBox
{
return targetNSBox;
}
-(void)setNetDigInBox:(BOOL)newDigIn
{
netDigInBox = newDigIn;
}
-(BOOL)netDigInBox
{
return netDigIn;
}
@end


On Jun 6, 2004, at 00:52, mmalcolm crawford wrote:

>
> On Jun 6, 2004, at 12:15 AM, Vince Ackerman wrote:
>
>
>> Are you saying my floats and Booleans have to be NSNumber objects and
>> use those set/get methods?
>
> No, as the documentation on KVC/KVO makes clear, you can use scalar
> values. KVC/KVO will automatically convert scalars to appropriate
> objects.
>
> <http://developer.apple.com/documentation/Cocoa/Conceptual/
> KeyValueCoding/Concepts/DataTypes.html>
>
>> So far I haven't been able to get it to update the NSString obj
>> either.......
>>
> I suspect that's a different problem. What are the circumstances?
>
> mmalc
_______________________________________________
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.


  • Follow-Ups:
    • Re: NSObjectController HELP
      • From: mmalcolm crawford <email@hidden>
References: 
 >Re: NSObjectController HELP (From: Vince Ackerman <email@hidden>)
 >Re: NSObjectController HELP (From: mmalcolm crawford <email@hidden>)
 >Re: NSObjectController HELP (From: Vince Ackerman <email@hidden>)
 >Re: NSObjectController HELP (From: mmalcolm crawford <email@hidden>)
 >Re: NSObjectController HELP (From: Vince Ackerman <email@hidden>)
 >Re: NSObjectController HELP (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Multiline using #define
  • Next by Date: Re: NSAttributedString and bindings
  • Previous by thread: Re: NSObjectController HELP
  • Next by thread: Re: NSObjectController HELP
  • Index(es):
    • Date
    • Thread