IOS Core Data Example With Sample Code

IOS core data is the most efficient way to save and load data in iPhone and iPad app. It is also more complicated than another ways such as NSUserDefaults or NSFileManager. The best way to help us fully understand how IOS core data works is writing an real project. In this tutorial, I will design a simple iPhone app to demonstrate the whole process of using core data in iOS app. The process includes:

  • How to design the data structure with core data
  • How to initialise the core data
  • How to add data in core data
  • How to fetch data from core data
  • How to fetch data from core data by filter

Before we start the core data tutorial, let me briefly describe this small app first. This app will store 4 people’s information by using core data framework. The information includes name, password, gender, email and address. The main features of this example app is showing people’s information and search people by name. All above tasks will be implemented by core data framework.
Read more

Hide UINavigation Bar in Push Segue Animation

Last time, we talk about how to create a Push segue animation without UINavigation controller. The problem I want to solve is that I want to use horizontal sliding effect as ViewController transition without using UINavigation. However, there is no horizontal sliding effect in model segue. Therefore, I have to use custom style segue and define a custom segue. With the custom style segue, we can easily switch ViewControllers without any pain.

In this IOS tutorial, I will show you a new way to apply Push segue by using UINavigationController, but hide the navigation bar. This approach is more clean, nice and easy to understand. It is also very easy for you to use in your own project. Because we are using a normal UINavigator, all view transition are implemented by UINavigationController functions including pushViewController and popViewControllerAnimated.

My working environment is Mac OS X Mavericks with Xcode 5.0.2. Deployment target is 7.0. Target device is iPhone. You can also use this source code in your iPad project.
Read more

iPhone Rss Reader App IOS Tutorial 4: Show Rss Feed in UIWebView

This is the forth iphone programming tutorial in the iPhone Rss Reader app example. In this iphone source code example, I will improve the xml parser to get more data from rss feed xml, and store them in a new value object class. When user clicks the rss title in the table view, I will use push segue to switch to a UIWebView, which will show the rss content inside.

This tutorial will update the storyboard to add a new UIViewController, and all data in this UIWebView example is generated by the previous iphone example source code. Hence, I recommend you to review the whole example tutorials as well.

Read more

Create Animation in IOS Apps With PNG Sequence Files

There are thousands of questions about how to use flash animation in IOS apps because the iphone apps and ipad apps don’t support the flash animation files, or swf format file. Now, I have a solution for it. We can convert the flash animation into png files and load the png sequence in iphone, ipad apps to simulate the animation.

In Adobe Flash CS6, there are two new features to export MovieClip animation to a set of png sequence files or png sprite sheet. In this IOS programming tutorial, I will show you an example about how to export the MovieClip to png sequence files and animate png files in IOS apps.
Read more

Create Push Segue Animation Without UINavigation Controller

Latest Update: A better way to implement push segue animation without UINavigation bar
Apple provides three styles of Storyboard Segue, push segue, modal segue and custom segue. Push segue is a predefined segue with a horizontal sliding animation. To make it works, we have to integrate our view controller with UINavigationController. Sometimes, we don’t want to have a UINavigation Bar, but want to use push segue between viewcontroller transition. We may find that it won’t work. Alternatively, we can use modal segue instead. In modal style, there are four transitions including Cover Vertical, Flip Horizontal, Cross Dissolve and Partial Curl. However, there is no horizontal sliding animation effect. Hence, we have to use custom style segue. Here is a video to show you how we can create a horizontal sliding animation transition by custom segue.

Read more