Is something like this is not a memory leak or other issues?
- (void) requestAndUpdateView: (UIViewController *) vc {
[afHttpManager POST:....
success:^(....){ [vc doSomething]} ...
...
];
}
Is something like this is not a memory leak or other issues?
- (void) requestAndUpdateView: (UIViewController *) vc {
[afHttpManager POST:....
success:^(....){ [vc doSomething]} ...
...
];
}
No it is not a memory leak, because vc has not been created in this scope, so you should not manage it's retain count in it.
However your code reveals another issue : be sure to perform every UI modification on the Main thread otherwise you will experience random crash.
EDIT Asked for more details :
Every UI action should be made on the App's Main thread. In Cocoa touch, your application is attached to main thread. Application's main event loop receives UI events. Using another thread (background threads) to change anything that is graphic is a bad idea because the UIKit is not thread safe.
My guess is that afHttpManager does it's work in another thread to avoid freezing the App's UI, so any code executed will be on the same thread than your afHttpManager.