BWSplitView "autosaves" invalid size which causes subsequent app crash
Reported by Rainer | March 17th, 2010 @ 12:21 AM
I often move between multiple monitor setups on my macbook, putting it to sleep, disconnect a monitor, power it back on. Sometimes this causes my app window to get an invalid size (I would be very grateful for advice here). My project has BWSplitViews in them, some with "Autosave" turned on. It seems that BWSplitView does save invalid sizes when being quit. After that I cannot restart the application anymore due to a crash, see logs.
<BWSplitView: 0x100326c00>: the delegate <BWSplitView: 0x100326c00> was sent -splitView:resizeSubviewsWithOldSize: and left the subview frames in an inconsistent state:
2010-03-17 05:08:39.633 Time Tracker[77426:a0f] Split view bounds: {{0, 0}, {157, 0}}
2010-03-17 05:08:39.634 Time Tracker[77426:a0f] Subview frame: {{0, 0}, {157, nan}}
2010-03-17 05:08:39.634 Time Tracker[77426:a0f] Subview frame: {{0, nan}, {157, nan}}
2010-03-17 05:08:39.635 Time Tracker[77426:a0f] The outer edges of the subview frames are supposed to line up with the split view's bounds' edges. NSSplitView is working around the problem, perhaps at the cost of more redrawing. (This message is only logged once per NSSplitView.)
2010-03-17 05:08:39.699 Time Tracker[77426:a0f] *** Assertion failure in -[NSView initWithFrame:], /SourceCache/AppKit/AppKit-1038.25/AppKit.subproj/NSView.m:1289
2010-03-17 05:08:39.700 Time Tracker[77426:a0f] An uncaught exception was raised
2010-03-17 05:08:39.701 Time Tracker[77426:a0f] Frame containing non-finite values {{0, nan}, {737, nan}} passed to [NSView initWithFrame:]
2010-03-17 05:08:39.704 Time Tracker[77426:a0f] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Frame containing non-finite values {{0, nan}, {737, nan}} passed to [NSView initWithFrame:]'
Call Stack
*** Call stack at first throw:
(
0 CoreFoundation 0x00007fff846ad444 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x00007fff805d00f3 objc_exception_throw + 45
2 CoreFoundation 0x00007fff846ad267 +[NSException raise:format:arguments:] + 103
3 Foundation 0x00007fff8511ed66 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 AppKit 0x00007fff86b97d05 -[NSView initWithFrame:] + 411
5 AppKit 0x00007fff86c2f0e4 -[NSCustomView nibInstantiate] + 646
6 AppKit 0x00007fff86b870d4 -[NSIBObjectData instantiateObject:] + 259
7 AppKit 0x00007fff86b864be -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 336
8 AppKit 0x00007fff86b84b49 loadNib + 226
9 AppKit 0x00007fff86b84059 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 248
10 AppKit 0x00007fff86b83e91 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 326
11 AppKit 0x00007fff86b81413 NSApplicationMain + 279
12 Time Tracker 0x0000000100001cbf main + 33
13 Time Tracker 0x0000000100001c7c start + 52
IMHO BWSplitView should not save invalid values but remember the last known good size.
I tried to fix this by defining min and max sizes (after the fact) but I still cant get my app to load anymore (I guess I need to find out where the "current" sizes are stored).
No comments found
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
BWToolkit is an Interface Builder plugin that contains commonly used UI elements and other objects designed to simplify Mac development.