All you should have to do is something like this: NSData *dataFromString = NSString stringWithFormat:@"%@", yourString dataUsingEncoding:NSASCIIStringEncoding then to extract the data: NSString *stringFromData = NSString alloc initWithData:dataFromString encoding:NSASCIIStringEncoding.
All you should have to do is something like this: NSData *dataFromString = NSString stringWithFormat:@"%@", yourString dataUsingEncoding:NSASCIIStringEncoding; then to extract the data: NSString *stringFromData = NSString alloc initWithData:dataFromString encoding:NSASCIIStringEncoding.
Unfortunatly, and I'm not sure why, this doesn't seem to work. I get a very short string, for example "bplist00Ô" as my output. – kodai May 23 at 22:28 That's definitely odd.
I'm going to test a couple things as alternatives and get back to you with (hopefully) something that does work – slev May 23 at 22:30 What I posted did the trick for me, though I noticed that if you decode the data into a string from a different method than when you encode it, you get faults. This can be fixed by adding retain to the dataFromString instance after you encode your string. Hopefully this fixes the issue you were having.
If not, there is another possible route to take if necessary – slev May 23 at 22:44.
I'm trying to convert NSData generated from NSKeyedArchiver to an NSString so that I can pass it around and eventually convert it back to NSData. I have to pass this as a string (I'm using three20 URL passing). I've gone through various encodings, UTF8, ASCII, etc. and can't get anything to work.
NSKeyedArchiver says that the NSData is formated as a property list: NSPropertyListBinaryFormat_v1_0. Does anyone have any idea how I can convert this NSData to a String and back again? Size of the string isn't an issue.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.