Replacing bad words in a string in Objective-C
I have a game with a public highscore list where I allow layers to enter their name (or anything unto 12 characters). I am trying to create a couple of functions to filter out bad words from a list of bad words I have in a text file. I have two methods: One to read in the text file: -(void) getTheBadWordsAndSaveForLater { badWordsFilePath = [[NSBundle mainBundle] pathForResource:@"badwords" ofType:@"txt"]; badWordFile = [[NSString alloc] initWithContentsOfFile:badWordsFilePath encoding:NSUTF8StringEncoding error:nil]; badwords =[[NSArray alloc] initWithContentsOfFile:badWordFile]; badwords =