Wednesday, January 28, 2015

dequeueReusableCellWithIdentifier usage


The purpose of dequeueReusableCellWithIdentifier is to use less memory. If the screen can fit 4 or 5 table cells, then with reuse you only need to have 4 or 5 table cells allocated in memory even if the table has 1000 entries.In the second way there is no reuse. There is no advantage in the second way over just using an array of table cells. If your table has 1000 entries then you will have 1000 cells allocated in memory. If you are going to do that you would put them in an array and just index the array with the row number and return the cell. For small tables with fixed cells that may be an reasonable solution, for dynamic or large tables it is not a good idea.

What are the things need to take care while designing app for 2 different resolutions ?

It all depends on your image:
  • If your Image can be stretched, UIImageView will do all the work.
  • If only a part of you image should be stretched you should use this:
    • code - imageView.image = [imageView.image resizableImageWithCapInsets:UIEdgeInsetsMake(top, left, bottom, right)];
  • If your image can't be stretched you should then do different images for the phones and change them in runtime.


IPA creation from Xcode

1) Click on project you will see the project settings change the name of bundle identifier for whom we want to make an IPA.
2) Change the signing certificate as per bundle identifier.
3) Edit the scheme and set this set Build configuration for Archive scheme to Release/Distribution [Default Distribution]
4) Select the Build for iOS Device and clean the build.
5) Now select Archive option from Product menu of Xcode.
6) After successful completion it will show you the Archive tab of Xcode from here you can validate your application by selecting latest archive and pressing Validate button or you can make IPA by clicking Distribute button.
7) When you click Distribute button you will get 3 option
a. Submit to App store
b. Save for enterprise or Ad-Hoc deployment - Used to create IPA
c. Export as Xcode archive

8) Select Save for enterprise or Ad-Hoc deployment option, press Next button it will validate and will show you the Certificate you have selected for signing if its ok then press Next. Now IPA is ready and you can save this on HDD to use.

Structure of the IPA

An IPA has a built-in structure for iTunes and AppStore to recognize, The example below shows the structure of an IPA,
/Payload/
/Payload/Application.app
/iTunesArtwork
/iTunesMetadata.plist

As shown above, the Payload folder is what contains all the app data. The iTunes Artwork file is a 512×512 pixel PNG image, containing the app's icon for showing in iTunes and the App Store app on the iPad. The iTunesMetadata.plist contains various bits of information, ranging from the developer's name and ID (e.g., Google), the bundle identifier, copyright information, genre, the name of the app, release date, purchase date, etc.

IPA ?

An .ipa file is an iPhone application archive file which stores an iPhone app. It is usually encrypted with Apple's FairPlay DRM technology. Each .ipa file is compressed with a binary for the ARM architecture and can only be installed on an iPhone, iPod Touch, or iPad. Files with the .ipa extension can be uncompressed by changing the extension to .zip and unzipping.

.IPA files cannot be installed on the iPhone Simulator because they do not contain a binary for the x86 architecture. To run applications on the simulator, original project files which can be opened using the Xcode SDK are required. Occasionally, however, some .IPA files can be opened on the simulator by extracting and copying over the .app file found in the Payload folder. Some simple apps are able to run on the simulator through this method.

CoreVideo Framework


Core Video provides a pipeline model for digital video in iOS. Partitioning the processing into discrete steps makes it simpler for developers to access and manipulate individual frames without having to worry about translating between data types such as QuickTime. It also provides buffer and buffer pool support for Core Media. Applications that do not need to manipulate individual frames should never need to use Core Video directly.

CFNetworkFRamework

CFNetwork is a framework in the Core Services framework that provides a library of abstractions for network protocols. These abstractions make it easy to perform a variety of network tasks, such as: 1. Working with BSD sockets.
2. Creating encrypted connections using SSL or TLS.

  • 3. Resolving DNS hosts
  • 4. Working with HTTP, authenticating HTTP and HTTPS servers
  • 5. Working with FTP servers

Difference between "strong" and "weak"

Strong means that as long as this property points to an object, that object will not be automatically released.

Weak instead, means that the object the property points to, is free to release but only if it sets the property to NULL

NSOperation


