Apple’s has announced a push notification service for the iPhone that it’ll provide to all developers. It’ll maintain a persistent IP connection to the phone and let a 3rd party server ping Apple’s notification service in order to push out notifications to users device, which can be in the form of badges, sounds or custom textual alerts. According to Apple, the service will preserve battery life and maintain performance, not to mention work over WiFi or cellular.
-
119 comments -
We can use the UITextField’s delegate method
- (BOOL)textField: (UITextField *)textField shouldChangeCharactersInRange: (NSRange)range replacementString: (NSString *)stringto set the maximum character length.
This can be done by doing the following:
#define MAX_LENGTH 10 - (BOOL)textField: (UITextField *)textField shouldChangeCharactersInRange: (NSRange)range replacementString: (NSString *)string { if (textField.text.length >= MAX_LENGTH && range.length == 0) { return NO; } else { return YES; } } -
There might be need at several stages of iPhone application development to insert a new view on top of other views. This can be achieved by setting the zPosition value of the view in question. If a View has a zPosition that is bigger than another views zPosition it will appear on top of the other view.
-

Messed Up Icons With iPhone OS 3.0 Beta 5
With the latest release of iPhone OS 3.0 seed 5, the icons of the applications are being messed up. This mostly occurs when we install updates to the applications from App store. Few applications will not have any icons altogether, few apps have icons of their neighbouring apps like shown in the figure. iPhone OS 3.0 beta 5 is lot more buggier than beta 4 or beta 3. Also I have observed beta 5 drains the battery very fast. My iPhone lost more than half of its power over night even without performing any tasks while lying idle. Seems Apple has purposefully made beta 5 buggy so that users are forced to move to the final version expected in the WWDC.
On the screenshot we can observe that, PingPongLite application doesnt have icon at all and NewsPro and Bloomberg have same icons.
However on a positive note, if we restart the iPhone, all icons are restored to their original application icons.
Read the rest of this entry »
-

UIWebview Action Alert
If there is an <a href></a> tag in the html that is being loaded in an UIWebView, then touching that link for few seconds would trigger an alert showing ‘Action’ or the alternate text provided for the link.
If we need to disable it, then we need to set
document.documentElement.style.webkitTouchCallout=”none”;
This can be called in the onload event of the html <body> tag which is being loaded in UIWebview. Put this piece of Javascript before the <body> tag
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Hide Action Alert In UIWebView</title> <script type="text/javascript"> function OnLoad() { document.documentElement.style.webkitTouchCallout = "none"; } </script> </head> <body onload="OnLoad()"/> </body> </html>
-

iPhone OS Active SDK Targets Missing
The iPhone SDK 3.0 is great in offering tons of new features to developers to play with. It irresistable not to install it n use it. But we should be ready to make few sacrifices in using it. Firstly as the release notes says, iPhone OS 3.0 beta installed on iPhone can’t be revereted back to a earlier version of OS. While this was a big issue for people who skipped reading the release notes n were excited to install iPhone OS 3.0 Seed 1. However the later versions of iPhone OS 3.0 Seed 3 and 4 seem to be pretty stable and near production quality expect for few problems like low battery backup. The other major issue I am facing with iPhone SDK 3.0 is not being able to set the Active Target to a earlier version of iPhone OS other than 3.0. XCode silently removes all the other available options from the ‘Active SDK’ list and gives only iPhone OS 3.0. This can be annoying, but we cant blame Apple for this as they have warned this in their release notes. The image on the left shows the behaviour I am talking about. Read the rest of this entry »
-
The other day I was trying to build GData with one of my iPhone applications built on iPhone SDK 3.0. The build failed complaining that NSTask is undeclared. Based on release notes for iPhone OS 3.0, I got to know that NSTask has been removed from the Foundation framework among several other API’s with iPhone OS 3.0.
Moving forward all projects which used NSTask would fail n would require some amount of recoding to fill the missing gaps. -

UIPrerenderedIcon
If you would like to render your iPhone application icon without any sheen and bevel effects added by iPhone OS, then add the boolean value
UIPrerenderedIcon=YES
in your application’s info.plist. Adding this key will instruct iPhone OS not to add the additonal effect around the icon and leave it as it is. On the left is a screenshot of one of the application’s – BubbleWrap(marked in red square)available on the Apple App store which use UIPrerenderedIcon= YES.
<key>UIPrerenderedIcon</key> <true/>
-
UIApplication* myApplication = [UIApplication sharedApplication];
myApplication.networkActivityIndicatorVisible = YES;

Network Activity Indicator
-
22
Apr 09There you go — Apple has just announced that its Worldwide Developer Conference 2009 will take place from June 8th through June 12th in sunny San Fransico. Apple has a few surprises up its collective sleeve. So what do you guys think? Netbook? Snow Leopard? Tablet? More than one new iPhone model? Hit the comments section and be heard.

WWDC 2009
-
Apple has now posted iPhone SDK 3.0 beta 3 and iPhone OS 3.0 beta 3 to the iPhone Dev Center. Developers can now test their applications that will use the Apple Push Notification service.
-
Check the opensource cool stuff about iPhone programming here at:-
http://code.google.com/p/iphone-sdk-programming-book-code-samples/
-
Add the following line of code to stop the iPhone from going to sleep mode. (Use it judiciously, it will drain the device battery.)
[[ UIApplication sharedApplication ] setIdleTimerDisabled: YES ]; -
3
Apr 09To hide the status bar in iPhone, edit the Info.plist of your application by adding the below key.
<key>UIStatusBarHidden</key><true />
or programmatically hide or show the status bar by invoking:[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]; -
Last week I spent some time playing around with the Maps application on the iPhone and I thought I’d share some of my findings. (Note that since there is no maps application available in the iPhone simulator all of the below will be launched in Safari instead – you’ll have to actually run it on your iPhone to see it in the maps application.)
-
Apple’s announcement of its official 3.0 firmware release for the iPhone and iTouch line of products was met with a mixed dose of excitement and unhappiness: Some welcomed long-awaited features like copy-and-paste functionality and stereo Bluetooth, while others decried that Apple just hasn’t done enough to stay competitive against the Androids and Blackberries of the mobile world. Here’s looking at you, background-running functionality.
Regardless of your beliefs about the success or failure of the 3.0 firmware, you don’t have to wait until this summer to try out all the new features. That’s because a number — if not a majority — of these added benefits are already available via third-party and Apple Store applications. Don’t believe us? Jailbreak your iPhone and check out our list:
A note about jailbreaking: Jailbreaking your iPhone can allow it to do many things that the built-in software, and software distributed through the App Store, can’t yet do. But keep in mind that jailbreaking will technically void your warranty, is a legal gray area as of this writing, and could potentially result in other problems, so jailbreak at your own risk.
-
Like most iPhone devs today, I fired up Safari and started downloading iPhone 3.0 Software BETA immediatly after the announcement this morning. 100 new user features and 1000 new developer APIs is nothing to sneeze at! This is no minor point update, but a feature packed upgrade.
-
The iPhone SDK (software development kit) is free to download atwww.apple.com/developer, but only for Mac OS X. It’s based on the same Xcode development suite used to develop many Mac OS X apps, which provides a versatile environment for writing the Objective-C code that underpins iPhone software. It’s complemented by companion tools, such as Instruments, that enable performance analysis and drag-and-drop interface building.



