raconteur

During the last fourteen days I worked on a new piece of software. Its name is raconteur and it is a slide compiler written in Objective-C. It lets you create presentations in Markdown and compiles them to HTML afterwards. Why The last times I used Keynote it took some time until I got an acceptable […]

hipblog

For our learning group rubyseeds, we have a Jekyll blog, where we document the topics we talked about. When I write a new blog post, it requires some steps: Create a new file in the _posts/ folder with the following naming scheme: yyyy-MM-dd-title.md in the new file, create the frontmatter which consists of title, category, […]

Basic Core Data model versioning

When you add new properties, entities, relationships to an existing data model which is already deployed in production, this will fail with this error: Therewith this does not happen, some steps are necessary. At first, you need to configure Core Data, that data is migrated automatically: The second step is, to create a new version […]

Writing an email client

I was wondering if it could be that hard writing an email client by myself. I thought the basic things couldn’t be that hard, and I was right. I created a new application using the MailCore2 library and fetching mails becomes very easy. Yup, only fetching mails works at the moment. I spend some time […]

Load specific items from NSManagedObjectContext

Given the case you do not want to load all elements from the context but only those matching a certain criteria. For this, you need to use a NSPredicate. NSPredicate *readArticlesPredicate = [NSPredicate predicateWithFormat:@“read == 1″]; NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; [fetchRequest setEntity: [NSEntityDescription entityForName:@“FeedEntry“ inManagedObjectContext: self.managedObjectContext]]; [fetchRequest setPredicate:readArticlesPredicate]; NSError *error = nil; NSArray […]

Load things from NSManagedObjectContext

How do I load things from NSManagedObjectContext? Not that hard:     NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];     [fetchAccounts setEntity: [NSEntityDescription entityForName:@“YourEntity“ inManagedObjectContext: self.managedObjectContext]];     NSError *error = nil;     NSArray *results = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error];     if (error) {         NSLog(@“Error: %@\n%@“, [error localizedDescription], [error userInfo]);         return nil;     }

Inserting things into NSManagedObjectContext

Insert a new item into NSManagedObjectContext: //Creates new NSManagedObject NSManagedObject * obj = [NSEntityDescription insertNewObjectForEntityForName:@“Item“ inManagedObjectContext: self.managedObjectContext]; //Set value(s) [obj setValue: @“yadda yadda“ forKey: @“text“]; //save stuff [[self managedObjectContext] save: nil];  

Cocoa – ADNKit authentication

Yesterday evening I worked on a Mac App and on my agenda was authentication. This app (maybe later on more details about it) is an App.Net client. If you have a look at the developer documentation you see that there are three options available: web flow (server side) web flow (client side) Password flow I decided […]