• 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
Tiger Decoding problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tiger Decoding problem


  • Subject: Tiger Decoding problem
  • From: Nicholas Crosbie <email@hidden>
  • Date: Mon, 30 May 2005 10:24:59 +1000 (EST)

Hi,

Newbie problems.  I'm trying to read in and convert
binary
data.  The (new in Tiger) appropriate code seems to be
either......

+ (id)stringWithContentsOfFile:(NSString *)path
encoding:(NSStringEncoding)enc error:(NSError **)error
OR
+ (id)stringWithContentsOfFile:(NSString *)path
usedEncoding:(NSStringEncoding *)enc error:(NSError
**)error

I've tried to test these function in a Foundation Tool
project.

What's wrong with my code (see below)?

Building always fails at the NSString *contents line.
Do I have to initialize an
NSError object?  Help with the correct syntax would be
much appreciated.  Note that I'm not
building a new class....just trying to test
stringWithContentsOfFile........


	// DECODE TO HUMAN READABLE FORM

#import <Cocoa/Cocoa.h>

int main (int argc, char *argv[])
{
	NSAutoreleasePool  *pool = [NSAutoreleasePool new];
	NSString *path = [NSString new];


		path = @"/Users/nicholas/test2/fileB";

		NSString *contents = [NSString
stringWithContentsOfFile:path NSStringEncoding
encoding:NSUTF8StringEncoding];


	NSLog(@"contents %@",contents);

	[pool release];
	return 0;

}

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Tiger Decoding problem
      • From: Dustin Voss <email@hidden>
    • Re: Tiger Decoding problem
      • From: Ondra Cada <email@hidden>
    • Re: Tiger Decoding problem
      • From: Frederick Cheung <email@hidden>
  • Prev by Date: Re: Tiger development Panther deployment
  • Next by Date: Re: Tiger Decoding problem
  • Previous by thread: Difficulty adding and removing objects from "nested" NSArrayControllers
  • Next by thread: Re: Tiger Decoding problem
  • Index(es):
    • Date
    • Thread