Search Your Question

What are the app id and bundle identifier?

Ans : 
Bundle ID : 
A bundle ID or bundle identifier uniquely identifies an application in Apple's ecosystem. This means that no two applications can have the same bundle identifier. To avoid conflicts, Apple encourages developers to use reverse domain name notation for choosing an application's bundle identifier.
i.e com.iosiqa.newapp or com.iosiqa.app.new

App ID : App ID consists of Team ID + Bundle ID. Team ID is provided by apple to one team in developer account.
i.e ABC12345.com.iosiqa.newapp

What is use of APP ID? 
Whenever you want to enable a capability or application service for your application, you enable that capability for the App ID your application is linked to. This used to be tedious, requiring a visit to Apple's developer website. Xcode has evolved quite a bit over the years and it takes care of the details most of the time.

How To declare custom tableview cell? What Is The Use Of dequeuereusablecellwithidentifier ?

Ans : 

Let's create custom cell :

1. Take viewcontroller or tableviewcontroller
2. In Tableview, put one uitableviewcell and change style to custom.
3. Give any string (i.e "newcell") to reuseidentifier of cell in attribute inspector.
4. Put labels, textfields, views in cell according to your need.
5. Add new file named as newCell.swift that inherit from UITableViewCell.
6. Select your cell and give class name newCell.
7. Now you can make outlet of that cell in newCell.swift.

Here magic will be created using dequeuereusablecellwithidentifier : 

The best part of using dequeueReusableCellWithIdentifier is that using this you can re-use your cells.

Imagine if your table has 1000 entries. Now, if for each entry a table cell would be created then for 1000 entries, 1000 tableview cells and memory allocation for 1000 tableview cells.

App will be slowed down or would crash if the entries goes beyond 1000.

When we use, dequeueReusableCellWithIdentifier, the tableView just creates exactly the number of cells based on your table height and cell height. Suppose, if it shows 4 cells in the tabelView and rest you can see by scrolling, then memory for only 4 cells would be allocated at any given point of time.

Now, when you will scroll the tableView, it will re-use the same cell but will change the cell content (data) based on your data source.

Hope this clears your doubt.

Code

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:"newcell"];
    cell.textLabel.text = @"Test";
    return cell;

}

Difference between App Bundle and File Directory

Ans : Although bundles and packages are sometimes referred to interchangeably, they actually represent very distinct concepts:

1.
A package is any directory that the Finder presents to the user as if it were a single file.
A bundle is a directory with a standardized hierarchical structure that holds executable code and the resources used by that code.

2.
The Finder considers a directory to be a package if any of the following conditions are true:
.The directory has a known filename extension: .app, .bundle, .framework, .plugin, .kext, and so on.
.The directory has an extension that some other application claims represents a package type; see Document Packages.

Difference between array, set and dictionary

Ans : 

Array :
Arrays are effectively ordered lists and are used to store lists of information in cases where order is important.
Cost of adding item in array is greater than set and dictionary if item is not appending first.

For example, posts in a social network app being displayed in a tableView may be stored in an array.

Set : 
Sets are different in the sense that order does not matter and these will be used in cases where order does not matter. Sets are especially useful when you need to ensure that an item only appears once in the set.

Dictionary : 
Dictionaries are used to store key, value pairs and are used when you want to easily find a value using a key, just like in a dictionary.


For example, you could store a list of items and links to more information about these items in a dictionary.


What is NSPredicate?

Ans : Using NSPredicate, we can filter records before fetching from Coredata or collections. It work in place of where clause in sql.

NSPredicate on Core Data :

When we want data from coredata of only who's name is Manan Shah. So using predicate we can filter as following :

var strName = "Manan Shah"
request.predicate = NSPredicate(format: "name = %@", strName)

NSPredicate on Collections : 

let manan = Person(firstName: "Manan", lastName: "Shah", age: 28)
let sagar = Person(firstName: "Sagar", lastName: "Shah", age: 26)

let people = [manan, sagar] as NSArray

let thirtiesPredicate = NSPredicate(format: "age >= 27")

people.filtered(using: thirtiesPredicate)
Result : manan object will be return.