Thursday, May 31, 2012

iPhone Application Sample Code(Part-1)

iPhone/iPad Application Sample Code:-

An iOS Page Curl filter:-->>>>>>

Sources:-  https://github.com/lomanf/PaperStack


OCCalendarController(From github.com)


OCCalendar is a very simple component for iPhone/iPad that provides a "Popover" date picker controller. It is very easy to add to your project, and is 100% CoreGraphics code, so it uses no images, and is resolution independent. I realize that I need to cut down the size for iPhone a bit more. I originally wrote it just for iPad, and my paths and sizing are all just slightly too wide for the iPhone. I'll fix it when I get a chance.





Tuesday, May 29, 2012

iPhone interview questions(Basic-3)


Q.What are all  the newly added frameworks iOS 4.3 to iOS 5.0?
  • • Accounts
  • • CoreBluetooth
  • • CoreImage
  • • GLKit
  • • GSS
  • • NewsstandKit
  • • Twitter

Q.What is Automatic Reference Counting (ARC)

is a compiler-level feature that simplifies 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.

Q.  Notification in IOS?

Q.What is the difference between delegates and notifications?

We can use notifications for a variety of reasons. For example, you could broadcast a notification to change how user-interface elements display information based on a certain event elsewhere in the program. Or you could use notifications as a way to ensure that objects in a document save their state before the document window is closed. The general purpose of notifications is to inform other objects of program events so they can respond appropriately.
But objects receiving notifications can react only after the event has occurred. This is a significant difference from delegation. The delegate is given a chance to reject or modify the operation proposed by the delegating object. Observing objects, on the other hand, cannot directly affect an impending operation.

Q.What is posing in IOS?

Objective-C permits a class to entirely replace another class within an application. The replacing class is said to "pose as" the target class. All messages sent to the target class are then instead received by the posing class. There are some restrictions on which classes can pose:
  • A class may only pose as one of its direct or indirect superclasses
  • The posing class must not define any new instance variables which are absent from the target class (though it may define or override methods).
  • No messages must have been sent to the target class prior to the posing.
Posing, similarly to categories, allows globally augmenting existing classes. Posing permits two features absent from categories:
  • A posing class can call overridden methods through super, thus incorporating the implementation of the target class.
  • A posing class can override methods defined in categories.
An example:
@interface CustomNSApplication : NSApplication
@end
@implementation CustomNSApplication
- (void) setMainMenu: (NSMenu*) menu{
     // do something with menu
}
@end

class_poseAs ([CustomNSApplication class], [NSApplication class]);
This intercepts every invocation of setMainMenu to NSApplication.










iPhone interview questions(Basic-2)


8.What are the location services? 

Location Services allows applications such as Maps, Camera, and Compass to use information from cellular, Wi-Fi1, and Global Positioning System (GPS) networks to determine your approximate location. This information is collected anonymously and in a form that does not personally identify you.  More Detail 
.
9.How would you create your own custom view?

By Sub-classing the UIView class.

10.Whats 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.)

11.Explain retain counts.

Retain counts are the way in which memory is managed in Objective-C. When you create an object, it has a retain count of 1. When you send an object a retain message, its retain
count is incremented by 1. When you send an object a release message, its retain count is decremented by 1. When you send an object a autorelease message, its retain count is decremented by 1 at some
stage in the future. If an objectʼs retain count is reduced to 0, it is deallocated.

12.Whats the difference between  NSArray and  NSMutableArray?

NSMutableArray (and all other classes with Mutable in the name) can be modified. So, if you create a plainNSArray, you cannot change its contents later (without recreating it). But if you create an NSMutableArray, you can change it — you'll notice it has methods like -addObject: and -insertObject:atIndex:.more Details are here

13.Whats a struct?

A struct is a special C data type that encapsulates other pieces of data into a single cohesive unit. Like an object, but built into C.More

14.Whats the difference between frame and bounds?


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 as a location (x,y) and size (width,height) relative to its own coordinate system (0,0).






iPhone interview questions(Basic-1)

We collected lot of iPhone Question list and their answers from different-2 websites. So I want to publish all these questions in one place.

1.What is iPhone? 


  • iPhone is a combination of internet and multimedia enabled smart phone developed by Apple Inc.
  • iPhone functions as a camera phone, including text messaging, and visual voice mail
  • iPhone is a portable media player that resembles a video iPod
  • It has user interface that is built around the multi-touch screen including virtual keyboard.
  • App Store , which launched in the mid 2008 has over 1,00,00000 applications with functionalities including games, references, GPS navigation, advertising, television shows, films, reference, celebrities. 

2.What are the features of iPhone 3gs? 

Video: Videos can be edited, shared. High quality VGA video can be shot in portrait or landscape.
3 Megapixel Camera: Still photos with greater quality can be taken
Voice control: It recognizes the names in contacts and recognizes the music on iPod.
Compass: iPhone 3GS has built-in digital compass, used to point the way.
Internet Tethering: Internet surfing can be done from anywhere. A 3G connection can be shared on Iphon3 with Mac notebook or laptop.. 

3.What is iphone OS? 

iPhone OS runs on iPhone and iPod touch devices.
Hardware devices are managed by iPhone OS and provides the technologies needed for implementing native applications on the phone.
The OS ships with several system applications such as Mail, Safari, Phone, which provide standard services to the user. 

4.What is iPhone sdk? 

iPhone SDK is available with tools and interfaces needed for developing, installing and running custom native applications.
Native applications are built using the iPhone OS’s system frameworks and Objective-C language and run directly on iPhone OS.
Native applications are installed physically on a device and can run in presence or absence of network connection. 

5.What is iPhone architecture? 

It is similar to MacOS X architecture
It acts as an intermediary between the iPhone and iPod hardware an the appearing applications on the screen
The user created applications never interact directly with the appropriate drivers, which protects the user applications from changes to the hardware



6.What is iPhone reference library? 

iPhone reference library is a set of reference documents for iPhone OS .
It can be downloaded by subscribing to the iPhone OS Library doc set.
Select Help>Documentation from Xcode, and click the subscribe button next to the iPhone OS Library doc set, which appears in the left column. 

7.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 dialing is prevented.
The display is automatically brightens the iPhone by the ambient light sensor when the sunlight or bright rooms and dims in darker places.