I'm receiving EXC_BAD_ACCESS at random times in a place that I confirmed the exception should not happen.
The line its happening on is
`[[LevelEditorScene sharedLevelEditor] setObject:object forKey:key]`
LevelEditorScene
is a class, setObject:forKey:
is a method I implemented (not the one from NSObject
)
In GDB:
(gdb) print-object [LevelEditorScene sharedLevelEditor]
<LevelEditorScene = 06C3FF40 | Tag = -1>
Means LevelEditorScene sharedLevelEditor
is ok.
(gdb) print (bool)[[LevelEditorScene sharedLevelEditor]
respondsToSelector:@selector(setObject:forKey:)]
$9 = true
Means it responds to the selector
(gdb) print-object object
15
(gdb) print-object key
Maze Width
Means the arguments are ok (it shouldn't matter anyway).
What else can be causing the exception?