Showing posts with label iOS sdk. Show all posts
Showing posts with label iOS sdk. Show all posts

Wednesday, April 17, 2013

Xcode 4.6.2 - PCH file built from a different branch

After updating Xcode 4.6.2, got error like

error: PCH file built from a different branch ((clang-425.0.27)) than the compiler ((clang-425.0.28)) xcode 4.6.2

After do a Clean (Product -> Clean) its disappeared :)

Monday, December 17, 2012

iOS - Search or compare korean text

In our UItableView search, we are using the below code to search a typed text in the cell content

 NSComparisonResult result = [eachCellContent compare:searchText options:NSDiacriticInsensitiveSearch|NSCaseInsensitiveSearch range:NSMakeRange(0, [searchText length])];

This is working fine. But this is not working with korean text.

E.g:
suppose one of the cell text is "소".//we are getting this combination by typing these two letters   ㅅ and ㅗ
If we type ㅅ only , our compare method is not working and so not listing the "소". (it is working if we type both ㅅ and ㅗ )

But the above example is working well with AddressBook application.

Is there any other compare method to support this ? (we also need this NSDiacriticInsensitiveSearch|NSCaseInsensitiveSearch )

Updated on 2013-01-14

Got solution from stackoverflow

NSString *normalizedContent = [eachCellContent decomposedStringWithCanonicalMapping];
NSString *normalizedSearch = [searchText decomposedStringWithCanonicalMapping];
and then compare these.


NSString *eachCellContent = @"소";
NSString *searchText = @"ㅅ";

NSString *normalizedContent = [eachCellContent decomposedStringWithCanonicalMapping];
NSString *normalizedSearch = [searchText decomposedStringWithCanonicalMapping];

NSComparisonResult result = [normalizedContent compare:normalizedSearch
                                               options:NSDiacriticInsensitiveSearch|NSCaseInsensitiveSearch
                                                 range:NSMakeRange(0, [normalizedSearch length])
                                                locale:[NSLocale currentLocale]];
if (result == NSOrderedSame) {
    NSLog(@"same");
}
// Output: same
 



Thursday, November 8, 2012

application executable is missing a required architecture. At least one of the following architecture must be present armv6

Getting this error when submit a universal application.
"application executable is missing a required architecture. At least one of the following architecture must be present armv6"

The issue was with changes in Xcode 4.5.x for ios 6
Its minimum supported os version is 4.3
So we have to set the Deployment Target = 4.3 or greater. 

Friday, November 2, 2012

Xcode : iPad mini simulator

The 'iPad mini' has the resolution of iPad which is 1024 x 768.

 iPad mini does not have a Retina Display. It has greater pixel density. But the pixel density is not  good as Retina Display

So we can use the Device Simulator labeled as 'iPad' for testing 'iPad mini'

Wednesday, October 31, 2012

unsupported architecture armv7 - Xcode 4.5

Got this error when try to submit universal application

On Build Settings, The Architectures are:

$(ARCHS_STANDARD_32_BIT)
armv6

Its fixed when change the value of "Build Active Architecture Only"

Build Active Architecture Only = Yes

Wednesday, October 24, 2012

iOS - Getting thumbnail of PDF document

We can get the thumbnail of any page of pdf document. The following example is getting the thumbnail of first page

            NSURL* pdfFileUrl = [NSURL fileURLWithPath:filePath];
            CGPDFDocumentRef pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfFileUrl);
           
            CGPDFPageRef page = CGPDFDocumentGetPage(pdf, 1);//for the first  page
            CGRect aRect = CGPDFPageGetBoxRect(page, kCGPDFCropBox);           
            UIGraphicsBeginImageContext(aRect.size);
            CGContextRef context = UIGraphicsGetCurrentContext();
           
            CGContextSaveGState(context);
            CGContextTranslateCTM(context, 0.0, aRect.size.height);
            CGContextScaleCTM(context, 1.0, -1.0);
            CGContextTranslateCTM(context, -(aRect.origin.x), -(aRect.origin.y));
           
            CGContextSetGrayFillColor(context, 1.0, 1.0);
            CGContextFillRect(context, aRect);
           
            CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(page, kCGPDFCropBox, aRect, 0, false);
            CGContextConcatCTM(context, pdfTransform);
            CGContextDrawPDFPage(context, page);
           
            UIImage *thumbnail = UIGraphicsGetImageFromCurrentImageContext();           
            CGContextRestoreGState(context);
            UIGraphicsEndImageContext();
            CGPDFDocumentRelease(pdf);

