How to save data to PList files in iOS

How to save data to PList files in iOS

While working with iOS Applications there are various ways to store data locally into an app. Such as NSUserdefaults, SQLite database, Plist file, NSKeyArchiever, Core data etc.

A developer can choose any of the medium suitable for the application. It can be measured by the complexity of the data & length of the data. Usually, plist is used for storing flag values or for in-app purchase settings or for storing some of the key settings of the application. This kind of data doesn’t require any complex data structure of any advanced functions.

Plist file doesn’t require to fire any queries nor any complex process for fetching or updating data. So it loads faster than the other data storage options.

That is the reason why its more often used in the game for storing scores, statistics of the game. Implementation is also very easy as just a few lines of code required to set up 2 main functions for handle plist files records. First for reading records, Second for writing records.

Here are few easy steps with a graphical representation for creating, reading & writing plist file.

Create New plist file :

Right click on projects & click create new file

From Resources select property list & name it as you want (For ex: mySettings.plist).

Set up prefix value into plist :

You can store anything type of variable like Dictionary, Array, Strings to the plist. Note that the root type will remain NSDictionary always. Lets say we have to store string value inside plist file.

So here i am storing string value by setting up prefix value to 0. We can store & manage multiple strings, arrays & dictionary values inside same plist file.

Writing value to plist file:

