|
-
January 26th, 2010, 08:31 PM
#2
Re: wierd allocation
No, it is not static at all, it is by definition an instance variable, i.e., each instance of a class owns a separate copy. You are confused about when it is allocated, and it is not bad at all; you should do that when you need a variable to hang around for the lifetime of an object. What do you think is going on when you create a backing field for a property? You are creating an instance variable and two methods, one to set it and one to return it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|