[self.view removeFromSuperView]
this will from the currentview from it's superView.
From your code it seems you are seeting the ViewCONTROLLER TO THE rootViewController of Window
So in that case you should do as below
Remove The Current ViewController form the Window's RootView Controller
and Set which you want
Suppose as you click close BTN the remove CurrentViewController i.e profileView
.
[self.window setRootViewController:nil];
and then set desired ViewController which you want.
[self.window setRootViewController:createViewController];
createViewController
instance of ViewController which you want to show on closing the profileView