dequeueReusableCellWithIdentifier erreur dans mon UITableView dans iOS5

J'obtiens cette erreur dans iOS 5

-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]: unrecognized selector sent to instance 0xa217200

Cependant, je n'ai pas d'erreurs dans iOS 6. Comment puis-je résoudre ce problème? Voici mon code:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"MyCell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; ///SIGABRT error

    if (!cell)
    {
        cell = [[UITableViewCell alloc]
        initWithStyle: UITableViewCellStyleSubtitle
        reuseIdentifier: CellIdentifier];
    }

    return cell;
}
  • Besoin de votre tableView délégué méthodes collé ici.
  • fournir suffisamment de code pour obtenir la réponse
  • ajout de code
InformationsquelleAutor user123 | 2012-08-18