Re: NSAttributedString attribute:atIndex:effectiveRange crash
Re: NSAttributedString attribute:atIndex:effectiveRange crash
- Subject: Re: NSAttributedString attribute:atIndex:effectiveRange crash
- From: Greg Hoover <email@hidden>
- Date: Tue, 16 Oct 2007 15:21:36 -0700
Thank you thank you thank you!
Greg
On Oct 16, 2007, at 3:16 PM, Dave Fernandes wrote:
Your range pointer is not pointing to a valid structure. Try:
On Oct 16, 2007, at 6:02 PM, Greg Hoover wrote:
NSRangePointer range;
NSRange range;
id attribute = nil;
if (charIndex < [textStorage length])
attribute = [textStorage attribute: NSLinkAttributeName
atIndex: charIndex
effectiveRange: range];
effectiveRange: &range];
NSURL *url = nil;
if (attribute)
url = [attribute copy];
[textStorage release];
The problem is that half the time it crashes with EXC_BAD_ACCESS
and this stack trace:
#0 0x927fff1e in blockForLocation
#1 0x927ffe9a in -[NSRLEArray objectAtIndex:effectiveRange:]
#2 0x928003fc in -[NSConcreteMutableAttributedString
attribute:atIndex:effectiveRange:]
#3 0x93377c7f in -[NSConcreteTextStorage
attribute:atIndex:effectiveRange:]
I can't seem to find any info related to blockForLocation or
figure out what the problem is. Any help would be much appreciated.
Thanks in advance,
Greg
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
40utoronto.ca
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden