I'm pretty sure the problem is that this line is failing:
if self.contentItems?.first?.content! == "" {
On a fresh install nothing has been saved, and the value of self.contentItems?.first?.content! is going to be nil and not "". So since this check gives the wrong value it fails later with str1 expecting there to be content stored. Instead, if you change the line to:
if self.contentItems?.first?.content! == nil {
It will at least not fail and and I believe work more correctly based on my skimming of what the code is trying to do.
Just quickly tried this and the demo is working as expected now on my system
I've not had a lot of time today to play more around this as I back to my day job this week but hopefully on Wednesday night I'll be able to look over the videos you sent and understand how this works and can be incorporated into my next app maybe I can get my boss to give me some time to work on my apps
Thanks also @Jonathan for helping out with this and creating an amazing piece of software to help my ideas come to life.
I will probably post the new example in the next couple of days.
Do go over the videos, I feel that is key for getting started on coreData, don't kill yourself over the previous example but do look at it .
There are a some changes that deal with multiple boxes in the next version and also App native Alert/editor.
Again this is just proof of concept and may not be the correct way of writing an app to any acceptable standard. I.e Since all of my Apps I write are for my own use I am a hack when it comes to code..
I did away with Alerts and am now using another ViewController.
This seemed a better way of doing it. The trick for me at least was figuring out a way to pass data to and back from each ViewController. I figured that out it, not seen it done my way but it works !!
I am using segue unwinds. Amazing little critters.
I will post the files once I have filled them with comments...
Hi @MarkHunte. this looks great? Does it effect any functionality with how the rest of the app will work in hype? As you can see from my online version, there is text to speech and I was wondering if this method would interfere with that somehow.
var text = hypeDocument.getElementById("text").innerHTML;
var x = text;
var u = new SpeechSynthesisUtterance();
var voices = speechSynthesis.getVoices();
u.voice = voices.filter(function(voice) { return voice.name == 'Bruce'; })[0];
u.text = x
u.lang = 'en-UK';
u.rate = .8;
speechSynthesis.speak(u);
It works relatively well but obviously there some differences between different browsers.