Category: Programming
Regular Expressions Cheat sheet
Regular Expressions form sequence of characters which can be used for pattern matching. They are quite powerful tool for finding or matching combination of characters. Special Characters in Regular Expression backslash ( \ ) – Used for matching special character by proceeding with backslash Eg:- For matching period in a string use backslash before period…
Generate random numbers – Example of motion and touch event
Let us see how to use motion and touch event in iOS by looking through a simple project that displays random number. This project displays random number on a label for a touch and motion event. Check out this link for more about events in iOS After creating a single view application, add a new…
Java version 1.7 required to Google Plugin on Eclipse
This is not related with iOS development but I have deployed the backend service for my iOS app on Google App Engine. This is about the steps for resolving the “JRE version is 1.6.0 1.7.0 or later is needed to run Google Plugin for Eclipse”. 1. Download the latest JDK from oracle website – http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html.…
Decode job advert posted in Swift Language
I came across this unique Swift job advert in stackoverflow.com posted by Criteo. (Need to add override for the init function, missed in the original job post) var hello = “Hello, I am a Swift Program, paste me in the playground” var doyouswift = “You think you have what it takes to build the next…
Simple UITableView and UIAlertView example
In this article, we are going to see how to create a simple UITableView for displaying data. And display an alert on selection of any row using UIAlertView. Launch Xcode, Click File > New Project and select Single View Application as the project template. Enter the project details for Product Name, Organization Name, Company Identifier…
NSLog datatype formatting option in Objective-C
NSLog in Objective-C is function call that is useful during debugging of a program. A typical NSLog example is NSLog(@” How to use NSLog”); The above statement prints the message ” How to use NSLog ” in console window. If you want to print the value of Objective-C variable or data type then you need…
Different data types in Objective-C
Objective-C like any other programming languages has different data types like int, float, double, char and id. Data types are used for specifying the kind of data that is being stored in a variable. For example, the below code stores a single character to a variable “flag” char flag = ‘1’ Data type – char…
‘NSInvalidUnarchiveOperationException’, reason: ‘Could not instantiate class named MKMapView’
Problem :- Xcode project with MapView control displays the error “‘NSInvalidUnarchiveOperationException’, reason: ‘Could not instantiate class named MKMapView’” Solution :- The ‘Could not instantiate class named MKMapView’ error is displayed when the Xcode project with MapView control on xib does not include the MapKit library as part of the Link Libraries. Select the Xcode project…