https://www.objc.io/issues/2-concurrency/common-background-practices/ @interface ImportOperation : NSOperation - (id)initWithStore:(Store*)store fileName:(NSString*)name; @property (nonatomic) float progress; @property (nonatomic, copy) void (^progressCallback) (float); @end static const int ImportBatchSize = 250; @interface ImportOperation () @property (nonatomic, copy) NSString* fileName; @pro..
http://b4you.net/blog/231 int timestamp = [[NSDate date] timeIntervalSince1970]; NSDate *date = [NSDate dateWithTimeIntervalSince1970:1245981099]; NSDate *date; NSDateComponents *com; date = [NSDate dateWithTimeIntervalSince1970:1245980099]; com = [[NSCalendar currentCalendar] components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | N..
http://hayageek.com/uialertcontroller-example-ios/ //Create UIAlertController + (instancetype)actionWithTitle:(NSString *)title style:(UIAlertActionStyle)style handler:(void (^)(UIAlertAction *action))handler; //Adding an action - (void)addAction:(UIAlertAction *)action; //Adding text filed to UIAlertController.This method is supported only for UIAlertControllerStyleAlert - (void)addTextFieldWit..
https://www.objc.io/issues/5-ios7/from-nsurlconnection-to-nsurlsession/ https://code.tutsplus.com/tutorials/networking-with-nsurlsession-part-1--mobile-21394 - (void)viewDidLoad { [super viewDidLoad]; NSURLSession *session = [NSURLSession sharedSession]; } - (void)viewDidLoad { [super viewDidLoad]; NSURLSession *session = [NSURLSession sharedSession]; NSURLSessionDataTask *dataTask = [session da..
http://www.ios-blog.co.uk/tutorials/objective-c/objective-c-using-nstimer/ /[NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(targetMethod:) userInfo:nil repeats:NO]; [myTimer invalidate]; myTimer = nil; NSTimer *t = [NSTimer scheduledTimerWithTimeInterval: 2.0 target: self selector:@selector(onTick:) userInfo: nil repeats:NO]; [self performSelector:@selector(onTick:) wi..
http://sharphail.tistory.com/65 /NSArray *old_ary = [NSArray arrayWithObjects: [NSNumber numberWithInt:1],[NSNumber numberWithFloat:2.5f],[NSNumber numberWithBool:YES],nil]; NSArray *new_ary = @[@1,@2.5f,@YES]; NSLog(@"old_array : %@",[old_ary objectAtIndex:1]); NSLog(@"new_array : %@",new_ary[1]); NSDictionary *old_dic = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:11],@"..
https://eezytutorials.com/ios/nsmutablearray-by-example.php /NSMutableArray *array = [NSMutableArray arrayWithCapacity:1]; [array addObject:@"Eezy"]; [array addObject:@"Tutorials"]; NSLog(@"%@",array); var array:NSMutableArray = NSMutableArray(capacity:1) array.addObject("Eezy") array.addObject("Tutorials") print(array) NSMutableArray *array = [[NSMutableArray alloc]init]; NSLog(@"%@",array); NS..
http://www.ios-developer.net/iphone-ipad-programmer/development/strings/using-nsstring http://susemi99.kr/536 //Create a string NSString *MyStringName1 = @"Hello"; //Create new NSString from another string NSString *MyStringName2 = [MyStringName1 stringByAppendingString:@", world!"]; NSString *source = @"0123456789"; NSString *firstFour = [source substringToIndex:4]; // firstFour is @"0123" NSSt..
https://www.natashatherobot.com/ios-core-data-singleton-example/ http://susemi99.kr/536 // // CoreDataManager.h // ShopLater // // Created by Natasha Murashev on 6/7/13. // Copyright (c) 2013 Natasha Murashev. All rights reserved. // #import foundation foundation.h #import coredata coredata.h @interface CoreDataManager : NSObject + (CoreDataManager *)sharedManager; - (void)saveDataInManagedConte..