Category: Programming
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…
Objective-C – What are Categories?
Categories in Objective-C are used for adding extra functionality to a class without accessing the source code of the class and without subclassing it. Let us see this with an example by adding an additional method to NSNumber that just writes the value of the NSNumber argument to NSLog. Create Project Create a new Command…