Skip to main content

Posts

Unique string for application

Use  identifierForVendor,  this unique string is same till you not delete your application from the device. Swift :    var uniqueId = UIDevice . currentDevice (). identifierForVendor . UUIDString   println ( "identifierForVendor : \ (uniqueId)" )          Objective-C :  NSString * uniqueId  = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; Refrence Link :  http://possiblemobile.com/2013/04/unique-identifiers/

Google Search API

Place Search API : Authentication :   https://developers.google.com/places/documentation/ Below detail coming from above link Need to first register for the API key then you are able to use below link services: The Google Places API uses an API key to identify your application. API keys are managed through the  Google APIs Console . You'll need your own server API key  before you can begin using the API. To activate the Places API and create your key: Visit the  Google APIs Console  and log in with your Google account. A default project called  API Project  is created for you when you first log in to the APIs Console. You can use the project, or create a new one by clicking the  API Project  button at the top of the window and selecting  Create .  Google Maps API for Work  customers must use the API project created for them as part of their  Google Places API for Work  purchase. Click the  Serv...

sizeWithFont method is deprecated. Replace with sizeWithAttributes.

Create category that works for both iOS7 and iOS8 or only use sizeWithAttributes. #import "NSString+StringSizeWithFont.h" @implementation NSString (StringSizeWithFont) - ( CGSize ) sizeWithMyFont:( UIFont *)fontToUse {     if ([ self respondsToSelector : @selector (sizeWithAttributes:)])     {         NSDictionary * attribs = @{ NSFontAttributeName :fontToUse } ;         return ([ self sizeWithAttributes :attribs]);     }     return ([ self sizeWithFont :fontToUse]); } @end Category call :      NSString *text= @"Do any additional setup after loading the view, typically from a nib." ;     CGSize fontSize = [text sizeWithMyFont :[ UIFont fontWithName : @"Helvetica"                                             ...

Convert Date into ISO formate

Call below function like : [self toStringFromDateTime:[NSDate date]]; - (NSString*)toStringFromDateTime:(NSDate*)datetime {     // Purpose: Return a string of the specified date-time in UTC (Zulu) time zone in ISO 8601 format.     // Example: 2013-10-25T06:59:43.431Z     NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];     //ISO DateFormatter     [dateFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@" UTC "]];     [dateFormatter setDateFormat:@" yyyy-MM-dd'T'HH:mm:SS.SSS'Z' "];     NSString* dateTimeInIsoFormatForZuluTimeZone = [dateFormatter stringFromDate:datetime];     return dateTimeInIsoFormatForZuluTimeZone; }

Fixed : App crash on update with core data changes

Why migration required ? When the model does not match the store, a migration is required. In order to perform a migration, Core Data (technically, an instance of NSMigrationManager) requires these things: The destination managed object model (the one with the changes) A managed object model that can open the existing store The ability to infer mapping between the two models (for a lightweight migration), or a manual mapping model Permission to attempt to perform an automatic migration (for a lightweight migration) It is therefore absolutely essential that you never make changes to the managed object model for a released version of an app. That is, if your app is already in the App Store,  don’t change a single thing in that version of the managed object model . Solution for the Crash while update an application from the app store: Create a  new version  of the managed object model! This reminds me to mention some other best practices to adopt when worki...

Symbolicating Crash Logs

Link to download symbolicatecrash file https://github.com/chrispix/ symbolicatecrash-fix 1. Using XCode:  This is probably the easiest way to symbolicate the crash reports, but not always effective. To symbolicate using XCode you need three files: a.     Crash report (.crash file). b.     Symbol file (.dSYMB file). c.     Application bundle (.app file). In most of the cases you will have “yourapp.ipa” file, to extract “yourapp.app“ from “yourapp.ipa” just change the extension of “yourapp.ipa” to “yourapp.zip” and extract the zip file, you will get a folder named “Payload”, in this folder you will have “yourapp.app” package. 2. Using symbolicatecrash command: Some times XCode do not symbolicate the crash log properly, In this situation we can use symbolicatecrash script manually. Before proceeding keep you “.app”,  ”.dSYM” and “.crash” files in one folder. Now open ...