The NSOperation class is an abstract class you use to encapsulate the code and data associated with a single task. Because it is abstract, you do not use this class directly but instead subclass or use one of the system-defined subclasses (NSInvocationOperation or NSBlockOperation) to perform the actual task.

Location Based Services


Location Services allows location-based apps and websites (including Maps, Camera, Safari, and other Apple and third-party apps) to use information from cellular, Wi-Fi1, and Global Positioning System (GPS)2 networks to determine your approximate location.

__block


When variable is marked with __block, the modifications done inside the block are also visible outside of it.

Block

Block objects are a C-level syntactic and runtime feature. They are similar to standard C functions, but in addition to executable code they may also contain variable bindings to automatic (stack) or managed (heap) memory.

You can use blocks to compose function expressions that can be passed to API, optionally stored, and used by multiple threads. Blocks are particularly useful as a callback because the block carries both the code to be executed on callback and the data needed during that execution.

layoutSubviews


layoutSubviews is a method that is called automatically during view size changes. It can be used by a custom view to perform additional manual changes above and beyond any autoresizing behaviors

Autolayout


Auto layouts introduced in iOS6 with which we can support different screen resolution. Also it makes it easier with internationalization we don't need different xib or storyboard for every language.

Grand Central Dispatch


Grand Central Dispatch (GCD) comprises language features, runtime libraries, and system enhancements that provide systemic, comprehensive improvements to the support for concurrent code execution on multicore hardware in iOS and OS X.

iOS Design Patterns

A design pattern is a template for a design that solves a general, recurring problem in a particular context. It is a tool of abstraction that is useful in fields like architecture and engineering as well as software development.

  • a. Abstract Factory Pattern
  • b. Adaptor Pattern
  • c. Object Modeling Pattern
  • d. Chain of Responsibility Pattern
  • e. Command Pattern
  • f. Composite Pattern
  • g. Decorator Pattern
  • h. Facade Pattern
  • i. Iterator Pattern
  • j. Mediator Pattern
  • k. Memento Pattern
  • l. Model-View-Controller Pattern
  • m. Observer Pattern
  • n. Proxy Pattern
  • o. Receptionist Pattern
  • p. Singleton Pattern
  • q. Template Method Pattern

Design patterns are separated into three categories: creational, structural, and behavioral.
  • Creational patterns are design patterns specifically used for dealing with the creation of objects. The abstract factory and singleton are considered creational patterns.
  • Structural patterns are used to define structures of objects. The adaptor, composite, decorator, and proxy patterns are types of structural design patterns.
  • Behavioral patterns identify communication between objects. The chain of responsibility, command, iterator, memento, observer, and template method are examples of behavioral design patterns.

The Model-View-Controller (MVC) design pattern is considered the cornerstone design pattern for iOS app development. The MVC design pattern consists of three parts: model, view, and controller. The model contains data, information, logic, or objects considered part of the business layer of an iOS app. The view contains all of the user information components-such as text areas, buttons, and sliders considered the presentation layer of an iOS app. The controller is the liaison, or communication layer, of an iOS app
Similarly Delegation, and Target-action design patterns. The delegation pattern is based on the concept of one object acting on behalf of another, while target-action is a design pattern where an object stores information that will be sent to a specific object when a certain event happens.

These three design patterns are considered fundamental building blocks for iOS app development.

View's life cycle

Creation
1a -> initWithCoder for initializing view via Storyboard
1b -> initWithNibName for initializing view via Nib file
1c -> init if we do not use none of the above 2 methods and use simple View init method to initialize View.
2   -> loadView
3   -> viewDidLoad
4   -> viewWillAppear
5   -> viewWillLayoutSubviews
6   -> viewDidLayoutSubviews
7   -> viewDidAppear
Destruction
1   -> viewWillDisappear
2   -> viewDidDisappear
3   -> viewWillAppear
4   -> viewWillLayoutSubviews
5   -> viewDidLayoutSubviews

6   -> viewDidAppear

JSON and XML difference and Usage

1. XML is easier to understand than JSON
2. XML is markup language so it is used for hierachiecal element which can not be done in JSON
3. JSON is very simple and can easily be used for text format objects and its serialization.
4. XML used too much bandwidth than JSON

