I may have the wrong terminology in the title using the word singleton. Now I am looking for a good technique. I have an object called user that stores registered users, such as a session key for server requests. I just want one of these entities to ever exist. Is there a standard technique for this?
That i still have something like this
NSManagedObjectContext *moc = [self managedObjectContext]; NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"UserEntity" inManagedObjectContext:moc]; NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease]; [request setEntity:entityDescription]; NSArray *array = [moc executeFetchRequest:request error:&error]; if (array == nil) {
source share