Re: Crashes while reordering columns in a NSTableView

2009-07-21 Thread Tim Schmidt


On Jul 20, 2009, at 11:18 PM, Alexander Spohr wrote:



Am 21.07.2009 um 00:38 schrieb Tim Schmidt:


Is there any way to work around this


Yes: find your memory bug.
EXC_BAD_ACCESS almost always is a memory bug in your code.

atze



Obviously CG's bitblock transfers access unallocated memory in this  
case. If I accidently free said memory it completely eludes me where  
this might happen (I am pretty confident I don't release any of my  
model/controller objects unintentionally (I tried running with all the  
usual mallocdebug options as well as NSZombies). Furthermore all NIBs  
are managed by NSViewController subclasses. Can anybody point me to  
some advanced guides on NSTableView (beyond the class reference and  
tables guide).

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Crashes while reordering columns in a NSTableView

2009-07-20 Thread Tim Schmidt

Hi all,

I am having a lot of problems with NSTableView crashing my  
application, when reordering (dragging) columns.


The crashes either take down the whole app and all I get is the  
following message:

Error: __CGPixelAccessDataInitialize: vm_copy failed: status 1.

or, it manages to break into the debugger with stack-traces like the  
following (nearly all crashes happen in CGBlt_copyBytes with an  
EXC_BAD_ACCESS signal.


Thread 1:

#0  0x90ec0fb9 in CGBlt_copyBytes ()
#1  0x90ef7e70 in __CGPixelAccessDataInitialize ()
#2  0x9144b010 in __CGPixelAccessAccessBitmapData ()
#3  0x90f2eab8 in __CGPixelAccessCreateImageFromRect ()
#4  0x90f2e916 in CGPixelAccessCreateImageFromRect ()
#5  0x90720ec5 in -[NSCGImageRep initWithFocusedViewRect:] ()
#6  0x906544cc in -[NSTableView  
_captureReorderResizeColumnImageCaches] ()

#7  0x90653261 in -[NSTableView drawRect:] ()
#8  0x9072c75a in -[NSView(NSInternal)  
_recursive:displayRectIgnoringOpacity:inContext:topView:] ()

#9  0x90cc7f08 in -[NSView(NSLayerKitGlue) drawLayer:inContext:] ()
#10 0x96c7bf00 in -[CALayer drawInContext:] ()
#11 0x96e7036c in tiled_layer_render ()
#12 0x96e2a267 in source_perform ()
#13 0x9737b595 in CFRunLoopRunSpecific ()
#14 0x9737bc78 in CFRunLoopRunInMode ()
#15 0x939b928c in RunCurrentEventLoopInMode ()
#16 0x939b8fde in ReceiveNextEventCommon ()
#17 0x939b8f19 in BlockUntilNextEventMatchingListInMode ()
#18 0x9061ad0d in _DPSNextEvent ()
#19 0x9061a5c0 in -[NSApplication  
nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#20 0x90b91d59 in -[NSTableHeaderView  
_lastDraggedOrUpEventFollowing:canceled:] ()

#21 0x90b92426 in -[NSTableHeaderView _reorderColumn:withEvent:] ()
#22 0x908d6c63 in -[NSTableHeaderView mouseDown:] ()
#23 0x906e9133 in -[NSWindow sendEvent:] ()
#24 0x906b5cd9 in -[NSApplication sendEvent:] ()
#25 0x9061362f in -[NSApplication run] ()
#26 0x905e0834 in NSApplicationMain ()
#27 0x2af2 in main (argc=1, argv=0xb640) at X/main.m: 
13



Thread 2:
#0  0x9368446e in __semwait_signal ()
#1  0x936af3e6 in _pthread_cond_wait ()
#2  0x936aedcd in pthread_cond_wait$UNIX2003 ()
#3  0x931d9329 in CVDisplayLink::runIOThread ()
#4  0x936ae155 in _pthread_start ()
#5  0x936ae012 in thread_start ()


Thread 3:
#0  0x9368446e in __semwait_signal ()
#1  0x936af3e6 in _pthread_cond_wait ()
#2  0x936aedcd in pthread_cond_wait$UNIX2003 ()
#3  0x964beb32 in glvmDoWork ()
#4  0x936ae155 in _pthread_start ()
#5  0x936ae012 in thread_start ()


Reordering columns also leads to strange artifacts (it works for a few  
seconds before it crashes...). Said table is programmatically  
manipulated at runtime (i.e. columns are removed | added). The  
superview uses CG.  Xcode also occasionally dumps the following to  
console if gdb manages to break:

Xcode could not locate source file: cpu_capabilities.h (line: 246)

Is there any way to work around this, as Column reordering is a pretty  
important feature for this tool


Very best regards,
Tim Schmidt



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Basic KVO question

2009-07-01 Thread Tim Schmidt

Hi everyone,

first of all, thanks for reading this. I have a basic KVO question. In  
one of my NIBs I have an NSArrayController and a NSSegmentedControl  
with add/remove segments for the array of said controller. Now I want  
to enable the remove-segment according to the controllers canRemove  
message. I've set the NIB's viewcontroller as an observer of the  
arraycontroller's canobserve property as follows:


[statesController addObserver:self forKeyPath:@canRemove  
options:NSKeyValueObservingOptionNew  
context:PED_CAN_REMOVE_STATE_CONTEXT];



and receive the obligatory change notifications alright, but the  
change dictionary always contains an NSNull instance for the  
NSKeyValueChangeNewKey instead of the NSNumber bool subclass I would  
expect. Am I doing something wrong here?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com