doctor view controller code break down for ipad and iphone