【发布时间】:2012-02-15 20:22:42
【问题描述】:
尝试访问“事件”类的属性时出现错误
Json List all Ok 当我尝试访问错误跳转时
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 并寻找过度发布。
标签: iphone objective-c ios5 instance