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

  • Home
  • SEARCH
  • 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 8984475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:06:55+00:00 2026-06-15T21:06:55+00:00

Im new to Objective and iPad apps. Im trying to display an array that

  • 0

Im new to Objective and iPad apps. Im trying to display an array that Ive already used in a separate Class/View Controller. The array Im trying to access is in “MainMenuScreen.m” and I want to use that array in another class called “ScoresScreen.m”.
All my code is working, I just need to get the array from the other class and plug into my code.I tried using Segue but im getting this error in my code, and im stuck. Thankyou in advance


.h

#import <UIKit/UIKit.h>


@interface ScoresScreen : UIViewController<UITableViewDataSource, UITableViewDelegate>{
     NSMutableArray *scoresArray;
}
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (weak, nonatomic) NSMutableArray *scoresArray; //Added this line

@end

.m

#import "ScoresScreen.h"
#import "MainMenuScreen.h"

@interface ScoresScreen ()

@end

@implementation ScoresScreen
@synthesize scoresArray; //Added this line
NSMutableArray *TestScoresArray;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
   ...
....
....

.m

#import "MainMenuScreen.h"
#import "PlayGame.h"
#import "ImageTest.h"
#import "ScoresScreen.h"
@interface MainMenuScreen ()

@end

@implementation MainMenuScreen

//---------------------------------------------------------------------------------

//------------------------------------Variables------------------------------------

PlayGame *playGame;//PlayGameObject

NSMutableArray *gameDataArray;//Game Data Array (A array storying multable ImageTest Objects)

NSMutableArray *scoresArray;//<-------This need to go to view scores

//---------------------------------------------------------------------------------

//----------------------------------Constructors-----------------------------------

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    scoresArray = [[NSMutableArray alloc] init];

    [scoresArray addObject: [NSMutableArray arrayWithObjects:@"Bob",[NSNumber numberWithInt:134],nil]];//testData
    [scoresArray addObject: [NSMutableArray arrayWithObjects:@"Roger",[NSNumber numberWithInt:12],nil]];//testData
    [scoresArray addObject: [NSMutableArray arrayWithObjects:@"Ben",[NSNumber numberWithInt:34],nil]];//testData

    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

//---------------------------------------------------------------------------------

//----------------------------------Add New Score----------------------------------
//a setter Method so Play Game can add the user name and score to the scoresArray
-(void)AddNewScore :(NSString *)userName :(int)score
{
    //adds user name and score to the array
    if (scoresArray != nil)
    {
        /*NSMutableArray *nameAndScore = [[NSMutableArray alloc] init];
        [nameAndScore addObject:userName];
        [nameAndScore addObject: [NSNumber numberWithInt:score]];//int needs to be converted before storing in an array
        [scoresArray addObject:nameAndScore];*/

        [scoresArray addObject: [NSMutableArray arrayWithObjects:userName,[NSNumber numberWithInt:score],nil]];


        for(NSMutableArray *m in scoresArray)
        {
            NSLog(@"%@%@", m[0],m[1]);//prints out the array in logs to make sure it is working
        }
    }
}




    //added this method
            - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
            {
               ScoresScreen *controller = [segue destinationViewController];
               controller.array = yourArray; //use of undeclared identifier 'yourarray'
//and this error "property 'array' not found on object of type 'ScoresScreen*'"
            }
    //This is where I get the error ^.

…Please can someone help me? Thanks

---------
  • 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-15T21:06:57+00:00Added an answer on June 15, 2026 at 9:06 pm

    Use this in your MainMenuScreen.m file

    #import "MainMenuScreen.h"
    #import "PlayGame.h"
    #import "ImageTest.h"
    #import "ScoreScreen.h"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to objective-c and iOS development. I need an iPad application to display
I'm new to Objective C. I see in many iPhone/iPad applications that after releasing
So new to objective-c and iphone/ipad development. Trying to get my feet wet with
I am making a new Objective C class and it gave two options as
Fairly new to Objective C and trying to work within Storyboards given it's the
I'm new in objective-c, and I'm now trying to write a simple user-sign-in program
I'm new in objective-C and i wonder if its correct: I have a class
New to Objective-C iPhone/iPod touch/iPad development, but I'm starting to discover lots of power
I am fairly new to Objective C and iOS programming but am constantly trying
I have a brand new Objective-C class called test . The test class has

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.