5. JSON is used widely on Web coz its easier to parse from JavaScript as JSON stands for JavaScript Object Notation but to the same for XML with JavaScript it requires to use different library.

SyncML

SyncML (Synchronization Markup Language) is the former name for a platform-independent information synchronization standard. The purpose of SyncML is to offer an open standard as a replacement for existing data synchronization solutions, which have mostly been somewhat vendor-, application- or operating system specific.

SyncML is most commonly thought of as a method to synchronize contact and calendar information (personal information manager) between some type of handheld device and a computer (personal, or network-based service), such as between a mobile phone and a personal computer.

HTTP Connection API, Callback

Http connection is done via NSURLConnection class in which user has to implement methods of delegate 
NSURLConnectionDelegate - For authentication related

NSURLConnectionDataDelegate - For response data related

Is a delegate retained ?


No, the delegate is never retained! Ever! Because It's a memory management thing. Objective-C works with reference counts to keep the memory clean. This does mean that it can't detect cyclic relationships.

Delegate methods of MKMapView ?

Firstly you have added the storeKit.framework in your xcode project then define the protocol as <MKMapviewDelegate> in .h file.
- (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)animated;
- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated;
- (void)mapViewWillStartLoadingMap:(MKMapView *)mapView;
- (void)mapViewDidFinishLoadingMap:(MKMapView *)mapView;
- (void)mapViewDidFailLoadingMap:(MKMapView *)mapView withError:(NSError *)error;
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation;
- (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views;


Fast enumeration ?


Fast enumeration is a language feature that allows you to enumerate over the contents of a collection. (Your code will also run faster because the internal implementation reduces message send overhead and increases pipelining potential.)

App Bundle ?


When you build your iOS app, Xcode packages it as a bundle. A bundle is a directory in the file system that groups related resources together in one place. An iOS app bundle contains the app executable file and supporting resource files such as app icons, image files, and localized content.

important delegate methods of NSXML parser ?

-DidStartElement
-FoundCharecters
-DidEndElement

-FoundError

What are the ways to store data locally on device ? 

We store data locally in device through:
1.    Plist. - 
2.    NSUserDefaults.
3.    SQLite - 
4.    CoreData - Core Data is a schema-driven object graph management and persistence framework. Fundamentally, Core Data helps you to save model objects (in the sense of the model-view-controller design pattern) to a file and get them back again.


What is the purpose of UIWindow object ?


The presentation of one or more views on a screen is coordinated by UIWindow object.

What is MVC ? MVC Architecture of iPhone App ?

Here are the reasons why we should use the MVC (Model View Controller) design pattern.
1.    They are resuable : When the problems occurs, there is no need to invent a new solution, we just have to follow the pattern and adopt it as necessary.
2.    They are expressive: By using the MVC design pattern our application becomes more expressive.

1) Model: The model object knows about all the data that need to be displayed. It is model who is aware about all the operations that can be applied to transform that object. It only represents the data of an application. The model represents enterprise data and the business rules that govern access to and updates of this data. Model is not aware about the presentation data and how that data will be displayed to the browser.
2) View: The view represents the presentation of the application. The view object refers to the model. It uses the query methods of the model to obtain the contents and renders it. The view is not dependent on the application logic. It remains same if there is any modification in the business logic. In other words, we can say that it is the responsibility of the of the view's to maintain the consistency in its presentation when the model changes.

3) Controller:  Whenever the user sends a request for something then it always go through the controller. The controller is responsible for intercepting the requests from view and passes it to the model for the appropriate action. After the action has been taken on the data, the controller is responsible for directing the appropriate view to the user. In  GUIs, the views and the controllers often work very closely together.

How can you respond to state transitions on your app ? 

On state transitions can be responded to state changes in an appropriate way by calling corresponding methods on app’s delegate object.
applicationDidBecomeActive method can be used to prepare to run as the foreground app.
applicationDidEnterBackground method can be used to execute some code when app is running in the background and may be suspended at any time.

applicationWillEnterForeground method can be used to execute some code when your app is moving out of the background
applicationWillTerminate method is called when your app is being terminated.

Which framework delivers event to custom object when app is in foreground ? 


