Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6681629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:36:42+00:00 2026-05-26T04:36:42+00:00

I dont know where m getting wrong here is the output of console 2011-10-07

  • 0

I dont know where m getting wrong here is the output of console

2011-10-07 11:03:29.508 Golden Corral[2365:207] After whole process Name : Ggggggggggg
2011-10-07 11:03:29.513 Golden Corral[2365:207] After whole process Score : 27600
2011-10-07 11:03:29.515 Golden Corral[2365:207] Error : Error Domain=NSCocoaErrorDomain Code=1660 "The operation couldn’t be completed. (Cocoa error 1660.)" UserInfo=0x5566d60 {NSValidationErrorObject=<HighScore: 0x5563eb0> (entity: HighScore; id: 0x5555ed0 <x-coredata:///HighScore/tDAD877F0-0594-4E14-819F-AF5BDA4A38A82> ; data: {
PlayerName = Ggggggggggg;
TopTenScore = 27600;
}), NSValidationErrorKey=PlayerName, NSLocalizedDescription=The operation couldn’t be completed. (Cocoa error 1660.), NSValidationErrorValue=Ggggggggggg}

and here is my code of saving data. I am checking whether the user enteres his name for highscore or not, if not m taking name Anonymous else what the user has entered. Gdb shows the correct value of both user name and highScore but data is not storing in database.

    -(void)calculateHighScore
{

    //////////////////////////       Core Data  Entries.    ///////////////


    HighScore *ScoreData = (HighScore*)[NSEntityDescription insertNewObjectForEntityForName:@"HighScore" inManagedObjectContext:self.managedObjectContext];



    if ([txtName.text isEqualToString:@""] || [txtName.text length] == 0 )
    {



            NSLog(@"The Name :%@",txtName.text);

            NSLog(@"%d",CountHighScore);

            ScoreData.PlayerName = @"Anonymous";
            ScoreData.TopTenScore = [NSNumber numberWithInt:CountHighScore];

            NSLog(@"The Name :%@",ScoreData.PlayerName);

            NSLog(@"%d",CountHighScore);

            isWinner = NO;
            levelCount ++;




    }

    else 
    {



            NSLog(@"Befor Text assign highscore :%d",CountHighScore);

            //CountHighScore = [txtName.text intValue];

            ScoreData.PlayerName = txtName.text;
            ScoreData.TopTenScore = [NSNumber numberWithInt:CountHighScore];

            NSLog(@"The Name :%@",txtName.text);

            NSLog(@"%d",CountHighScore);


            isWinner = NO;
            levelCount ++;




    }

    NSLog(@"After whole process Name : %@",ScoreData.PlayerName);
    NSLog(@"After whole process Score : %d",CountHighScore);

    // Code for inserting into DataBase
    NSError *CorrectError;      
    if (![self.managedObjectContext save:&CorrectError])
    {
        // Handle the error...
        NSLog(@"Error : %@",CorrectError);
    }



}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:36:43+00:00Added an answer on May 26, 2026 at 4:36 am

    Answer was found during conversation in comments.

    When you are creating new key in your model you can set restrictions to the values of that property.

    In current example restrictions were set on values of key PlayerName: maximum length of it was set to 8.

    So when you set value of PlayerName key to @"Ggggggggggg" that has length more then 8 you will receive error when committing changes to the database. All restrictions are checked only after your have made all the changes to objects and want to save them to your database by committing changes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know what I'm doing wrong here, but I'm getting parse error: Parse
I keep getting this error and I really dont know why. I have tried
While deploying a dwr web app, i'm continuously getting this error. I dont know
Here is my code... I am getting an indentation error, but I don't know
New to SQLite so I don't know what I'm doing wrong. I'm just getting
I'm getting IOError: [Errno 13] Permission denied and I don't know what is wrong
I don't know why I'm getting (bin) in the file status - I checked
I don't know why but i am having trouble getting my head round event
I am getting the following error on my site, however, i don't know what
I dont know if I should use the httpcontext caching or the Enterprise Library

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.