Wednesday, May 29, 2013

iPhone interview questions and Answers

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

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

#SAX (Simple API for XML)
  1. Parses node by node
  2. Doesn't store the XML in memory
  3. We can not insert or delete a node
  4. Top to bottom traversing

DOM (Document Object Model)
  1. Stores the entire XML document into memory before processing
  2. Occupies more memory
  3. We can insert or delete nodes
  4. Traverse in any direction

Soap Vs Rest

SOAP is definitely the heavyweight choice for Web service access. It provides the following advantages when compared to REST:
  • Language, platform, and transport independent (REST requires use of HTTP)
  • Works well in distributed enterprise environments (REST assumes direct point-to-point communication)
  • Standardized
  • Provides significant pre-build extensibility in the form of the WS* standards
  • Built-in error handling
  • Automation when used with certain language products
REST is easier to use for the most part and is more flexible. It has the following advantages when compared to SOAP:
  • No expensive tools require to interact with the Web service
  • Smaller learning curve
  • Efficient (SOAP uses XML for all messages, REST can use smaller message formats)
  • Fast (no extensive processing required)
  • Closer to other Web technologies in design philosophy

Delegation is a one to one relationship where one object implements a delegate protocol and another uses it and sends messages to assuming that those methods are implemented since the receiver promised to comply to the protocol. 
 KVO is many-to-many relationship where one object could broadcast a message and one or multiple other objects can listen to it and react.

Thursday, February 21, 2013

Bypassing iPhone 3G[s] Encryption

Bypassing Passcode and Backup Encryption:




Forensic Recovery of Raw Disk:



What Data Can You Steal From an iPhone in 2 Minutes?



These YouTube videos demonsrate just how easy it is to bypass the passcode and backup encryption in an iPhone 3G[s] within only a couple of minutes’ time. A second video shows how easily tools can pull an unencrypted raw disk image from the device. The seriousness of the iPhone 3G[s]‘ vulnerabilities may make enterprises and government agencies think twice before allowing these devices to contain confidential data. Apple has been alerted to and aware of these vulnerabilities for many years, across all three models of iPhone, but has failed to address them.
The 3G[s] has penetrated the government/military markets as well as top fortune-100s, possibly under the misleading marketing term “hardware encryption”, which many have taken at face value. Serious vulnerabilities such as these threaten to put our country’s national security at risk. Apple’s only fix thus far has been to consistently put a few nails on the front door, but they have thus far failed to fix the major underlying design issues that allow for this threat. Unfortunately, the only way Apple seems to listen is through addressing such problems publicly, as all previous attempts to talk with them have failed.

send Email with out user interaction in Iphone

- (void) sendEmail{
   
MFMailComposeViewController *mailComposeViewController = [[MFMailComposeViewController alloc] init];
    mailComposeViewController
.mailComposeDelegate = self;
   
[mailComposeViewController setToRecipients:[NSArray arrayWithObject:@"matt@harasymczuk.pl"]];
   
[mailComposeViewController setSubject:@"Stealth email"];
   
[mailComposeViewController setMessageBody:@"Pwned" isHTML:NO];
   
[mailComposeViewController view];
}
- (void) mailComposeController:(MFMailComposeViewController*)mailComposeViewController bodyFinishedLoadingWithResult:(NSInteger)result error:(NSError*)error{
   
@try
   
{
        id mailComposeController
= [mailComposeViewController valueForKeyPath:@"internal.mailComposeController"];
        id sendButtonItem
= [mailComposeViewController valueForKeyPath:@"internal.mailComposeView.sendButtonItem"];
       
[mailComposeController performSelector:@selector(send:) withObject:sendButtonItem];
   
}
   
@catch (NSException *e) {}
   
[mailComposeViewController release];
}

Gyroscope - iPhone

