• Error: Whitelist rejection in Phonegap

    I’m using Cordova(Phonegap) to create a cross-platform salesforce app. When I run the application, after logging into the salesforce it will throw the below error when I query salesforce objects:

    [143:2013] ERROR whitelist rejection: url=”cloudforce.com”

    After googling around, i found that this issue is due to permissions. Cordova expects all domain/subdomain that your app wants to access is listed in the config.xml

    I added the below additional line to the config file and zoooom…it all works as expected

     
  • ld: don’t know how to convert branch instruction

    Yesterday while I was working on a iOS Objective-C code which had some C method calls (mostly libXML calls), my XCode  (Version 5.0 (5A11386k))  started throwing the linker error

    ld: don't know how to convert branch instruction 8e01f3f0 referencing _xmlNewDocNode.island to bx
    This issue occurs when you have a project created on XCode version 4.x and then open it using the XCode 5.0 developer preview edition. 
    Not sure how to tackle this issue. I will keep posted when I get a solution to this.
    
    
    Update: Check my comment below on how to resolve this issue.
     
  • Invalid C/C++ compiler in target YOUR_TARGET

    When you move your development environment from XCode 4.x to XCode DP 5.x, your project might encounter build/compiler errors stating “Invalid C/C++ compiler in target YOUR_TARGET: com.apple.compilers.llvmgcc42″. This issue is basically caused by the compiler setting for the project. Change the “Compiler for C/C++/Objective C” to “Default Compiler (Apple LLVM 5.0)” and do a clean build and the error should be fixed.

    Invalid C/C++ compiler in target

    Invalid C/C++ compiler in target

     
  • RIP Steve Jobs

    We will miss you Steve..!

    Screen shot 2011-10-06 at 2.07.04 PM

     
  • Android: “Sending jdwp tracking request failed!”

    Recently when I was debugging on a Android test application I encountered a crash/exception and in a hurry to fix the issue, I closed the emulator mid way and after a while started working on a different project. The new project didn’t had any errors for sure but the console was reporting via DDMS “Sending jdwp tracking request failed!”.

    Sending jdwp tracking request failed

    Sending jdwp tracking request failed

    After googling for a while I found the fix that you just need to restart your eclipse. Also sometimes a clean project works.

     
  • Fix “No architectures to compile” error

    if you ever face the below error while trying to build a iOS project
    “No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=i386, VALID_ARCHS=armv6 armv7).”

    Then try this:

    Project Build Settings:

    Architectures: Standard (armv6 armv7)
    Base SDK: Latest iOS Build Active
    Architectures Only: Checked Valid
    Architectures: armv6 armv7

    Make sure you delete an sub settings in the Architecture build setting.

    Target Build Settings:

    Same at project settings.

    Clean all targets and try building the project again

     
  • Terminal Error : “Could not determine audit condition”

    When I launched the Terminal today on my Snow Leopard it started showing the error

    login: Could not determine audit condition

    [Process completed]

    Closing and reopening didnt fix this issue and googling about it, I came to know that was caused by me changing permission of the /usr/bin directory. To fix this problem, just delete the file
    /usr/bin/login and restart your Terminal app and you must be all set to go.

     
  • Supporting both Retina Display and Normal Display

    With iPhone 4.0 SDK, all graphics/images are automatically scaled (including coordinates) according to the device screen resolution. All we have to do is provide two versions of each image used in our application – one to suit for the retina display, other one suit to normal resolution. All images that needs to be rendered for retina display must have a “@2x” in the filename (just before the file extension). If the device uses retina display, it will automatically load the @2x file, otherwise it will load the normal file and scale it up.

     
  • In-App SMS in iPhone OS 4.0

    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

    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

    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

    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

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

    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

    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

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

    [UIApplication sharedApplication].applicationIconBadgeNumber = 5;

     
  • Localizing Settings.bundle

    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

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

    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

    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 »

     

Bad Behavior has blocked 484 access attempts in the last 7 days.