AUTHOR: Thomas Sattlecker

Software and more

Navigation

CoreData CRUD methods in Swift 2.0

With Swift 2.0, Apple introduced a protocol oriented way of programming. I want to use this to create a protocol that adds CRUD functionality to CoreData models without the need for all the type casting. import Foundation import CoreData protocol CoreDataCRUD { } extension CoreDataCRUD where Self : NSManagedObject { static func create() -> Self { return NSEntityDescription.insertNewObjectForEntityForName(Utility.classNameAsString(self), inManagedObjectContext: sharedCoreDataManager.context()) as! Self } static func findById(id: String) throws -> Self? { let fetchRequest = NSFetchRequest(…

apple developer program signup

I had the worst experience when signing up for an apple developer account and i thought i should share this. enter account information Early on in the process you have to enter your account information. Things like your name and address. Select your preferred program. Review your entered data and submit. Result: check your data again As you can see, somehow the country information was missing. Now you might think, how could i miss this? Apple…

Swift CoreData: generate swift NSManagedObjects

This is a follow up to my previous post about Xcode6 and CoreData. If you set the class in your xcdatamodel to <MyAppName>.User and create the NSManagedObjects from the entities, Xcode6 does not generate the correct .swift model files. It parses the class <MyAppName>.User only to the . and creates a single <MyAppName>.swift file. For now the only fix i have is to rename the class to User,…

Swift CoreData: Unable to load class named...

CoreData: warning: Unable to load class named 'User' for entity 'User'. Class not found, using default NSManagedObject instead. If you get this error, but you are sure that there should exist an entity 'User', it is most likely that you forgot to set the correct class in the xcdatamodel. It should look like this: <MyAppName>.User Follow up: Generating the .swift model files Source: https://developer.apple.com/library/prerelease/mac/documentation/Swift/Conceptual/…

Modern Web-development Stack

Some time ago now i stumbled over some web development tools and frameworks when evaluating the current modern stuff. After building some small applications i decided to write a very small seed application with the following technology stack. github node Not much to tell about node. It is built on Chrome's V8 engine for building fast, scalable network application. If you do not hate javascript, give it a try! expressjs When using node you often want…

maven multi modules setup

This is a very common use case and it took me some time to figure everything out. Consider we have a Maven project with 2 modules and both modules need to have access to the same database with the same domain models. Since we do not want to write these models multiple times lets create a 3rd module for them. Setup We want a project setup like this. pom.xml --> /WebProject pom.xml --&…

AngularJs Directives

What are Directives? Directives may be the most difficult part of AngularJs and at the same time the most powerful and useful. Think of directives as components you use to assemble an application. You can create your own HTML tags or attributes. Angular comes with a lot of them already included. Thinks like ng-repeat ng-show... are nothing else than directives. When to use Directives Use them as often as you can. Not only are directives reusable…

Rdio vs Spotify

This is a pure opinion of mine and compares the two streaming services on my needs only. I will not compare all the features but just the differences i discovered. If you do not know Spotify or Rdio I recommand to take a look at them. Both provide a very good service. Device support I have to give both of them credits for the huge device support they have. OSX, Windows, Web, iOS, Android, Windows Phone…

mongodb text search

nosql databases have their good and bad parts. In the case of mongodb a problem was definitely 'in text searches'. You could use regex queries which are very slow compared to what you probably want and need. What is the new text search? The feature was introduced in January 2013 and adds a full text search directly implemented into mongodb. MongoDB Text Search is currently in beta and supports the search of string content in documents…