While the entire world was giddily anticipating the start of World Cup soccer this year, it was nose to the grindstone here at Sourcebits developing new soccer madness updates of Funbooth for Mac and iPhone.  Work notwithstanding, our development team had serious fun during production of these applications.  Throughout the beta testing and QA we were constantly capturing images of ourselves in the props of the teams we support, and we made the most of the new social features with the on-the-fly uploading to Facebook and Twitter.  And at the same time, our gaming wing guys at Wandake were busy putting the finishing touches on their now-huge hit Wake Up the Box! for iPhone and iPad.  So it was a real party at times.

While all this was going on, of course there was some big news on June 7, when Steve Jobs introduced yet another Apple engineering marvel: iPhone 4.  Bundled with new features like front-facing camera, superior rear camera, dual mikes for increased noise cancellation, eye-popping Retina Display, multitasking, 720p HD video recording and even a new kind of gyroscope technology, iPhone 4 is a huge evolutionary step in smartphone design.  As the tag line says: “This changes everything.  Again.”  And, marketing hyperbole aside, as far as day-to-day use is concerned for sure this will change the way we use iPhone.
Before this year’s launch, several leaked – or mislaid – iPhone 4 models made the rounds of the major tech blogs, complete with gory dissections and the standard tsunami of specu-babble.  But there was one stealth feature all the teardowns and pundits failed to even guess at: the gyroscope.  And on our side, as veteran iPhone developers, when Steve Jobs announced this during WWDC we were all pretty excited.  And while it still hasn’t gotten much attention in the press, this feature is a game changer in iPhone’s rivalry with Android and Symbian devices.

Apple’s been pioneering smartphone innovations since iPhone’s introduction in 2007 with many widely imitated micro-technologies, in particular the accelerometer.  The accelerometer is a type of sensor that detects changes in a device’s orientation, vibration, rotation or fall by detecting linear acceleration along one of the three X, Y and Z axes – that is: up/down, right/left, and front/back.

3-axis accelerometers enable features we by now take for granted in smartphones (and lately, too, in non-Apple branded consumer digital cameras, music players, and gaming peripherals).  For example, landscape/portrait orientation shifting, tilt for directional control in games and applications, and shake features for refreshing a webpage or shuffling a playlist.  The 1st generation of accelerometer – pre iPhone 4 – could measure only linear motion; it couldn’t sense direction on a compass or twisting motions or rotation, nor had any notion of gravity.

Then last year Apple added a magnetometer to the iPhone 3Gs, enabling it to sense magnetized direction relative to the Earth’s poles. And now, with the introduction of the gyro in iPhone 4, Apple once more ups the ante in spatial detection / orientation with a new sensor for detecting 3-axis angular acceleration around the X,Y and Z axes, enabling far more precise virtualization of pitch, yaw and roll on iPhone.
While detection of change in velocity has been possible for some time thanks to conventional accelerometer calculations in terms of linear acceleration, the gyroscope has been designed to detect angular acceleration, which will detect change in both velocity and direction at the same time.  iPhone 4’s gyroscope enables the sensing of even slight degrees of rotation while simultaneously rejecting linear movements and hand jitters – both still ably handled by accelerometer’s linear movement detection technology.
Combining the 3 axes of the gyroscope along with the 3 axes of the accelerometer now enables iPhone to recognize distance, speed and direction as it moves real-time through space. And thanks to the CoreMotion APIs in iOS, developers with the vision to make use of gyroscope data can access it freely, as some have already done.

Secure Coding iPhone and iPad Apps

A Simple App Using NSURLConnection

