1 / 12

IOS TRAINING IN CHENNAI

Greens Technologies is a leading provider of iOS Training in Chennai. Excellent syllabus with Assured Job Placements. Create iOS Apps ( iPhone/iPad ) using iOS 8 SDK, Work with XCode 6 and getting started with Swift programming Language and Objective-C training. We provide Best iOS Training in Chennai with Placement in leading companies.

01rakshitha
Download Presentation

IOS TRAINING IN CHENNAI

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. iOS - File Handling

  2. Methods used in File Handling The methods used for accessing and manipulating the files are discussed below. Here we have to replace FilePath1, FilePath2 and FilePath strings to our required full file paths to get the desired action. Check if a File Exists at a Path NSFileManager*fileManager=[NSFileManagerdefaultManager]; NSArray*directoryPaths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);NSString*documentsDirectoryPath=[directoryPaths objectAtIndex:0]; if ([fileManagerfileExistsAtPath:@""]==YES){NSLog(@"File exists");}

  3. Comparing Two File Contents if([fileManagercontentsEqualAtPath:@"FilePath1"andPath:@" FilePath2"]){NSLog(@"Same content"); } Check if Writable, Readable, and Executable if([fileManagerisWritableFileAtPath:@"FilePath"]){NSLog(@"isWritable");}if([fileManagerisReadableFileAtPath:@"FilePath"]){NSLog(@"isReadable");}if([fileManagerisExecutableFileAtPath:@"FilePath"]){NSLog(@"is Executable");}

  4. Move File if([fileManagermoveItemAtPath:@"FilePath1"toPath:@"FilePath2"error:NULL]){NSLog(@"Moved successfully"); } Copy File if([fileManagercopyItemAtPath:@"FilePath1"toPath:@"FilePath2"error:NULL]){NSLog(@"Copied successfully"); } Remove File if([fileManagerremoveItemAtPath:@"FilePath"error:NULL]){NSLog(@"Removed successfully");}

  5. Read File NSData*data =[fileManagercontentsAtPath:@"Path"]; Write File [fileManagercreateFileAtPath:@""contents:dataattributes:nil];

  6. iAd Integration – Steps Involved iAd Integration – Steps Involved Step 1 − Create a simple view-based application. Step 2 − Select your project file, then select targets and then add iAd.framework in choose frameworks. Step 3 − Update ViewController.h as follows − #import <UIKit/UIKit.h>#import <iAd/iAd.h>@interfaceViewController:UIViewController<ADBannerViewDelegate>{ADBannerView*bannerView;}@end

  7. Step 4 − Update ViewController.m as follows − #import "ViewController.h" @interfaceViewController() @end @implementationViewController – (void)viewDidLoad { [superviewDidLoad]; bannerView=[[ADBannerViewalloc]initWithFrame: CGRectMake(0,0,320,50)]; // Optional to set background color to clear color [bannerViewsetBackgroundColor:[UIColorclearColor]]; [self.viewaddSubview:bannerView]; } -(void)didReceiveMemoryWarning{ [superdidReceiveMemoryWarning]; // Dispose of any resources that can be recreated . } #pragma mark – AdViewDelegates -(void)bannerView:(ADBannerView*)banner didFailToReceiveAdWithError:(NSError*)error { NSLog(@"Error loading"); } -(void)bannerViewDidLoadAd:(ADBannerView*)banner { NSLog(@"Ad loaded"); } -(void)bannerViewWillLoadAd:(ADBannerView*)banner { NSLog(@"Ad will load"); } -(void)bannerViewActionDidFinish:(ADBannerView*)banner { NSLog(@"Ad did finish"); } @end

  8. iOS - Storyboards Step 1 − Create a single view application and make sure that you select storyboard checkbox while creating the application. Step 2 -SelectMainStoryboard.storyboard where you can find single view controller. Add one more view controllers and update the view controllers as shown below.

  9. Step 3 − Let us now connect both the view controllers. Right-click on the "show modal" button and drag it to the right view controller in the left side view controller as shown below. Step 4 − Select modal from the three options displayed as shown below. Step 5 − Update ViewController.h as follows − #import <UIKit/UIKit.h> @interfaceViewController:UIViewController-(IBAction)done:(UIStoryboardSegue*)seque;@end

  10. Step 6 − Update ViewController.m as follows − #import "ViewController.h" @interfaceViewController() @end @implementationViewController - (void)viewDidLoad{ [superviewDidLoad]; } -(void)didReceiveMemoryWarning{ [superdidReceiveMemoryWarning]; / /Dispose of any resources that can be recreated. } -(IBAction)done:(UIStoryboardSegue*)seque{[self.navigationControllerpopViewControllerAnimated:YES];} @end

  11. Step 7 − Select the MainStoryboard.storyboard and right-click on the Exit button in the right side view controller, select done and connect with the back button

  12. GREENSTECHNOLOGYSBest iOS Training Institute in Chennai provides Real-time and Practical Trainings exclusively on Mobile technologies. Greens, The Best iOS Training center in Chennai has been providing the best possible iOS Course in Chennai on both Classroom Trainings and Online Trainings.

More Related