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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:24:15+00:00 2026-05-30T12:24:15+00:00

I’m pretty new to iPhone development – so apologies if this is a dumb

  • 0

I’m pretty new to iPhone development – so apologies if this is a dumb question 😉

I have a bunch of data for mapping a pre-calculated relationships between values

e.g.

Mapping light input to power output for a solar panel.

One scale is fixed and can be easily calculated (i.e. it goes up in steps of 0.1 and has a known start and end point)

0.0 – 80.0

The other scale is defined by some data that I have in text format:

9.80293622028191E+0000, 9.82985159414126E+0000, 9.85682155471754E+0000, 9.88384617060865E+0000, 9.91092551045114E+0000, 9.93805964292038E+0000, 9.96524863673053E+0000, 9.99249256063480E+0000, 1.00197914834255E+0001, 1.00471454739344E+0001, 1.00745546010324E+0001 etc

I can use this on the phone to plot the lines for different variables.

The total data in text format is about 4mb (about 32kb per data line)

The question is – how best to store that array of float values such that I can easily update it – and also easily load it up for display?

I don’t ever need to pick out a single value from it – I’ll always need the whole list for a given line – so it seems to make sense to store it as a single data object. I could save it as text to a file and then overwrite the file when I want to update it. However – I’m going to need a SQL lite db for other data and this seems more sensible for storing data.

Using the float data type in SQL seems to be quite a heavy way to do it – as I’ll always want a complete set of values for a line so every select will be a join and (I’ll have to store the order info so I can get them back in the right order)

Does it makes sense to push the whole array into a string and store it as Text? Or is there a decent way to serialize an NSArray into a blob field and reconstruct it later?

—–EDIT———-

It turns out that a few thousand rows of floats in the SQLite db is terribly slow on the phone itself. It’s ok in the simulator, but can take 20 seconds or so to load on the phone. To get round this I’ve put this data into flat text files and I convert to floats as I load it into an NSArray.

  • 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-30T12:24:17+00:00Added an answer on May 30, 2026 at 12:24 pm

    You can serialize/unserialize your Array calling:

    - (NSArray *)componentsSeparatedByString:(NSString *)separator;
    

    and

    - (NSString *)componentsJoinedByString:(NSString *)separator;
    

    However, I would recommend either

    1) storing your Array into a file (writeToFile, arrayWithContentsOfFile)

    or better

    2) writing them into your existing SQLite-Database value by value. If I got you right, you don’t need any joins. Just fetch your values using:

    SELECT y FROM data LIMIT start_value, end_value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am trying to loop through a bunch of documents I have to put
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.