problems building on 10.5 for 10.4

  • Hi,

    I'm building an app on 10.5 but i'm targetting 10.4. The app runs fine
    on 10.5. Whenever i try and run it o 10.4, i get a couple of weird
    problems and then a crash. Maybe you guys can help me a bit.

    The first error is this one and i get it twice: ( this happens before
    any awakeFromNib Calls )

    *** Assertion failure in -[NSMenu itemAtIndex:], Menus.subproj/
    NSMenu.m:713
    2007-10-30 15:51:13.323 Design[2669] Exception raised during posting
    of notification.  Ignored.  exception: Invalid parameter not
    satisfying: (index >= 0) && (index < (_itemArray ?
    CFArrayGetCount((CFArrayRef)_itemArray) : 0))

    The next one is an EXC_BAD_ACCESS. The stack in the crash log looks
    like this:

    Exception:  EXC_BAD_ACCESS (0x0001)
    Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000008

    Thread 0 Crashed:
    0  com.apple.AppKit               0x932f7e41 _NXSetCellParam + 153
    1  com.apple.AppKit               0x933da0f8 -[NSTableView
    _drawContentsAtRow:column:clipRect:] + 653
    2  com.apple.AppKit               0x933d9789 -[NSOutlineView
    _drawContentsAtRow:column:clipRect:] + 158
    3  com.apple.AppKit               0x933d902b -[NSTableView
    drawRow:clipRect:] + 335
    4  com.apple.AppKit               0x933d8ed2 -[NSOutlineView
    drawRow:clipRect:] + 240
    5  com.apple.AppKit               0x933d67ce -[NSTableView
    drawRowIndexes:clipRect:] + 99
    6  com.apple.AppKit               0x933d56a4 -[NSTableView drawRect:] +
    2499
    7  com.apple.AppKit               0x933013b1 -[NSView _drawRect:clip:]
    + 3228
    8  com.apple.AppKit               0x9330040b -[NSView
    _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 614
    ...

    Any ideas what might be going on?

    thanks

    AC
  • Alex -- can you get the backtrace for when the first exception
    (assertion) happens?

    In gdb, on Tiger, break on [NSException raise]. Then get the bt and
    email it back to the list.

    The second backtrace is probably due to the first one's problem.

    --corbin

    On Oct 30, 2007, at 12:49 PM, Alexander Cohen wrote:

    > Hi,
    >
    > I'm building an app on 10.5 but i'm targetting 10.4. The app runs
    > fine on 10.5. Whenever i try and run it o 10.4, i get a couple of
    > weird problems and then a crash. Maybe you guys can help me a bit.
    >
    > The first error is this one and i get it twice: ( this happens
    > before any awakeFromNib Calls )
    >
    > *** Assertion failure in -[NSMenu itemAtIndex:], Menus.subproj/
    > NSMenu.m:713
    > 2007-10-30 15:51:13.323 Design[2669] Exception raised during posting
    > of notification.  Ignored.  exception: Invalid parameter not
    > satisfying: (index >= 0) && (index < (_itemArray ?
    > CFArrayGetCount((CFArrayRef)_itemArray) : 0))
    >
    > The next one is an EXC_BAD_ACCESS. The stack in the crash log looks
    > like this:
    >
    > Exception:  EXC_BAD_ACCESS (0x0001)
    > Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000008
    >
    > Thread 0 Crashed:
    > 0  com.apple.AppKit               0x932f7e41 _NXSetCellParam + 153
    > 1  com.apple.AppKit               0x933da0f8 -[NSTableView
    > _drawContentsAtRow:column:clipRect:] + 653
    > 2  com.apple.AppKit               0x933d9789 -[NSOutlineView
    > _drawContentsAtRow:column:clipRect:] + 158
    > 3  com.apple.AppKit               0x933d902b -[NSTableView
    > drawRow:clipRect:] + 335
    > 4  com.apple.AppKit               0x933d8ed2 -[NSOutlineView
    > drawRow:clipRect:] + 240
    > 5  com.apple.AppKit               0x933d67ce -[NSTableView
    > drawRowIndexes:clipRect:] + 99
    > 6  com.apple.AppKit               0x933d56a4 -[NSTableView drawRect:]
    > + 2499
    > 7  com.apple.AppKit               0x933013b1 -[NSView
    > _drawRect:clip:] + 3228
    > 8  com.apple.AppKit               0x9330040b -[NSView
    > _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 614
    > ...
  • I actually found the solution for the second problem. On leopard, i
    was returning a nil cell in some circumstances from a custom
    TableColumn. On leopard, i dont think it matters, probably due to the
    new groupings in the NSTableView ( i think we can get nil cells sent
    to our delegates once in a while ), on tiger, it crashes outright.

    thanks

    AC

    On 30-Oct-07, at 5:17 PM, Corbin Dunn wrote:

    > Alex -- can you get the backtrace for when the first exception
    > (assertion) happens?
    >
    > In gdb, on Tiger, break on [NSException raise]. Then get the bt and
    > email it back to the list.
    >
    > The second backtrace is probably due to the first one's problem.
    >
    > --corbin
    >
    > On Oct 30, 2007, at 12:49 PM, Alexander Cohen wrote:
    >
    >> Hi,
    >>
    >> I'm building an app on 10.5 but i'm targetting 10.4. The app runs
    >> fine on 10.5. Whenever i try and run it o 10.4, i get a couple of
    >> weird problems and then a crash. Maybe you guys can help me a bit.
    >>
    >> The first error is this one and i get it twice: ( this happens
    >> before any awakeFromNib Calls )
    >>
    >> *** Assertion failure in -[NSMenu itemAtIndex:], Menus.subproj/
    >> NSMenu.m:713
    >> 2007-10-30 15:51:13.323 Design[2669] Exception raised during
    >> posting of notification.  Ignored.  exception: Invalid parameter
    >> not satisfying: (index >= 0) && (index < (_itemArray ?
    >> CFArrayGetCount((CFArrayRef)_itemArray) : 0))
    >>
    >> The next one is an EXC_BAD_ACCESS. The stack in the crash log looks
    >> like this:
    >>
    >> Exception:  EXC_BAD_ACCESS (0x0001)
    >> Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000008
    >>
    >> Thread 0 Crashed:
    >> 0  com.apple.AppKit               0x932f7e41 _NXSetCellParam + 153
    >> 1  com.apple.AppKit               0x933da0f8 -[NSTableView
    >> _drawContentsAtRow:column:clipRect:] + 653
    >> 2  com.apple.AppKit               0x933d9789 -[NSOutlineView
    >> _drawContentsAtRow:column:clipRect:] + 158
    >> 3  com.apple.AppKit               0x933d902b -[NSTableView
    >> drawRow:clipRect:] + 335
    >> 4  com.apple.AppKit               0x933d8ed2 -[NSOutlineView
    >> drawRow:clipRect:] + 240
    >> 5  com.apple.AppKit               0x933d67ce -[NSTableView
    >> drawRowIndexes:clipRect:] + 99
    >> 6  com.apple.AppKit               0x933d56a4 -[NSTableView
    >> drawRect:] + 2499
    >> 7  com.apple.AppKit               0x933013b1 -[NSView
    >> _drawRect:clip:] + 3228
    >> 8  com.apple.AppKit               0x9330040b -[NSView
    >> _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 614
    >> ...
    >
  • On Oct 30, 2007, at 4:01 PM, Alexander Cohen wrote:

    > I actually found the solution for the second problem. On leopard, i
    > was returning a nil cell in some circumstances from a custom
    > TableColumn. On leopard, i dont think it matters,

    Well, the "way it works" is that you can implement the new delegate
    method:

    - (NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:
    (NSTableColumn *)tableColumn row:(NSInteger)row;

    The first time it is called, 'tableColumn' will be nil, and you can
    return a cell to have it expand across all table columns, or return
    'nil' to have it call you back again for each tableColumn. However,
    there are no nil cells.

    > probably due to the new groupings in the NSTableView ( i think we
    > can get nil cells sent to our delegates once in a while ),

    The groupings are done by implementing "isGroupRow" -- you shouldn't
    use that Leopard feature if you are targeting 10.4.

    > on tiger, it crashes outright.

    This still doesn't make sense; it should work on Tiger (unless you are
    setting Leopard only features). If you can capture the backtrace, I am
    still curious to  see it. It could indicate a problem that needs to be
    fixed.

    thanks,
    corbin
  • I have already seen something very similar to your first assertion
    failure a couple of times on one of my projects. It was due to having
    edited some nib files using IB3. The files became corrupt in some way
    to the eyes of IB2 and the Cocoa frameworks in Tiger. Try to save
    them again selecting Mac OS X 10.4 as the target OS for the nib in
    Interface Builder.
    --
    João Pavão

    On 2007/10/30, at 19:49, Alexander Cohen wrote:

    > Hi,
    >
    > I'm building an app on 10.5 but i'm targetting 10.4. The app runs
    > fine on 10.5. Whenever i try and run it o 10.4, i get a couple of
    > weird problems and then a crash. Maybe you guys can help me a bit.
    >
    > The first error is this one and i get it twice: ( this happens
    > before any awakeFromNib Calls )
    >
    > *** Assertion failure in -[NSMenu itemAtIndex:], Menus.subproj/
    > NSMenu.m:713
    > 2007-10-30 15:51:13.323 Design[2669] Exception raised during
    > posting of notification.  Ignored.  exception: Invalid parameter
    > not satisfying: (index >= 0) && (index < (_itemArray ?
    > CFArrayGetCount((CFArrayRef)_itemArray) : 0))
    >
    > The next one is an EXC_BAD_ACCESS. The stack in the crash log looks
    > like this:
    >
    > Exception:  EXC_BAD_ACCESS (0x0001)
    > Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000008
    >
    > Thread 0 Crashed:
    > 0  com.apple.AppKit               0x932f7e41 _NXSetCellParam + 153
    > 1  com.apple.AppKit               0x933da0f8 -[NSTableView
    > _drawContentsAtRow:column:clipRect:] + 653
    > 2  com.apple.AppKit               0x933d9789 -[NSOutlineView
    > _drawContentsAtRow:column:clipRect:] + 158
    > 3  com.apple.AppKit               0x933d902b -[NSTableView
    > drawRow:clipRect:] + 335
    > 4  com.apple.AppKit               0x933d8ed2 -[NSOutlineView
    > drawRow:clipRect:] + 240
    > 5  com.apple.AppKit               0x933d67ce -[NSTableView
    > drawRowIndexes:clipRect:] + 99
    > 6  com.apple.AppKit               0x933d56a4 -[NSTableView
    > drawRect:] + 2499
    > 7  com.apple.AppKit               0x933013b1 -[NSView
    > _drawRect:clip:] + 3228
    > 8  com.apple.AppKit               0x9330040b -[NSView
    > _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 614
    > ...
    >
    > Any ideas what might be going on?
    >
    > thanks
    >
    > AC
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today