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....

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...

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...

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...

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...

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...

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...

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 NUL...

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....

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 behavior...

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....

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   ->...

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...

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...

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 relate...

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; ...

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 -FoundErro...

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...

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...

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...

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...

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...

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...

"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 ...

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...

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...

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...

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...

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...

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...

"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...

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...

"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...

"synthesize" keyword ?

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

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 tim...

"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 tim...

"assign" keyword ?

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

"retain" keyword ?

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

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...

Method declaration in Objective c ?

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

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...

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...

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...

About

Blog Archive

Powered by Blogger.

Blog Archive