Это мой код:
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
NSLog(@"location for url1 B %@", locationForURL1);
if ((alertView.tag <= 3) && (alertView.tag >= 1)) {
if (buttonIndex == 1) {
NSLog(@"location for url1 %@", locationForURL1);
У locationForURL1 была запись в остальной части кода вплоть до этой точки, но она потерпела крах при первом NSLog здесь.
Итак, я добавил nszombieenabled и получил message sent to deallocated instance 0x508eda0
. Как я могу использовать это, чтобы узнать мою проблему? Я слышал, как люди говорили, что это в методе init, что меня смутило, так как я не могу найти метод init. Я никогда раньше не делал отладку таким образом.
EDIT:
Я выделяю это так:
@interface RewriteViewController : UIViewController <MPMediaPickerControllerDelegate> {
NSString *locationForURL1;
}
@property (nonatomic,retain) NSString *locationForURL1;
Я думаю, что это как-то связано с личностью. Переменная, но я никогда не могу понять, когда я собираюсь поставить себя. и если я собираюсь вместо этого поставить что-то другое.
Это все ссылки, которые у меня есть на locationForURL1 в файле .m:
@synthesize locationForURL1;
-(void)getWeatherLocation {
if (currentResult == 1) {
self.locationForURL1 = locationTown;
locationForURL1 = [locationForURL1 stringByAppendingString:@","];
locationForURL1 = [locationForURL1 stringByAppendingString:locationCountry];
}
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if ((alertView.tag <= 3) && (alertView.tag >= 1)) {
if (buttonIndex == 1) {
NSLog(@"location for url1 %@", self.locationForURL1);
self.weatherFullURL = [self.weatherFullURL stringByAppendingString:self.locationForURL1];
}
}
}
-(void)dealloc {
[locationForURL1 release];
[super dealloc];
}