The UIKit infrastructure takes care of delivering events to custom objects. As an app developer, you have to override methods in the appropriate objects to process those events.

What are the location services ?

Applications such as Maps, camera and compass are allowed to use the information from cellular, Wi-Fi and Global Positioning System networks for determining the approximate locations.

The location is displayed on the screen, using a blue marker.

Difference between shallow copy and deep copy ?


Shallow copy is also known as address copy. In this process you only copy address not actual data while in deep copy you copy data.

App Submission process ?

Process ->
1. You must be enrolled in Apple's iOS Developer Program.
2. Open iTunes login with credential and click on Manage Your Application
3. Click on "Add New App" enter company name, primary language click continue
4. Enter App name, select Bundle ID from list and enter SKU number.
5. Select App availability date, Pricing tier or Free and click continue.
6. Enter App's Metadata which will be displayed on App Store.
7. Fill up App rating and details like Content maturity etc.
8. Upload app icon and application screenshot on iPhone as well as iPod if it supports iPad then that too.
9. Now you will see the App info click View Details below App Icon it will show you "Ready to Upload Binary" click on that.
         10. If you are using only the default cryptography libraries supplied by Apple’s API then click Yes otherwise No.
         11. Now Open Xcode select iOS device in theme chooser also select Archive under Project menu it will open Organizer - Archive window if everything is OK
         12. Click on Submit then enter your credentials and click Next.
         13. Now select app you want to sign and profile will be Distribution click next app will start uploading on iTunes
         14. If everything went well you will see the message that No issues were found in "App-Name". It has passed validation and submitted to App Store for further review.
         15. Come back to iTunes after some time you can see the app status as "Waiting for Review" this step is only time consuming once review is started its almost done and status changes to "In Review"
         16. If application is approved then status will change to "Preparing for app store" once its done status will change to "Ready for sale".


What is code signing ?

Signing an app can help system to identify who signed the application and to verify that the application has not been modified after signed. It is required for submitting to the App Store (both for iOS and Mac apps). This digital identity consists of a public-private key pair and a certificate. The certificate is issued by Apple.

In order to sign applications, you must have both parts of your digital identity installed. Use Xcode or Keychain Access to manage your digital identities.

Which JSON framework is supported by iOS ?(Json-JavaScript Object Notation.)

SBJson framework is supported by iOS. It is a JSON parser and generator for Objective-C. SBJson provides flexible APIs and additional control that makes JSON handling easier.

#####JSOn
JSON syntax is a subset of the JavaScript object notation syntax:
  • Data is in name/value pairs
  • Data is separated by commas
  • Curly braces hold objects
  • Square brackets hold arrays

  • The file type for JSON files is ".json"
  • The MIME type for JSON text is "application/json"


"Push Notification" ?

to get the any update / alert from server
Process -> 
1. Create AppId and provisioning profile for each application that uses Push Notification also SSL certificate for Server with private key at iOS provisioning portal 2. Register for getting Push Notification to APNS in AppDelegates - didFinishLaunchingWithOptions method with API registerForRemoteNotificationTypes:Types
3. APNS receives Bundle identifier, Provisioning Profile with above register API call.
4. APNS will send the token id to client and it can be received in callback didRegisterForRemoteNotificationsWithDeviceToken
5. Send this token id to your server who will be sending the Notifications to APNS and then APNS to client.
6. Now if anything new happens on server it will send the payload (JSON Dictionary) to APNS with SSL certificate and Token Id.
7. APNS server will send the notification to client as per token id now you can get this Notification in didReceiveRemoteNotification

#######
8. New male and female Siri voices for U.S. English and French, and a male voice for German.
9. Improved Calendar app which tells you when is the event in a month.
10. In the lock screen, when music is playing, you can toggle between the music controls and the Clock by pressing the Home button.

11. In the Messages app, when you tap on the Contact option, it displays the icons for call, FaceTime and Info. If you tap on the call button, it gives you an option for Voice call or FaceTime call.

What is ARC ? How to deal with backward compatibility while working with Non ARC and ARC ?

