Number of Instances of Class

Cheetah

Well-known member
Joined
Oct 12, 2006
Messages
232
Programming Experience
Beginner
Hi there,

Is there anyway i can see the number of instances i have of a certain class at debug time. I think i may have two, when i only want one.

Thanks.
 
No, there isn't. But you can track any usage by using context menu on class name and select "Find all references". (same as menu Edit, Find Symbol, exact match whole word)
 
You can write code within a class to track the number of instances created. Also, you can simply place a breakpoint on the constructor declaration and you'll break each time you create an instance. This all assumes that it's your own class of course.
 
Back
Top