Note that there are some explanatory texts on larger screens.

plurals
  1. POCore Data is creating NULL values
    primarykey
    data
    text
    <p>I have a pretty simply piece of save code that goes as follows:</p> <pre><code> SOModule* newModule = [NSEntityDescription insertNewObjectForEntityForName:@"SOModule" inManagedObjectContext:self.managedObjectContext]; newModule.name = self.tf_name.text; newModule.ip = self.tf_ip.text; newModule.port = self.tf_port.text; newModule.user = self.tf_user.text; newModule.password = self.tf_pass.text; newModule.created = [NSDate date]; NSError* error = [NSError alloc]init]; [self.managedObjectContext save:&amp;error]; //doesn't say anything when NULL stuff is created </code></pre> <p>The Managed Object Context is created by using this Core Data method:</p> <pre><code>-(NSManagedObjectContext*)managedObjectContext { return [(SOAppDelegate*)[[UIApplication sharedApplication]delegate]managedObjectContext]; } </code></pre> <p>The problem is that I am getting NULL values at random times when ever I try to save the text fields in the <code>SOModule</code> object. Here's an example I pulled from inspecting my Core Data database:</p> <p><img src="https://i.stack.imgur.com/fZCmg.png" alt="enter image description here"></p> <p>As you can see, there is no recognizable pattern of the NULL values appearing, while the save function is being called in the same way every time. Also, just to clarify, I just started to put <code>test8</code> multiple times because I got tired haha, but I haven't implemented checking for duplicates yet, so this shouldn't matter.</p> <p>Any help would be awesome, this is driving my nuts!</p> <p>~Carpetfizz</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload