SORU
18 AĞUSTOS 2012, CUMARTESİ


iOS5 benim UİTableView içinde dequeueReusableCellWithİdentifier hata

İOS 5'te bu hatayı alıyorum

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

Ancak, iOS 6'da hata alıyorum. Bu sorunu nasıl düzeltebilirim? İşte benim kod:

- (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;
}

CEVAP
18 AĞUSTOS 2012, CUMARTESİ


EDİTBu yöntem yeni iOS6 SDK eklenir.

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

Ama iOS UITableViewCell biz genellikle bu yöntemi kullanın örneğini oluşturmak için 5,: -

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

İOS 5, iOS 6'da kullandığınız ekstra parametre yok. (forİndexPath:).

Değişiklik yöntemi. Çalışacaktır.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • funbro1

    funbro1

    11 Aralık 2007
  • SaraBeautyCorner - Nails and Nail Art Designs, DIY, Fashion & Makeup Tutorial

    SaraBeautyCo

    7 EKİM 2012
  • Willie D.

    Willie D.

    16 Aralık 2006