Le vendredi 4 avril 2014 18:37:18 UTC+2, Jens Alfke a écrit : > > > On Apr 4, 2014, at 8:26 AM, nadia echi <[email protected] <javascript:>> > wrote: > > > Can you show the code that opens the database and registers the views? > > > self.window.rootViewController = self.viewController; > > [self.window makeKeyAndVisible]; > > > > CBLManager *manager = [CBLManager sharedInstance]; > > //[CBLView setCompiler: [[[CBLJSViewCompiler alloc] init] > autorelease]]; > > // create a database > > NSError *error; > > self.database = [manager createDatabaseNamed: @"catafoto" error: > &error]; > > if (!self.database) > > NSLog(@"Couldn't open database (error=%@)" ,error); > > NSURL *url =manager.internalURL; > > > > //********** customer View search: > > > > CBLView* view = [self.database viewNamed: @"client/docView"]; > > [view setMapBlock: ^(NSDictionary* doc, void (^emit)(id key, idvalue)) { > > NSString* type = [doc objectForKey: @"type"]; > > > NSArray * value = [NSArray arrayWithObjects: > > [doc objectForKey: @"id"], > > [doc objectForKey: @"description1"], > > nil]; > > if ([type isEqualToString:@"CLIE"]) emit([doc objectForKey:@"_id"], > value); > > } version: @"1.0"]; > > > > //*********** product varianty > > > view = [self.database viewNamed: @"prodVersion/docView"]; > > [view setMapBlock: ^(NSDictionary* doc, void (^emit)(id key, idvalue)) { > > NSString* type = [doc objectForKey: @"type"]; > > > > NSArray * value1 = [NSArray arrayWithObjects: > > [doc objectForKey: @"code"], > > [doc objectForKey: @"id"], > > [doc objectForKey: @"versionCode"], > > nil]; > > if ([type isEqualToString:@"product"]) emit([doc objectForKey: > @"_id"], value1); > > } version: @"1.0"]; >
> ......ect > > > > (6) Reopen app ----> mean i killed the process and relaunch it : with this > i can found my list updated > > > > > -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/9fc21c78-c798-467f-83a9-bdba0195be85%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
