»
S
I
D
E
B
A
R
«
In-App SMS in iPhone OS 4.0
Aug 12th, 2010 by Anish Kumar

With iPhone OS 4.0 and above we can send SMS right from within our application. Now our application can invoke the SMS composer screen just like we invoke the Mail composer screen. We need to invoke an instance of MFMessageComposeViewController and assign the delegate, recipients and body of the SMS. The code snippet is provided below:

Read the rest of this entry »

Problem With FBDialog Cancel Button
Jul 21st, 2010 by Anish Kumar

The FBConnects’s FBDialog class has a problem with the cancel button. When user taps the cancel button, the delegate method “dismissWithSuccess” is called instead of “dialogDidCancel“. This flaw in the FBConnect SDK makes it difficult to determine whether the user has tapped on cancel button or not. We can overcome this issue by editing FBDialog.m in the FBConnect. Add the below code as the first line in FBDialog.m’s webViewDidFinishLoad : methods

[_webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('cancel').onclick = function onclick(event) { window.location.href = 'fbconnect:cancel'; }"];

This should fix the issue and dialogDidCancel should get called correctly..!

Uploading Images To Facebook Wall Using FBConnect
Jul 21st, 2010 by Anish Kumar

We can upload images to Facebook users wall using the following FBConnect code:

FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
dialog.delegate = self;
dialog.userMessagePrompt = "Image Upload Sample";
dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"Anish\","
"\"href\":\"http://www.macoscoders.com/\",\"description\":\"This is an example to upload image to FB\","
"\"media\":[{\"type\":\"image\","
"\"src\":\"http://www.macoscoders.com/images/anish.jpg\","
"\"href\":\"http://www.macoscoders.com/\"}],"
"\"properties\":{\"another link\":{\"text\":\"Home page\",\"href\":\"http://www.macoscoders.com/\"}}}"]];
[dialog show];

Make sure you have implemented the correct delegate methods for FBConnect to know the status of posting to wall
Cheers..!

Opening App Review Page Of App Store
Jun 7th, 2010 by Anish Kumar

If you would like to launch the app review page of your application so that its easier for your user to navigate there in the app store and write a good review to your app, here is the code snippet
Use this:


