The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > Developer > Omni Frameworks
FAQ Members List Calendar Search Today's Posts Mark Forums Read

A small bug Thread Tools Search this Thread Display Modes
Hi again -

I somehow triggered a small bug in OUIEditableFrame: the setAttributedText:newContent method bombs (in replaceCharactersInRange) when newContent is nil. My countermeasure is of course simple as you can see below. A simple bit of defensive programming ;-) Don't ask me how since it is simply pulling the Hello.rtf from the picker and just started acting bizarre, possibly a leak in another part of my code (which I am pursuing) ... Anyhoo, worth reporting. You also have the backtrace.


// Called by both -setAttributedText: and -setTextStorage:
- (void)setAttributedText:(NSAttributedString *)newContent
[self textStorage]; // Make sure our text storage has been created.

OUIEditableFrameMutationOptions options = OUIEditableFrameMutationOptionNotifyInputDelegate;
if (!beforeMutate(self, _cmd, options))
if (_content && newContent) {
int l = [_content length];

[_content replaceCharactersInRange:(NSRange){0, l} withAttributedString:newContent];

afterMutate(self, _cmd, options);

#0 -[OUIEditableFrame setAttributedText:] (self=0x11c61d30, _cmd=0x15f057) at /Volumes/Shiva/Users/Me/Development/iPhone/iPhone_Apps/Lux/Framework/OmniGroup/Frameworks/OmniUI/iPad/OUIEditableFrame.m:2270
#1 0x000f96d3 in -[OUIEditableFrame didMoveToWindow] (self=0x11c61d30, _cmd=0x393c238) at /Volumes/Shiva/Users/Me/Development/iPhone/iPhone_Apps/Lux/Framework/OmniGroup/Frameworks/OmniUI/iPad/OUIEditableFrame.m:1812
#2 0x00b375a7 in -[UIView(Internal) _didMoveFromWindow:toWindow:] ()
#3 0x00b37244 in -[UIView(Internal) _didMoveFromWindow:toWindow:] ()
#4 0x00b413c1 in -[UIScrollView _didMoveFromWindow:toWindow:] ()
#5 0x00b37244 in -[UIView(Internal) _didMoveFromWindow:toWindow:] ()
#6 0x00b33a00 in -[UIView(Hierarchy) _postMovedFromSuperview:] ()
#7 0x00b387b8 in -[UIView(Internal) _addSubview:positioned:relativeTo:] ()
#8 0x00b324bb in -[UIView(Hierarchy) addSubview:] ()
#9 0x0002f1f6 in -[CanvasToolbarViewController _prepareViewControllerForContainment:hidden:] (self=0xbaac940, _cmd=0x160f0e, soonToBeInnerViewController=0x11a60830, hidden=1 '\001') at /Volumes/Shiva/Users/Me/Development/iPhone/iPhone_Apps/Lux/Framework/ImageEditor/Canvas/CanvasToolbarViewController.m:137
#10 0x0002f4d4 in -[CanvasToolbarViewController setInnerViewController:animatingFromView:rect:toVi ew:rect:] (self=0xbaac940, _cmd=0x161033, viewController=0x11a60830, fromView=0xbaa0840, fromViewRect={origin = {x = 0, y = 0}, size = {width = 0, height = 0}}, toView=0x11c61d30, toViewRect={origin = {x = 0, y = 0}, size = {width = 0, height = 0}}) at /Volumes/Shiva/Users/Me/Development/iPhone/iPhone_Apps/Lux/Framework/ImageEditor/Canvas/CanvasToolbarViewController.m:197
#11 0x000301b9 in -[CanvasToolbarViewController setInnerViewController:animatingView:toView:] (self=0xbaac940, _cmd=0x15e8e4, viewController=0x11a60830, fromView=0xbaa0840, toView=0x11c61d30) at /Volumes/Shiva/Users/Me/Development/iPhone/iPhone_Apps/Lux/Framework/ImageEditor/Canvas/CanvasToolbarViewController.m:303
#12 0x00017874 in -[CanvasSingleAppController setupInnerViewControllerForDocument:animated:] (self=0xbaa1e20, _cmd=0x15e957, thisDocument=0x11a5ef10, anim=1 '\001') at /Volumes/Shiva/Users/Me/Development/iPhone/iPhone_Apps/Lux/Framework/ImageEditor/Canvas/CanvasSingleAppController.m:701
#13 0x00017eba in -[CanvasSingleAppController _mainThread_finishedLoadingDocument:] (self=0xbaa1e20, _cmd=0x15e83a, result=0x11a5ef10) at /Volumes/Shiva/Users/Me/Development/iPhone/iPhone_Apps/Lux/Framework/ImageEditor/Canvas/CanvasSingleAppController.m:785
#14 0x026feea2 in -[NSObject performSelector:withObject:] ()
#15 0x0140b98f in __NSThreadPerformPerform ()
#17 0x02634bf3 in __CFRunLoopDoSources0 ()
#18 0x026344d4 in __CFRunLoopRun ()
#19 0x02633e34 in CFRunLoopRunSpecific ()
#20 0x02633d4b in CFRunLoopRunInMode ()
#21 0x02c439dd in GSEventRunModal ()
#22 0x02c43aa2 in GSEventRun ()
#23 0x00afba1b in UIApplicationMain ()
#24 0x00002c6d in main (argc=1, argv=0xbffff460) at /Volumes/Shiva/Users/Me/Development/iPhone/iPhone_Apps/Lux/Framework/ImageEditor/Canvas/main.m:29

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Small caps sphaera OmniOutliner 3 for Mac 0 2009-10-25 11:10 AM
Two small bugs in 5.7 manu_lazard OmniWeb Bug Reports 7 2008-04-15 11:54 AM
a very small UI bug andreas_g OmniWeb Bug Reports 1 2006-05-18 09:52 AM

All times are GMT -8. The time now is 02:57 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.