• 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
Bindings debugging woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bindings debugging woes


  • Subject: Bindings debugging woes
  • From: Hamish Allan <email@hidden>
  • Date: Fri, 10 Feb 2006 18:51:01 +0000

I'm trying to use a property list as the data model for an NSTreeController binding to an NSBrowser. I load it in from the bundle and it seems fine, i.e. I can do this sort of thing:

NSLog(@"%@", [[[self valueForKeyPath:@"children"] objectAtIndex:0] valueForKeyPath:@"name"]);

and get the right sort of answer. However, when it's being used by the bindings, I'm getting an "-[NSCFString characterAtIndex:]: Range or index out of bounds" error.

If I put a breakpoint on -[NSException raise], here is the stack trace:

#0 0x92901508 in -[NSException raise]
#1 0x9290135c in +[NSException raise:format:]
#2 0x928f5ffc in -[NSCFString characterAtIndex:]
#3 0x928f6088 in -[NSDictionary(NSKeyValueCoding) valueForKeyPath:]
#4 0x938b6538 in -[NSBinder _valueForKeyPath:ofObject:mode:raisesForNotApplicableKeys:]
#5 0x93b4d414 in -[NSBinder valueForBinding:atIndexPath:resolveMarkersToPlaceholders:]
#6 0x93bbbdb8 in -[NSBrowserBinder browser:createRowsForColumn:inMatrix:]
#7 0x938224b4 in -[NSBrowser addColumn]
[snip]


If I try to use a class to pose as NSDictionary so that I can override valueForKeyPath: to see what is being requested, I get an even more severe outcome:

#0 0x909c8cc0 in _objc_trap
#1 0x909c8c38 in _objc_error
#2 0x909c8bc4 in __objc_error
#3 0x909c1970 in class_poseAs
#4 0x0006d8f4 in +[ClassInWhichPosingIsSetUp initialize] at ClassInWhichPosingIsSetUp.m:26
#5 0x909bf670 in class_initialize
[snip]


How can I go about chasing this problem?

Thanks,
Hamish

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Bindings debugging woes
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Re: Problem moving subview within superview
  • Next by Date: Re: Finder Column View Path Abbreviation
  • Previous by thread: Created simple Utility panel class
  • Next by thread: Re: Bindings debugging woes
  • Index(es):
    • Date
    • Thread