iphone - memory leak in singleton class -


I am new to iPhone development. I am developing an application in which I am using single tone class. When I am creating the object of a single tone class, then it is giving me leakage of memory when analyzing my code. This is giving the message as "possible leakage of the object" and "allocated object is not referenced later". But I am using that item in my code, the following is my code where I created a single tone class object
  - (zero) viewDidoad {[Super Viewedload]; NSLog (@ "Inside View"); Self.navigationController.navigationBar.topItem.title = @ "Menu List"; UIImage * image = [UIImage imageNamed: @ "Navigation_bar.png"]; [_bg Image Set Frame: CGRactMake (0, -45,320,510)]; [Self.navigationController.navigationBar setBackgroundImage: Bairametrics for Image: UIBarMetricsDefault]; [Self-back controller. Tabbar setbackgaged image: [UIimage image named: @ "tab_bar page"]]; [Self. NavigationTime SetHidebackBackton: Yes]; MenuTableView.backgroundColor = [UIColor clear collar]; MenuTableView.tableFooterView = [[UIView alloc] initWithFrame: CGRectZero]; _hotelMenu = [SharedHotelMenu sharedInstanceMethod]; _queryFormatter = [[DatabaseQueryFormatter alloc] init]; _isSearchOn = No; _searchResult = [[NSMutableArray alloc] init]; _category Search Layer CornerRadia = 19; _category Search Clip Tubol = yes; _categorySearch.delegate = Self; UIView * _paddingView = [[UIView alloc] initWithFrame: CGRectMake (0,0,5,10)]; _categorySearch.leftView = _paddingView; _categorySearch.leftViewMode = UITextFieldViewModeAlways; [_paddingView release]; UIView * _paddingRightView = [[UIView alloc] initWithFrame: CGRectMake (0,0,30,10)]; _categorySearch.rightView = _paddingRightView; _categorySearch.rightViewMode = UITextFieldViewModeAlways; [_paddingRightView release]; [[NSNotificationCenter defaultCenter] addObserver: Self Selector: @Selector (Searchbar) Name: UITextFieldTextDidChangeNotification Object: _categorySearch]; }}   

I created a single vowel object in the form of _hotelMenu = [SharedHotelMenu sharedInstanceMethod]

As far as I can see, this code may be the cause of memory leakage

  menuTableView.tableFooterView = [[UIView alloc] initWithFrame: CGRectZero];   

This is in the form of a @property (nonatomic, retain) UIView * tableFooterView and it will keep your object and counting 2 will be like this.

Use this UIView * footerView = [[UIView alloc] initWithFrame: CGRectZero]; MenuTableView.tableFooterView = Footer; [See footer];

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -