I wanted to add a view in UIWindow with following code:
UIWindow
AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate; UIWindo
Try this code:
window = [[UIApplication sharedApplication].windows lastObject];
Replace the following code:
window = [[UIApplication sharedApplication].windows objectAtIndex:0];