English 中文(简体)
使用Modal 通过核心数据收集数据
原标题:Using a ModalView to save data via CoreData

我只是一个行文,用户只是搜索一些科学数据。 如同这一点一样:

-It has to "main" views selecteable by a TabBarViewController. -The first View is where the user just proceeds to the search query. -The secon view are just some settings, info and disclaimer information.

我使用了第二种观点,即将随附装运的亚银。 既然人口众多,我会实际执行环境、信息等等。

管理内容在申请方(申请方)中设立,如:

 firstViewViewController.managedObjectContext = self.managedObjectContext; 
secondViewController.managedObjectContext = self.managedObjectContext;
saveCustom.managedObjectContext = self.managedObjectContext;

self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];

return YES;

管理主题案文在第二View中被适当合成。

至今为止,科索沃信托公司在运作,我可以把物品留在银行。

现在,我提出了第一名书记员发出的模式意见。 我希望用户能够节省习俗数据。 为此,我重复了我在第 se号总书上所做的事。 我在上诉书中增加了相应的法典(或我认为是的)。

当我努力利用联运网(联运)挽救数据时,我会发现以下错误。

<><><>>>> 因无一例外而终止妊娠 +entityForName: 无法找到一个NSManaged 实体名称反对意见XXX

三十是我的实体的正确名称。

我知道,这是与管理有关的内容。 反对案文没有初步形成。 但是,我不理解为什么在座各位,而不是在座标上工作。

因此,我如何能够发挥作用?

我知道,将上诉人进口到示范意见中,虽然会奏效,但这不是一件好的做法。

提前感谢!

Edit:

用于节省数据的Im代码如下:

-(void)saveDataToCD{

NSString *entityString=[NSString stringWithFormat:@"%@",[arrayAdquiritDelMV objectAtIndex:1]];
NSString *deltaString=[NSString stringWithFormat:@"%@",[arrayAdquiritDelMV objectAtIndex:3]];





    NSManagedObjectContext *context = [self managedObjectContext];

    NSManagedObject *pepe = [NSEntityDescription insertNewObjectForEntityForName:entityString inManagedObjectContext:context];  // aqui un string
    [pepe setValue:assigment.text forKey:@"definition"];
    [pepe setValue:impurity.text forKey:@"impurity"];
    [pepe setValue:[NSNumber numberWithDouble:[delta.text doubleValue]] forKey:deltaString];  //aquí un string


    NSError *error;


    if (![context save:&error]) 
    {
        NSLog(@"Problem saving: %@", [error localizedDescription]);
    iiiiii

Edit #2, 这里是我所说的模式观点:

-(IBAction)saveCustom:(id)sender{

if(saveCustomController == nil)
{
    SaveCustom *viewTwo = [[SaveCustom alloc] initWithNibName:@"SaveCustom" bundle:[NSBundle mainBundle]];
    self.saveCustomController = viewTwo;

    [viewTwo release];
iii

[self presentModalViewController:self.saveCustomController animated:YES];

iii

最佳回答

从你所说的话来看,它并不像这样看待,但它仍然值得尝试。

Have you modified your Core-Data model since you ve launch your application?
If yes you need to go in your application folder and delete the Core-Data backing file.
Because it is now out of sync with your model and core data don t know what to do with it.

我唯一怀疑是,在我经过修改后提出申请时,我会收到这一错误,而不是后来提出2或3个意见。


你们如何以身作则地提出这种看法,你在什么地方创造这种看法,以及你在什么地方以这种观点为榜样?


您即将向国际会计师联合会通报什么情况。

if(saveCustomController == nil)
{
SaveCustom *viewTwo = [[SaveCustom alloc] initWithNibName:@"SaveCustom" bundle:[NSBundle mainBundle]];
self.saveCustomController = viewTwo;

[viewTwo release];
}

[self presentModalViewController:self.saveCustomController animated:YES];

你没有一条像一条这样的一条线。

viewTwo.managedContext = aManagedContext;

When you do it in applicationFinised... your instance don t exist yet.
And in Obj-C you can send a message to nil, it will just be ignored, you won t crash like in other language.

问题回答

暂无回答




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签