Tag: objective c

Daylight Saving Time Bug in EventKit

I discovered a bug in eventKit where dates are altered when saving. In this sample, I use an event with title Midnight that is a 1 second long event calculated to be local astronomical midnight. In the local timeZone, there are two occurrences of 1AM to 2AM in locale format because of daylight saving time […]

UITextView freezes iPad app from textViewShouldBeginEditing. (Invalid Glyph Index)

So I’ve been working on this bug for about a week now, and for the life of me I can’t figure out what’s happening. Due to confidentiality issues I can’t post too much code, but I’ll do my best to explain everything. What’s happening is that we’re populating a UITextField via code, and initially have […]

WKWebView won't open social media login popups

I have a WKWebView in my app. Everything is running smooth except the website I show has the social media logon buttons. The problem is, they display (or try to display) a popup where you allow it to have access to your social media account. I have researched this and tried a few things, but […]

How to use NSPredicate with chained virtual property?

Assume two ManagedObject backed by Sqlite: 1.) A User which has two properties, firstname and lastname and a virtual (transient) property fullname which is read-only. @interface User : NSManagedObject … @property NSString *firstname; @property NSString *lastname; @property (readonly) NSString *fullname; @end @implementation User … – (NSString*)fullname { return [NSString stringWithFormat:@”%@ %@”, self.firstname, self.lastname]; } @end […]

Core Data / NSFetchedResultsController – Registering changed objects related to the fetched object

I use a NSFetchedResultsController to get a list of objects which is displayed in a UITableView. If I change values in the objects the whole thing triggers and automatically reloads the changed rows. But one of the displayed values comes from related objects (one-to many relationship). Those objects have a transient title (so it’s value […]

CoreData iOS – How to create unique ID for objects?

I have a project in IOS for iPhones and iPads and such. For the project I am using CoreData to hold the data the user feeds in the app. For ease of understanding lets say its like a contacts app. So basically you know you have your name, work, phone etc. Well this app also […]

How to create SourceList to show Core Data ToMany relations?

Coming from iOS, I am stuck at NSOutlineView as Source list, I have read many resources but cannot grasp it clearly. What I want is, just to show coreData ToMany relationship as sourceList using NSTreeController. I am persisting data from text file to disk. Entities and relations are as follow: Group >> Item >> Description […]

How to get latitude and longitude of an image using PHAsset in iOS?

I am trying to fetch images from photo library within the range of two dates and I am getting the images successfully. And I am also getting the info of the image by using below code. PHContentEditingInputRequestOptions *options = [[PHContentEditingInputRequestOptions alloc] init]; options.networkAccessAllowed = YES; //download asset metadata from iCloud if needed [asset requestContentEditingInputWithOptions:options completionHandler:^(PHContentEditingInput […]

Call Receive to receiver to play sound

Call rececive to play sound in recevier speacker but not error accer and not sound play any one speacker in device to plz solution this problem. NSString *voice=[[NSUserDefaults standardUserDefaults] objectForKey:TB_Voice_conversation_value]; NSError *error; BOOL Errors; NSString *filePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:voice]; NSURL *myFileURL = [NSURL fileURLWithPath:filePath]; AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:myFileURL error:nil]; [player setDelegate:self]; […]

iOS 9 cancelLocalNotification problems

I’ve had an app on the App Store for over a year now which uses UILocalNotifications to act as reminders. The UILocalNotifications use the repeatInterval, set to NSCalendarUnitMinute, to keep reminding the user of whatever they wanted to be reminded of. Everything was fine with the app when building against iOS 7/8 but now that […]