I have this problem: I sent to a friend my xcode project, he is able to open and run without errors, but at some point the app crashes.
More precisely app manages a sqlite database that stores the scores of the game and just when he tries to enter the page that shows the scores the app crashes with a NSRangeException as the data structure that stores the scores extracted from the db is empty.
Of course in my Xcode it works perfectly so, is there anything special I need to do before exporting a project to make it work on another mac? Should I also add the db file and make him re-import into his project?
I just created a zip file with the project folder.
If anyone can help me would be greatly appreciated. Thank you
Related
I just submitted an app to the App store and it is now available. Unfortunately I realized that my development test data was included in the SQLite database! How do I go about emptying my database for the distribution, in other words removing all rows from tables? I know how to do this for a simulation (Reset content and settings), but since the deployed version just uses the Generic iOS build that does not run in the simulator, I am not sure how to clear the database.
Figured this out myself. You have to find the location of the sql file in your project.
Find the .sql file in your project.
Go to File-> Show in Finder
Then go to that location using Terminal and use sqlite3 to set up your DB as you want it.
Using Xcode (Version 8.3.3) I created a sample app with the template for Single View Application and clicking Use Core Data.
At this point my app is running and I have a database containing data that I do not want to rebuild each time the app is started.
In other words I have the files:
MyApp.sqlite, MyApp.sqlite-shm and MyApp.sqlite-wal
I copied those files to the MyApp project folder.
Now here is my question:
How do I need to change the code so that the app will use the data in the database next time it is started?
Note: the only code I have related to the question is no more than the one automatically generated by Xcode.
I created a core data model that was working fine until I added a new entity to the model, my code is fine I think... because Xcode can't detect any errors, but as soon as I run my app on the simulator the compiler gives me an error saying
reason=The model used to open the store is incompatible with the one used to create the store
I don't quite understand what this error means. I did search for references regarding this error but the one I found is outdated it was from Xcode 3.2, I'm currently running Xcode 7.1.1, interestingly enough there's no check mark on none of the replies. Despite that I still tried to use some of those methods and nothing has worked.
Things I tried
Resetting iOS Simulator -> Reset Contents and Settings...
Deleted the [Simulator App Folder]/Document/*.sqlite and ran the project
Have you had the same problem? If so can you help me troubleshoot it? Thanks.
That error means that you changed the model so that it doesn't match the one you were using when you created the app's data. It's the classic sign of changing a data model and not either doing model migration or deleting the app from the phone/simulator (and it's been pretty much the same as long as Core Data has existed, so old information is not irrelevant). Deleting the app from the simulator would normally be all that's needed to run the app again. If it's not working, then you're somehow leaving old data in place.
The best way to delete an app from the simulator is usually the same as you'd delete an app on a real device-- click and hold until the app icon starts moving, then click the "x" on its icon to delete it.
If deleting the app doesn't help, you're using old data some other way. Maybe you have some pre-loaded data built into the app that was configured using an old version of the model?
My favorite solution is to open the sqlite database with a third party app, then open the Z_MetaData table and delete the row found in there.
Works like a charm every time.
It may affect your 'migration' if you do migrations.
We do not, so not an issue.
So I am in the process of submitting my first application to iTunes, I went through the entire process, and when I clicked distribute on my archive so that i could submit my app for approval, I got this image saying that a certain amount of things have failed. I fixed all the app icons that were missing (I didn't know that you had to have all of them, but I have them all now).
If possible, could you guys explain what each one means and how to fix it (I'm having a very large problem here since my app is actually part of a school project due in two days).
Are you including large files with your application? In the Xcode Supporting Files folder, right-click on each file and select Show in Finder to see the size of each file. Are the biggest files absolutely necessary or a duplicate of another file?
Are there large arrays with several thousand or more elements within your code? Could the data be placed on a server external to your code and read in?
I've finally obtained an iOS developer license, I've managed to publish a hello world, basic kind of app, get an IPA file and install it on my iphone.
However, now i'm trying something more complex, including using imported libraries. I start the publish process as usual, no error is produced but i'm not getting a message that the ipa is ready.
When i look at the target directory I have folders named like 'AOTBuildOutput5264907783565294361.tmp' with files in them.
Looks like it crashes in the middle, but I get no error message to debug!
Please help me find out where I can read these error messages or provide some other kind of insight!
Thanks in advance
Rotem
I've occasionally run into problems like this. It usually occurs when I'm trying to publish the app from my dropbox folder whilst it is trying to sync.
I can only assume that the problem happens because another application is accessing that file (in my case dropbox).
So make sure nothing else is trying to sync to that folder. Hope that helps.
I ended up moving my development folder to somewhere else in my filesystem and everything went fine. I guess having hebrew charachters in the path didn't work so well for the compiler.