0

I am experimenting with Airdrop on my iPhone 6 (iOS 9.2), running my app. I have set up the info.plist with the Document Types according to the Apple UTI types documentation. With my app running, if I try to send a one-line .txt file to the app via Airdrop, the phone crashes and resets. I have a breakpoint set in my app delegate.m in the method that should be called when a URL is received via Airdrop, but the breakpoint is not executed. Here is the relevant app delegate.m code. This is the method in the code where I set the breakpoint (at the NSLog).

    - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    NSLog(@"url: %@", url);
    NSURL *urlToOpen = url;
    NSString *contentOfFile = [NSString stringWithContentsOfURL:urlToOpen encoding:NSUTF8StringEncoding error:nil];
    NRCTableViewController *controller = [[NRCTableViewController alloc]init];
    controller.urlText = contentOfFile;
    [controller receiveURL];
    return YES;

}

There is nothing in the device crash log. I have searched here and elsewhere (Google) but have not found anything about this.

Here is a screen shot of the info.plist showing the Document Types.

I have successfully sent the same one-line text file to a short Airdrop demo app with the same Document Types.

I would appreciate any help. Thanks!

enter image description here

Nelson Capes
  • 411
  • 3
  • 12
  • Could you post the crashlog? – ccjensen Mar 11 '16 at 15:16
  • There is no crash log, so I don't think the app actually crashed. What happens is that when I try to send a simple text file to my app using Airdrop, I don't get the Sharing screen that you normally see. Instead, the iPhone resets (shows the Apple logo) and returns to the Home screen. – Nelson Capes Mar 11 '16 at 21:08
  • That sounds like a springboard crash. When you sync the device with tunes, does it sync off any system crashes? They usually end up ~/Library/Logs/CrashReporter/MobileDevice// – ccjensen Mar 12 '16 at 03:39

0 Answers0