iOS - get the thumbnail of a video

We can get the thumbnail of any time. The following example is at time 0

MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:filePath]];
moviePlayer.shouldAutoplay = NO;
UIImage *thumbnail = [moviePlayer thumbnailImageAtTime:0 timeOption:MPMovieTimeOptionNearestKeyFrame];
[moviePlayer stop];
[moviePlayer release];


Another way to get the frame - http://stackoverflow.com/a/4330647

Friday, October 5, 2012

NSLocalisedString - Read from user created file.

static NSBundle *myBundle;

+ (NSString *)getLocalizedString:(NSString *)str{
  
    return NSLocalizedStringFromTableInBundle(str, nil, [MyBundle getMyResourceBundle],nil);
  
}

/** set the resource file as the file which is created by user in the location document/ . We just create a folder en.lproj and create a file 'Localizable.strings' inside the folder **/
+ (NSBundle *)getMyResourceBundle{
   
        if(myBundle == nil){
       
        NSFileManager *fileManager = [NSFileManager defaultManager];
        NSString *documentsDirectory = [FileUtils applicationDocumentsDirectory];
        documentsDirectory = [documentsDirectory stringByAppendingPathComponent:@"en.lproj/Localizable.strings"];
       

        BOOL isDire = NO;
       
       
        if([fileManager fileExistsAtPath:documentsDirectory isDirectory:&isDire])
        {
           
            myBundle =  [[NSBundle alloc] initWithPath:[documentsDirectory stringByDeletingLastPathComponent]];
        }
        if(myBundle == nil){
          
                myBundle = [NSBundle mainBundle];
          
        }
       
       
    }
   
    return myBundle;

}

/** if need to set english (or any specific) resource file always. The corresponding resource file should exist in our project **/
+ (NSBundle *)getMyResourceBundle{
   
    if(myBundle == nil){
                   NSString* path= [[NSBundle mainBundle] pathForResource:@"en" ofType:@"lproj"];//set english
                    myBundle = [NSBundle bundleWithPath:path];
                   if(myBundle == nil){
     
                          myBundle = [NSBundle mainBundle];
                    }
     }
    
return myBundle;
}

Tuesday, July 3, 2012

NSDateFormatter will not work for the date before 1970 ?


double seconds = -62167464057.000;

NSDate *oldDate = [NSDate dateWithTimeIntervalSince1970:seconds];

MELog("oldDate = %@", oldDate);//oldDate = 0002-12-29 03:59:03 +0000

NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init]  autorelease];

[dateFormatter setDateStyle:NSDateFormatterNoStyle];

[dateFormatter setTimeStyle:NSDateFormatterShortStyle];


NSString *formattedDateString = [dateFormatter stringFromDate:oldDate];

NSLog(@"formattedDateString = %@", formattedDateString);//formattedDateString = 3:57 AM


In the above code, the date component has the time 3:59, But when we format it to extract the time field, we are getting 3:57
My timezone is London, so it should return 3:59
Is this because of we are trying to format a date before 1970 ? Please confirm if anyone knows.

Its discussing here

Monday, June 25, 2012

iOS - Add Contact to AddressBook - Sample code




Add AddressBook.Framework to the Project

#import <AddressBook/AddressBook.h>