[[UIApplication sharedApplication] openURL:[NSURL URLWithString:
@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=YOUR_APP_ID&mt=8"]];

Replace YOUR_APP_ID with the application ID of your app.

Cheers…!

Tab Bar Icons
Jun 7th, 2010 by Anish Kumar

What are requirement of anicon for Tab Bar item ?

From Tab Bar Item class reference:

The item’s image: If nil, an image is not displayed. The images displayed on the tab bar are derived from this image. If this image is too large to fit on the tab bar, it is scaled to fit. The size of an tab bar image is typically 30 x 30 points. The alpha values in the source image are used to create the unselected and selected images—opaque values are ignored.


You can't use color images as only alpha values matter.

And then they changed the entire publishing industry..!
May 28th, 2010 by Anish Kumar

Are you a budding author who needs help?  Apple has just given you a way to get your masterpiece into the iBooks store for the iPad (and soon for iPhone with OS 4.0), and the best thing is  you can do it all yourself without ever knocking the doors of an publisher, distributor, agent or anything else for that matter. You, as an author can decide how much to charge and which countries to sell into. You  get the same deal as the iPhone/iPad app publishers( meaning that Apple takes 30% and you keep 70% of the revenue).

There are some requirements before you can successfully publish your book on the iBookStore:

  • Get an ISBN numbers for the books you want to publish
  • Convert the book into EPUB format
  • Make sure the book pass EpubCheck 1.0.5
  • a US Tax ID (sorry guys, this is only open to the US at this point)
  • an iTunes account backed up by a credit card Read the rest of this entry »
Adobe abandons iPhone code tools
May 11th, 2010 by Anish Kumar

Adobe has decided to stop developing software tools that allow Apple’s iPhone and iPad to use its popular Flash technology.

The decision reverses an earlier pledge in which it said it would help get Flash working on the gadgets.

Closed tools

In mid-April, Adobe released software  Creative Suite 5 that contained option to export Flash applications into native iPhone applications. Shortly before the release, Apple updated the terms and conditions of the license software developers must sign to create iPhone and iPad applications. The revised terms placed strict restrictions on what developers can use to create these applications and effectively banned them from using 3rd party tools such as Creative Suite 5.

At the time Adobe wrote that it still intended to deliver the feature. Now it has said it will halt development of future export tools for Creative Suite.

“We will still be shipping the ability to target the iPhone and iPad in Flash CS5,” wrote Mike Chambers, Adobe’s principal product manager for developer relations, on his blog. “However, we are not currently planning any additional investments in that feature.” Mr Chambers also commented on Apple’s revision of its terms and conditions. He wrote: “…as developers for the iPhone have learned, if you want to develop for the iPhone you have to be prepared for Apple to reject or restrict your development at any time.”

Apple responded in a statement to technology news site CNet in which it described Flash as “closed and proprietary”. Apple preferred to support more open standards which replicate everything Flash can do, added the statement.

Mr Chambers wrote that now Adobe will concentrate on Google’s Android smartphone software and ensure that its Flash technology works well with that. “Fortunately,” he wrote, “the iPhone isn’t the only game in town.”

Set Application Badge Number
Apr 13th, 2010 by Anish Kumar

To manually set the iPhone application icon badge value, use the following code snippet

[UIApplication sharedApplication].applicationIconBadgeNumber = 5;

Localizing Settings.bundle
Apr 12th, 2010 by Anish Kumar

For adding internationalization support to iPhone Settings.bundle, follow these steps:-
1. Close the Xcode IDE
2. Drag and duplicate the settings bundle onto the desktop (or wherever)
3. Open bundle contents by selecting “Show Package Contents” from the right click menu options
4. Drag Root.strings into the en.lproj folder
5. Duplicate the en.lproj folder and rename to whatever language you want (using 2-letter code. Eg: fr.lproj for French)
6. Replace the original settings bundle with the new one.
7. Open Xcode IDE and the new files and folders should be there
This methods works fine in the simulator and on my iPhone device.

New Features In iPhone OS 4.0
Apr 9th, 2010 by Anish Kumar

iPhone OS 4 is the next generation of the world’s most innovative mobile operating system. Its unique capabilities and new technologies will change what you thought was possible on a mobile platform. With a rich set of over 1500 new APIs, iPhone SDK for iPhone OS 4 provides you with an amazing range of technologies to enhance the functionality of your iPhone and iPod touch apps. iPhone Developer Program members can visit the iPhone Dev Center to download the iPhone SDK 4 beta now.

Multitasking

iPhone OS 4 delivers seven new multitasking services that allow your apps to perform tasks in the background while preserving battery life and performance. These multitasking services include:

  • Background audio – Allows your app to play audio continuously. So customers can listen to your app while they surf the web, play games, and more.
  • Voice over IP – Your VoIP apps can now be even better. Users can now receive VoIP calls and have conversations while using another app. Your users can even receive calls when their phones are locked in their pocket.
  • Background location – Navigation apps can now continue to guide users who are listening to their iPods, or using other apps. iPhone OS 4 also provides a new and battery efficient way to monitor location when users move between cell towers. This is a great way for your social networking apps to keep track of users and their friends’ locations.
  • Push notifications – Receive alerts from your remote servers even when your app isn’t running.
  • Local notifications – Your app can now alert users of scheduled events and alarms in the background, no servers required.
  • Task finishing – If your app is in mid-task when your customer leaves it, the app can now keep running to finish the task.
  • Fast app switching – All developers should take advantage of this. This will allow users to leave your app and come right back to where they were when they left – no more having to reload the app.

Read the rest of this entry »

Warning: The Copy Bundle Resources build phase contains this target’s Info.plist file ‘Resources/Info.plist’.
Mar 30th, 2010 by Anish Kumar

Some times we would like to move the info.plist to other directories than the default project root directory. In such cases XCode would throw warning like “Warning: The Copy Bundle Resources build phase contains this target’s Info.plist file ‘Resources/Info.plist’.”

The Info.plist file belongs directly inside of the bundles Contents folder — that is to say, one level up from the Resources subdirectory. Thus copying Info.plist to that would serve little purpose, and might even be evidence of programmer oversight on something (as Xcode might think), hence the warning.  The Info.plist should not actually be a member of any target. The check boxes in the Get Info window of the info.plist should be unchecked and this warning can be avoided.

Hope this helps..!

Apple Releases New iPad
Jan 28th, 2010 by Anish Kumar

Apple has released iPad, its new tablet computer, which is the size of a standard children’s slate and does not have a keyboard or mouse, but relies on a touch-screen.

Apple iPad

Apple iPad

Steve Jobs claims it will offer the best browsing experience you can have, like “holding the Internet in your hands.” The iPad appears to be answer to netbooks, but combines the best of all iPhone and earlier Apple products. Read the rest of this entry »

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

Double Release Of Cocoa Objects
Oct 23rd, 2009 by Anish Kumar

Today while working on an iPhone project , I was just about to commit an code which displays a bar graph, and ended up finding a crash with the following error:

objc[<pid>]:FREED(id): message release sent to freed object="<memory_address>"
Double Release Of Cocoa Objects

Double Release Of Cocoa Objects

Read the rest of this entry »

How To Replace “__MyCompanyName__” in the new files from XCode
Oct 23rd, 2009 by Anish Kumar

When we create a new file in XCode, the default template has the company name listed as __MyCompanyName__. If you want this to show your actual company name instead of __MyCompanyName__, then execute the following command in your terminal. Make sure to replace the”YourCompanyNameHere” with the name of your company.

defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{ "ORGANIZATIONNAME" = "YourCompanyNameHere" ; }'
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 »

Adobe AIR 2 Preview
Oct 15th, 2009 by Anish Kumar

At Adobe MAX in Los Angeles today, Adobe previewed the next major release of Adobe AIR to thousands of Adobe customers and partners. Several exciting new capabilities of the AIR runtime were demonstrated by Adobe’s CTO, Kevin Lynch, as part of the “day one” keynote. In addition, Christian Cantrell, a member of the AIR engineering team, presented a session titled “What’s Coming in AIR 2″ that provided a more detailed sneak peak of some of the upcoming features of the AIR runtime (stay tuned — we will soon be posting a recording of Christian’s talk).

After shipping AIR 1.0, many of developers challenged Adobe to open the runtime up even more by, for example, allowing communication with native processes and providing enhanced networking support. With AIR 2, Adobe’s goal from the outset was to remove limitations in the runtime that prevented developers from building their applications.

Read the rest of this entry »

Saxony Jazz Orchestra
Oct 10th, 2009 by Anish Kumar
Jazz Concert By Saxony

Jazz Concert By Saxony

Jazz in the City!  Saxony Youth Orchestra performed at Chowdiah hall yesterday. The Bangalore School of Music, organized the jazz talent from Germany.The Saxony Youth Jazz Orchestra conducted by Rolf von Nordenskjld showcased their unique sound, combining jazzy notes with big band influences. They played a wide range of German and international tunes arranged especially for this concert.

The organisers say in almost 16 years, more then 300 young talented people playing more than 170 concerts have contributed to the ensemble. They have worked together with internationally recognized musicians, such as Jrgen Friedrich, Marko Lackner, Ansgar Striepens, Milan Svoboda, Al Porcino, Carla Bley, Steve Swallow, Ernst-Ludwig Petrowsky, Eberhard Weise and the singer Uschi Brning.

The conductor for the 2009 India tour is the well-known jazz saxophonist Rolf von Nordenskjld from Berlin.  For the orchestras trip to India he conjured up a unique program that combines traditional big band sounds with contemporary ideas. 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.

Apple releases iPhone OS SDK 3.1.2
Oct 9th, 2009 by Anish Kumar

Apple on Thursday released an update for the iPhone SDK, bringing the current version of the SDK to 3.1.2.

The new SDK 3.1.2, which now includes Xcode 3.2.1, is available in versions that are compatible with Leopard and Snow Leopard for iPhone and iPod Touch developers.

The update contains general bug fixes for the SDK and Xcode. Dashcode is reported to now support the creation of Web applications that are optimized for Safari on the iPhone, PC, and Mac.

If you’ve used this new update, please tell us about your experiences with it in the comments.