Reading a ".puz" file

Member
Posts: 65
Joined: 2008.09
Post: #1
Hey everyone,
I'm working on a crossword app for iOS that has to read in files that are of the ".puz" file format.
After reading the wiki http://code.google.com/p/puz/wiki/FileFormat I realized that it may be easier for me to load the file in as plain text then parse for the NULL character and assign each part as an NSString in an array using:
Code:
NSArray *dataChunks = [puzzleData componentsSeparatedByString:@"\0"];
Where puzzleData is the entire file as an NSString. The problem (ASFAIK) is that the NSString holds the right data (at least it looks that way in the debugger), but when I create the components for the array it comes out as garbage. I'm a bit confused because the amount of objects in the array looks right. I'm given 95 objects and it looks like there are that many NULL characters in the file. I think it's a conversion issue, but I just don't understand the nature of the problem.

Is there a better way of doing this?

At the end of the day I would just like to be able to read the files in a string format.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Problem with reading bundle text file momostu 4 3,261 Feb 24, 2010 02:05 PM
Last Post: momostu