At least I think it’s a basic problem. I just started working with views programmatically.
In RouteCaptureViewController.h:
@property (strong, nonatomic) IBOutlet UIView *routeCaptureSuperView;
@property(nonatomic, weak) IBOutlet UIImageView *captureImageView;
@property(nonatomic, retain) IBOutlet UIImageView *previewImageView;
@property (weak, nonatomic) IBOutlet UIView *captureRouteButtonView;
In my storyboard:

All of the outlets are properly connected, I checked.
I’m implementing addSubview in a method as such and nothing happens:
[self.routeCaptureSuperView addSubview:self.captureRouteButtonView];
[self.routeCaptureSuperView addSubview:self.captureImageView];
The following lines worked previously in the code:
[self.captureImageView removeFromSuperview];
[self.captureRouteButtonView removeFromSuperview];
And I know self.routeCaptureSuperView is not nil from an NSLog.
If I understood you correctly and you removed the views to add them again later I can make an educated guess:
In the moment you send
removeFromSuperviewto your views they get deallocated because they are declared asweakonly.Weak means that the property will be nil’d if the object is deallocated because the last strong relationship to that object is released.
The parent view is the object that keeps the last strong relationship to those two views.
Try to change
weaktostrongin the@propertydeclaration of the two subviews.