Bonjour à tous,
j’ai implémenté la fonction shareMe du cours dans mon app en cours de dev et ça fonctionne très bien sur mon iPhone mais ça plante sur l’iPad et je ne comprends pas pourquoi.
J’ai ça:
et erreur console suivante:
2018-01-31 08:22:32.664616+0100 Calc4relais[1657:2033358] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don’t want.
Try this:
(1) look at each constraint and try to figure out which you don’t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
« <NSLayoutConstraint:0x1c409d790 UILabel:0x101a18ad0’Fille’.width == 70 (active)> »,
« <NSLayoutConstraint:0x1c02882a0 Calc4relais.UISwitchCustom:0x101b2ad90.width == 70 (active)> »,
« <NSLayoutConstraint:0x1c409d8d0 UILabel:0x101a18db0’Gar\U00e7on’.width == 70 (active)> »,
« <NSLayoutConstraint:0x1c409d970 H:[UILabel:0x101a18ad0’Fille’]-(10)-[Calc4relais.UISwitchCustom:0x101b2ad90] (active)> »,
« <NSLayoutConstraint:0x1c409d9c0 H:[Calc4relais.UISwitchCustom:0x101b2ad90]-(10)-[UILabel:0x101a18db0’Gar\U00e7on’] (active)> »,
« <NSLayoutConstraint:0x1c409db50 H:[UIStackView:0x101a184d0]-(21)-| (active, names: ‹ | ›:UITableViewCellContentView:0x101a182e0 )> »,
« <NSLayoutConstraint:0x1c409dba0 H:|-(21)-[UIStackView:0x101a184d0] (active, names: ‹ | ›:UITableViewCellContentView:0x101a182e0 )> »,
« <NSLayoutConstraint:0x1c0289dd0 ‹ UISV-canvas-connection › UIStackView:0x101a184d0.leading == UILabel:0x101a18ad0’Fille’.leading (active)> »,
« <NSLayoutConstraint:0x1c0289e70 ‹ UISV-canvas-connection › H:[UILabel:0x101a18db0’Gar\U00e7on’]-(0)-| (active, names: ‹ | ›:UIStackView:0x101a184d0 )> »,
« <NSLayoutConstraint:0x1c028a820 ‹ UIView-Encapsulated-Layout-Width › UITableViewCellContentView:0x101a182e0.width == 972 (active)> »
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x1c409d8d0 UILabel:0x101a18db0’Garçon’.width == 70 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-01-31 08:22:32.673782+0100 Calc4relais[1657:2033358] [MC] Lazy loading NSBundle MobileCoreServices.framework
2018-01-31 08:22:32.676214+0100 Calc4relais[1657:2033358] [MC] Loaded MobileCoreServices.framework
2018-01-31 08:22:32.703144+0100 Calc4relais[1657:2033358] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don’t want.
Try this:
(1) look at each constraint and try to figure out which you don’t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
« <NSLayoutConstraint:0x1c8099e60 UILabel:0x101f1a350.width == 50 (active)> »,
« <NSLayoutConstraint:0x1c028c1c0 ‹ UISV-fill-proportionally › UILabel:0x101f1a350.width == 0 (active)> »
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x1c8099e60 UILabel:0x101f1a350.width == 50 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-01-31 08:22:32.715086+0100 Calc4relais[1657:2033358] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don’t want.
Try this:
(1) look at each constraint and try to figure out which you don’t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
« <NSLayoutConstraint:0x1c809a6d0 UILabel:0x101f1cc70.width == 50 (active)> »,
« <NSLayoutConstraint:0x1c42828f0 ‹ UISV-fill-proportionally › UILabel:0x101f1cc70.width == 0 (active)> »
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x1c809a6d0 UILabel:0x101f1cc70.width == 50 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-01-31 08:22:32.724239+0100 Calc4relais[1657:2033358] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don’t want.
Try this:
(1) look at each constraint and try to figure out which you don’t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
« <NSLayoutConstraint:0x1c809aea0 UILabel:0x101f1f710.width == 50 (active)> »,
« <NSLayoutConstraint:0x1c809db00 ‹ UISV-fill-proportionally › UILabel:0x101f1f710.width == 0 (active)> »
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x1c809aea0 UILabel:0x101f1f710.width == 50 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-01-31 08:22:32.734070+0100 Calc4relais[1657:2033358] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don’t want.
Try this:
(1) look at each constraint and try to figure out which you don’t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
« <NSLayoutConstraint:0x1c809b670 UILabel:0x101f21db0.width == 50 (active)> »,
« <NSLayoutConstraint:0x1c4283d40 ‹ UISV-fill-proportionally › UILabel:0x101f21db0.width == 0 (active)> »
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x1c809b670 UILabel:0x101f21db0.width == 50 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-01-31 08:22:32.777094+0100 Calc4relais[1657:2033358] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don’t want.
Try this:
(1) look at each constraint and try to figure out which you don’t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
« <NSLayoutConstraint:0x1c4288e30 ‹ UISV-canvas-connection › UIStackView:0x101a227a0.leading == UITextField:0x102861600.leading (active)> »,
« <NSLayoutConstraint:0x1c4288e80 ‹ UISV-canvas-connection › H:[UILabel:0x101a237c0]-(0)-| (active, names: ‹ | ›:UIStackView:0x101a227a0 )> »,
« <NSLayoutConstraint:0x1c4288f70 ‹ UISV-fill-proportionally › UITextField:0x102861600.width == UIStackView:0x101a227a0.width (active)> »,
« <NSLayoutConstraint:0x1c4289010 ‹ UISV-fill-proportionally › UILabel:0x101a237c0.width == 0 (active)> »,
« <_UISystemBaselineConstraint:0x1c42a1320 ‹ UISV-spacing › H:[UITextField:0x102861600]-(NSLayoutAnchorConstraintSpace(8))-[UILabel:0x101a237c0] (active)> »
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x1c4289010 ‹ UISV-fill-proportionally › UILabel:0x101a237c0.width == 0 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-01-31 08:22:32.778070+0100 Calc4relais[1657:2033358] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don’t want.
Try this:
(1) look at each constraint and try to figure out which you don’t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
« <NSLayoutConstraint:0x1c4288e30 ‹ UISV-canvas-connection › UIStackView:0x101a227a0.leading == UITextField:0x102861600.leading (active)> »,
« <NSLayoutConstraint:0x1c4288e80 ‹ UISV-canvas-connection › H:[UILabel:0x101a237c0]-(0)-| (active, names: ‹ | ›:UIStackView:0x101a227a0 )> »,
« <NSLayoutConstraint:0x1c4288f70 ‹ UISV-fill-proportionally › UITextField:0x102861600.width == UIStackView:0x101a227a0.width (active)> »,
« <_UISystemBaselineConstraint:0x1c42a1320 ‹ UISV-spacing › H:[UITextField:0x102861600]-(NSLayoutAnchorConstraintSpace(8))-[UILabel:0x101a237c0] (active)> »
)
Will attempt to recover by breaking constraint
<_UISystemBaselineConstraint:0x1c42a1320 ‹ UISV-spacing › H:[UITextField:0x102861600]-(NSLayoutAnchorConstraintSpace(8))-[UILabel:0x101a237c0] (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-01-31 08:22:32.784402+0100 Calc4relais[1657:2033358] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don’t want.
Try this:
(1) look at each constraint and try to figure out which you don’t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
« <NSLayoutConstraint:0x1c42805f0 H:[UILabel:0x101a246f0]-(0)-[UILabel:0x101a249d0’%’] (active)> »,
« <NSLayoutConstraint:0x1c428a140 ‹ UISV-spacing › H:[UILabel:0x101a246f0]-(20)-[UILabel:0x101a249d0’%’] (active)> »
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x1c428a140 ‹ UISV-spacing › H:[UILabel:0x101a246f0]-(20)-[UILabel:0x101a249d0’%’] (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-01-31 08:22:32.784845+0100 Calc4relais[1657:2033358] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don’t want.
Try this:
(1) look at each constraint and try to figure out which you don’t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
« <NSLayoutConstraint:0x1c42805a0 H:[UILabel:0x101a24410’\U00e9cart:’]-(10)-[UILabel:0x101a246f0] (active)> »,
« <NSLayoutConstraint:0x1c428a0a0 ‹ UISV-spacing › H:[UILabel:0x101a24410’\U00e9cart:’]-(20)-[UILabel:0x101a246f0] (active)> »
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x1c428a0a0 ‹ UISV-spacing › H:[UILabel:0x101a24410’écart:’]-(20)-[UILabel:0x101a246f0] (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-01-31 08:22:40.084297+0100 Calc4relais[1657:2033358] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2018-01-31 08:22:40.087295+0100 Calc4relais[1657:2033358] [MC] Reading from public effective user settings.
2018-01-31 08:22:54.915912+0100 Calc4relais[1657:2033358] [MC] Filtering mail sheet accounts for bundle ID: fr.pro4eps.Calc4relais, source account management: 1
2018-01-31 08:22:54.929650+0100 Calc4relais[1657:2033358] [MC] Filtering mail sheet accounts for bundle ID: fr.pro4eps.Calc4relais, source account management: 2
2018-01-31 08:22:55.193479+0100 Calc4relais[1657:2033358] [MC] Filtering mail sheet accounts for bundle ID: fr.pro4eps.Calc4relais, source account management: 1
2018-01-31 08:22:55.194537+0100 Calc4relais[1657:2033358] [MC] Filtering mail sheet accounts for bundle ID: fr.pro4eps.Calc4relais, source account management: 2
2018-01-31 08:22:55.368353+0100 Calc4relais[1657:2033358] *** Terminating app due to uncaught exception ‹ NSGenericException ›, reason: ‹ Your application has presented a UIActivityViewController (<UIActivityViewController: 0x1020e9a00>). In its current trait environment, the modalPresentationStyle of a UIActivityViewController with this style is UIModalPresentationPopover. You must provide location information for this popover through the view controller’s popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the view controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation. ›
*** First throw call stack:
(0x185156364 0x18439c528 0x18f353fec 0x18ea5ac18 0x18ea586dc 0x18e97ab3c 0x18e96def0 0x18e6ff54c 0x1850fdedc 0x1850fb894 0x1850fbe50 0x18501be58 0x186ec8f84 0x18e77067c 0x100a2b380 0x184b3856c)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
La fonction de partage via UIActivity controller est déclenchée par un Right Bar Button item qui est connecté (et lui seul, j’ai bien vérifié).
Voici le code au cas ou ça viendrai de là mais je n’en ai pas l’impression:
@IBAction func shareTypedText() {
if let nameC1:String = ui_prenomC1.text, let nameC2:String = ui_prenomC2.text, let nameC3:String = ui_prenomC3.text, let nameC4:String = ui_prenomC4.text, let timeC1:String = ui_timeC1.text, let timeC2:String = ui_timeC2.text, let timeC3:String = ui_timeC3.text, let timeC4:String = ui_timeC4.text, let number1:String = ui_number1.text, let number2:String = ui_number2.text,let number3:String = ui_number3.text,let number4:String = ui_number4.text, let marque1:String = ui_marquesTextfield.text, let marque2:String = ui_marques2 .text, let marque3:String = ui_marques3.text, let noteRelais:String = notePerfRelais.text, let noteFinale:String = ui_noteFinale.text, let tempsTh:String = ui_timeTheorique.text, let tempsRea:String = ui_timeRealTest.text, let gap:String = ui_gap.text, let purcentGap:String = displayGap.text, let noteC1:String = ui_noteC1.text, let noteC2:String = ui_noteC2.text,let noteC3:String = ui_noteC3.text,let noteC4:String = ui_noteC4.text, let noteGap:String = ui_noteEff.text {
// date formatée
let _dateNow = Date()
let _frenchDate = DateFormatter()
_frenchDate.dateStyle = .medium
_frenchDate.timeStyle = .medium
_frenchDate.locale = Locale(identifier: « FR-fr »)
let dateFormat = _frenchDate.string(from: _dateNow)
let message = "\n Le \(dateFormat) \n Configuration testée: \(number1)-\(number2)-\(number3)-\(number4) \n -\(nameC1): \(timeC1) (\(noteC1)) \n -\(nameC2): \(timeC2) (\(noteC2)) \n -\(nameC3): \(timeC3) (\(noteC3)) \n -\(nameC4): \(timeC4) (\(noteC4)) \n\n Marque transmission 1: \(marque1) pieds \n Marque transmission 2: \(marque2) pieds \n Marque transmission 3: \(marque3) pieds \n\n Valeur du relais théorique: \(tempsTh) \n Temps réel du relais: \(tempsRea)\n Amélioration de: \(gap) soit \(purcentGap) (\(noteGap)) \n Note du 4x50m: \(noteRelais) \n\n \(noteFinale)"
let share = UIActivityViewController(activityItems: [message], applicationActivities: nil)
present(share, animated: true, completion: nil)
}
}
Si quelqu’un voit le truc, je suis preneur. Merci!!!