Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Collections for use in iOS

Discussion in 'iOS and tvOS' started by Canley, Nov 26, 2022.

  1. Canley

    Canley

    Joined:
    Jun 17, 2022
    Posts:
    35
    Hi,

    I created a class and declared a list for my app in c#:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class NotesList : MonoBehaviour
    6. {
    7.     public List<string> DailyNotes = new List<string>();
    8.  
    9.     void Start()
    10.     {
    11.         DailyNotes.Add(“note 1);
    12.         DailyNotes.Add(“note 2);
    13.         DailyNotes.Add(“note 3);
    14.         DailyNotes.Add(“note 4);
    15.    }
    16. }
    In visual scripting I copy that data, line by line, into an AotList. Everything works great when I run it in unity.

    Once I compile and run it in TestFlight, it stops working - the values don't load into the AotList.

    I think this is because iOS doesn't like List?

    I've been hunting around for examples of how to use AotList instead in my c# code, and can't find what I need.

    Can anyone help me?

    Thanks heaps :)
     
  2. Canley

    Canley

    Joined:
    Jun 17, 2022
    Posts:
    35
    Ok - it ~was~ working ok on running in unity. Not now.

    Advice still welcome!