[Solved] How can i convert this code to swift 4? [closed]

UILocalNotification is deprecated. Try this code: let gregCalrendar = Calendar(identifier: .gregorian) var dateComponent = gregCalrendar.dateComponents([.year, .month, .day, .hour, .minute], from: Date()) dateComponent.year = 2012 dateComponent.month = 9 dateComponent.day = 28 dateComponent.hour = 16 dateComponent.minute = 11 let dd = UIDatePicker() dd.setDate(gregCalrendar.date(from: dateComponent)!, animated: true) let content = UNMutableNotificationContent() content.title = “UMUT CAN ALPARSLAN” let trigger … Read more

[Solved] understanding ‘lldb’ backtace – app crashes when button is pressed

This is your problem: Foundation`-[NSObject(NSKeyValueCoding) setValue:forKey:] because after this, is raised an Exception: CoreFoundation`-[NSException raise] + 12 You are trying to set a value for a key in your object that could not exists or has some other problem. P.S.: Update your answer with some relevant code so I can update my answer with more … Read more

[Solved] iOS After NSDateFormatter Date is nil [duplicate]

Use a dateFormat string of @”yyyy-MM-dd HH:mm:ss Z” instead. Your dateFormat does not match the format of the string you’re trying to convert. By the way, there’s no point in converting [NSDate date] to a string and back again. Just use [NSDate date] and be done with it: NSDate *compareDateNow = [NSDate date]; NSComparisonResult result … Read more

[Solved] Sorting in Objective C [duplicate]

For a full explanation see this answer from a related question. In short you basically have to implement… – (NSComparisonResult)compare:(Contact *)otherContact; …in your Contact class (order of comparison: self, otherContact). NSComparisonResult has three possible values: NSOrderedAscending, NSOrderedSame and NSOrderedDescending. solved Sorting in Objective C [duplicate]

[Solved] Convert a swift function in objective-c

I think you want to find if given string contains at least one of the strings contained in the array to ban abusive words – (BOOL) checkIfOfStringOfArray: (NSArray *) array inString: (NSString *) string { for (NSString * element in array) { if ([string containsString: element]) return YES; } return NO; } Call like: BOOL … Read more

[Solved] numberOfRowsInSection repeats counting the last section

Surely you just want to look at the relevant section rather than looping through all the sections. Something like: – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if([buttonTags containsObject:@(section)]) { return 0; } else { return [arrayOfArrays[section] count]; } } 0 solved numberOfRowsInSection repeats counting the last section

[Solved] How to update a UITableView that after NSUserdefaults settings have been changed? [closed]

It is kind a best way to reload your table. if you want to reload one row(or more), you can use [self.tableView reloadRowsAtIndexPaths: withRowAnimation:]; if you want to do multiple inserts or delete you can use [self.tableView beginUpdates]; [self.tableView endUpdates]; [self.tableView reloadData]; reload everything…redisplays visible rows, reloads data. solved How to update a UITableView that … Read more

[Solved] Objective C / Xcode [closed]

Create an outlet to your UIImageView called myImageView and an action for your UIButton called myButtonHit. -(IBAction)myButtonHit:(id)sender { self.myImageView.hidden = !self.myImageView.hidden; } solved Objective C / Xcode [closed]

[Solved] what is the use of NSLocalizedString and when to use?

Second parameter will be used as a prompt to translators about context of string being used in your application. It will be added to file generated by genstring tool, output will be something like: self.textfiled.text = NSLocalizedString(@”AboutUserKey”, @”Title for about user button”)]; … // en/Localizable.string /* Title for about user button */ “AboutUserKey” = “About”; … Read more

[Solved] Is it okay to be learning to program for iOS with an iOS 5 book? [closed]

There are less radical changes to the API, that’s true. Auto-Layout it probably the biggest change. The rest are additions that you can check out later, like Pass Kit, Reminders API, UICollectionView or better social integration. I wouldn’t worry too much about an iOS 5 book being out-dated, if it’s good. Make sure it teaches … Read more

[Solved] Check Null value

You should check for (null) just via if (email == nil) { NSLog(@”null2″); } or just if (!email) { NSLog(@”null1″); } The NSNull class is there to put null values inside collections that normally use null as a terminator symbol. See the apple docs for further details on the NSNull class. 8 solved Check Null … Read more