»
S
I
D
E
B
A
R
«
Error: “CGGStackRestore: gstack underflow”
Nov 2nd, 2009 by Anish Kumar

Today while I was working with some CoreGraphics API’s, I encountered a error which I was seeing it for the first time. CG for dumping an error “CGGStackRestore: gstack underflow” in the console everytime I invoked a method that was doing some CG based operations. Googling around I found that in CoreGraphics, you can save (CGContextSaveGState) and restore (CGContextRestoreGState) the graphics state. When the  state is saved, a copy is put on the graphics state’s “stack”, and when it is restored, the top state on the stack is removed and used. If we restore the state more times than we save it and then when we try to remove and use the top item of the stack, the stack is empty, causing a stack “underflow” error. So just make sure you have enough save-restore state methods called and it will fix the issue.

CGGStackRestore

CGGStackRestore

Coming Soon: Develop Native iPhone Application Using Actionscript
Oct 20th, 2009 by Anish Kumar

With Flash Professional CS5, we can now build applications for iPhone and iPod touch using ActionScript 3. These applications can be delivered to iPhone and iPod touch users through the Apple App Store. A public beta of Flash Professional CS5 with prerelease support for building applications for iPhone is planned for later this year. At MAX 2009, Adobe showed a number of applications and games for iPhone that have been built using a prerelease version of Flash Professional CS5. The tooling update allows developers to use Flash technologies to develop content for iPhone and iPod touch. Developers can write new code or reuse existing web content to build applications for iPhone. Because the source code and assets are reusable across the Flash Platform runtimes,—Adobe AIR and Flash Player—it also gives developers a way to more easily target other mobile and desktop environments.

Read the rest of this entry »

XCode Error: “Loading Stack Frames”
Oct 9th, 2009 by Anish Kumar
Xcode: Loading Stack Frames

Xcode: Loading Stack Frames

Recently I encountered an new error for the first time in XCode. When my iPhone application under development crashed, instead of showing me the stack trace of where the application crashed, it threw an error “Loading Stack Frames” and was struck there indefinitely.  After researching about this for a while, I came to know my application crashed because of a stack overflow due to a non-terminating recursion in your code, and gdb is now trying to load all the stack frames on the stack . Usually, the stack of a application doesn’t get deeper than 50 frames or so (and that’s already a quite deeply nested stack). My application stack had run into 104708 frames which was quite too high.I finally figured out that the crash was due to an race condition.

Customising UITableView: A nice article
Jun 25th, 2009 by Anish Kumar

One of my colleague found this nice article on the web which explains things we need to do and not to do to customize a UITableView and make it look great than a plain dump table.

http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html

Error: “no valid ‘aps-environment’ entitlement string found for application”
Jun 23rd, 2009 by Anish Kumar

I got this error while building an iPhone application that is going to use APNS. I am still trying to figure out what is causing this problem. A more detailed error message is here:-

"Error Domain=NSCocoaErrorDomain Code=3000 UserInfo=0x113e80 "no valid 'aps-environment' entitlement string found for application"

APNS Error

APNS Error

XCode: Could Not Support Development
Jun 20th, 2009 by Anish Kumar
XCode: Could Not Support Development

XCode: Could Not Support Development

Today  when I started my work on an iPhone project, my XCode failed to mount my iPhone. The XCode organizer was showing an orange dot next to it instead of the usual green one. Organizer complained “Could Not Support Development”. I tried restarting my XCode, launched iTunes but in vain. iTunes was able to mount my iPhone but XCode simply failed and I was not able to test my app’s on my phone. Read the rest of this entry »

Error Starting Executable
Jun 18th, 2009 by Anish Kumar
Error Starting Executable

Error Starting Executable

Quite a few times in our iPhone application development cycle we would encounter XCode error “Error Starting Executable – No provisioned iPhone OS device is connected.” even when we know the device is connected to the machine.   This error occurs when the connected device is not configured in the XCode->Organizer. Organizer would fail to mount the device as the version of XCode installed on the developer machine may not support the version of iPhone OS installed on the device.

Read the rest of this entry »

Add Background Image To UIView
Jun 11th, 2009 by Anish Kumar

If you ever need to add a image as background for an UIView then do it like this (Make sure the image is in your app’s resource bundle):-

- (void)viewDidLoad
{
    self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"MyBackground.png"]];
}
My First Post Using Wordpress For iPhone
Jun 8th, 2009 by Anish Kumar

This is my first post using iPhone 3.0 Wordpress application. This is awesome cool in that now I can blog when I am travelling. I will write more about this app as I begin to use more of it.

the first feedback would be I am missing all the formatting options that I take for granted on desktop version of wordpress.

How to set badge value of an TabBar Item
May 19th, 2009 by Anish Kumar

Many iPhone projects would require setting some numeric value on tabBarItem called badge. We can set the badge value for a tabBarItem by:-

Fig: UITabBarItem With Badges

Fig: UITabBarItem With Badges

//__tabBarController  is a outlet to our UITabBarController
__tabBarController.selectedViewController.tabBarItem.badgeValue = @”1″;
The badge value expects an string and it should be an integer. The maximum width of the badge is around 58 pixels in which approximately 7 to 9 digits fit in depending on the digits being displayed.
Too Many Digits In Badge

Too Many Digits In Badge