Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Add the following to the end of <code>application:DidFinishLaunchingWithOptions</code>:</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... NSURL *url = (NSURL *)[launchOptions valueForKey:UIApplicationLaunchOptionsURLKey]; if (url != nil &amp;&amp; [url isFileURL]) { return YES; } else return NO; } // End of application:didFinishLaunchingWithOptions: // New method starts -(BOOL) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { mvc = [nc.viewControllers objectAtIndex:0]; if (url != nil &amp;&amp; [url isFileURL]) { [mvc handleOpenURL:url]; } return YES; } </code></pre> <p>where mvc is my main ViewController, and nc my navigation controller. </p> <p>Then in the MainViewController, do something like this:</p> <pre><code>- (void)handleOpenURL:(NSURL *)url { [self.navigationController popToRootViewControllerAnimated:YES]; // Next bit not relevant just left in as part of the example NSData *jsonData = [NSData dataWithContentsOfURL:url]; NSError *error; NSDictionary *dictionary = [[NSJSONSerialization JSONObjectWithData:jsonData options:kNilOptions error:&amp;error] objectAtIndex:0]; [self managedObjectFromStructure:dictionary withManagedObjectContext:self.context]; ... } </code></pre> <p>after declaring handleOpenURL in the .h of course. </p> <p>Thanks goes to Christian for putting in the effort for this. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload