Insert Blob data into sqlite databas with archieve and Unarchieve data for local Notification

Hello Every one,

Today i am going to post the one very useful tutorial for creating the Localnotification application in which the stores the LocalNotification and retrieve the Notification from the database and retrieved data also convert into NSData then the that NSData is converting into the UILocalNotification that object is schedule  the Notification for the fetching from the SQLite database.In this Tutorial i will creating the set Alarm and that alarm detail stores into the DB, Also the we can bind the NSDictionary to NSLocalNotification,If the user select the and want to delete the particular alarm then swipe it and remove from the database and also UINotification also


Note:- In UILocalNotification one Issue arise  like when the application is deleted from the Device then the LocalNotification can’t deleted when the second time i instal the application then earlier notification show.


Solution:- For that i decide the one conditional checking when the no one entry in DB then the code thru i cancel all notifications.


now, I starts the Tutorial.

Step 1) Create the new project  >> Select Single View Application >>  Next >>Give the application name like “LocalNotificationDemo”.

Step 2) import the new frame work name is “libsqlite3.0.dylib”

Step 3) Create the new database either use firefox addon  “SQLite Manager” or also use the “Mike Tool for SQLite Database”

Following is the structure of the database

Step 4) Copy the database file into project resources.

Step 5) Create new file with .xib name as a “DBManager”

below Code for the DBManager.h file


below Code for the DBManager.m file

Initialization of a database

Constants of a file

Insert data into database

Select all data from the database

Delete data from the database

Step 6) Create the new file name like “NotifierViewController”

Insert below code into NotifierViewController.h

Insert below code into NotifierViewController.m

Following is the output of the User Interface

7) Create New File with name as “CountDown”  which shows the list of the Notifications and if users want do delete the notification here.

Below code for the “CountDown.h”

Below code for the “CountDown.m”

Following is the output of the User Interface

 8) Output of the Application

Lists of the Notificaitons

Delete The Notification

Step 9) Precautions of the Application in iPhone Application.

Note :- In LocalNotification only we can sets the 64 LocalNotification set at a time in every application

Step 10) Grab the Source code from Here.

Thanks and Regards,
Nimit Parekh.

Leave a Reply

Your email address will not be published. Required fields are marked *