MsFinder helps you find memory s in your iOS apps at develop time. It can automatically find s in UIView and UIViewController objects, present an alert with the object in its View-ViewController stack when s happening. More over, it can try to find a retain cycle for the object using FBRetainCycleDetector. Besides finding s in UIView and UIViewController objects, developers can extend it to find s in other kinds of objects.
QQ group: 482121244
pod 'MsFinder'
MsFinder comes into effect after pod install
, there is no need to add any code nor to import any header file.
WARNING: FBRetainCycleDetector is removed from the podspec due to Facebook's BSD-plus-Patents license. If you want to use FBRetainCycleDetector to find retain cycle, add pod 'FBRetainCycleDetector'
to your project's Podfile and turn the macro MEMORY_S_FINDER_RETAIN_CYCLE_ENABLED
on in MsFinder.h
.
MsFinder can automatically find s in UIView and UIViewController objects. When s happening, it will present an alert with the object in its View-ViewController stack.
Memory
(
MyTableViewController,
UITableView,
UITableViewWrapperView,
MyTableViewCell
)
For the above example, we are sure that objects of MyTableViewController
, UITableView
, UITableViewWrapperView
are deallocated successfully, but not the objects of MyTableViewCell
.
If your class is designed as singleton or for some reason objects of your class should not be dealloced, override - (BOOL)willDealloc
in your class by returning NO.
- (BOOL)willDealloc {
return NO;
}
MsFinder finds s in UIView and UIViewController objects by default. However, you can extend it to find s in the whole object graph rooted at a UIViewController object.
- (BOOL)willDealloc {
if (![super willDealloc]) {
return NO;
}
MLCheck(self.viewModel);
return YES;
}