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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:33:33+00:00 2026-05-29T20:33:33+00:00

So far I have: //read in data from CSV file and separate it into

  • 0

So far I have:

//read in data from CSV file and separate it into 'row' strings:
// where dataString is simply a CSV file with lines of CSV data
// 31 lines with 9 integers in each line
NSArray *containerArray = [dataString componentsSeparatedByString:@"\n"]; 
NSArray *rowTemp; //local variable just for my sake
NSMutableArray *tableArray;//mutable array to hold the row arrays

//For each index of containerArray:
//take the string object (string of CSV data) and then,
//create an array of strings to be added into the final tableArray

    for (int i = 0; i < [containerArray count]; i++) {
    rowTemp = [[containerArray objectAtIndex:i] componentsSeparatedByString:@","];
    [tableArray addObject:rowTemp];        
    }

Then when I try the following, it returns: (null)

NSLog(@"Row 6, cell 1 is %@", [[tableArray objectAtIndex:5] objectAtIndex:0]);

Any ideas? is there a better way?

FYI this data is static and very unlikely to change. Any way to create and populate a static array rather than using a mutable array, would be much appreciated.

Thanks in advance.

  • 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-29T20:33:34+00:00Added an answer on May 29, 2026 at 8:33 pm

    I just got the answer! with some help from iPhoneSDK forums, and what I failed to do was actually create the tableArray. What I did in the code above was merely create the variable. NSMutableArray *tableArray; and did not actually create the mutable array I wanted. Instead what I should have done was: NSMutableArray *tableArray = [NSMutableArray arrayWithCapacity: [containerArray count]]; Which worked like a charm.

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

Sidebar

Related Questions

I have a data set which I read from my a .csv file. After
I need to read data from a text file where the field lengths and
I'm writing a program for an exercise that will read data from a file
I have a large number of csv files that I want to read into
I want to download a file from the internet. And so far I have
I'm trying to read serial data from my Arduino using Java. I have followed
We have a software that reads data from other third party websites, so far
I am beginning on ASP.net MVC. All the articles I have read so far
Question: I need to read a CSV file. I use the FileHelpers library to
TLDR; How do I read data from a table using Entity Framework, when the

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.