Erstellen eines konstanten Dictionary-Objekts

Ich möchte etwas erreichen, was in diesem Beitrag getan wird:Konstanten in Objective-C

Ich möchte jedoch ein NSDictionary erstellen.

wenn ich etwas mache wie:

constants.h

extern NSArray *const mFooKeys;
extern NSArray *const mFooObjects;
extern NSDictionary *const mFooDictionary;

constants.m

NSArray *const mFooKeys = [[NSArray alloc] initWithObjects: 
                                   @"Foo", @"Bar", @"Baz", nil];
NSArray *const mFooObjects = [[NSArray alloc] initWithObjects: 
                                   @"1", @"2", @"3", nil];
NSDictionary *const mFooDictionary = [[NSDictionary alloc] dictionaryWithObjects:mFooObjects 
                                                                         forKeys:mFooKeys]; 

Habe ich in Dealloc veröffentlicht und alles ist in Ordnung, oder steckt noch mehr dahinter? das ist eher eine vorsichtige frage als eine frage nach etwas falsch, aber ich habe das gefühl, ich könnte das wirklich durcheinander bringen, ohne es zu merken.

Antworten auf die Frage(4)

Ihre Antwort auf die Frage