ARC means Automatic Reference Counting. iOS 5.0 has got the ARC .In objective C memory release mechanism works on reference counting so its programmers responsibility to manage references of an object, but its often forgotten. So Apple introduce the concept of ARC in 2011 with iOS5 it is somewhat similar to Garbage Collection of Java so compiler will keep track of object references in memory. Once this count is zero means that object is no longer in use so its been deallocated.


If you are not using ARC in your project, add '-fobjc-arc' as a compiler flag for the .h and .m files which are ARC compliant.

Garbage collector in iPhone?


Garbage collection is not available in iOS.

LLVM compiler


LLVM (formerly Low Level Virtual Machine) is a compiler infrastructure written in C++; it is designed for compile-time, link-time, run-time, and "idle-time" optimization of programs written in arbitrary programming languages. Originally implemented for C and C++, the language-agnostic design (and the success) of LLVM has since spawned a wide variety of front ends: languages with compilers that use LLVM include ActionScript, Ada, D, Fortran, GLSL, Haskell, Java bytecode, Julia, Objective-C, Python, Ruby, Rust, Scala[2] and C#.

garbage collector vs ARC

Just wondering if anyone knows what is the different between Objective C 2.0 Garbage Collector and new Automatic Reference Counter in IOS 5 SDK?
ARC is not a Garbage Collector. It is better to think of it as manual reference counting (retain/release/autorelease) calls which are added by the compiler. It also uses some runtime tricks.All of Apple's Objective-C types use reference counting, but there are multiple variants now. Before ARC, and before GC, all we used was manual reference counting (MRC). With MRC, you would explicitly retain and release your objects. MRC was difficult for some people, particularly those who had spent little time managing their memory explicitly. Therefore, the demand for simpler systems grew over time. MRC programs also require that you write a good amount of memory management code, which can become tedious.
is IOS 5 SDK also use Objective C 2.0?
Yes, but the ObjC Garbage Collector is not and was never an option on iOS.
When compared to manual memory management and garbage collection, ARC gives you the best of both worlds by cutting out the need to write retain / release code, yet not having the halting and sawtooth memory profiles seen in a garbage collected environment. About the only advantages garbage collection has over this are its ability to deal with retain cycles and the fact that atomic property assignments are inexpensive
Advantages of Garbage Collection
  • GC can clean up entire object graphs, including retain cycles.
  • GC happens in the background, so less memory management work is done as part of regular application flow.
Disadvantages of Garbage Collection
  • Because GC happens in the background, the exact time frame for object releases is undetermined.
  • When a GC happens, other threads in the application may be temporary put on hold.

Advantages of Automatic Reference Counting
  • Real-time, deterministic destruction of objects as they become unused.
  • No background processing, and more efficient on lower-power systems, such as mobile devices.
Disadvantages of Automatic Reference Counting

  • Cannot cope with retain cycles.

Whats the difference between frame and bounds?

All UIViews have frame and bounds properties which define their dimensions.
The frame of a view is given in the coordinates of its superview so a view controller’s view’s frame will include offsets for the status bar, navigation bar, or tab bar. The bounds of a view are given in the view’s own coordinate system which does not include these elements.

In addition the frame property’s values are undefined if the view has any transform other than the identity transform. Rotating a view into landscape mode applies a transform to the view so it is not safe to rely on frame values for an app in landscape mode.
The frame of a view is the rectangle, expressed as a location (x,y) and size (width,height) relative to the superview it is contained within. The bounds of a view is the rectangle, expressed in its own coordinate system (0,0). Frame's size and bound's size are always same/equal. 
Center A center is a CGPoint expressed in terms of the superview's coordinate system and it determines the position of the exact center point of the view.
Using the frame allows you to reposition and/or resize a view within its superview.
When you need the coordinates to drawing inside a view you usually refer to bounds.
A typical example could be to draw within a view a subview as an inset of the first. Drawing the subview requires to know the bounds of the superview.
Different behaviours happen when you change the bounds of a view. For example, if you change thebounds size, the frame changes (and vice versa). The change happens around the center of the view.

Can we change Permission Message on iOS6 ?

Yes we can change the permission text of default permission alert by adding respective key in Info.pList file

If you want to access contacts in iOS6 app NSContactsUsageDescription can be added to .pList file and its value will be the message you want to display in Alert box.

