How to detect iPhone common settings?
I want to detect iPhone'开发者_开发知识库s common settings like settings about Mail, Contacts and Calendar.
(source: simonblog.com)I want to detect this Sort Order and Display Order settings for a native contact book application. Is this possible and how? Thanks in advance.
For the settings about the Adress Book, you can use the methods ABPersonGetSortOrdering() and ABPersonGetCompositeNameFormat() to get respectively the sort order and the display order. Read the AdressBook guide and the ABPerson class reference.
For mail, you can detect if the device is configured to send email with the class method canSendMail of the MFMailComposeViewController class. I am not aware of an API that give you more information than that. I doubt Apple would add one (and as a user, I prefer it this way).
For calendar, see this question: Programmatically add custom event in the iPhone Calendar
And for detecting the locale timezone, it's as simple as [NSTimeZone localTimeZone];
. Again, I invite you to read the NSTimeZone class reference, to learn what you can do with this object.
精彩评论