ios-queryable has seen a few improvements since it’s initial release. This is all part of my effort to make it the best wannable LINQ implementation for iOS development and Core Data.
I have added a bunch of handy new methods from IEnumerable<T>, including:
- single / singleOrDefault
and the predicate versions of first and firstOrDefault. I have also added support for parameters in where queries (and all of the other queries that support predicates) – something that should’ve been in the initial release.
Finally, IQueryable now supports the NSFastEnumeration protocol, so that you can directly read the results of queries in a foreach loop:
IQueryable* widgetQuery = [self.objectContext ofType:@"Widget"];
foreach(Widget* widget in widgetQuery)
// Do widgety stuff
As always, your feedback is appreciated (as are your pull requests!).
One of my favourite blog topics is poking fun at Xcode and all of the bizzare problems I encounter with it. The most recent one was a compiler error that looked like this:
fatal error: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/include/Availability.h' has been modified since the precompiled header was built
Strange, right? Fortunately, it was an easy fix – all I had to do was a Clean. After that, it compiled correctly.
What boggles my mind is that Xcode knew exactly what was wrong, but wasn’t smart enough to fix the problem itself. Maybe I am being unrealistic here, but it seems to me that a file included in the precompiled header has changed, the correct behavior would be to, you know, recompile the precompiled header?
Then again, it’s Xcode. So I guess not.
My current project relies heavily on Core Data. Since writing queries with Core Data really sucks, I have thrown together a little helper project called ios-queryable to ease the pain.
From the readme:
ios-queryable is an Objective-C category that provides IQueryable and IEnumerable-like functionality to Core Data.
It supports query composition and deferred execution, and implements a subset of IEnumerable’s methods, such as where, take, skip, and orderBy.
It lets you write code like this:
NSArray* widgets = [[[[[self.managedObjectContext ofType:@"Widget"]
where:@"Type == 'abc'"]
instead of like this:
NSFetchRequest* fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription* entity = [NSEntityDescription
NSPredicate* predicate = [NSPredicate predicateWithFormat: @"type == 'abc'"];
NSSortDescriptor* sortDescriptor = [[NSSortDescriptor alloc]
NSArray* sortDescriptors = [[NSArray alloc] initWithObjects: sortDescriptor, nil];
NSArray* widgets = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error];
Please send me your feedback, and keep in mind that ios-queryable is still a work in progress!
I recently attempted to purchase an app from the app store on my iPhone, and I must say, the experience was quite hilarious. Here is a rough overview of the process (from memory, so apologies if a few details are off):
- Tap the price
- Tap buy
- Enter my password
- Get prompted to enter in three security questions
- Tap not now
- Wait a while, notice that nothing is happening
- Tap buy
- Tap OK when prompted to enter in my security questions
- Select my questions and answers
- Tap ok
- Tap buy
- Get prompted to verify my credit card into
- Tap continue
- Enter in my credit card info
- Tap done
And there you have it – buying apps in only 15 easy steps!
I was going to make a snarky comment about how Apple should license Amazon’s one-click buying patent, but apparently they already have. Joke’s on me.
I’ve been looking into third-party app analytics services such as Mopapp and appFigures for a while now. There’s something that worries me about these services, though: they ask for your Apple ID and password.
Wait, what? Are you sure this is a good idea? Am I even allowed to give out this information? I’m not sure, so I decided to check. And here it is, straight from the horse’s mouth – Section 1 of Apple’s developer agreement (emphasis mine):
The Apple ID and password you use to login as a Registered Apple Developer cannot be shared in any way or with any one. You are responsible for maintaining the confidentiality of your Apple ID and password and for any activity in connection with your account.
That seems pretty cut-and-dry. Sharing your login information is a violation of the agreement. So what’s the deal? Is it only ‘sharing’ if I give my login info to a person? Do we simply ignore the issue because these third-party analytics services are so useful?
Considering that you can get banned from the app store for violating the developer agreement, this seems like a pretty serious matter. Granted, fraud might be a completely different level of violation than sharing your login info, but given Apple’s history of somewhat arbitrary decisions, I’m not sure that I want to risk it.
What do you think?
Gym Calculator is now available on the app store.
This will be a rather short postmortem as it’s such a small application. But don’t worry, I have some things in the pipeline that will warrant much longer ones…
Gym Calculator is an app that does the math for you when you are at the gym. It lets you quickly add up your plates to figure out how much weight you are doing. You can also give it a target weight, and it will tell you exactly what plates to put on the bar to achieve it.
Review Time (time spent in the iOS app submission queue):
New technologies I learned and used:
There wasn’t anything particularly new here. I guess the most notable new ‘technology’ was that Gym Calculator was the first app I created from the ground up with the 4″ iPhone in mind.
The main challenges were not implementation issues, but small-scale design decisions. For example, the app supports conversion between pounds and kilograms, but metric and imperial olympic weight sets are different. Should a 45lb bar convert to a 20.4 kg bar (the mathematical equivalent), or to a 20 kg bar (the real-world equivalent)? I chose the latter.
Aside from bug fixes, I don’t see too much development happening on Gym Calculator in the future. It’s such a small app that there’s not really too many other things I could do with it.