• 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: A text view finishes getting images in HTML
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A text view finishes getting images in HTML


  • Subject: Re: A text view finishes getting images in HTML
  • From: Scott Anguish <email@hidden>
  • Date: Fri, 28 Jun 2002 02:33:37 -0400

On Thursday, June 27, 2002, at 10:05 AM, Erik J. Barzeski wrote:

Hi,

I've got a text view through which I display either HTML or plain text.
Unfortunately, if an image in an HTML view isn't in the cache, the only way
to display the image is to wait for it to download and somehow refresh the
view.

What would be nifty is a "textViewDidFinishLoadingAllMyDarnPictures"
notification or something

Actually, it exists...

Each time your document is changed as it loads, it gets a HTMLDocumentChangedNotification which has some useful information in the key as far as what happened.

I wrote an article on this just after this was added (way back in the Rhapsody days).. I'm not sure where it disappeared to.. but it walked you though building an app in like 12 lines that could browse the web.

The notifications are of course unofficial, and unsupported...

You can find out all sorts of cool stuff by using an app like this

#import "AppDelegate.h"

@implementation AppDelegate

- (void)awakeFromNib
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(gotNotification:) name:NULL object:NULL];

}

- (IBAction)loadURL:(id)sender
{
NSAttributedString *theStr;
NSURL *theURL = [NSURL URLWithString:@"http://www.stepwise.com/index.html";];

theStr=[[NSMutableAttributedString alloc] initWithHTML:[theURL resourceDataUsingCache:NO]
baseURL:theURL
documentAttributes:NULL];
[[theText textStorage] setAttributedString:theStr];
}


- (void)gotNotification:(NSNotification *)notification
{
if ([[notification name] hasPrefix:@"HTML"]) {
NSLog(@"[notification object] %@",[notification object]);
NSLog(@"[notification name] %@",[notification name]);
NSLog(@"[notification userInfo] %@",[notification userInfo]);
}
}

@end
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >A text view finishes getting images in HTML (From: "Erik J. Barzeski" <email@hidden>)

  • Prev by Date: Re: What's STILL wrong with "symbol" fonts?
  • Next by Date: Implementing PBX style exception handling.
  • Previous by thread: Re: Calling AppleScript Methods from Obj-C
  • Next by thread: Learning Cocoa with F-Script
  • Index(es):
    • Date
    • Thread