What is latest iOS version
IOS - 12.1
What is latest Xcode version
Xcode- 1
Who invented Objective c
Broad cox and Tom Lov
IPHONE / IPAD Screen Size
iPhone 4 (3.5 inches,480X620 pixel
iPhone 4s (3.5 inches,960X640 pixels Retina Displa
iPhone 5s (4.0 inches,1136 x 640 pixels Retina Displa
iPhone 6 (4.7 inches,1334X750 pixels Retina Displa
iPhone 6 Plus (5.5 inches,1920X1080 pixels Retina Displa
iPad (9.7 inches,1024X768 pixel
iPad (9.7 inches,2048X1536 pixels Retina Displa
What is delegate
Delegate is an object that handles the events happening on an object. To do
that delegate has to follow a protocol specifying the task it is going to handle
Delegat
The delegation is a commonly used pattern in object-oriented programming. It
is a situation where an object, instead of performing a tasks itself, delegates
that task to another, helper object. The helper object is called the delegate
A delegate allows one object to send messages to another object when an
event happens
A delegate is just an object that another object sends messages to when
certain things happen, so that the delegate can handle app-speci c details
the original object wasn't designed for. It's a way of customising behaviour
without subclassing
They are never retained
What is data source
-The datasource is an object that implements the required datasource
protocol that is needed to create a complex control
Ex UITableView is a view that needs a datasource object to which will help
building the table. Often it’s the controller that is displaying the table view. The
protocol that dataSource object ( mostly controller it self) has to implement is
“UITableViewDataSource” .
e
fi
.
What is @synthesize
We use @synthesize to generate getters and setters automatically from
compiler. We declare properties and then generate getter and setter method
by using @synthesize
NSArray and NSMutableArray
NSArrayʼs contents can not be modi ed once itʼs been created whereas a
NSMutableArray can be modi ed as needed, i.e items can be added/removed
from i
What is "Protocol" on objective c
A protocol declares methods that can be implemented by any class. Protocols
are not classes themselves. They simply de ne an interface that other objects
are responsible for implementing. Protocols have many advantages. The idea
is to provide a way for classes to share the same method and property
declarations without inheriting them from a common ancesto
What is difference between "protocol" and "delegate"
protocol is used the declare a set of methods that a class that
"adopts" (declares that it will use this protocol) will implement.
Delegates are a use of the language feature of protocols. The delegation
design pattern is a way of designing your code to use protocols where
necessary
Atomic
It is the default behaviour. If an object is declared as atomic then it becomes
thread-safe. Thread-safe means, at a time only one thread of a particular
instance of that class can have the control over that object
Nonatomic
It is not thread-safe. You can use the nonatomic property attribute to specify
that synthesised accessors simply set or return a value directly, with no
guarantees about what happens if that same value is accessed
simultaneously from different threads. For this reason, it’s faster to access a
nonatomic property than an atomic one
Retain
is required when the attribute is a pointer to an object.The setter method will
increase retain count of the object, so that it will occupy memory in
autorelease pool
t
fi
?
fi
.
fi
?
copy:
If you use copy, you can't use retain. Using copy instance of the class will
contain its own copy. Even if a mutable string is set and subsequently
changed, the instance captures whatever value it has at the time it is set. No
setter and getter methods will be synthesised
Readonly
If you don't want to allow the property to be changed via setter method, you
can declare the property readonly
Readwrite
is the default behaviour. You don't need to specify readwrite attribute
explicitly
Assign
will generate a setter which assigns the value to the instance variable
directly, rather than copying or retaining it. This is best for primitive types like
NSInteger and CGFloat, or objects you don't directly own, such as delegates
Strong:
Strong is required when the attribute is a pointer to an object.The setter
method will increase retain count of the object, so that it will occupy memory
in autorelease poo
Unsafe_unretained
There are a few classes in Cocoa and Cocoa Touch that don’t yet support
weak references, which means you can’t declare a weak property or weak
local variable to keep track of them. These classes include NSTextView,
NSFont and NSColorSpace,etc. If you need to use a weak reference to one
of these classes, you must use an unsafe reference. An unsafe reference is
similar to a weak reference in that it doesn’t keep its related object alive, but it
won’t be set to nil if the destination object is deallocated
What are sensors in iPhone
The proximity sensor immediately turns off the display when the iPhone is
lifted to ear. With this sensor the power is saved and accidental dialling is
prevented
What is Core Data
Core Data is a framework that manages an object graph
It is used to store data from your iPhone application into a Sqlite le which is
present in the document directory of your application.
-
fi
.
Core Data is not a relational database, you can see Core data as a wrapper
around Sqlite although core data is quite simpler as compared to Sqlite but it
does not offer some of the functionality that Sqlite can offer and vice vers
What is the difference between Cocoa and Cocoa Touch
Coco
Cocoa is the application framework for developing applications in Mac OS X
Cocoa is commonly referred to as the combination of the Foundation
and AppKit frameworks,
Cocoa Touc
Cocoa Touch is the application framework for iPhone,iPad and iPod
Touch
Cocoa Touch is the combination of the Foundation and UIKit
framework
What is ARC
ARC is a compiler-level feature that simpli es the process of managing the
lifetimes of Objective-C objects. Instead of you having to remember when to
retain or release an object, ARC evaluates the lifetime requirements of your
objects and automatically inserts the appropriate method calls at compile
time
Difference between shallow copy and deep copy
Shallow copies duplicate as little as possible. A shallow copy of a
collection is a copy of the collection structure, not the elements. With a
shallow copy, two collections now share the individual elements
Deep copies duplicate everything. A deep copy of a collection is two
collections with all of the elements in the original collection duplicated
What are the App states. Explain them
Not running State
The app has not been launched or was running but was terminated by the
system
Inactive state
.
fi
?
The app is running in the foreground but is currently not receiving events. (It
may be executing other code though.) An app usually stays in this state only
brie y as it transitions to a different state. The only time it stays inactive for
any period of time is when the user locks the screen or the system prompts
the user to respond to some event, such as an incoming phone call or SMS
message
Active state:
The app is running in the foreground and is receiving events. This is the
normal mode for foreground apps
Background state
The app is in the background and executing code. Most
apps enter this state brie y on their way to being
suspended. However, an app that requests extra
execution time may remain in this state for a period of
time. In addition, an app being launched directly into the
background enters this state instead of the inactive state.
For information about how to execute code while in the
background, see “Background Execution and
Multitasking.
Suspended state
The app is in the background but is not executing code.
The system moves apps to this state automatically and
does not notify them before doing so. While suspended,
an app remains in memory but does not execute any
code. When a low-memory condition occurs, the system
may purge suspended apps without notice to make more
space for the foreground app
What is Automatic Reference Counting (ARC)
ARC is a compiler-level feature that simpli es the process of managing the
lifetimes of Objective C objects. Instead of you having to remember when to
retain or release an object, ARC evaluates the lifetime requirements of your
objects and automatically inserts the appropriate method calls at compile
time
fl
.
fl
.
fi
?
What is model view
controller
MVC is a Design pattern
-Model stands for the
database object which will
manage all the database
transaction
- View stands for the UI i.e.
the UI visible to the user. User
will be interacting with the
view
- Controller is an object who
handles the view events and
also render the database
changes to the UI. In short , it
bridges the interaction
between Modal and View
What is the difference
between NSArray and
NSMutableArray
NSArra
- is a static arra
- Once created you can not modify the arra
- Ex you can not add or remove the object in NSArray
NSMutableArra
- is a dynamic arra
- You can add or remove the object dynamically
What are the delegate methods of NSURLConection
- didReceiveResponse
- didReceiveData
- didFinishLoadingData
- didFailWithErro
.
Core Data is heavily optimized with regards to caching, lazy-loading and
memory management
If you use it (with the SQLite store type), especially in conjunction with
NSFetchedResultsController, you should get better performance than you
could get with SQLite on your own
Apple has worked hard to make Core Data perform well on the iPhone. My
application switched from SQLite w/ FMDB to Core Data and it is now faster
and more stable with less code
.