奇怪的内存泄露 incorrect decrement of the reference count of an object that is not owned at this point by

    LoginViewController *loginViewController = [[LoginViewController alloc] initwithLoginUrl: loginUrl];

    

    CustomNavigationController *customNavigationController = [[CustomNavigationController alloc] initWithRootViewController: loginViewController];

    customNavigationController.navigationBar.tintColor = NavgaitonBar_Color;

    [self.navigationController presentModalViewController: customNavigationController animated: YES];

    

    [loginViewController release];

    [customNavigationController release];


红色为提示内存泄露的地方 


只要把    LoginViewController *loginViewController = [[LoginViewController allocinitwithLoginUrl: loginUrl];


修改为     LoginViewController *loginViewController = [[LoginViewController allocinitWithLoginUrl: loginUrl];


就可以解决内存泄露

你可能感兴趣的:(object,reference)