New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

What is wrong with this program?


Post Reply New Thread Subscribe

 
Thread Tools
jaysonturner

 
Member Since: Mar 27, 2007
Posts: 3
jaysonturner is on a distinguished road
Mac Specs: MacBook 2Ghz Core2Duo

jaysonturner is offline
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.
QUOTE Thanks

Post Reply New Thread Subscribe


« Getting PHP to work on Leopard | Darwin x86, newbie needs help! »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Apple to test retail program at Best Buy schweb Apple Rumors and Reports 6 04-12-2004 01:43 PM
Apple Computer Recycling Program schweb Apple Rumors and Reports 1 03-05-2003 12:03 PM

All times are GMT -4. The time now is 12:52 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?