Day 14 at Mobile Makers (Core Data, NSFetchRequest, NSManagedObjects

Persistence is preserving data from one application load to the next time it is loaded, a way to save data offline and this is also how our topic today, core data, ties into everything. Core data is a way to save data each time the user uses the app so that the next time they open it, that same data is still there. The key thing to remember with this is to check the core data box when making your new project in the master template. Then you can make a new entity and with this entity you can give it attributes with specific types like string or int. Then you can reference these attributes because they are key/value pairs.

This week is really challenging and my mind is on overload with the announcement of swift as well. I have dived into swift some already and once I become a little more familiar with it, I think I am going to love it. Some of the main things I noticed are that you don’t have to specify variable types, which is really neat. Also, everything you type shows up on the right side so you can see what is happening as you are typing.

Don showed me a neat trick today using animations. The code is below and then I will explain it.

– (IBAction)onTextFieldTapped:(id)sender

{

[UIViewanimateWithDuration:0.5

delay:1.0

options: UIViewAnimationCurveEaseIn

animations:^{

self.containingView.center = CGPointMake(self.containingView.center.x, (self.containingView.center.y -50);

//way to set this to the center of the view?

}

completion:^(BOOL finished){

}];

}

This code above is an action that is tied into each textField on a view controller. All these textFields are in their own view, separate from the main view. Every time a textField is exited, the code above runs and after a 1 second delay, it moves the view as a whole down the y axis by 50 pixels. This is pretty cool because as the user moves down from a textField to the next, the whole view moves up with it and this ensure that the keyboard is never covering any of the textfields.

Kevin gave a really awesome github tutorial today and it cleared a lot of things up for me. He showed us a example of two people working on a project and showed us how to do a project from start to near completion. He showed us best practices to ensure that we did not run into merge errors as well. I will go more in depth on his tutorial in a future blog post after working with it more. Next week we form groups and that will be our first chance to really dig into using push and pull requests along other developers and seeing how the whole process works.

-Blake

Leave a comment