-(NSUInteger) copyContactToAB{

NSUInteger addressbookId = 0;

    UIImage *imgContact = nil;//[UIImage imageNamed:@"test.png"];
    NSString *companyName = @"Test";
    
    NSString *firstName= @"Hanoch";
    NSString *lastName= @"J";
    NSString *workPhone = nil;
    NSString *workFax = nil;
    NSString *mobile = nil;
    NSString *homePhone = nil;
    NSString *workEmail = nil;
    
    
    //work address
    NSString *address1_street = nil;
    NSString *address1_city = nil;
    NSString *address1_state = nil;
    NSString *address1_postalcode = nil;
    NSString *address1_country = nil;
    
    //home address
    NSString *address2_street = nil;
    NSString *address2_city = nil;
    NSString *address2_state = nil;
    NSString *address2_postalcode = nil;
    NSString *address2_country = nil;
    
    
    ABRecordRef aRecord = ABPersonCreate();
    CFErrorRef  anError = NULL;
    ABRecordSetValue(aRecord, kABPersonFirstNameProperty, firstName, &anError);
    ABRecordSetValue(aRecord, kABPersonLastNameProperty, lastName, &anError);
    if(companyName){
        ABRecordSetValue(aRecord, kABPersonOrganizationProperty, companyName, &anError);
    }
    
    
    
    
    
    if (anError != NULL) {
        
        MELog(@"error while creating..%@", anError);
    }
    
    if(imgContact){
        
        
        NSData *data = UIImagePNGRepresentation(imgContact);
        if(ABPersonSetImageData(aRecord, (CFDataRef)data, &anError)){
            
            
        }
        
        
    }
    
    
    //(@"adding email");
    if(workEmail){
        ABMutableMultiValueRef emails = ABMultiValueCreateMutable(kABMultiStringPropertyType);
        ABMultiValueAddValueAndLabel(emails,  workEmail, kABWorkLabel, NULL);
        
        ABRecordSetValue(aRecord, kABPersonEmailProperty, emails, &anError);
        
        CFRelease(emails);
    }
    
    //(@"adding phonee");
    ABMutableMultiValueRef multi = ABMultiValueCreateMutable(kABMultiStringPropertyType);
    
    
    if(workPhone) ABMultiValueAddValueAndLabel(multi, workPhone, kABWorkLabel, NULL) ;
    if(workFax) ABMultiValueAddValueAndLabel(multi, workFax, kABPersonPhoneWorkFAXLabel,NULL) ;//&&
    if(mobile) ABMultiValueAddValueAndLabel(multi, mobile, kABPersonPhoneMobileLabel,NULL);
    if(homePhone) ABMultiValueAddValueAndLabel(multi, homePhone, kABHomeLabel,NULL);
    
    if(workPhone || workFax || mobile || homePhone){
        
        ABRecordSetValue(aRecord, kABPersonPhoneProperty, multi, &anError);
        if (anError != NULL) {   MELog(@"error while creating ABMutableMultiValueRef..%@", anError); }
        
    }
    
    CFRelease(multi);
    
    
    
    //add work adress
    ABMutableMultiValueRef multiAddress1 = ABMultiValueCreateMutable(kABMultiDictionaryPropertyType);
    
    NSMutableDictionary *addressDictionary1 = [[NSMutableDictionary alloc] init];
    if(address1_street)  [addressDictionary1 setObject:address1_street forKey:(NSString *) kABPersonAddressStreetKey];
    if(address1_city)  [addressDictionary1 setObject:address1_city forKey:(NSString *)kABPersonAddressCityKey];
    if(address1_state)  [addressDictionary1 setObject:address1_state forKey:(NSString *)kABPersonAddressStateKey];
    if(address1_postalcode) [addressDictionary1 setObject:address1_postalcode forKey:(NSString *)kABPersonAddressZIPKey];
    if(address1_country) [addressDictionary1 setObject:address1_country forKey:(NSString *)kABPersonAddressCountryKey];
    //[addressDictionary setObject:@"us" forKey:(NSString *)kABPersonAddressCountryCodeKey];
    
    bool didAdd = NO;
    
    if([addressDictionary1 count] > 0){
        didAdd = ABMultiValueAddValueAndLabel(multiAddress1, addressDictionary1, kABWorkLabel, NULL);
    }
    
    [addressDictionary1 release];
    
    //add home address
    
    NSMutableDictionary *addressDictionary2 = [[NSMutableDictionary alloc] init];
    if(address2_street)  [addressDictionary2 setObject:address2_street forKey:(NSString *) kABPersonAddressStreetKey];
    if(address2_city)  [addressDictionary2 setObject:address2_city forKey:(NSString *)kABPersonAddressCityKey];
    if(address2_state)  [addressDictionary2 setObject:address2_state forKey:(NSString *)kABPersonAddressStateKey];
    if(address2_postalcode) [addressDictionary2 setObject:address2_postalcode forKey:(NSString *)kABPersonAddressZIPKey];
    if(address2_country)  [addressDictionary2 setObject:address2_country forKey:(NSString *)kABPersonAddressCountryKey];
    //[addressDictionary setObject:@"us" forKey:(NSString *)kABPersonAddressCountryCodeKey];
    
    if([addressDictionary2 count] > 0 ){
        didAdd = ABMultiValueAddValueAndLabel(multiAddress1, addressDictionary2, kABHomeLabel, NULL);
        
        
    }
    if(didAdd){
        //(@"home address added");
        anError = NULL;
        ABRecordSetValue(aRecord, kABPersonAddressProperty, multiAddress1, &anError);
        if (anError != NULL) {   MELog(@"error while creating home address..%@", anError); }
    }
    
    CFRelease(multiAddress1);
    [addressDictionary2 release];
    addressDictionary2 = nil;
    
    
    ////////////
    
    ABAddressBookRef addressBook;
    CFErrorRef error = NULL;
    addressBook = ABAddressBookCreate();
    
    /*BOOL isAdded =*/ ABAddressBookAddRecord (addressBook, aRecord, &error);
    

    if (error != NULL) {
        
        MELog(@"ABAddressBookAddRecord %@", error);
    }
    error = NULL;
    
    
    
    if(ABAddressBookSave ( addressBook,  &error)){
        
        
        addressbookId =  ABRecordGetRecordID (aRecord);
        
    }
    
    if (error != NULL) {
        MELog(@"ABAddressBookSave %@", error);
    }
    
    CFRelease(aRecord);

    CFRelease(addressBook);
    
    
return addressbookId;

}
Thanks to http://www.simplebits.com/cgi-bin/simplecode.pl?mode=process to format the above code

