In Xcode, is there a way to set up a table that is not for the user interface, but as an "engine" for processing data

I'm wondering if there is a way to set up something similar to a spreadsheet in Xcode. I am trying to create a "listening game" or "clicker game" and it would be very difficult to store so many variables in normal coding.

Having this "table" will allow me to keep track of multipliers and refresh rates instead of hammering my encoding.

Preferably, I could just tell my code what to pull and what to look for from the table. The table will be the "engine" and it will not be the user interface. The table will do all the work behind the scenes and then show it through the label and button based UI.

+3


source to share


2 answers


As Traxido says, without any details, we cannot point you to a specific example / solution. Based on the title, the answer is "yes". However, this is not a ui component. It doesn't even need to be alone. You want the data structure to contain your data in a way that can be conveniently stored and retrieved. You can create a class that is part of other data structures such as arrays and dictionaries and possibly other data structures. You may have many questions before you finish. So: the answer is yes. Try it yourself and ask new questions if you get stuck. Please provide code and error messages and I am sure you will get answers quickly.



+1


source


Yes, you can.

Create a shared or single instance and store all data in its instances. (or) create a custom data structure and override the set or get methods to automatically process the output every time you add or remove a data item.



Example: if you want to keep an array that is always sorted. MySortedArray is a custom structure that inherits NSMutableArray and maintains a protected NSMutableArray instance. Override the addObject method to ensure that it is sorted whenever a new object is added.

0


source







All Articles