If I am reading this correctly, it has crashed trying to send a dealloc message to a segmented control (presumably the one I have on my navigation bar).
The relevant part of the segment control creation is:
I am figuring either I shouldn't release (or rather should use autorelease) the components I use to build the segmented control in the creation part, or I shouldn't be setting it to nil in my ViewDidUnload routine. The crash is very elusive, so doing a "fix" and then testing it doesn't really work. I was hoping someone would see what I am doing wrong.
Generally, whenever you release your ownership, you should also clear your reference.
So, two options, if you don't need any reference to your object after it has been created and added to the UI, you can just release and set the reference to nil. You don't need to do anything in the load's tearing down, or in the dealloc since you already released your ownership. In this case, you actually don't need an instance variable to reference it; a local variable will do. The UI still maintains ownership over the object (when you added it to as a subview) and will maintain it as long a the UI is shown.
On the other hand, in case you do need to hold a reference to the object throughout the UI's lifetime (for example to be able to update it), then the instance variable is correct. In this case, however, you should not release your ownership in the viewDidLoad and instead do that in the tearing down (and also set the reference to nil) and in the dealloc.
Since you are releasing your ownership and setting the reference to nil in the tearing down process, the dealloc one will do nothing; but it's still needed in case the tearing down process is skipped (allowed in iOS); in this case, the dealloc will release your ownership.