Question:- What is the difference between atomic- and non-atomic properties? Which is the default for synthesized properties? When would you use one over the other?
Answer:- Properties specified as atomic are guaranteed to always return a fully initialized object. This also happens to be the default state for synthesized properties. While it is a good practice to specify atomic properties to remove the potential for confusion, if we leave it off, the properties will still be atomic. This guarantee of atomic properties comes at the cost of performance. However, if we have a property for which we know that retrieving an uninitialized value is not a risk (e.g., if all access to the property is already synchronized via other means), then set it to non-atomic can boost the performance.
Question:- Does Objective-C contain private methods?
Answer:- No, there is nothing called a private method in Object-C programming. If a method is defined in .m only, then it becomes protected; if it is defined in .h, it is public. If we really want a private method, then we need to add a local category/unnamed category/class extension in the class and add the method in the category and define it in class.m.
Question:- What is a plist?
Answer:- Property list or plist refers to a list that organizes data into named values and lists of values using several object types. These types provide us the means to produce data that is meaningfully structured, transportable, storable, and accessible, but still as efficient as possible. Property lists are frequently used by applications running on both Mac OS X and iOS. The property-list programming interfaces for Cocoa and Core Foundation allow us to convert hierarchically structured combinations of these basic types of objects to and from standard XML. We can save the XML data to the disk and later use it to reconstruct the original objects. The user defaults system, which we programmatically access through the NSUserDefaults class, uses property lists to store objects representing user preferences. This limitation would seem to exclude many kinds of objects, such as NSColor and NSFont objects, from the user defaults system. However, if objects conform to the NSCoding protocol, they can be archived to NSData objects, which are property-list-compatible objects.
Question:- Explain MVC?
Answer:- MVC is the acronym for “Model-View-Controller.” MVC is a design pattern for web applications that consists of three interconnected components. Model – A model is where the data is stored. View – The classes in view are reusable as they don’t have any domain-specific logic. Controller – with delegation patterns, the controller act as a communication between the model and view. The MVC model, also known as the “pattern,” is widely used in the development of modern user interfaces.
Question:- What is the purpose of reuseIdentifier? What is the benefit of setting it into a non-nil value?
Answer:- The reuseIdentifier is used to group together the similar rows in a UITableView, i.e., the rows that differ only in their content, otherwise having similar layouts. A UITableView will normally allocate just enough UITableViewCell objects to display the content visible in the table. If reuseIdentifier is set to a non-nil value, then the UITableView will first attempt to reuse an already allocated UITableViewCell with the same reuseIdentifier when the table view is scrolled. If reuseIdentifier has not been set, then the UITableView will be forced to allocate new UITableViewCell objects for each new item that scrolls into view, potentially leading to laggy animations.
Question:- What are Swifts advantages?
Answer:- The main advantages of Swift are mentioned below: • Easy to read • Easy to maintain • Extremely fast • Dynamic libraries • Safe programming language • Efficient memory management • Concise code
Question:- What is the difference between an ‘App ID’ and a ‘Bundle ID’? What is each used for?
Answer:- • An App ID is a two-part string used to identify one or more apps from a single development team. The string consists of a Team ID and a Bundle ID search strings, with a period (.) separating the two. • The Team ID is supplied by Apple and is unique to a specific development team, while a Bundle ID is supplied by the developer to match either the Bundle ID of a single app or a set of Bundle IDs of a group of apps.
Question:- • An App ID is a two-part string used to identify one or more apps from a single development team. The string consists of a Team ID and a Bundle ID search strings, with a period (.) separating the two. • The Team ID is supplied by Apple and is unique to a specific development team, while a Bundle ID is supplied by the developer to match either the Bundle ID of a single app or a set of Bundle IDs of a group of apps.
Answer:- Cocoa Touch is the result of combining the Foundation and AppKit frameworks, while Cocoa is the result of combining the Foundation and UIKit frameworks. To build API stacks, Cocoa and Cocoa Touch sit on top of other application sets. Media, Core Services, and CoreOS are the other layers.
Question:- What is NSURLConnection class? Define its types and use cases.
Answer:- There are two ways of using the NSURLConnection class. One is asynchronous and the other is synchronous. An asynchronous connection will create a new thread and perform its download process on the new thread. A synchronous connection will block the calling thread while downloading the content and doing its communication. Many developers think that a synchronous connection blocks only the main thread, which is not true. A synchronous connection will always block the thread from which it is fired. If we fire a synchronous connection from the main thread, the main thread will be blocked. However, if we fire a synchronous connection from a thread other than the main thread, it will be like an asynchronous connection and wont block our main thread. In fact, the only difference between synchronous and asynchronous connections is that at runtime a thread will be created for the asynchronous connection while it won’t do the same for a synchronous connection. In order to create an asynchronous connection, we need to: 1. Have our URL in an instance of NSString 2. Convert our string to an instance of NSURL 3. Place our URL in a URL Request of type NSURLRequest or, in the case of mutable URLs, in an instance of NSMutableURLRequest 4. Create an instance of NSURLConnection and pass the URL request to it
Question:- Explain Swifts pattern matching techniques
Answer:- • Tuple patterns: Values of corresponding tuple forms are matched using tuple patterns. • Type-casting patterns: You can cast or mix styles using type-casting patterns. • Wildcard patterns: Every kind and kind of value is matched by wildcard patterns, which disregard them. • Optional patterns: To align optional values, optional patterns are used. • Enumeration case patterns: The cases of existing enumeration forms are matched by enumeration case patterns. • Expression patterns: You may use expression patterns to compare a given value to a given expression.
Question:- What is a Guard statement?
Answer:- If one or more requirements aren’t met, a guard statement is used to pass program control out of a domain. The advantages of guard statement are as follows: • It is another way to safely unwrap optionals • It provides an early exit • It avoids pyramids of doom
Question:- How is memory management handled on iOS?
Answer:- Memory management is crucial in any application, especially important in iOS applications due to memory and other limitations. ARC, MRC, reference forms, and value types are all included. Every iOS developer should be aware of this! Memory leaks and system crashes are all too common in iOS apps due to poor memory management.
Question:- Explain the characteristics of Android.
Answer:- Criteria • Type of operating system • OS fragmentation • Customization Characteristics • Open source • Multiple OS versions and interoperability concerns • Heightened customization possible
Question:- Why cannot you run the standard Java bytecode on Android?
Answer:- No, not necessarily. We can program Android apps using the Native Development Kit (NDK) in C/C++. The NDK is a toolset that allows us to implement parts of our app using native code languages such as C and C++. Typically, good use cases for NDK are CPU-intensive applications such as game engines, signal processing, and physics simulation.