Tuesday, April 10, 2012

How to add fixed space between UIToolBar items


Create Barbutton with UIBarButtonSystemItemFixedSpace   

UIBarButtonItem *fixedSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
fixedSpace.width = 40;


And add this item to the item array

iOS - UDID replacement


Apple deprecated accessing the device identifier and hear that they going to reject apps which using the UDID

Our application is using the UDID to uniquely represent a user per application.

And we need to identify the user even if the user removes the application and install it again.


-------------------------------
The following is our replacement of UDID

 - (NSString *)getUUID
{
    KeychainItemWrapper  *wrapper = [[KeychainItemWrapper alloc] initWithIdentifier:@"mydeviceudid" serviceName:@"myservice" accessGroup:nil];
    NSString *newuuid = [wrapper objectForKey:(id)kSecAttrAccount]   
    if(newuuid == nil){
          CFUUIDRef theUUID = CFUUIDCreate(NULL);
         CFStringRef newcfuuid = CFUUIDCreateString(NULL, theUUID);
          CFRelease(theUUID);
         newuuid = [(NSString *)newcfuuid autorelease];
          [wrapper setObject:newuuid forKey:(id)kSecAttrAccount];
     }
    return newuuid;
 }
 


 references : http://stackoverflow.com/questions/427180/how-to-create-a-guid-uuid-using-the-iphone-sdk

Friday, March 30, 2012

error: failed to launch -- No such file or directory iOS device xcode

On Xcode, I am getting this error when launch application on Device
Xcode 4.3, Device OS 5.1
Solved:
Quit the Xcode and Reopen the project again solved the issue.

if the error is error: failed to launch,..  failed to get the task for process , please  look at the selected profile is correct one

iOS : NSLog is not working on Simulator

