我在嘗試訪問類的「事件」IOS5 - [__ NSCFDictionary NOMBRE]:無法識別的選擇發送到實例0x6da25a0
的Json列出所有確定,當我試圖訪問錯誤的屬性時出現錯誤跳到
Evento* bean = [ListaEventos objectAtIndex:indexPath.row];
DetalleViewController *detalle = [self.storyboard instantiateViewControllerWithIdentifier:@"Detalle"];
NSLog(@"detalle: %@",[bean nombre]);//bean Log OK!!, but bean.nombre Error!! why?
類:evento.h
@interface Evento : NSObject
@property (strong, nonatomic) NSString *idevento;
@property (strong, nonatomic) NSString *nombre;
@property (strong, nonatomic) NSString *descripcion;
@property (strong, nonatomic) NSString *fecha;
@property (strong, nonatomic) NSString *telefono;
@property (strong, nonatomic) NSString *direccion;
@end
Evento.m
@implementation Evento
@synthesize idevento;
@synthesize nombre;
@synthesize descripcion;
@synthesize fecha;
@synthesize telefono;
@synthesize direccion;
@end
顯然,'bean'是一個'NSDictionary',而不是'Evento'的一個實例。最有可能的是,你需要啓用NSZombies並尋找過度釋放。 – Costique 2012-02-15 20:29:53