I\'m trying to create a sharing extension using the new iOS 8 app extensions. I tried to get the current URL of a Safari site to show it in a UILabel. Simple enough.
Your extension view controller should be adopting the NSExtensionRequestHandling protocol. One of this protocol's methods is:
- (void)beginRequestWithExtensionContext:(NSExtensionContext *)context
You should be waiting for this to be called before you attempt to get the NSExtensionContext. It even provides the context in the method as the context parameter.
This was outlined in this document.