Currently i'm using a Property on the AppDelegate class.
Now, as my needs expend, I need more then 1 of these global property, so I thought to make a Singleton class that will hold the properties and will mange them. I found a lot of information about Singletons, but I couldn't figure out, is it possible to modify the property without having an Instance of the class?
For example:
@interface Tools : NSObject
@property (nonatomic,retain) NSDictionary* item;
...
@end
I would like to do:
[Tools setItem:someDict];
someClass = [someClass alloc] initWithItem:[Tools getItem]];
All my ideas ended up with the problem that the class Tools has no instance. I've tried setting item to be static variable (not property), which worked, but i'm sure that this is not the right why to do it.
related but different question, Adding:
#import "Tools.h"
To the project-Prefix.pch file ,so the item properties will be available from everywhere on the project, Is a good idea?