Can we do it this way? [defaultStore createPossession];


#1

One question regarding the populating of objects in singleton.

In PossessionStore.m, a defaultStore is declared:

and in PossessionStore.m, a defaultStore class method? is declared:

also in the loop inside the init method in ItemsViewController.m, 10 random objects are added into the defaultStore singleton object:

[code]- (id)init
{
// Call the superclass’s designated initializer
self = [super initWithStyle:UITableViewStyleGrouped];

if (self) {
    for (int i = 0; i < 10; i++) {
        [[PossessionStore defaultStore] createPossession];
    }
}

return self;

}
[/code]

I’ve been wondering 2 things:

  1. Can’t we just call: [defaultStore createPossession]; instead of: [[PossessionStore defaultStore] createPossession];
  2. Is defaultStore an object or a method? Or defaultStore is actually 2 different objects having the same name?

P