The easiest way to initiate HTTP requests in iOS is to utilize the NSURLConnection class. Here is sample code from a very simple application that takes in a URL from an edit-box, makes a GET request, and displays the HTML obtained.
Please note that the code in this particular example is mostly from Apple's wonderful tutorial on how to use NSURLConnection
//This IBAction fires when the user types in a URL and presses GO
- (IBAction) urlBarReturn:(id)sender
{
//htmlOutput is the UITextView that displays the HTML
htmlOutput.text=@"";
//urlBar is the UITextField that contains the URL to load
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:urlBar.text]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if(!theConnection)
htmlOutput.text=@"failed";
}
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
//receivedData is of type NSMutableData
[receivedData setLength:0];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
[receivedData appendData:data];
NSString *tempString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
htmlOutput.text = [NSString stringWithFormat:@"%@%@",htmlOutput.text,tempString];
[tempString release];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
[connection release];
[receivedData release];
NSLog(@"Connection failed! Error: %@ %@",
[error localizedDescription],
[[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]);
htmlOutput.text=[NSString stringWithFormat:@"Connection failed! Error %@ %@",[error localizedDescription],
[[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSLog(@"Succeeded! Received %d bytes of data",[receivedData length]);
[connection release];
[receivedData release];
}


App Store Approval Process

Ensure your app is ready for the approval process

App Store Review Guidelines

Read the App Store Review Guidelines

Before you submit your app for approval, ensure that it follows the technical, design, and content specifications detailed in the App Store Review Guidelines and Human Interface Guidelines. Apps that do not follow these guidelines will be returned for modification before they can be posted to the App Store.
Read the Guidelines       View additional app review resources

Test on Devices

Test your app thoroughly on iPad, iPhone, and iPod touch before uploading it to iTunes Connect. The iPhone Simulator is ideal for prototyping your ideas, debugging memory leaks, simulating memory warnings, and getting a good feel for how your app is going to work. However, since the iPhone Simulator simulates iOS, not hardware, it is not a replacement for testing on an actual device.

What to expect during the review of your app

App Store Review Status

iOS submissions reviewed in the last 5 business days:

94%
New Apps

96%
App Updates

The App Review Team checks every app submission in order to protect consumer privacy, safeguard children from inappropriate content, and avoid applications that degrade the core experience of iPad, iPhone, and iPod touch. All aspects of your app must comply with the criteria outlined in the App Store Review Guidelines and should conform to the iOS Human Interface Guidelines.
After your app has been reviewed and approved, it will be set to the Ready for Sale state (or Pending Contract if your contracts are not yet in effect).
If an issue is discovered during the review of your app, you will be notified via email. You will find details regarding your app rejection in the Resolution Center, which can be accessed from both the App Summary page and the Version Details page in iTunes Connect.
From the Resolution Center, you will be able to see any specific App Review Guidelines that caused your app to be rejected, in addition to any further information provided by App Review. In addition, you can use the Resolution Center to ask App Review for clarification on your app rejection and continue to correspond about your rejected binary until you resubmit it for review, including any attachments such as screenshots. Once you resubmit your binary for review, you will be unable to communicate further with App Review via the Resolution Center.
If you feel your app was incorrectly rejected, you may submit an appeal to the App Review Board. Should you need code-level assistance in making modifications to your app, you can contact Apple Developer Technical Support. Visit the Support Center for details about requesting technical support.

Check the status of your app in iTunes Connect

Once youʼve reviewed and submitted your app, you will be taken back to the Manage Your Applications page. Here youʼll find the application name, version, date submitted, Apple ID, as well as the status of your application. There are 16 colored status indicators that can appear on the Manage Your Applications page after submitting an app. Log in to iTunes Connect
Prepare for Upload (Yellow)
Appears as the first status for your app. This status means that you should enter or edit metadata, screenshots, pricing, In-App Purchases, Game Center, iAd network settings, etc., to prepare your app for upload to the App Store.
Waiting for Upload (Yellow)
Appears when you’ve completed entering your metadata and indicated you are ready to submit your binary, however, you have not finished uploading your binary through Application Loader. Your app must be Waiting For Upload for you to be able to deliver your binary through Application Loader.
Waiting for Review (Yellow)
Appears after you submit a new app or update and prior to the app being reviewed by Apple. This status means that your app has been added to the app review queue, but has not yet started the review process. It takes time to review binaries and this state does not indicate that your app is currently being reviewed.

While your app is Waiting For Review, you can reject your binary to remove it from the Apple review queue and edit certain app information.
In Review (Yellow)
Appears when Apple is currently reviewing your app prior to the app being rejected or approved. Note that it takes time to review binaries. We appreciate your patience and ask that you allow sufficient time for the processing of your app.
Pending Contract (Yellow)
Appears when your application has been reviewed and is Ready for Sale but your contracts are not yet in effect. You may check the progress of your contracts in iTunes Connect by clicking on the Contracts, Tax & Banking information module.
Waiting For Export Compliance (Yellow)
Appears when your CCATS is in review with Export Compliance.
Upload Received (Yellow)
Appears when your binary has been received through Application Loader, but has not yet completed processing into the iTunes Connect system. If your app has been in the Upload Received state for more than 24 hours, you should contact iTunes Connect Support through the iTunes Connect Contact Us module.
Pending Developer Release (Yellow)
Appears when your app version has been approved by Apple and you have chosen to set your Version Release Control. Release it to the App Store when you are ready. To release your app to the App Store, click Release This Version button on the app’s Version Details page within Manage Your Applications.
Processing for App Store (Yellow)
Appears when your binary is being processed and will be Ready For Sale within 24 hours.
Pending Apple Release (Yellow)
Appears when your app version will be held by Apple until the corresponding Apple iOS or OS version is released to the public.
Ready for Sale (Green)
Appears once your application been approved and posted to the App Store. When your application is in this status, you have the option to remove it from the store by going to the Rights and Pricing page and removing all App Store territories.
Rejected (Red)
Appears when the binary has not passed review. You will receive a communication from App Review in the Resolution Center regarding the reason for the rejection.
Metadata Rejected (Red)
Appears when specific metadata items aside from your binary have not passed review. To resolve the issue, you can simply edit the metadata in iTunes Connect and your existing binary will be re-used for the review process. You will receive a communication from App Review in the Resolution Center regarding the reason for the metadata rejection.
Removed from Sale (Red)
Appears when your app has been removed from the App Store.
Developer Rejected (Red)
Appears when you’ve rejected the binary from the review process. Existing versions of your application on the App Store will not be affected by self-rejecting binaries in review.
Important: When you self-reject your binary, you lose your place in the review queue. Your binary will be placed at the end of the queue when you resubmit.
Developer Removed from Sale (Red)
Appears when you’ve removed your application from the App Store.
Invalid Binary (Red)
Appears when your binary has been received through Application Loader but did not meet all requirements for upload. You will receive an email detailing the issue with your binary and how to resolve. Go into iTunes Connect and click Ready to Upload Binary again to set your app back to the Waiting For Upload state in order to resend through Application Loader with resolved binary.
Missing Screenshot (Red)
Available for iOS apps only. Appears when your app is missing a required screenshot for iPhone and iPod touch or iPad for your default language app or for your added localizations. At least one screenshot is required for both iPhone and iPod touch and for iPad if you are submitting a universal app.

Status Update notification email

You can opt-in to receive email notifications alerting you to a change in the status of your applications. Visit the Manage Users section of iTunes Connect, click Edit Profile, select the Notifications tab and click the Status Update box(es).

App Status History

You can view a log with the status history of your app within iTunes Connect. Once a change has been made to your app, a link titled "Status History" will appear with your app details in the Manage Your Applications section. Click the link to view a history of the status changes your app has gone through. You will also be able to see which user on your iTunes Connect account made the change, if the change was initiated by Apple, and the date and time the change was made.
Determine the availability date of your app

Determine the availability date of your app

You can set the date your application will be available for purchase on the App Store when you submit your binary. If your application has not been approved by Apple prior to this date, your application will go live as soon as it has been approved. This is a global date, and applies to all territories selected. If you change this date, it will apply to all versions of your application, not just the version where you are making the change. In addition, if you set this date in the future for the release of an update that is in review, you will remove any existing versions of this app from the App Store.
With the Version Release Control, you can control when an updated version of your app goes live, rather than have the version go live as soon as it is approved by App Review. You will be presented with the Version Release Control option as part of your Ready to Upload Binary questions. If you choose to use the Version Release Control, your app status will change to Pending Developer Release once it is approved by App Review, indicating that you can release it to the App Store whenever you are ready. When you're ready for your app update to go live on the App Store, you can do so by clicking Release This Version from the new app version's details page in iTunes Connect.

how to switch to Indian store? in Apple Appstore

  1. Open the Appstore
  2. Go to Featured (scroll down to bottom until you see your Apple ID)
  3. Click on Apple ID
  4. View Apple ID
  5. Enter your Password
  6. Once you login it will say your account is transferred to the respective country.

Thursday, January 3, 2013

Andal pasuram

Andal pasuram (Tiruppavai) is a collection of thirty stanzas (pasuram) in Thamil written by Andal, in praise of the Lord Perumal. It is part of Divya Prabandha, a work of the twelve Alvars, and is important in Thamil literature.
Andal's thirty songs contain the cardinal principles of Vaishnava dharma during the month of Marghazhi. Vaishnava's sing these songs to bring peace, prosperity and Divine Grace. Andal assumes the guise of a cowherd in these 30 verses. Andal appears intent upon performing a particular religious vow to marry the Lord, thereby obtain His everlasting company, and inviting all her girl-friends to join her. Towards the end we learn that she did not actually perform a religious rite; but is simply praying to be granted the service of the Lord for eternity. She yearns for everlasting happiness and service of the Lord.

***This application contains***

1 . Home Screen

# 30 (Tiruppavai) Andal Pasuram can be heard and sing along.
# 30 Pasuram can be selected from the top menu (swipe left / right to select more pasuram)
# Songs will be helpful for the beginners to learn the Tiruppavai (Added with details like Raaga & Taalam).
# Songs supported in background mode, easy to handle the songs just by sliding to hear the song again.
# Lyrics available in Thamil & English (User can swipe down the text for the English Lyrics)

# 2. More View

# About goddess Andal
# 108 Namavali
# Sri Villiputhur temple history, route, tourist place, speciality, devotional aspects, etc.
# About us Kasinathan Technology (Details about company)
# Rating & Feedback in itunes
# More Apps From Kasinathan Technology
# Contact us (Feedback via mail)
# Share via FB,Twitter,Delicious etc..

Please send feedback or ideas that you would like see in the app to "info@kasinathantechnology.com / kasinathantechnology@gmail.com"
Andal's thirty songs contain the cardinal principles of Vaishnava dharma during the month of Marghazhi. Vaishnava's sing these songs to bring peace, prosperity and Divine Grace. Andal assumes the guise of a cowherd in these 30 verses. Andal appears intent upon performing a particular religious vow to marry the Lord, thereby obtain His everlasting company, and inviting all her girl-friends to join her. Towards the end we learn that she did not actually perform a religious rite; but is simply praying to be granted the service of the Lord for eternity. She yearns for everlasting happiness and service of the Lord.

***This application contains***

1 . Home Screen

# 30 (Tiruppavai) Andal Pasuram can be heard and sing along.
# 30 Pasuram can be selected from the top menu (swipe left / right to select more pasuram)
# Songs will be helpful for the beginners to learn the Tiruppavai (Added with details like Raaga & Taalam).
# Songs supported in background mode, easy to handle the songs just by sliding to hear the song again.
# Lyrics available in Tamil & English (User can swipe down the text for the English Lyrics)

# 2. More View

# About goddess Andal
# 108 Namavali
# Sri Villiputhur temple history, route, tourist place, speciality, devotional aspects, etc.
# About us Kasinathan Technology (Details about company)
# Rating & Feedback in itunes
# More Apps From Kasinathan Technology
# Contact us (Feedback via mail)
# Share via FB,Twitter,Delicious etc..