• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSAttributedString attribute:atIndex:effectiveRange crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSAttributedString attribute:atIndex:effectiveRange crash (From: Greg Hoover <email@hidden>)
 >Re: NSAttributedString attribute:atIndex:effectiveRange crash (From: Dave Fernandes <email@hidden>)

  • Prev by Date: Re: NSAttributedString attribute:atIndex:effectiveRange crash
  • Next by Date: Re: Validation error in a relationship? (in coredata)
  • Previous by thread: Re: NSAttributedString attribute:atIndex:effectiveRange crash
  • Next by thread: Re: Cocoa-dev Digest, Vol 4, Issue 1017
  • Index(es):
    • Date
    • Thread