What is wrong with this program?

Joined
Mar 27, 2007
Messages
3
Reaction score
1
Points
3
Your Mac's Specs
MacBook 2Ghz Core2Duo
This program loads in a file via a URL (im doing this so i dont have to host the file for now), gets its html and converts it to a string. I then try and display the string and xcode brings up the bloody debugger.

Ive also tried performing other things on the html string, including using range to find substrings, none of them seem to liek the string that is created.

Code:
#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    NSData *data = [NSData dataWithContentsOfFile:@"/Users/Jayson/images.html"];
	
	[data writeToFile:@"/Users/Jayson/html.html" atomically:YES];
	
    NSString *theHTML = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
	
    NSLog(theHTML);
	
    [theHTML release];
    [pool release];

    return 0;

Any help would be grand. Thanks.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top