Home > Uncategorized > MonoTouch and null

MonoTouch and null

October 6th, 2009 Rev Leave a comment Go to comments

Remember.  Setting variables to null doesn’t necessarily mean null. I had an Enum variable that I would set once.  So I’d declare it:

Values MyValue = null;

Then, in the natural order of things I’d check to see if it was null and assign it the current value if it was.  But, oddly enough it was never null. I forgot in obj-c (or c in general) unless you specifically set a pointer it’s pointing at god knows what.  So I added a None value to my enum and made sure to set it up as such:

Values MyValue = Values.None;

  1. No comments yet.
  1. No trackbacks yet.

Powered by WP Hashcash