iOS Interview Questions and Answers
Related differences
Ques 26. What is Swift?
Swift is a modern programming language created by Apple for iOS, OS X, watchOS, and tvOS apps that combines the best of C and Objective-C, but without the C compatibility issues. Swift follows secure programming patterns while also incorporating modern features to make programming simpler, more versatile, and enjoyable. Swift is welcoming to novice programmers and feels familiar with Objective-C developers.
Ques 27. What is Objective-C?
Objective-C is the primary programming language for writing applications for OS X and iOS. It’s an object-oriented programming language with a dynamic runtime that’s a superset of the C programming language. Objective-C takes C’s syntax, primitive types, and flow control statements and adds class and process definition syntax.
Ques 28. What is an NSError in Swift?
The NSError class is a Cocoa class. The knowledge about an error condition is encapsulated in an extendable, object-oriented manner by an NSError object. It includes a predefined error domain, a domain-specific error code, and a user details dictionary with application-specific data.
Ques 29. What is the difference between KVC and KVO?
- KVC (Key-Value Coding) is a method for accessing an object’s properties using strings at runtime rather than needing to know the property names statically at development time.
- KVO (Key-Value Observing) allows a controller or class to monitor changes in a property value. In KVO, an object may request to be informed of any adjustments to a particular property, and the observer is automatically notified if that property’s value changes.
Ques 30. What is the difference between retain and assign?
Retain creates a reference from one object to another and increases the retain count of the source object.
Assign creates a reference from one object to another without increasing the source’s retain count.
Most helpful rated by users: