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

The Archive Base Latest Questions

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

I have a NSMutableArray and I would like to use data from it in

  • 0

I have a NSMutableArray and I would like to use data from it in another view. I read up and found we can use indexOfObject to read data, but my NSMutableArray has multiple values, and I do not know how to obtain a particular field from the NSMutableArray.

Any help would be great appreciated.

I’m currently stuck at my IBAction onStartPressed. at the line

    self.clueHint.text = ds[0].initialClue;
//or
    self.clueHint.text = ds objectAtIndex:0 initialClue;

I displayed my other file and code which is involved.

ClueData.h
#import

@interface ClueData : NSObject
@property(nonatomic, strong) NSString * clueName;
@property(nonatomic, strong) NSString * initialClue;
@property(nonatomic, strong) NSString * clueHint1;
@property(nonatomic, strong) NSString * clueHint2;

@property(nonatomic, strong) NSString * clueAnswer;
@property(nonatomic, strong) UIImage * clueImage;
@end

ClueDataDAO.h

#import <Foundation/Foundation.h>
#import "ClueData.h"
@interface ClueDataDAO : NSObject
@property(strong, nonatomic) NSMutableArray * clueDataArray;

-(NSMutableArray *) PopulateDataSource;
@end

ClueDataDAO.m

#import "ClueDataDAO.h"

@implementation ClueDataDAO
@synthesize clueDataArray;
-(NSMutableArray *) PopulateDataSource
{
    clueDataArray = [[NSMutableArray alloc]init];
     ClueData * sampleData = [[ClueData alloc]init];

    sampleData.clueName = @"Tropical Fruit Tree";
    sampleData.initialClue = @"Where all the Tropical trees are planted.";
    sampleData.clueHint1 = @"It is located at Area 10";
    sampleData.clueHint2 = @"It could be found near Eco Lake";
    sampleData.clueAnswer = @"Fruit tree collection";
    NSString * file=[[NSBundle mainBundle]pathForResource:@"FruitTreeCollection" ofType:@"jpg"];
    sampleData.clueImage = [UIImage imageWithContentsOfFile:file];
    [clueDataArray addObject:sampleData];
    sampleData=nil;

    return clueDataArray;
}
@end

GamePageViewController.M

- (void)viewDidLoad
{
    [super viewDidLoad];
    daoDS = [[ClueDataDAO alloc]init];
    self.ds = daoDS.PopulateDataSource; //load pre-build NSMutableArray
    self.answer.delegate = self;
    // Do any additional setup after loading the view.
}

- (IBAction)onStartPressed:(id)sender {

    //initiate load object
// stuck at here :(

    ClueData * currentClue = [ds objectAtIndex:0]; // app got terminate at this line of code
self.clueHint.text = [currentClue initialClue];


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

    in the IBAction, first cast/save it to the correct var, like

    ClueData * sampleData = [ds objectAtIndex:0];

    then self.clueHint.text= [sampleData initialClue];

    as example

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

Sidebar

Related Questions

I'm learning iOS but have an issue extracting data from a multidimensional NSMutableArray ,
I have a NSMutableArray filled with NSMutableArray's. I would like to fill my table
My Case: I have original Page Control app from Apple. I would like to
I would like to delete a specific element from a NSMutableArray , and I
I have an NSMutableArray containing TBPosts that I would like to filter in descending
I have an NSMutableArray of names. I want the pass the data (selected name)
I have a NSMutableArray and it has the users high scores saved into it.
I have an NSMutableArray which has five objects in it. I want to insert
I have a NSMutableArray: NSMutableArray *temp = //get list from somewhere. Now there is
What's the best way to get objects from a window. I have a sudoku-like

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.