When to use NSMutableArray and when to use NSArray?

Normally we use mutable version of array where data in the array will change. For example, you are passing a array to function and that function will add some elements to that array or will remove some elements from array, then you will select NSMutableArray. When you don’t want to change your data, then you store it into NSArray. For example, the country names you will put into NSArray so that no one can accidentally modify it.
NSDictionary, NSMutableDictionary
NSString, NSMutableString

NSSet, NSMutableSet

Difference between "protocol" and "delegate" ?

Delegates are created using protocols.
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.

How user gets to know the difference between Local and Push notification ?


There is no difference between both notification for the user both seems the same to him. Only change is user will be notified at fist app launch with permission message that application uses Push Notification service is its using Push Notification.

"Notification" in Objective C ?

provides a mechanism for broadcasting information within a program, using notification we can send message to other object by adding observer.
When the event does happen, a notification is posted to the notification center(NSNotificationCenter), which immediately broadcasts the notification to all registered objects. Optionally, a notification is queued in a notification queue, which posts notifications to a notification center after it delays specified notifications.
An NSNotification object ( notification) contains a name, an object, and an optional dictionary. The name is a tag identifying the notification. The object is any object that the poster of the notification wants to send to observers of that notification—typically the object that posted the notification itself. The dictionary may contain additional information about the event.
Other objects can register themselves with the notification center as observers to receive notifications when they are posted. The notification center takes care of broadcasting notifications to the registered observers.
Ex:- 1. registering [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(rbtUserSubscriptionStatusChanged:) name:SUBSCRIPTION_STATUS_CHANGED_NOTIFICATION object:nil];
2. sending/posting notification [[NSNotificationCenter defaultCenter] postNotificationName:SUBSCRIPTION_STATUS_CHANGED_NOTIFICATION object:self userInfo:nil];
  • The NSNotificationCenter class manages notifications within a single process.
  • The NSDistributedNotificationCenter class manages notifications across multiple processes on a single computer.Posting a distributed notification is an expensive operation.  The notification gets sent to a systemwide server that then distributes it to all the processes that have objects registered for distributed notifications.

NSNotificationQueue objects, or simply, notification queues, act as buffers for notification centers.

"Delegate" in objective C

Delegate in Objective C is used when one class objects wants to assign some of its work to another object.
A delegate is an object that will respond to pre-chosen selectors (function calls) at some point in the future., need to implement the protocol method by the delegate object.


What is advantage of categories? What is difference between implementing a category and inheritance? 

. You can add method to existing class even to that class whose source is not available to you. You can extend functionality of a class without subclassing. You can split implementation in multiple classes. While in Inheritance you subclass from parent class and extend its functionality.

In a way you can say that Category are better option than to use inheritance but, The reason inheritance is still exist is you can not add member variables in Category only methods but inheritance makes it possible.

What is the "interface" and "implementation"?


interface declares the behavior of class and implementation defines the behavior of class.

What is synchronized() block in objective c? what is the use of that ?


The @synchronized()directive locks a section of code for use by a single thread. Other threads are blocked until the thread exits the protected code.

What compilers apple using ?


The Apple compilers are based on the compilers of the GNU Compiler Collection.

"Protocol" on objective c ?

A protocol declares methods that can be implemented by any class. Protocols are not classes themselves. They simply define 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 ancestor.

Types of Protocol
1. Informal -> An informal protocol is a category on NSObject, which implicitly makes almost all objects adopters of the protocol.

2. Formal -> A formal protocol declares a list of methods that client classes are expected to implement. Formal protocols have their own declaration, adoption, and type-checking syntax.

"dynamic" keyword ?

tells the compiler that the getter and setter methods are implemented not by the class itself but somewhere else (like the superclass  will be provided at runtime). Used in CoreData
Uses for @dynamic are e.g. with subclasses of NSManagedObject (CoreData) or when you want to create an outlet for a property defined by a superclass that was not defined as an outlet.
Super class:
@property (nonatomic, retain) NSButton *someButton;
...
@synthesize someButton;
Subclass:
@property (nonatomic, retain) IBOutlet NSButton *someButton;
...

