Apple Q2 profit rises 12% on higher sales of iPhones