I do not understand what I'm doing wrong. I have a dictionary that is the property of a singleton class:
@ interface CABResourceManager: NSObject {.... NSMutableDictionary * soundMap; } @ Property (Maintaining) NSMutableDictionary * Soundmap; Then I add an object to a dictionary in this dictionary:
+ (zero) loadSoundFromInfo: (ABSoundInfo) sound {static unsigned int currentSoundID = 0; CABSound * newSound = [[CABSound alloc] initWithInfo: (ABSoundInfo) sound soundID: ++ currentSoundID]; [[CABResourceManager shared RISMGR] SOMAMAP SET OBJECT: New Sound for: Sound.Name]; } and try to get it in another method:
+ (ALuint) playSoundByName: (NSString *) name {NSMutableDictionary * map = [CABResourceManager Shared ResMgr] .soundMap; CABSound * Sound = [Map ItemFork: Name]; // There is an exception and the app goes over the exception.
2011-03-27 20: 46: 53.943 Book 3 HD-N [5485: 207] *** - [NSCFSet objectForKey:]: Sent to unknown selector 0x226950 2011- 03-27 20: 46: 53.945 Book3HD-EN [5485: 207] *** Ending the application due to unacceptable exceptions 'NSInvalidArgumentException' I think that with memory management Something might happen, but here it is clear to me: The Cabsound Object Set Object () is kept in the dictionary, it should not be released at this time.
I think the soundmap is started properly so it seems that when you get the error So the soundmap is a bad indicator that can load + loadSoundFromInfo, which will not generate an error immediately.
Comments
Post a Comment