pendant la simulation de course iphone, je montre l'erreur pour "EXC_BAD_ACCESS" dans le code Xcode"EXC_BAD_ACCESS" dans Xcode
est ci-dessous:
Test.h
@interface Test : UIViewController
{
NSNumber *nWieght;
}
@property (nonatomic,retain) NSNumber *nWieght;
end
Test.m
@implementation Test
@synthesize nWieght;
- (void)viewDidLoad
{
...
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
**NSLog(@"integer Number is :%@", iWeight); // error occur**
}
Si je clique sur le bouton de UIAlertView, Xcode se produisent erreur "EXC_BAD_ACCESS" à ce code
Je ne sais pas pourquoi ce code se produit erreur. Aidez moi.
nWieght n'est probablement pas conservé et a donc été désalloué. – jbat100
J'ai initialisé iWeight dans la méthode ViewdidLoad. – Nockdoo
pouvez-vous poster la ligne de code où vous initialisez nWieght? – jbat100