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

Re: Tiger Decoding problem


  • Subject: Re: Tiger Decoding problem
  • From: Nicholas Crosbie <email@hidden>
  • Date: Mon, 30 May 2005 11:54:00 +1000 (EST)

Thanks Malcolm,

That makes sense.  But how do I include the error
argument?

My code now reads like this.


	// DECODE TO HUMAN READABLE FORM

#import <Cocoa/Cocoa.h>

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

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

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

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

	[pool release];
	return 0;

}



****this builds with status 0 but gives the following
warning:


/Users/nicholas/test2/test2.m:14: warning: passing
argument 3 of
'stringWithContentsOfFile:encoding:error:' from
incompatible pointer type


Also, NSLog does not print to the Run Log the contents
of my
decoded file. Why?

NC


--- Frederick Cheung <email@hidden> wrote:
>
> On 30 May 2005, at 01:24, Nicholas Crosbie wrote:
>
> > Hi,
> >
> > Newbie problems.  I'm trying to read in and
> convert
> >
> snip
> > What's wrong with my code (see below)?
> >
> [snip]
> >         NSString *contents = [NSString
> > stringWithContentsOfFile:path NSStringEncoding
> > encoding:NSUTF8StringEncoding];
> >
> >
> For some reason you've typed NSStringEncoding where
> there should be
> nothing (ie [NSString stringWithContentsOfFile:path
>
> encoding:NSUTF8StringEncoding];)
>
> Fred
>

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: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Tiger Decoding problem
  • Next by Date: NSTextView synchronization ...
  • Previous by thread: Re: Tiger Decoding problem
  • Next by thread: Re: Tiger Decoding problem
  • Index(es):
    • Date
    • Thread