[Solved] iOS App development [closed]

Learning Objective-C is an absolute minimum for iOS development. You really will be needing a Mac to develop on, but if you want to learn Objective-C before picking up a Mac then install a copy of Linux; gcc will compile Objective-C. Once you have a Mac you’ll have free access to XCode, which includes amongst … Read more

[Solved] UILocalNotification fire date computation

You can use NSCalendar and NSDateComponents to accomplish this. NSInteger daysToAdd = 5; NSDate *currentDate = [NSDate date]; NSDateComponents *comps = [[NSDateComponents alloc] init]; [comps setDay:daysToAdd]; NSDate *newDate = [[NSCalendar currentCalendar] dateByAddingComponents:comps toDate:currentDate options:0]; 4 solved UILocalNotification fire date computation

[Solved] POST method not working in ios

In iOS9, Apple added new feature called App Transport Security(ATS). ATS enforces best practices during network calls, including the use of HTTPS. Add the following in you info.plist You can add exceptions for specific domains in your Info.plist: <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>testdomain.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSExceptionRequiresForwardSecrecy</key> <true/> <key>NSExceptionMinimumTLSVersion</key> <string>TLSv1.2</string> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <false/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> … Read more

[Solved] Objective-C, How to count the number of TRUE booleans? [duplicate]

To Understand as Simple manner: int trueCount = 0; int falseCount = 0; for (<#initialization#>; <#condition#>; <#increment#>) { BOOL test3 = [test containsCoordinate:tg]; if (test3) { trueCount++; } else{ falseCount++; } } NSLog(@”True : %i”,trueCount); NSLog(@”False : %i”,falseCount); Implementation: -(void)markers{ NSURL *url = [NSURL URLWithString:@”http://example.com/api/s.php”]; data = [NSData dataWithContentsOfURL:url]; NSError *error; NSMutableArray *array = [NSJSONSerialization … Read more

[Solved] Xml to dictionary parsing using XML reader [closed]

if you are newbie and don’t know how to parse xml to dictionary… try with the below methods… in .h file add this methods #import <Foundation/Foundation.h> @interface XMLReader : NSObject { NSMutableArray *dictionaryStack; NSMutableString *textInProgress; NSError **errorPointer; } + (NSDictionary *)dictionaryForXMLData:(NSData *)data error:(NSError **)errorPointer; + (NSDictionary *)dictionaryForXMLString:(NSString *)string error:(NSError **)errorPointer; @end and in your .m … Read more

[Solved] Having problems using a custom cell instead the default cell [closed]

The only thing you ned in your table view controller is this: – (void)viewDidLoad { [super viewDidLoad]; [self.tableView registerNib:[UINib nibWithNibName:@”CellCustomLoadCell” bundle:nil] forCellReuseIdentifier:@”CellCustomLoadCell”]; } – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 2; } – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @”CellCustomLoadCell”; CellCustomLoadCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; cell.loadNumber.text=@”rodrigo”; return cell; } Registering the … Read more

[Solved] Json value failed in ios [closed]

I fixed this issue by replacing /n with empty string in json string NSString *json = [[NSString alloc]init]; json = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil]; json = [json stringByReplacingOccurrencesOfString:@”\n” withString:@””]; // NSLog(@”json %@”,json); NSArray *issueDetailsAry = [[json JSONValue]objectForKey:@”GetIssues”]; Now i got the output. This issue is because of server side linebreaks. solved Json value failed in … Read more

[Solved] How to compare two time from NSDate. Returning nil for nsdate when doing comparision. #debug my code

There was a typo:[dateFormatter setDateFormat:@”HH:mm:ss”]; should be:[formatter setDateFormat:@”HH:mm:ss”]; To compare two dates use: NSDate *date1 = [NSDate date]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@”HH:mm:ss”]; NSDate *date2 = [formatter dateFromString:@”05:00:00″]; NSComparisonResult result = [date1 compare:date2]; if(result == NSOrderedDescending) { NSLog(@”date1 is later than date2″); } If you only want to compare the hours: NSCalendar … Read more

[Solved] Type Properties In Swift [duplicate]

You can define properties of a type to either be associated with the type itself (these are called Type properties), but you can also define properties to be associated with a specific instance of that type. Type properties are usually used when you want to define something that is the same for each instance of … Read more

[Solved] How to pass the NSString from One UIViewController to Another UIViewController? [duplicate]

-(IBAction)buttonClicked:(id)sender { //check = [[NSString alloc] init]; — NO Need if (btn1.tag == 0) { check = @”foo”; NSLog(@”%@”,check); } if (btn2.tag == 1) { check = @”bar”; NSLog(@”%@”,check); } ViewController2 *obj = [[ViewController2 alloc] initWithNibName:@”ViewController2″]; [obj setCheck:check]; //push to ViewController2 [obj release]; } In your second view controller, #import <UIKit/UIKit.h> @interface ViewController2 : UIViewController … Read more