
How to implement XCTestCase in Xcode Project?
1. First, you have to import XCTest.framwork in project. 2. Now, go into “Project Tests” section on left section of Xcode. (EX. “Sample Tests”) 3. Now, right click on that tests and create new file with “Test case Class”.
How to store Image, MP3 data in DocumentDirectory And use it from Document Directory?
1. Store Image in DocumentDirectory and use from DocumentDirectory. –> Store Image: NSData *webData1 = [NSData dataWithContentsOfURL:[NSURL URLWithString:IMG_URL]]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *localFilePath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@”test.png”]]; [webData1 writeToFile:localFilePath atomically:YES]; –> Display Image
How to Draw turn by turn route in iphone/ipad native app?
1. First import below frameworks in viewcontroller.h file. #import <CoreLocation/CoreLocation.h> #import <MapKit/MapKit.h> #import <AddressBook/AddressBook.h> 2. Now in viewcontroller.m file get the starting and destination address using below method. Repeat below methods twice to get both address values. –
How to generate thumbnail photo for image and video from assets url?
==> When we are dealing assets-library and need to show thumbnails then without saving that image to anywhere we can directly show that image from assets url. ==> For image you can this code to show image in cell. NSURL*
How to Find Service Provider name in ios?
Add “CoreTelephony” Framework in Project import #import <CoreTelephony/CTCarrier.h> #import <CoreTelephony/CTTelephonyNetworkInfo.h> File in ViewController.h File Add Below Code in ViewController.m File CTTelephonyNetworkInfo *networkInfo = [[[CTTelephonyNetworkInfo alloc] init] autorelease]; NSString *serviceProvider = networkInfo.subscriberCellularProvider.carrierName; NsLog(“serviceProvider : %@”, serviceProvider);