Problem with NSData to NSString to NSData
Problem with NSData to NSString to NSData
- Subject: Problem with NSData to NSString to NSData
- From: Joel Norvell <email@hidden>
- Date: Tue, 28 Oct 2008 21:43:20 -0700 (PDT)
Dear Cocoa-dev People,
I have a file with some metadata prepended to a pdf.
I want to strip the metadata off and display the pdf.
I was trying to do this:
- (void) loadFromPath: (NSString *) path
{
NSData *myData = [NSData dataWithContentsOfFile:path];
NSString *myStr = [[NSString alloc] initWithData:pdfData
encoding:NSASCIIStringEncoding];
// I strip off the metadata here, leaving the pdfStr.
// Nothing I've tried here has worked:
NSData * myNewData = [pdfStr dataUsingEncoding: ???];
// Display the pdf here...
}
How can I get this to work?
Sincerely,
Joel Norvell
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden