Neden bu işi kapsamaz:Neden bir anahtar deyiminde bir NSInteger kullanamıyorum?
error: case label does not reduce to an integer constant
o NSInteger en böyle kullanmak mümkün değil mi:
NSInteger sectionLocation = 0;
NSInteger sectionTitles = 1;
NSInteger sectionNotifications = 2;
switch (section) {
case sectionLocation:
//
break;
case sectionTitles:
//
break;
case sectionNotifications:
//
break;
default:
//
}
Bu derleme hatası alıyorum? Öyleyse, değişkenleri anahtar deyiminde kullanmanın başka bir yolu var mı? sectionLocation
vb. Değişken değerlere sahiptir.
Yani if-else-if-else tekrar başvurmak zorunda olacak mı? Bunun etrafında bir yolu yok mu? – Rits
Evet, kullanım tanımlar, bununla ilgili sorun nedir? : D – fresskoma