@dynamic someButton;

"synthesize" keyword ?


ask the compiler to generate the setter and getter  methods according to the specification in the property declaration

Difference between "assign" and "retain" keyword ?

Retain - Specifies that retain should be invoked on the object upon assignment. takes ownership of an object. in ARC the reference count gets increased by one. in GC there is strong reference for it.

Assign - Specifies that the setter uses simple assignment. Uses on attribute of scalar type like float, int.

"non-atomic" keyword ?


In non atomic no such guaranty that value is returned from variable is same that setter sets. at same time

"atomic" keyword ?


"atomic", the synthesized setter / getter will ensure that a whole value is always returned from the getter or set by the setter, only single thread can access variable to get or set value at a time

"assign" keyword ?


Specifies that the setter uses simple assignment. Uses on attribute of scalar type like float, int. Also used with delegate

"retain" keyword ?


Specifies that retain should be invoked on the object upon assignment takes ownership of an object

Property in Objective c ?

Property allow declared variables with specification like atomic / nonatmic, or retain / assign 
Objective-C 2.0 introduces a new syntax to declare instance variables as properties, with optional attributes to configure the generation of accessor methods. Properties are, in a sense, public instance variables; that is, declaring an instance variable as a property provides external classes with access (possibly limited, e.g. read only) to that property. A property may be declared as "readonly", and may be provided with storage semantics such as "assign", "copy" or "retain". By default, properties are considered atomic, which results in a lock preventing multiple threads from accessing them at the same time. A property can be declared as "nonatomic", which removes this lock.
@property does work of declaration of setter and getter.

@synthesize does work of creating implementation of setter and getter.

Method declaration in Objective c ?


 - (return_type)methodName:(data_type)parameter_name : (data_type)parameter_name

Objective c ?


Objective-C is a reflective, object-oriented programming language which adds Smalltalk-style messaging to the C programming language. strictly superset of c.

Cococa and cocoa touch ?


Cocoa is for Mac App development  and cocoa touch is for apples touch devices - that provide all development environment .The Cocoa and Cocoa Touch frameworks that power OS X and iOS.Cocoa’s high-level APIs make it easy to add animation, networking, and the native platform appearance and behavior to your application with only a few lines of code.The Cocoa frameworks consist of libraries, APIs, and runtimes that form the development layer for all of OS X. By developing with Cocoa, you will be creating applications the same way OS X itself is created.

What is new in iOS7 ?

1.Complete UI change
2.Background run time reduced to 3 min from 10  min Apps that regularly update their content by contacting a server can register with the system and be launched periodically to retrieve that content in the background.
3.64bit support as iphone 5s is 64 bit processor
4.Push notification receieve in background app resumes for specific time interval in backgound is possible. You have to set UIBackgroundMode in info.plist file.
5Airdrop - AirDrop lets users share photos, documents, URLs, and other kinds of data with nearby devices with security..
6.SpriteKit.framework for sprite-based animations and graphics rendering
7.MultipeerConnectivity.framework) provides peer-to-peer networking for apps
8JavaScriptCore.framework) provides Objective-C wrapper classes for many standard JavaScript objects.
9.SafariServices.framework) provides support for programmatically adding URLs to the user’s Safari reading list.

10.Inter app audio:-enables the ability to send MIDI commands and stream audio between apps on the same device. For example, you might use this feature to record music from an app acting as an instrument or use it to send audio to another app for processing.

What are the features in IOS 6 ?

1.Map :  make easy way to launch map app and display points of interest or dierction
2. Social framework:-for users socail access,Integration of Facebook with iOS (Twitter in iOS5), framework to provide a single sign-on model
3.Passbook/pass kit  framework- that uses web services, support for downloading passes  Companies can create passes to represent items such as coupons, boarding passes, event tickets, and discount cards for businesses.The pass itself uses a special file format and is cryptographically signed before being delivered.
4.Autolayout:- define rules for view in form constraint with respective parent or another view. 
5.Data privacy:- privacy to contact, calender, reminder, photo library
6.game center enhancement with easy dev for developer

7.In App purchase:- purchasing itunes content inside the app.

About

Blog Archive

Powered by Blogger.

Blog Archive