• 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
NSMutableAttributedString initWithHTML / initWithData trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSMutableAttributedString initWithHTML / initWithData trouble


  • Subject: NSMutableAttributedString initWithHTML / initWithData trouble
  • From: Greg Hoover <email@hidden>
  • Date: Fri, 13 Jul 2007 23:08:55 -0700

I have been using the initWithHTML function to convert from an already loaded HTML string, but some of the time run into this crash. I tried to take the initWithHTML function out and went straight for initWithData (document type specified as HTML -- as shown) and still get the following backtrace. Anyone encountered this? Here's how I'm calling it:

NSString *title = [newsItem objectForKey: @"title"];
if (!title)
	continue;

NSData *titleData = [title dataUsingEncoding: [title fastestEncoding]];
if (!titleData)
	continue;

NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithData: titleData
options: [NSDictionary dictionaryWithObject: NSHTMLTextDocumentType
forKey: NSDocumentTypeDocumentOption]
documentAttributes: nil
error: NULL];



#0 0x900028ba in malloc
#1 0x00002420 in <function called from gdb>
#2 0x9537f8c6 in KHTMLPart::settings
#3 0x9537f862 in -[WebCoreSettings _updateAllViews]
#4 0x9537f3ca in -[WebCoreSettings setCursiveFontFamily:]
#5 0x951d9650 in -[WebView(WebPrivate) _updateWebCoreSettingsFromPreferences:]
#6 0x951d7530 in -[WebView _commonInitializationWithFrameName:groupName:]
#7 0x951d713e in -[WebView initWithFrame:frameName:groupName:]
#8 0x9520a406 in -[WebView initWithFrame:]
#9 0x934f44d6 in -[NSHTMLReader _loadUsingWebKit]
#10 0x934f40d5 in -[NSHTMLReader attributedString]
#11 0x934f3269 in _NSReadAttributedStringFromURLOrData
#12 0x934f0ec7 in -[NSAttributedString (NSAttributedStringKitAdditions) initWithData:options:documentAttributes:error:]
#13 0x002dffb0 in +[MSNewsServices attributedStringForNews:withDescriptions:maxEntries:] at MSNewsServices.m:420



Any insight would be much appreciated.

Greg

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: NSMutableAttributedString initWithHTML / initWithData trouble
      • From: Martin Wierschin <email@hidden>
  • Prev by Date: Software Update APi in Cocoa
  • Next by Date: Re: Modified date in CoreData model
  • Previous by thread: Re: Software Update APi in Cocoa
  • Next by thread: Re: NSMutableAttributedString initWithHTML / initWithData trouble
  • Index(es):
    • Date
    • Thread