tags:

views:

62

answers:

2

How can i get favicon image from its websire url using xcode....

Is there any special api for this?

Can anyone help me?..... Thanks in advance..

+1  A: 

The favicon is just a file or number of files that live in the root of the website. The most common is favicon.ico but there may be favicon.png or others. So for website X just download http://x/favicon.ico

Matt Howells
+1  A: 
NSURL *url = [NSURL URLWithString:@"http://www.google.com/favicon.ico"];
NSData *data = [[NSData alloc]initWithContentsOfURL:url];
UIImage *image = [[UIImage alloc]initWithData:data];

Now image contains the favicon.

marcc
To be complete you'd probably need to look at the link tags "shortcut icon" and "icon" for better favicons supported by Firefox and i think recent IEs.
Mark Nold