ViewController * tempObj = [[ViewController alloc] init]; [tempObj callIncomingClass];
It's hard to tell from your example, but assuming that -callIncomingClass is actually part of the ViewController definition and callIncoming() is being called from another place, the probable problem is that tempObj not the current view controller. You need to push tempObj on the navigation stack, present it as a modality, or otherwise make it the active view controller so that its view is loaded. If its view is not loaded, then there is no view to add a button, and even if it has a view, that view will not be in the window.
source share