Woking on Xcode 4.3.2 and iOS 5.1 , Suddenly my NSLog commands are stopped working..
And it is working with other projects.
Solved:
1. Clean (Xcode menu Product - > Clean)
2. Removed all simulator applications from 5.1 folder and 5.0 folder
<Home>/Library/Application Support/iPhone Simulator/5.0/Applications, and <Home>/Library/Application Support/iPhone Simulator/5.1/Applications

If the Library folder is not visible in your <Home> folder, enter the command "chflags nohidden ~/Library/ " on Terminal(Applications->Utilities->Terminal) application
Thanks for reading.. :)

iOS : How to disable all NSLog for release

1. Rename your all NSLog to MyLog

2. Add this code to your <ProjectName>-Prefix.pch file

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>


#ifdef DEBUG  
#define MyLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);

#else  
#define MyLog(...)

Failed to install error message with Xcode

I installed Xcode 4.3.1 version today, 
Getting error message "Failed to install" When I try ti install an adhoc application created by new sdk.

Its fixed by selecting the adhoc profile against the 'Release'  code signing identity, Also selected 'Release' on EditScheme - Archieve.

Thursday, September 1, 2011

NSURLRequest default cookie store will be required for http://...

Running iOS 5 sdk beta 6. So I think the error message is coming due to the beta software.. It may be fix in future release.. 

Wednesday, August 10, 2011

Understanding and Analyzing iOS Application Crash Reports

Read the App Store Review Guidelines from Apple site.

Read Technical Note TN2151 Understanding and Analyzing  Crash Logs

How to symbolicate the crash reports to see the lines in our source code ?

got an answer from stackoverflow


1. Our application need to build with Build Settings ->  under Build Options, the value of 'Debug Information Format' key should be "Dwarf with dSYM File"

2. We should keep the source and binary files which we used to submit the application to store

3. Select XCode, window -> organizer. select Archieve. Select the build which we used to submit and 'show in Finder'

4. select the xxx.xarchieve and 'Show contents'. You will get the .dSYM file and the .app file from the contents.

5. put the .app, .dSYM and crash logs files in a folder

6. open Terminal appplication and go to this folder // using  cd command

7. execute the command
atos -arch armv7 -o appname.app/appname memory_location_in_the_crashlogs


Wednesday, May 4, 2011

Distribute iPhone iPad application to users or customers





Preparing Apps for Distribution

Enterprise apps must be signed with your distribution certificate, and must have a provisioning profile that authorizes devices to use the app. The designated Team Agent for your program membership creates the distribution certificate and provisioning profiles at the online Provisioning Portal.
Generating the distribution certificate involves using the Certificate Assistant (which is part of the Keychain Access application on your Mac OS X development system) to generate a Certificate Signing Request (CSR). You upload the CSR to the iOS Provisioning Portal and receive a distribution certificate in response. When you install this certificate in Keychain, Xcode uses the certificate to sign your app. For detailed instructions, see the iOS Provisioning Portal.
Next, you need to create an enterprise distribution provisioning profile so your users can use your app on their device. You create an enterprise distribution provisioning profile for a specific app or multiple apps.
The designated Team Agent for your enterprise can create enterprise distribution provisioning profiles at the iOS Provisioning Portal at http://developer.apple.com/iphone. See the website for instructions.

Deploying Apps

There are three ways to install apps:
  • Distribute the app to your users for installation using iTunes.
  • Have an IT administrator install the app on devices using iPhone Configuration Utility.
  • Post the app on a secure web server; users access and perform the installation wirelessly.

Installing Apps Using iTunes

Your users use iTunes to install apps on their devices. Securely distribute the app to your users and then have them follow these steps:
  1. In iTunes, choose File > Add to Library and select the file (.app, .ipa, or .mobileprovision). You can also drag the file to the iTunes application icon.
  2. Connect a device to the computer, and then select it in the Devices list in iTunes.
  3. Click the Apps tab, and then select the app in the list.
  4. Click Apply.
If your user’s computers are managed, instead of asking them to add the files to iTunes, you can deploy the files to their computers and ask them to sync their device. iTunes automatically installs the files found in iTune’s Mobile Applications and Provisioning Profiles directories.

