2014-03-19 99 views
0

你好我在執行應用程序,它是像3種不同的語言根據病情如何插入在覈心數據的數據

美國,英國,澳大利亞

我通過使用核心數據插入數據但在這裏我想一次插入3種語言的數據,請任何人幫忙。

這裏是NSUserDefaults語言類型,我下面越來越喜歡和插入類似以下,但在這裏,如果我把一個字符串如

  • groupname:@"my list"一個languge語言目前我在用的和

  • groupname:@"Name"爲remaing 2個languges我想插入

哪能變量。

NSInteger languageType = [[[NSUserDefaults standardUserDefaults] valueForKey:TYPE_OF_ENGLISH] integerValue]; 
    [dbWrapper insertWordListGroupWithPictureGroupId:wordlistGroupId groupname:@"mylist":[[NSNumber numberWithInt:playerId] integerValue]:[[NSNumber numberWithInt:goaltype] integerValue] pictureGroupid:pictureCardGroupid mylistId:9998]; 
+0

對不起所需的推導,我不明白這個問題嗎?你可以發佈,什麼是在insertWordListGroup ...方法? –

+0

- (無效)inserMyList:(NSInteger的)wordlistId組名:(的NSString *)組名playerid:(NSInteger的)playerId goaltype:(NSInteger的)goalType mylistid:(NSInteger的)mylistId { TblMylist * mylistInfo = [NSEntityDescription insertNewObjectForEntityForName:@」 TblMylist「 inManagedObjectContext:_managedContext]; –

+0

mylistInfo.mylistid = [NSNumber numberWithInt:mylistId]; mylistInfo.goaltype = [NSNumber numberWithInt:goalType]; mylistInfo.playerid = [NSNumber numberWithInt:playerId]; mylistInfo.wordlistgroupid = [NSNumber numberWithInt:wordlistId]; mylistInfo.wordlistgroupname = groupName; NSError *錯誤;如果(![_ managedContext save:&error]) { NSLog(@「Could not save:%@」,[errors localizedDescription]); } } –

回答

1

languageType作爲附加參數去的方法insertWordListGroupWithPictureGroupId有不放置一個if statement裏面的方法