1

I need to generate a list of words to display on a view. How would I go about doing that. I generated a string of random characters with cocoa, but I know I'm supposed to use a different function for the iPhone.

Can someone please upload a snippet of code that would do this?

tshepang
  • 12,111
  • 21
  • 91
  • 136
  • What kind of words? Just random characters or actual dictionary words? – EmilioPelaez Jul 12 '11 at 15:33
  • I need to generate random wikipedia pages... I know this is a weird question but hopefully you can answer it. –  Jul 12 '11 at 15:34
  • If you need random wikipedia pages, you can use wikipedia's random feature, that way you make sure the word exists, and an article about it too. – EmilioPelaez Jul 12 '11 at 15:38

2 Answers2

3

You can find a rather basic Lorem Ipsum class here: https://github.com/dav/Objective-C-Lorem-Ipsum-Generator. Just add it to your project and you're done.

SpacyRicochet
  • 2,269
  • 2
  • 24
  • 39
1

I know this isn't really an answer to your question, but if you're after random wikipedia pages, I'd consider using their API method to query for random pages: http://en.wikipedia.org/w/api.php?action=query&list=random&rnnamespace=0&rnlimit=4

As for random words, assuming you want real words, you're going to need some kind of dictionary to pull randomly from. For this I'd also consider looking for an API. Another SO post ( How to pick a random english word from a list ) provided this url:

http://dictionary-thesaurus.com/wordlists/Nouns%285,449%29.txt

Good luck

Community
  • 1
  • 1
Chazbot
  • 1,890
  • 1
  • 13
  • 23