翻看該方法的參考文檔,蘋果對retainCount方法的描述以下:api
retainCountide
Do not use this method. (required)ui
The receiver’s reference count.this
This method is of no value in debugging memory management issues.Because any number of framework objects may have retained an object in order to hold references to it, while at the same time autorelease pools may be holding any number of deferred releases on an object, it is very unlikely that you can get useful information from this method.debug
在該方法的特別說明部分蘋果解釋道:調試
調試內存管理問題時調用該方法是沒有任何意義的。由於保不許Cocoa framework中的其它對象會retain咱們的目標對象,還有對於autorelease pool中的延遲釋放對象,調用這個方法也得不到有用的信息。坑爹的蘋果,這方法壓根就不是留給咱們用的!總之之後你們注意之後不要使用retainCount方法,只要遵照內存管理的規則就夠了。orm