Realm on iPhone Exception on read

After an absence from programming for a couple weeks and a hardware problem, I have returned to this issue of being unable to discover why my Realm data files are not visible on my iPhone device. Since I had no experience in Primary Keys, I converted my 7 .swift data files to not include Primary Keys. I have 7 entirely new files with different names and I deleted the App from my iPhone. I got the same error basically when I tested the array following a load I still have no data on the iPhone. However, I do have the App and have the data structures as seen in the Realm Browser.

I discovered a process that would allow me to inspect the data files that reside on the iphone by connecting the iPhone to my Mac, and loading the application from a fresh start after deleting the App from the iPhone. I then rebuilt the app with the iPhone device as the target, it was connected and my test for good data still follows the exception process because the data files were empty.

This is how I looked at the data from Xcode on the Mac to the connected iPhone.

Xcode - Windows - Devices and Simulators . Choose your desired device and navigate to the downloaded app in the Installed App section. With the correct app highlighted, select the gear icon underneath and choose Download Container. There I found the Default Realm file and my swift file entries (all seven of the new named files). When I did this I was expecting to see an object in the file. I move the PersonData.swift file contents to an array (usersArray) and access the first entry. When I test the the count value I take the Else path and load to the variables the Sample Data and not the .name property value.

Here is the test of the data file:
usersArray = realm.objects(PersonData.self)

    if usersArray!.count > 0 {
        print(usersArray!.count)
        nameLabel.text = usersArray?[0].name
    } else {
        print(usersArray!.count)
        nameLabel.text = "Sample Data"
    }

When I run on the simulator the usersArray!.count value is returned as 1 and my .name data displays on the simulated iPhone view with the textfield loaded with the .name value from the db.
When I run on the iPhone device the usersArray!.count value is returned as 0 and the “Sample Data” appears on the view in the appropriate textfield.

Does anyone have any thoughts on why the simulator finds the data and the device has the structures of the data.swift files (showing it’s name and the properties defined) but the data does appear to be on the device?

What else can I show to the community. I am using the same swift statements I used in the Todoey application that I wrote in the London App Brewery course cirriculm.