У меня следующая ошибка в приложении Ios 5 с использованием ARC:
*** -[ViewDettaglio respondsToSelector:]: message sent to deallocated instance 0x12193300
на консоли я пишу команду:
info malloc-history 0x12193300
и я получаю следующую трассировку стека:
Alloc: Block address: 0x12193300 length: 192
Stack - pthread: 0xa08a3540 number of frames: 31
0: 0x96bdab03 in malloc_zone_calloc
1: 0x96bdaa5a in calloc
2: 0x16f8c93 in class_createInstance
3: 0x170388b in _objc_rootAllocWithZone
4: 0x21af661 in +[NSObject allocWithZone:]
5: 0x17038b9 in _objc_rootAlloc
6: 0x2c4c8 in -[ViewElenco CaricaViewDettaglio:] at /Users/.../ViewElenco.m:186
7: 0x2e550 in -[ViewElenco mapView:annotationView:calloutAccessoryControlTapped:] at /Users/.../ViewElenco.m:337
8: 0x3fa99c
9: 0x405faa in MKLongHash
10: 0x21aeec9 in -[NSObject performSelector:withObject:withObject:]
11: 0x60d5c2 in -[UIApplication sendAction:to:from:forEvent:]
12: 0x60d55a in -[UIApplication sendAction:toTarget:fromSender:forEvent:]
13: 0x6b2b76 in -[UIControl sendAction:to:forEvent:]
14: 0x6b303f in -[UIControl(Internal) _sendActionsForEvents:withEvent:]
15: 0x6b22fe in -[UIControl touchesEnded:withEvent:]
16: 0x632a30 in -[UIWindow _sendTouchesForEvent:]
17: 0x632c56 in -[UIWindow sendEvent:]
18: 0x619384 in -[UIApplication sendEvent:]
19: 0x60caa9 in _UIApplicationHandleEvent
20: 0x1a95fa9 in PurpleEventCallback
21: 0x21811c5 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
22: 0x20e6022 in __CFRunLoopDoSource1
23: 0x20e490a in __CFRunLoopRun
24: 0x20e3db4 in CFRunLoopRunSpecific
25: 0x20e3ccb in CFRunLoopRunInMode
26: 0x1a94879 in GSEventRunModal
27: 0x1a9493e in GSEventRun
28: 0x60aa9b in UIApplicationMain
29: 0x20bb in main at /Users/.../main.m:14
30: 0x2065 in start
Код в строке 186 ViewElenco.m следующий:
ViewDettaglio *viewq=[[ViewDettaglio alloc] initWithNibName:@"ViewDettaglio" bundle:nil];
Как это может произойти?
Я использую UINavigationController для навигации из ViewElenco и ViewDettaglio.
EDIT
Возможно ли это в следующем коде:
ViewDettaglio* viewDettaglio=[[ViewDettaglio alloc] initWithNibName:@"ViewDettaglio" bundle:nil];
viewDettaglio.idObject=idObj;
[self.navigationController pushViewController:viewDettaglio animated:YES];
alloc возвращает освобожденный объект?