• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UIPrintInteractionController failure on iOS 9.3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UIPrintInteractionController failure on iOS 9.3


  • Subject: Re: UIPrintInteractionController failure on iOS 9.3
  • From: Luca Ciciriello <email@hidden>
  • Date: Tue, 26 Apr 2016 21:04:54 +0200

Hi Steve.
The problem is that I have no indications about the crash even setting an “All Exceptions” breakpoint. So I’m unable to identify the real case of this crash. The “computation flow” ends in "class AppDelegate: UIResponder, UIApplicationDelegate” without leave any information. I’ve noticed also that tis anomaly is present only on iPad device and iPad simulator. On iPhone device/simulator all works fine.
The anomaly is present with any non empty string contained in self.testo.text


Luca.

On 25 Apr 2016, at 23:56, Steve Christensen <email@hidden> wrote:

1. Could you please post the stack trace and the reason for the crash?

2. If this is an unhandled exception then the exception details would be helpful to include as well.

3. What is the value of self.testo.text that causes the crash?


On Apr 25, 2016, at 2:59 AM, Luca Ciciriello <email@hidden> wrote:

Hi All.
In my app I’ve a method used to print some text on a printer. 

My code is 

let printController = UIPrintInteractionController.sharedPrintController()
        
        let printInfo = UIPrintInfo(dictionary:nil)
        printInfo.outputType = UIPrintInfoOutputType.General
        printInfo.jobName = "note"
        printController.printInfo = printInfo
        
        func textFormatter(text: String) -> String
        {
            return text.stringByReplacingOccurrencesOfString("\n", withString: "<BR>")
        }
        
        let formatter = UIMarkupTextPrintFormatter(markupText: textFormatter(self.testo.text))
        formatter.contentInsets = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
        printController.printFormatter = formatter
        
        if UIDevice.currentDevice().userInterfaceIdiom == .Pad
        {
            printController.presentFromRect(self.printBtn.frame, inView:self.view, animated:true, completionHandler: nil)
        }
        else
        {
            printController.presentAnimated(true, completionHandler: nil)
        }

This code works properly in iOS 8.3 but my app crash in iOS 9.3 when in the code above I call

printController.presentFromRect(self.printBtn.frame, inView:self.view, animated:true, completionHandler: nil)

I’ve noticed that the app doesn’t crash if the self.testo.text is an empty string. This behaviour is the same on the simulator and on a real device. 

Where is my mistake? Any Idea?

Regards 

Luca.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: UIPrintInteractionController failure on iOS 9.3
      • From: Jens Alfke <email@hidden>
References: 
 >UIPrintInteractionController failure on iOS 9.3 (From: Luca Ciciriello <email@hidden>)

  • Prev by Date: Re: XCode Debugger Breakpoint Question
  • Next by Date: Re: XCode Debugger Breakpoint Question
  • Previous by thread: UIPrintInteractionController failure on iOS 9.3
  • Next by thread: Re: UIPrintInteractionController failure on iOS 9.3
  • Index(es):
    • Date
    • Thread