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 8255955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:42:21+00:00 2026-06-08T01:42:21+00:00

i am new in xcode. i hope someone will teach me more xcode. i’m

  • 0

i am new in xcode. i hope someone will teach me more xcode.

i’m learning core data now, from what i learn, i can save my data from uitextfield using uibutton. this is my code.

- (IBAction)button1:(id)sender
{
    TestSaveDataAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
    NSManagedObjectContext *context = [appDelegate managedObjectContext];
    Highscore *record = [NSEntityDescription insertNewObjectForEntityForName:@"Highscore" inManagedObjectContext:context];
    record.highscore1 = textField.text;
    NSLog(@"Saved for %@", textField.text);
    NSError *error;
    if (![context save:&error])
    {
        NSLog(@"Error");
    }

now i have a UILabel call label and a button2 next to it. how do i load my data in my label when button2 is pushed? Please teach me.

i already wrote like this but i dont know how to put it in my label. any tutorial that i find only put it in tableview. i don’t want to put it in tableview, i just want my data show in my label.

- (IBAction)button2:(id)sender
{
    TestSaveDataAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
    NSManagedObjectContext *context = [appDelegate managedObjectContext];
    NSFetchRequest *request = [[NSFetchRequest alloc] init];
    NSEntityDescription *entity = [NSEntityDescription entityForName:@"Highscore" inManagedObjectContext:context];
    [request setEntity:entity];
    NSError *error;
    if (![context save:&error])
    {
        NSLog(@"Error");
    }
}
  • 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-06-08T01:42:25+00:00Added an answer on June 8, 2026 at 1:42 am

    You have to add NSPredicate to your request and execute it.

        NSPredicate *predicate = <#create your predicate here#>;
        [request setPredicate:predicate];
    
        NSError *error;
        NSArray *results = [context executeFetchRequest:request error:&error];
        if (error) {
            //inform user
        }
        //if you found something, you can set text for your UILabel
        if ([results count]) {
            Highscore *record = [results objectAtIndex:0];
            label.text = record.highscore1;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new at developing with XCode and Objective-C and I hope you can help
Brand new to app coding-- hope you can help! I'm using XCode 4.3 with
Lets go from the start Created New Xcode project,opened interface builder dragged one NSButton
Hope all of you doing great. I am new in Iphone development using xcode
I'm starting a new xCode project. I'm porting in some code from my last
Since new Xcode 3.2 I find it very hard to add Quartz Core Framework.
I created a new Xcode project (iOS application, Tabbed Application). Now I'm seeing one
I updated to new Xcode 4.2 (for iOS 5), but now my project doesn't
I really hope someone will be able to help me out with this. I
In the new Xcode 4 Documentation Organizer, I can't find the sidebar outline that

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.