j'ai un accident uniquement sur IOS 11: [__NSCFNumber isEqualToString]: sélecteur non reconnu envoyé à l'instanceNSCFNumber isEqualToString: IOS11 collision entre viewDidLoad et viewWillApear
étape de débogage par l'étape indique que le blocage se produit après la fin de viewDidLoad et avant d'entrer viewWillApear
Comment puis-je déboguer?
J'ai essayé avec un breakpoint d'exception mais je n'ai plus d'informations. l'accident est clair, mais je n'ai pas de code et avant d'après le moment de l'accident, je ne l'utilise « isEqualToString » ou « objectAtIndex » ...
Code viewDidLoad:
self.buttonCancel = [[UIBarButtonItem alloc] initWithTitle:@"ANNULER" style:UIBarButtonItemStylePlain target:self action:@selector(actionCancel)];
[self.buttonCancel setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [EATColor colorBlack], NSForegroundColorAttributeName,[EATFont ElleNovaCExtraBold:12],NSFontAttributeName,NSKernAttributeName, @(0.66), nil] forState:UIControlStateNormal];
[super viewDidLoad];
// Do any additional setup after loading the view.
[self buildCollectionViewListing];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.collectionView.backgroundColor = [UIColor clearColor];
[[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTitle:@"ANNULER"];
[self.collectionView registerNib:[UINib nibWithNibName:@"EATSearchRecetteCollectionViewCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"idSearchRecette"];
[self.collectionView registerNib:[UINib nibWithNibName:@"EATSearchArticleCollectionViewCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"idSearchNews"];
[self.collectionView registerNib:[UINib nibWithNibName:@"EATSearchGalleryCollectionViewCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"idSearchGallery"];
[self.collectionView registerNib:[UINib nibWithNibName:@"EATSearchVideoCollectionViewCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"idSearchVideo"];
[self.collectionView registerNib:[UINib nibWithNibName:@"EATSearchHeaderCollectionViewCell" bundle:[NSBundle mainBundle]] forSupplementaryViewOfKind: UICollectionElementKindSectionHeader withReuseIdentifier:EATSearchHeaderCollectionViewIdentifier];
if (self.searchedText) {
if (self.searchBar) {
self.searchBar.text = self.searchedText;
}else {
self.title = [self.searchedText uppercaseString];
}
[self loadData];
}
Quel est le journal de plantage complet? Cela n'arrive pas sur iOS10? – Larme
Est-ce que votre ViewController a une super classe? Avez-vous vérifié super viewdidload? quel objet ajoutez-vous dans votre viewController? –
Lorsqu'il tombe en panne, tapez "bt" dans la console de débogage à l'invite "(lldb)". Ajoutez cette trace de pile à votre question. –