添加注释

This commit is contained in:
life
2015-11-08 19:07:43 +08:00
parent 6468254994
commit 8dbfdf9eb3
3 changed files with 11 additions and 5 deletions

View File

@@ -10,8 +10,8 @@
@implementation BaseService
static NSManagedObjectContext * context;
static NSManagedObjectContext * writerContext;
static NSManagedObjectContext * context; // context
static NSManagedObjectContext * writerContext; // context
// http://stackoverflow.com/questions/695980/how-do-i-declare-class-level-properties-in-objective-c
+ (NSManagedObjectContext *) context {
@@ -63,7 +63,7 @@ static NSManagedObjectContext * writerContext;
push:(BOOL)push
write:(BOOL)write
{
// privaate context,
// private context,
if(inContext != context) {
NSError * savingError = nil;
BOOL ok = [inContext save:&savingError];
@@ -108,7 +108,8 @@ static NSManagedObjectContext * writerContext;
return YES;
}
// context
//
// context, parentcontext
+ (NSManagedObjectContext *)getTmpContext
{
NSManagedObjectContext *temporaryContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];

View File

@@ -1,6 +1,6 @@
//
// Leas.m
// Leanote
// LeanoteService, AppDelegate.m, BaseService.context tmpContext
//
// Created by life on 15/7/30.
// Copyright (c) 2015 Leanote. All rights reserved.

View File

@@ -2,6 +2,8 @@
// SyncService.m
// Leanote
//
// Notebook, Note, Tag service, tmpContext
//
// Created by life on 15/6/7.
// Copyright (c) 2015 Leanote.com. All rights reserved.
//
@@ -355,6 +357,7 @@ BOOL inSyncing = NO;
}
}
// service
- (void) initService
{
_notebookService = [[NotebookService alloc] init];
@@ -392,6 +395,8 @@ BOOL inSyncing = NO;
+ (SyncService *) newSync
{
SyncService *syncService = [[SyncService alloc] init];
// tmpContext
syncService.tmpContext = [self getTmpContext];
[syncService initService];