Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ja Di ksw

macrumors 65816
Original poster
Apr 9, 2003
1,313
8
Hi everyone,
Is there a simple way to read/store the words from a pdf in order (for example, putting them in a NSMutableArray?) so each word can be retrieved later?
Thanks!
 
Hi everyone,
Is there a simple way to read/store the words from a pdf in order (for example, putting them in a NSMutableArray?) so each word can be retrieved later?
Thanks!

-Convert the PDF to an NSString
-Use componentsSeparatedByString to create an array of words
-Use sortedArrayUsingSelector:mad:selector(caseInsensitiveCompare) to sort the array.

You'll have tons of duplicate words. You might want to remove those. To do that you could convert the array into an NSOrderedSet or NSMutableOrderedSet and sort that.
 
Thanks for all the help (and sorry about my late reply, been insanely busy). I'll give it a go this week and see how it works.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.