I have always been confused in finding out what i need to import in order to use a feature.
For example, when i use MFMailComposeViewController I know from googling that i need to
#import <MessageUI/MFMailComposeViewController.h>
and add: MessageUI.framework
From the reference documentation, how do I know that i need these things?
http://developer.apple.com/library/ios/#documentation/MessageUI/Reference/MFMailComposeViewController_class/Reference/Reference.html
I want to learn how to better use the reference docs without relying on googling sample codes to find out what i need to import in the future, so can someone explain how to figure this out from documentation?
See how at the top it says it's declared in MFMailComposeViewController.h? The question then is what framework that's in. Here's one way to find out.
Start in an actual iOS project in Xcode. Press Shift-Command-O (File > Open Quickly) and paste or type MFMailComposeViewController into it. Open the listing for MFMailComposeViewController.h.
Now read the jump bar at the top of the editor. It says: ... > Frameworks > MessageUI.framework > ...
This lets you deduce that you need the MessageUI framework and that you need to import (not what you said, but) <MessageUI/MessageUI.h>
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With