Friday, July 29, 2011

ICloud APIs



iCloud storage APIs allow IOS application developers to store documents and other data to a central location so users can view or edit from any device without having to sync or transfer files.

How to renew iPhone development certificate

First, in the iPhone provisioning Portal, you'll see that your certificate is expired:


The only available option is to request for a new certificate. You hit Request certificate.

Tuesday, July 26, 2011

Implement UIWebView With a Transparent background in iPhone


Step 1: Create a Window base application using template. Give the name of the application “WebView”.
Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: We need to add the resource file called as “Background.png” into the resource folder. Select resources and add files existing sources and select theBackground.png.
Step 4: Now we’ll add view controller class to the project. Choose New file -> Select cocoa touch classes group and then select UIViewController subclass. Give the name WebViewController.
Step 5: We create a WebView.html from where the data will be display.

Customize UISlider color


Instead of having 3 UISlider with 3 UILabels telling red, green, blue, we have 3 UISlider with custom colors. Everybody would agree that this is nicer…
To do this, just customize your UISlider this way :
[redSlider setMinimumTrackImage:[[UIImage imageNamed:@"redSlider.png"] stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0] forState:UIControlStateNormal];
Then you just need the images. Taken (and edited) from the UICatalog Apple Template :

Thursday, July 14, 2011

How to Prevent iPhone from Sleeping

The automatic sleep timer is one of the ways the iPhone saves power. If the screen isn’t touched for a certain amount of time, it dims the screen and eventually turns it off. Although you should leave the timer on, there are times when this is not what you want (games are a good example).
To disable the timer, set the idleTimerDisabled property to YES,


[[UIApplication sharedApplication] setIdleTimerDisabled:YES];

Date Formatter Examples

NSDateFormatter

To save you some time, here are several simple examples for displaying date information:

// <strong>Output ->  Date: 10/29/08</strong>
 NSDate *today = [NSDate dateWithTimeIntervalSinceNow:0];
 NSDateFormatter *dateFormat = [[[NSDateFormatter alloc] init] autorelease];
 [dateFormat setDateStyle:NSDateFormatterShortStyle];
 NSString *dateString = [dateFormat stringFromDate:today];
 NSLog(@"Date: %@", dateString);
 

How to “unfreeze” your iPhone Application

To avoid “freezing” your application, ensure that any logic that is changing your UI is performed by the Main thread. One approach to this would be to leverage the NSNotificationCenter but sometimes that is overkill. A much simpler approach is to use one of the following performSelectorOnMainThread methods on NSObject:
performSelectorOnMainThread:withObject:waitUntilDone: 
performSelectorOnMainThread:withObject:waitUntilDone:modes:

CGRect, CGSize and CGPoint

Digging into development of iPhone applications, you’ll eventually encounter references to CGRect, CGSize, and CGPoint. These references are to C structures (see this post for more information on structures). This post will provide a high-level view of what comprises CGRect and its counterparts. Here is how CGRect is defined:

Rename an Xcode Project

Renaming an Xcode Project
First, click on the Project menu and select Rename:




From there, fill in the new name, I’d also recommend creating a snapshot as a precaution:




Renaming an Xcode project is no longer a mysterious, troublesome endeavor.

Capture iPhone Simulator Screenshots – Revisited – iPhone Simulator Cropper

iPhone-Simulator Cropper
This tool works by capturing the screen of the simulator runnning on your system. One really slick feature is the option to create captured images in two primary formats – first, a format suitable for upload to iTunes for your application screenshots – second, capturing a screenshot that is suitable for display on a website.

How to Prevent Your Application from Being Placed into the Background

By default, when running on a device that supports multitasking, if the user quits the application (pressing the Home button), the application will be notified and moved to the background. This is nice as the response time when the user requests the application again is generally very quick, not to mention the application resumes in the same place/state as when it exited.
Even with this built-in convenience, they are times when this default behavior may not be ideal. For example, depending on the application, it may require a fair amount of additional development time to properly manage this state change. In such cases, simply quiting the application may be preferred.

Get UDID from iTunes

The following tips runs you through the steps to quickly look up the UDID number for a device from with iTunes.
Begin by plugging in the device and starting iTunes. Choose your device in the DEVICES section on the left side of iTunes. At this point you should see the iPhone stats (name, capacity, software version, etc) similar to the figure below. By default the serial number will be shown on the second line from the bottom:




If you click the Serial Number, the content of that row will change to show the UDID:

The Google+ project: Huddle

A New Android Market for Phones

Adding Text Message to an ActionSheet

The ActionSheet supports one line of text, the title, which as the name implies, is displayed across the top of the Alert. See the image below for an example.


Wednesday, July 13, 2011

Xcode 4 has semantic issue

The version is 4.0.2. I think I found where the problem is.

The simple code is:

1.png 


when I add header search path recursively:
1.png 

then the "Semantic Issure" will occur:

1.png 


Otherwise, the issue will disappear!

So, the recursively search of header path's will cause this "Semantic Issue".

iPhone Splash Screen Tutorial

Creating a Splash Page

We will be adding a splash page that will fade out into our main game screen.  Start by downloading this image and adding it to your project’s Resources Folder. Make sure you check the box to copy this image to the project’s directory.
splash iPhone Tutorial for Creating a Splash Screen

Friday, July 8, 2011

Creating Static Libraries For iOS

What’s a static library

In computer science, a static library or statically-linked library is a set of routines, external functions and variables which are resolved in a caller at compile-time and copied into a target application by a compiler, linker, or binder, producing an object file and a stand-alone executable. This executable and the process of compiling it are both known as a static build of the program. Historically, libraries could only be static.
On the iPhone, static libraries have a .a extention and can only contain code. This means that any resources (xibs, images, etc…) must be packed either in a bundle or shipped separately than the library. We won’t go into this part today.

Wednesday, July 6, 2011

iPhone Programming Tutorial – Local Notifications


iChat: How to Change Your Displayed Name or Bonjour name

To change your displayed name or Bonjour messaging name, edit your Address Book card.

Note: Following these steps changes your Address Book card for all places that you use it, not just iChat. 1. Quit iChat if it is open.
2. Open Address Book.
3. Choose Card > Show My Card.
4. Click the Edit button.
5. Edit your first and last name.
6. Save changes by clicking the Edit button again or by selecting a different card.
7. Open iChat. Your revised name appears after you log in.

Friday, July 1, 2011

Apple Patents Improve iPhone Security With Biometrics

In a hint of things to come, more patents submitted by Apple just a few months ago show advances in future security designs for iPhones and notebook computers. The new authentication methods include several biometric technologies that would verify the identity of a user without any additional input from the owner of the device.

apple iphone patent security fingerprint biometric

Examples would use cameras and software for facial recognition or allow a touch screen to identify a fingerprint. These methods could authenticate a user and protect private information without the current delay required when entering a passcode.

Apple has also envisioned systems that would identify a user based on retinal patterns, the shape of their ears, or the sound of the user's voice. Other methods described in the patent application would have the user touch a sequence of shapes or gesture on the device in a particular pattern to unlock.

Although it sounds far-fetched, with further advances in mobile hardware even Apple's suggestion that DNA could be analyzed to authenticate may not be too far off.