UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@\"Enter Student Name\" message:nil delegate:self cancelButtonTitle:@\"Cancel\" otherButtonTitles
What you are doing wrong is you're trying to customize UIAlertView and put subviews into it. Apple generally dislikes and prohibits this approach. What you can try to do is the following:
You can try custom alert-view 'replication' like this one
Write your own 'replication' of alert-view that will fit your needs and work the same on both iOS6/7.