Deprecated: Assigning the return value of new by reference is deprecated in /home/bluestat/public_html/source/index.php on line 477
Scrabbalize - Commitdiff - ViewGit - Blue Static

Found a better way to remove all the objects in the wordlist ivar

Robert Sesek [2007-12-17 21:27]
Found a better way to remove all the objects in the wordlist ivar

* Source/AppController.m:
([AppController findWords:]): Improved the way we remove all the objects to clear the NSArrayController
diff --git a/Source/AppController.m b/Source/AppController.m
index 7b59c85..55fe550 100644
--- a/Source/AppController.m
+++ b/Source/AppController.m
@@ -39,11 +39,7 @@
  */
 - (IBAction)findWords:(id)sender
 {
-	// remove the wordlist
-	for (Word *word in [wordlist arrangedObjects])
-	{
-		[wordlist removeObject:word];
-	}
+	[wordlist removeObjects:[wordlist arrangedObjects]];

 	NSString *tileString = [tilesField stringValue];
 	int tileCount = [tileString length];