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

moonman239

Cancelled
Original poster
Mar 27, 2009
1,541
32
I posted in another thread about how I am unable to reinitialize a voice recognizer. I might have figured out why. I'm thinking that I need to know how to assign a new instance to a variable that previously had one. I'm using ARC, so I can't use dealloc, and setting the variable to nil does not work either.
 
If you weren't using ARC, you'd use release, not dealloc.


Write a test case.

Instead of SKRecognizer, make instances of a class like NSMutableArray. That's a class with well-known and well-described behavior. You can write all the necessary tests, NSLogs, etc. using NSMutableArray (or indeed any class with well-known creation behavior). This will show you how a well-known class works. Then you can change one line to instantiate SKRecognizer, and compare the new results with the results from NSMutableArray.


Post actual code.

You mention using variables, and using ARC, but ARC has no special meaning for certain kinds of variables. The kind of variable makes a big difference: is it static? Global? Instance variable? Local variable? We can guess, or we might look at your other thread, where you may or may not have posted real code. Or you can write a test case, run it, then post the actual code with any questions you might have.

If you encounter a problem when writing your test case, post the code you've written to that point, and ask a specific question about it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.