Installing Apps Using iPhone Configuration Utility

You can use iPhone Configuration Utility to install apps and profiles on connected devices.

Installing Distribution Provisioning Profiles:

  1. In iPhone Configuration Utility, choose File > Add to Library, and then select the distribution provisioning profile that you want to install.
    The profile is added to iPhone Configuration Utility and can be viewed by selecting the Provisioning Profiles category in the Library.
  2. Select a device in the Connected Devices list.
  3. Click the Provisioning Profiles tab.
  4. Select the provisioning profile in the list, and then click its Install button.

Installing Apps Using iPhone Configuration Utility

You can use iPhone Configuration Utility to install apps on connected devices.
  1. In iPhone Configuration Utility, choose File > Add to Library, and then select the app that you want to install.
    The app is added to iPhone Configuration Utility and can be viewed by selecting the Applications category in the Library.
  2. Select a device in the Connected Devices list.
  3. Click the Applications tab.
  4. Select the app in the list, and then click its Install button.

Installing Apps Wirelessly

iOS 4 supports over-the-air installation of enterprise applications, letting you distribute in-house software to your users without using iTunes or iPhone Configuration Utility.
Requirements
  • A secure web server accessible by authenticated users
  • An in-house iOS app in .ipa file format
  • An XML manifest file, described in this document
  • A network configuration that allows the device to access an iTunes server at Apple
Installing the app is simple. Users download the manifest file from your website to their iOS 4 device, which instructs the device to download and install the apps referenced in the manifest.
You can distribute the URL for downloading the manifest file via SMS or email, or by embedding it in another enterprise app you’ve created.
It’s up to you to design and host the website used to distribute apps. You need to make sure that users are authenticated, perhaps using basic auth or directory-based authentication, and that the website is accessible via your intranet or the Internet. The app and manifest can be placed in a hidden directory, or in any other location that’s readable using HTTP or HTTPS.

Preparing an Enterprise App for Wireless Distribution

To prepare your enterprise app for wireless distribution, you build an archived version in the form of a .ipa file, and a manifest file that enables wireless distribution and installation of the app.
In Xcode, you create an app archive using the “Build > Build and Archive” command. Then, in the Archived Applications source in Xcode’s Organizer, select the app and click the “Share Application…” button. Then click the “Distribute for Enterprise…” button. You’ll be asked to provide information for the manifest file that Xcode creates. For information about the manifest file, see below.  For more information about building and provisioning apps, visit the iOS Dev Center.

About the Wireless Manifest File

The manifest file is a file in XML plist format. It’s used by an iOS 4 device to find, download, and install apps from your web server. The manifest file is created by Xcode, using information you provide when you share an archived app for enterprise distribution. See “Preparing an Enterprise App for Wireless Distribution.”
A sample manifest file is included at the end of this document. The following fields are required:
Item
Description
URL
The fully qualified HTTP or HTTPS URL of the app (.ipa) file.
display-image
A 57 x 57-pixel PNG image that is displayed during download and installation. Specify the image’s fully qualified URL.
full-size-image
A 512 x 512-pixel PNG image that represents the app in iTunes.
bundle-identifier
Your app’s bundle identifier, as specified in your Xcode project.
bundle-version
Your app’s bundle version, as specified in your Xcode project.
title
The name of the app, which is displayed during download and installation.
Optional Keys
Optional keys you can use are described in the sample manifest file. For example, you can use the MD5 keys if your app file is large and you want to ensure download integrity beyond the error checking normally done during TCP communications.

Constructing your Website

Upload these items to an area of your website that your authenticated users can access:
  • The app (.ipa) file
  • The manifest (.plist) file
Your website design is up to you. It can be as simple as a single page that links to the manifest file. When users tap the web link, the manifest file is downloaded, which triggers the downloading and installation of the apps it describes.
Here’s an example link:
Don’t add a web link to the archived app (.ipa). It’s downloaded by the device when the manifest file is loaded. Although the protocol portion of the URL is itms-services, the iTunes Store is not involved in this process.