-(void)doWriteSettingFilePlist {
NSError *error;
NSString *path = [documentsDirectory stringByAppendingPathComponent:@”SettingFile.plist”];
NSFileManager *fileManager = [NSFileManager defaultManager];
// if File not exist at the same path
if (![fileManager fileExistsAtPath: path]) {
NSString *bundle = [[NSBundle mainBundle] pathForResource:@”SettingFile” ofType:@”plist”];
[fileManager copyItemAtPath:bundle toPath: path error:&error];
NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile:path];
[data setObject:self.strProVersion forKey:@”proversion”];
[data writeToFile:path atomically:YES];

Reading from plist file :

-(void)doReadSettingFilePlist {
NSError *error;
NSString *path = [documentsDirectory stringByAppendingPathComponent:@”SettingFile.plist”];
NSFileManager *fileManager = [NSFileManager defaultManager];
// if File not exist at the same path
if (![fileManager fileExistsAtPath: path]) {
NSString *bundle = [[NSBundle mainBundle] pathForResource:@”SettingFile” ofType:@”plist”];
[fileManager copyItemAtPath:bundle toPath: path error:&error];
NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile:path];
self.strProVersion = [data valueForKey:@”proversion”];

Notes :

Plist is more faster in terms of fetching data & handle small amount of records. Although its no recommended for use in high level database records storage where more complex operations are requires to handle. One more drawback is plist doesn’t provide update functions like SQLite does. Its just simply overwrites the data.

Overall its still useful feature for handling default app settings of the app like flag values sound, inApp purchase properties etc. with less coding & less efforts & minimum compilation time.

Set up UILocalNotification in iOS Swift/Objective C

Set up UILocalNotification in iOS Swift/Objective C


UILocalNotification helps to schedule specific notification for the user on specific date & time. As the name suggests that its handled & called from inside the application locally. So it can work without internet connection.

Its used in an application for various purpose like :

  • Keeping user active into application & make sure app usage increases
  • Notify for some reminders in the application
  • Used as a reminder feature inside the application
  • Keep highlighting for the features inside the application
  • Daily usage reminder for the application

So here is the tutorial about how we can create a UILocalNotification & manage it.

Objective C :


Create new notification :

-(void)doCreateLocalNotification {

NSDate *now = [NSDate date];

NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];

NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:now];

[components setHour:18];

[components setMinute:1];

[components setSecond:10];

NSDate *firedate = [calendar dateFromComponents:components];

UILocalNotification *notification = [[UILocalNotification alloc] init];

notification.fireDate = firedate;

notification.alertBody = @”Hey how are you ? Have you used application today ?”;

notification.repeatInterval = NSCalendarUnitDay;

[[UIApplication sharedApplication] scheduleLocalNotification:notification];


Destry all local notifications :

-(void)doDestryNotification {

[[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0];

[[UIApplication sharedApplication] cancelAllLocalNotifications];


Read more: Healthy iOS Development Tips & Tricks

Swift :


Create new notification :

func doCreateReminder() {

let dateToFire = NSDate().addingTimeInterval(60*60*24*7)

let notification = UILocalNotification()

notification.fireDate = dateToFire as Date

notification.alertBody = NSLocalizedString(“localalert”, comment: “”)

let dict:NSDictionary = [“type” : “reminder”]

notification.userInfo = dict as! [String : String]

notification.repeatInterval = NSCalendar.Unit(rawValue: UInt(0))

notification.soundName = UILocalNotificationDefaultSoundName



Destry all local notifications :

func doDestryAllNotification() {

UIApplication.shared.applicationIconBadgeNumber = 0




Tags: iOS, iOS app, iOS Application Development Services, iPhone Application Development Company, Mobile Apps Development, Update
Important Tips to Test iPhone Application

Important Tips to Test iPhone Application

This blog will help you out to improve your professional testing ability as a mobile application tester.

Even if you are not a professional tester & working as a developer but you want to make sure the test beta released by you does not come back with bunch of bugs & issues list than you can refer this blog & it will help you out to improve your application testing skills & eventually it will help you out to make bug free & seamless mobile experience.

Usually, this happens when tester reports any bug on application but does not provide required enough information to the developer & as result developers are not been able to detect the bug & that creates a communication gap.

So to overcome this issue here are few points that need to be in consideration while testing iOS Application.

Do always provide crash logs :

  • This is the very basic & initial step that every iOS Application tester should follow is while reporting bugs they must provide it with the crash logs.
  • In iPhone settings, it automatically stores crash logs of the application. Through that crash logs, a developer can easily detect the lines of code which causes the crash
  • To find the crash logs go to Settings -> Privacy -> Diagnostics & Usage -> Diagnostics & Usage Data. You will find a list of logs there & the recent log will be on the top sorted by the application name.
  • You can retrieve this log file by connecting your device with the computer & sync with iTunes

Do test under limited memory availability on a device :

  • To perform such testing you can test on the devices with lowest configurations or you can create such environment by increasing the usage on the device. For that, you can open all of the applications on the device & also use browser of the device & open few tabs with a couple of websites open
  • So that will consume the memory of device & that will create an environment for you to better test application on such environment
  • This will allow you to check how an application performs on lower memory conditions & in case of low memory availability it gives appropriate messages or throws exceptions

Data inputs testing :

  • In application, if you find a form fill up the view that has more chances of bugs, glitches. So try to products the bug on the page
  • Try by adding inputs that are out of bound & doesn’t suit that field. That will discover if any validation missed placing
  • Try out if keyboard return key works correctly while filling up form & also it scroll correctly & text area scrolls to top exactly over keyboard area while adding input

Test under lower internet connectivity :

  • Developers often do testing on simulators where the get the direct internet usage through ethernet connection & that’s why it loads data more faster
  • But using the same application on a device with limited speed is a slightly different scenario
  • Make sure all of the users wouldn’t have high-speed connections. So if application mostly depends on the server data then try to check how much loading time is & proper caching mechanism used in the application or not
  • To test that cache are enables or not you can try loading data again & again by killing the application in the background. You will notice that the time taken for loading the data is less in the second time then it took in the first time. That indicates that application using proper caching protocols.

Offline testing :

  • For the web server based application it requires necessary to do offline testing. Install first application & then drop the internet connectivity & see how the application behaves. Does it provides appropriate messages in case of no data availability or generates any crash issues?
  • Now do a similar process with a reinstall application load the web-based data for the first time & then turn off the internet connection & see if it loads offline stored data or cached data or it loads nothing.

Read More: Healthy iOS Development Tips & Tricks


Asynchronous data loading :

  • In iOS, it offers a feature for loading data asynchronous. That means it will not block the main thread & whatever data is loaded will appear & makes the application run smoothly.
  • This requires checking specifically where the data loaded from the web server & also the case where a large number of data loading it should not stuck whole application & wait until all data loads.


Memory level warnings :

  • This is the major point & requires to do hard testing of an application more preferably in a debugging mode.
  • For that, you will need to directly run an application to the device in a debugging mode
  • Once its installed try to do hard testing of an application by doing fast navigations to the pages & if any view contains scrolling with large data records than try to scroll up & down continuously for at least 60 seconds. If the application will have proper memory releasing techniques used then it will not get crashed
  • Otherwise, it will start giving memory level 0-1 warnings in just a few seconds of scrolling. That indicates or application CPU usage time & memory usage is very high & application can exit at any stage


Always prefer device testing :

  • Its more preferred that you do testing on every available device on which your application is compatible with.
  • Well, it’s not possible though to test on all devices but do at least test on the device you have available.
  • The reason why is few of the issues which not detects on the simulators but it can products a crash on a device.
  • Like if you have an image used in the application wrongly named or capitalized it will work fine on simulators but it will create an issue on a device. There are lots more such points that can only be tested on the device.


Test application on 64-bit devices :

  • It’s important to check if your application supports arm 64 supported devices or not. Now as per apple new rules all application is 64 bit compatible only will be allowed to upload to the store otherwise it will give error message while uploading on the store
  • But there are few applications still on the store which is never updated after its deployed on the store. So that not contains a 64-bit support


Conclusion :

Bugs & glitches free application easily get acceptance on the app store & it also increases the application engagement.

As every user when downloads the application they expect to application works at least without any bugs. So if a user gets it they will also appreciate it & more usage of the application by them will improve the over all ranking of the application.

This can only be achieved by the coordination between developers & testers.

How to Create and Setup a Prefix Header File for iOS

How to Create and Setup a Prefix Header File for iOS

Prefix header file is precompiled header file. Its automatically included while you create a new project. Normally developers use this file to declare common headers used in view controllers. Also used to import common frameworks. Headers & frameworks declared in prefix header will be accessible to all view controllers without creating any reference to it as it precompiled.

So from this point of view its very useful file & manages reusability & allows a user not to import frameworks again & again for each view controllers. Now if in your project prefix file is not present you can create it manually by following simple steps.

Here are the step to create and setup a Prefix Header File for iOS,

Right click on resources folder & click the new file

Select PCH file from others
Name it with exactly your project name & save it

Now go to targets -> build settings & find prefix header row. Now set a path for prefix header in the row. A path would be like, APPNAME/PREFIX FILENAME

Read more: Healthy iOS Development Tips & Tricks

That’s it!!! Now you can declare headers, common frameworks & third party classes which are commonly used.
Healthy iOS Development Tips & Tricks

Healthy iOS Development Tips & Tricks

About iOS Development:

Being an iOS developer always feels exciting because it gives us a chance to work with & to do innovative things. There is always a scope for something new depends on developer capabilities & level of thinking.

But at the same time, it also has challenges in the application development like to compatible with latest iOS versions & at the same time should also work on lower versions as well. We also need to keep in mind about future iOS versions as well to make sure easy adaptability. In short, it should have always a scope for the future aspects.

Quick & Easy Tips that Should Help you

Design :

Use app thinning concept & create image sets into .xassets files only. Don’t directly put images into resource folder. Using .xassets applies app thinning & also allows image compression so it makes sure the archive file size will not get much affected by a large number of images.

App Icon / Launch screen & other graphical elements used in the application must not be size beyond 1 mb. Make sure all images are of few kb. Preferably 10-20 kb size of images makes app runs smoothly. If you find any image size of around 500 kb or more than 1 mb contact designer immediately & tell them to compress the image file & make it small size. There are lots of online tools available which allows compressing images without even designer help. Some of the good online tools are :



Right now 1 images are not getting used any more on iPhone devices. So there is no mean to add 1x images into .xassets folder. So you can keep it empty. That will reduce the number of images in the application so overall it will help to reduce the size of an application.

Keep removing unnecessary & unused images from an application. Sometimes it happens that large scale application has always keep updated with new graphics & adding/Removing features on the app. So at the time developer often forgets to remove old or unused images from the application. That files increases the application size & also downs the performance of the application as well. So it becomes necessary to keep cleaning unused files from the application.

Read more: Why does your Business need a Mobile App?


Always prefer to with ARC based on iOS Development. That will reduce the half of your work to reduce the memory usage

Keep removing unnecessary third-party libraries & classes that are not currently in use for the application. That will improve compilation time & improves app performance

Less Usage of nib files. That will always increase the memory load. Always prefer to add view controllers into a storyboard

Make sure storyboard does not load with too many controllers. That increases compile time of the application

Make View controller as light as possible as because too many controls added into view controller makes it slow in appearance. Make dynamic controls which are less in use. That will make view controller light in storyboard

“Simplicity is the best virtue”, That quote has always been a truth in iOS development. The more simplified code will less the complexity.

Use standard naming convention. It’s nothing but you need to keep in mind one thing that variable, methods or file whatever you create must be present their characteristics. For eg: you are taking string variable to store name then you should name it like “strName”

Use @autoreleasepool where arc doesn’t work or any major operations where you think causing the memory issues you can write that code inside @autoreleasepool. So what it will ensures that the relevant objects will be released just after the end of operation completion.

See example :

@autoreleasepool {
sourceTile.origin.y = y * sourceTileHeightMinusOverlap + sourceSeemOverlap;
destTile.origin.y = destResolution.height – (( y + 1 ) * sourceTileHeightMinusOverlap * imageScale + kDestSeemOverlap);
sourceTileImageRef = CGImageCreateWithImageInRect( sourceImageRef, sourceTile );
if( y == iterations – 1 && remainder ) {
float dify = destTile.size.height;
destTile.size.height = CGImageGetHeight( sourceTileImageRef ) * imageScale;
dify -= destTile.size.height;
destTile.origin.y += dify;
CGContextDrawImage( destContext, destTile, sourceTileImageRef );
CGImageRelease( sourceTileImageRef );

Find & resolve memory level warnings. Try to check the memory usage & CPU usage time by while navigating from one to another view controllers. That will give the rough idea about which view controller causing high memory usage so you can take appropriate actions on that page. For more detailed information like which line exactly causing memory leaks, you can use memory tools available with Xcode.

Use Pragma Symbols in a code to separate the functions.

Create classes & increase reusability of methods & functions. That will help to reduce compilation time by not to compile same functions again & again.

Remove Breakpoints, NSLogs once your purpose of it done. Also, remove commented & unused methods. That adds complexity to the project & increases development time.

Use dispatch_async function while performing UI operations through programming. This is a very common issue & makes application become unresponsive sometimes while performing UI operations & at the same time some another process blocks it. That results in bad user experience & user might leave the application in that case.

See example :

dispatch_async(dispatch_get_main_queue(), ^{
[self.collectionView reloadData];


By following above tips developer not only can develop & maintain high quality apps but also helps to make a seamless experience & make a user more active on the application. That helps to make application analytics stronger & it directly effects to improve app ranking on the store.

Tags: iOS, iOS app, iOS Application Development Services, iPhone Apps Development India, Mobile Apps Development, Mobility, New Feature
10 essential WordPress plugins for food bloggers

10 essential WordPress plugins for food bloggers

Many people have started blogging nowadays and the main problem that occurs is they don’t know the use of plugins and how to save their content from being used by different site. WordPress has numerous plugins that can help blogger improve, market and save their content from thieves. They just need to know the right use and which plugins to use.


Tags: Build your own Website, food blog plugins, Indian food recipes, recipe, Tips and tricks, WordPress, wordpress plugin for food blog, WordPress plugins, WordPress Website Development
DIY ideas to refashion your old jeans

DIY ideas to refashion your old jeans

Hello beauties. We all know that the best fashion clothes never go out of style, and jeans are the perfect example. Almost every girl have a pair of jeans in their closet. But sometimes, we are getting bored to wear same jeans frequently and want to throw them away, right!

Wait! Don’t feel down, you can give those old jeans a new fashionable touch and transform them into trendy pieces. All you need are your old jeans, some fabric scraps, laces, sewing machine, scissors, studs, thread and pins.


Tags: Distressed jeans, DIY, fashion, How to, Painted jeans, Refashion jeans, Ripped jeans, Tie die jeans, Tips and tricks
Free online mockup sites to generate eyecatchy screenshots for mobile apps

Free online mockup sites to generate eyecatchy screenshots for mobile apps

Users or clients need to understand how your proposed app will work. To solve this purpose, your must showcasing your app with impressive app screenshots. Well, here you need to hire design professionals, right! Designers always have to spend hours on making perfect screenshots for multiple devices.

Mockup templates is a one-step solution that will save designers time and indirectly  the making cost of your mobile app. Use mockup templates for showing off your app designs or screenshots, no photoshop needed. Here in this post i am going to share the hand-picked list of free online mockup sites. Check out high quality PSD templates on these mockup sites that help you getting attractive app screenshots easily for free with no hassle.


Tags: App screenshot mockup, App store screenshot mockup, Free app mockup tools, Free mockup sites 2016, Free mockups online, Free PSD mockups, iPhone mockups, Mobile app mockup, Mockup screenshot generator, pressroom
How to install wamp server on windows

How to install wamp server on windows

Why Wampserver is used?

Any website that uses server-side language such as Apache, PHP and MySQL requires a local server to run before make it live. Developer will need local server environment  to test changes rather than on web server.

Wampserver or WAMP is a local server package for Windows system. Its main purpose is to run test applications before being uploaded on to the web server.


Tags: Configure wamp server in windows, How to install wamp server, Installing wamp on windows 8, Installing wamp server, pressroom, Set up wamp localhost, Set up wamp on windows 10, Steps to install wamp server, Wamp server for windows, Wamp server installation guide, Wamp server installation in windows 7

Create stunning looks virtually right on your phone

create stunning looks right on your phoneFashion is a hot topic in today’s era. It is an aspect of our daily lifestyles. People want to look more attractive by wearing clothes in keeping with trend and occasions, right! As we all know that proper clothes will reveal our personality in a pleasant way. You can say that the fashion is the craze of dressing up.

In a technology conscious market, smartphones are the latest medium to deal with any situation. In the world, there are apps for everything from shopping to organize. Then, why not using the mobile app to create stunning looks virtually? Yes, fashion apps are a great way to make your look impressive and to feel happy wearing your own outfits. There are many fashion apps available on both Apple and Android devices with different categories such as personal stylist, color consultant, wardrobe consultant, closet management that help you digitally archive your personal style.


Tags: fashion apps, fashion stylist, Lifestyle app for iPhone, online personal stylist, online stylist, personal fashion stylist, personal stylist, pressroom, wardrobe consultant