Tuesday, February 18, 2014

iOS7 TDD w/ OCMock and Xcode5 Linker problem: -ObjC

I'm setting up a new project, using CocoaPods and a couple of libraries (TestFlight, OCMock, AFNetworking, et al). While CocoaPods may not work well with private repos among public repos, I find it quite useful, especially if someone else wants to join my project quickly.

The biggest pain points I had were linking, which means unless I know in advance that linkers need to be forced for each individual library, I'll get some obtuse error, like:

ld: file not found: -ObjC
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What that really means is I needed to update the flag in my specific project to  -all_load.

Know how to do that? I didn't originally, but finally figured it out. Under the specific project I'm targeting (my tests in this case), in Build Settings -> Linking, I look for the "Other Linker Flags" and make 1 teensy change:

remove '-force_load'
add '-all_load'

That's it!

Oh, and if you're referencing any old OCMock tutorials, please don't use SenTestingKit.framework. You don't even need a header file for test. Just use the following inside your main class:

Now OCMock works great and my code works. Now to write some tests!

Thanks to this blog's comment for helping: Nick Hart

Tuesday, January 7, 2014

Google Glass - getting started

I'm a developer, and sometimes I get to explore new technologies. In 2014, I get to be a Google Glass Explorer. No, I'm not the first to this game, and there are several others out there, and heck, Google might release a newer product in the next week that would make what I just got obsolete, but right now I'm learning the ropes on my device. I've only been allotted a little bit of time, but in that time, I've learned a few things that I'm sharing for my own edification (and feel should've been included in a setup guide, or something, but was just left to explore/discover on my own).

Simply going to http://glass.google.com doesn't yield anything useful because you don't even have a login there. Oh, and it redirects you to http://www.google.com/glass/start/. That's not intuitive nor helpful, not to mention there is no login...Ok??

Simple stuff:

  1. Get the app
  2. Pairing with a device
  3. Connecting to a WiFi Network
    • https://glass.google.com/u/0/myglass
    • Getting to this site wasn't intuitive either. Just going to glass.google.com was to see a large advertisement, but nothing about logging in and viewing my app. 
  4. There's a community 
  5. Search for posts
    1. inside the community, it'd be helpful if there was a stack-overflow style search, question and answer view.

Google, next time please at least give me some directions to get the basics down. Even my iPad had these initial things available. Better to over-communicate than assume your audience knows what to expect. If you want common users to understand and learn how to use your device, you need to make it as intuitive as possible. Nothing of my experience has yet to be intuitive.

Even a simple directive to point me here https://support.google.com/glass/?hl=en#topic=4363345
would have made a world of difference. Honestly, there has to be a better way to launch this product so that dorks like me don't have to hunt. If I wanted that, I'd go learn Unix. I want to use Glass to be more productive, and so far it's been a PITA. Let's work together to make this better. Deal?