• 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
Location of an ``out of bounds" index error (sequel to ``Newbie Q: communication problem with NSTableView")
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Location of an ``out of bounds" index error (sequel to ``Newbie Q: communication problem with NSTableView")


  • Subject: Location of an ``out of bounds" index error (sequel to ``Newbie Q: communication problem with NSTableView")
  • From: email@hidden
  • Date: Sun, 21 May 2006 12:04:51 +0200 (CEST)
  • Importance: Normal

>i'll assume next that your using Interface Builder (IB) to create your
window and tableview
>and that you have setup the connections between your TableController and
the tableView there

  that's right.

 Since your last mail I updated many things : I suppressed the
TableController class and did everything
in the MyDocument class. Now I've got a different problem :
- the Console tells me I've used an ``out of bounds" index in some array.
- the debugger tells me more precisely when it occurs :

  at some invocation of the ``updateUI" method, the command [table1
reloadData] is called
 then comes the method
tableView:(NSTableView *)aTableView objectValueForTableColumn(...), which
I defined as follows :

 - (id)tableView:(NSTableView *)aTableView
        objectValueForTableColumn:(NSTableColumn *)aTableColumn
        row:(int)rowIndex
{

	if (aTableView==table1) {
	   return [array1 objectAtIndex: rowIndex];
	}
	if (aTableView==table2) {
	   return [array2 objectAtIndex: rowIndex];
	}
}

 I checked that the indexes are correct (array1 and array2 have length 1
and rowIndex is 0).
When I continue with the ``step over" instruction in the debugger, it leaves
the function above and goes into an esoteric file (here's a sample )

0x936dc3ec  <+0240>  mr	r5,r29
0x936dc3f0  <+0244>  mr	r6,r28
0x936dc3f4  <+0248>  bla	0xfffeff00 <objc_msgSend_rtp>
0x936dc3f8  <+0252>  lwz	r0,136(r26)
0x936dc3fc  <+0256>  mr	r25,r3
0x936dc400  <+0260>  cmpw	cr7,r28,r0
0x936dc404  <+0264>  bne+	cr7,0x936dc418 <-[NSTableView
_drawContentsAtRow:column:clipRect:]+284>
0x936dc408  <+0268>  lwz	r0,140(r26)
0x936dc40c  <+0272>  cmpw	cr7,r27,r0
0x936dc410  <+0276>  bne+	cr7,0x936dc418 <-[NSTableView
_drawContentsAtRow:column:clipRect:]+284>
0x936dc414  <+0280>  li	r24,1

 When it reaches a line that goes "0xfffeff18  <+0024>  lwz r2,32(r12)"
the error message "Program received signal : EXC_BAD_ACCESS" appears.
Needless to say I do not understand one word of this native code, so I'm
stuck ...


              Ewan



 _______________________________________________
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

  • Prev by Date: Re: Determining how the app is run (intel/ppc/rosetta/os version)?
  • Next by Date: Re: NSAppleScript not in the main thread
  • Previous by thread: Re: blinking text
  • Next by thread: textDidChange not firing
  • Index(es):
    • Date
    • Thread