Setting Server MIME Types

It may be necessary to configure your webserver so that the manifest file and app file are transmitted correctly.
For Mac OS X Server use Server Admin to add the following MIME types to the MIME Types settings:
application/octet-stream ipa
text/xml plist
For IIS, use IIS Manager to add the MIME type in the Properties page of the server:
.ipa application/octet-stream
.plist text/xml

Troubleshooting Wireless App Distribution

If wireless app distribution fails with an “unable to download” message, check the following:
  • Make sure the app is signed correctly. Test it by installing it on a device using iPhone Configuration Utility.
  • Make sure the URL to the app (.ipa) file (in the manifest file) is correct and the app file is accessible to web users.
  • Make sure the link to the manifest file is correct and that the manifest file is accessible to web users.

    Still you are getting the message "unable to download" with Done and Retry button.. Please note that

    #. Dont try to manually edit the .plist file. Always give the right values when saving the file as enterprise distribution. If you have mistaked the application url when create enterprise distribution, Again create the application with correct url value instead of editing the manifest file.

Network Configuration Requirements

If the devices are connected to a closed internal network, you should allow iOS devices access to these sites.
URL
Reason
ax.init.itunes.apple.com
The device obtains the current file-size limit for downloading apps over the cellular network. If this site it not reachable, installation may fail.
ocsp.apple.com
The device contacts this site to check the status of the distribution certificate used to sign the provisioning profile. See“Certificate Validation.”

Providing Updated Apps

Apps that you distribute yourself aren’t automatically updated. When you have a new version for users to install, notify them of the update and instruct them to install the app. Consider having the app check for updates and notify the user when it opens. If you’re using wireless app distribution, the notification can provide a link to manifest file of the updated app. You will need to update all of your enterprise apps at least once a year. See “Certificate Validation.”
If you want users to retain data stored on their device, make sure the new version uses the same bundle-identifier key as the one it’s replacing and tell users not to delete their old version before installing the new one. The new version will replace the old one and retain data stored on the device, provided that the bundle-identifiers match.

Certificate Validation

The first time an application is opened on a device, the distribution certificate is validated by contacting Apple’s OCSP server. Unless the certificate has been revoked, the app is allowed to run. Inability to contact or get a response from the OCSP server is not interpreted as a revocation. To verify the status, the device must be able to reach ocsp.apple.com. See “Network Configuration Requirements.”
The OCSP response is cached on the device for the period of time specified by the OCSP server—currently between 3 and 7 days. The validity of the certificate will not be checked again until the device has restarted and the cached response has expired. If a revocation is received at that time, the app will be prevented from running. Revoking a distribution certificate will invalidate all of the applications you have distributed.
An app will not run if the distribution certificate has expired. Currently, distribution certificates are valid for one year. A few weeks before your certificate expires, request a new distribution certificate from the iOS Dev Center, use it create create new distribution provisioning profiles, and then recompile and distribute the updated apps to your users. See “Providing Updated Apps.”

Sample Manifest File



   
   items
   
       
           
           assets
           
               
               
                   
                   kind
                   software-package
                   
                   md5-size
                   10485760
                   
                   md5s
                   
                       41fa64bb7a7cae5a46bfb45821ac8bba
                       51fa64bb7a7cae5a46bfb45821ac8bba
                   
                   
                   url
                   http://www.example.com/apps/foo.ipa
               
               
               
                   kind
                   display-image
                   
                   needs-shine
                   
                   url
                   http://www.example.com/image.57x57.png
               
               
               
                   kind
                   full-size-image
                   
                   md5
                   61fa64bb7a7cae5a46bfb45821ac8bba
                   needs-shine
                   
                   urlhttp://www.example.com/image.512x512.jpg
               
           metadata
           
               
               bundle-identifier
               com.example.fooapp
               
               bundle-version
               1.0
               
               kind
               software
               
               subtitle
               Apple
               
               title
               Example Corporate App
           
       
   


From Apple site http://developer.apple.com/library/ios/#featuredarticles/FA_Wireless_Enterprise_App_Distribution/Introduction/Introduction.html