NSScotland 2014

nsscotland-logoThis past weekend, I attended NSScotland in Edinburgh. The conference, in its 3rd year, is organised by Alan Francis and Paul Wilson, who also organised the Scottish Ruby conference. The venue for the conference was on the south side of Edinburgh in the Pollock Halls.

Spread over two days, the conference covered a good mix of technical and non-technical subjects, including iOS app testing at Facebook (Graham Lee), Computing’s Hidden Heroes (Emily Toop), and, the personal highlight for me, Eric Knapp’s talk on Helping Blind Musicians with an iOS App. Between talks, there was plenty of time for socialising and catching up with other developers.

On Saturday night, we were treated to chilli for dinner, cooked by Illegal Jacks, in a near-by Church Hall. As there was no connectivity in the hall, people were forced to talk to each other, rather than huddling over laptops!

On the Monday following the conference, Alan had organised a Swift tutorial, taught by Daniel Steinberg. The tutorial covered the basics of swift from the very beginning and progressed at a nice pace up to the more complicating features. Personally, some of the subjects covered in the final part of the tutorial made my head spin a bit, but this was due to my lack of computer science knowledge, rather than the instructor. At the end of the tutorial I was left with a good understanding of Swift, having never touched it before.

A big thank you to Alan and Paul for organising the conference, Daniel Steinberg for teaching the tutorial and Zonal and Karelia Software for their sponsorship. I’m already looking forward to next year!

Posted in Uncategorized | Leave a comment

NSPopover from NSToolbarItem

Recently, when working on the next release of iSMARTtrain, I wanted to display an NSPopover containing the various options when a button in the toolbar was clicked. I mean, how hard can that be? – I’d already done it in the iPad version of Ergophase. Trivial!

NSPopover from NSToolbarItem

Three hours later, it turns out, it’s not as straight-forward as I thought. Central to displaying an NSPopover is the following method call:-

 (void)showRelativeToRect:(NSRect)positioningRect ofView:(NSView *)positioningView preferredEdge:(NSRectEdge)preferredEdge

Surely all I need to do is to get the view from the Toolbar button, pass it to this method, the popover’s displayed, and all is good with the world?

Well, unfortunately not.

For whatever reason, NSToolbarItem is inherited from NSObject, rather than NSControl, meaning that it has no View property that can be accessed (well, actually it does, but for the default button added in IB, view always returns Nil).

I posted my problem in Stackoverflow and, unusually, got no solution. Searching Apple’s developer forums turned up this post (http://devforums.apple.com/message/499986), which refered me to one of this year’s WWDC videos.

Once I’d seen that, everything became a bit clearer. The solution is to create an NSToolbarItem with a custom view containing an NSButton. When the button is clicked, pass the View of the button to the showRelativeToRect method, displaying the popover.

In the spirit of  http://xkcd.com/979, I’m posting a really simple example with the code on github (http://github.com/tevendale/ToolbarPopover). One slight issue with the current code is the way the button behaves when clicked, but I’m sure someone smarter than me will manage to fix that.

Posted in Cocoa | 2 Comments

YFCalendarView – iPad Calendar Framework

YFCalendarView is our open-source framework for a full-screen iPad calendar. It’s loosely based on the Mac calendar framework LRCalendar (which seems to have largely disappeared from the ‘net).

It provides a full-screen monthly calendar, functionally similar to the iPad Calendar app ‘Month’ view.

YFCalendarSmall

Download the latest code from our Github repository: http://github.com/tevendale/YFCalendar

Posted in Cocoa, iOS | Tagged , , , | Leave a comment

Project ANT – Live ANT+ Data on Your Mac

Project ANT is our new product from Yellow Field Technologies. It’s an application to enhance your turbo training or treadmill sessions. For use with any ANT+ Sport compatible power meter, heart rate monitor belt, speed or cadence sensor, it displays your data on your desktop or laptop Mac with a graph or video.

Screenshot

The data displayed in each field can be selected from a number of options, including average power and Phil Skiba’s xPower, RI and BikeScore™ metrics.

Displayoptions

Project ANT uses Garmin’s ANT+ USB stick to communicate with the ANT sensors.

The application is currently in the late stages of development, and the latest Beta can be downloaded from http://www.yellowfield.co.uk/projectant/. You can also join our mailing list at this page.

There are still a few features to be added to the application before final launch, including data export to tcx, csv and pwx formats, and session analysis.

Video image above, © Sufferfest.

Posted in Uncategorized | Tagged , , , , , , | Leave a comment

iOS Debugging with Hardware

dockstubz from CableJive

If you’re developing an app which uses hardware that plugs into the 30-pin Dock Connector of the iPhone or iPad, then debugging in Xcode can become a bit of a problem. I’m working with Wahoo Fitness using their Fisica ANT+ device at the moment, and I was about to break out the soldering iron to make some sort of a pass-through connector when Chip from Wahoo mentioned using dockStubz from Cablejive.

This provides a male and female dock connector with a USB connector in the middle of the unit. This lets the iOS device be connected to a Mac with the hardware device installed, allowing breakpoints and the like to be set in Xcode.

It’s available directly from Cablejive in the US and from Amazon in the UK (and presumably the rest of Europe).

Posted in Cocoa, iOS | 12 Comments

Round NSTextFieldCell

RoundTextFieldCell.png

YFRoundTextEditField is a TextEditField sub-class for displaying data in a table cell with rounded ends in a similar style to iCal. It was created with help of Peter Hosey who responded to this question on at Stackoverflow. The source code can be downloaded from here:  RoundTextFieldCell.zip.

 

Posted in Cocoa | Leave a comment

Installing Core Plot in a Mac Application

I’ve started using the Core Plot framework in one of my Mac apps, and I had a few problems setting it up, which, looking through some posts on the web, other users have had as well. Since it took a while for me to track down the exact solution to my problem, I’m posting in here in the hope that it’ll save some other users the time I spent on it.

Firstly, a word or two about Core Plot. The framework in a data visualisation (aka graphing) solution created by primarily by Drew McCormack, with input for several other people. Basically, it lets you create line, bar and pie charts in a cocoa app with minimal effort.

I’d previously used Core Plot in a couple of iPhone & iPad apps, and managed to install it without any problems. However, when installing it in my Mac app by following the instructions on the website (http://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications) I was met with a string of compiler errors related to Core Plot classes.

After checking my installation and making sure that search paths, etc., were all set to point to the Core Plot folder, it became apparently that something else was amiss. Searching through a number of posts on the web and the Core Plot site, and poking though a couple of Apple documents, it became apparent that one vital step missing from the docs was to set the build folder in the CorePlot.xcodeproj to match the build folder of the actual project containing it. This is done by double clicking on the CorePlot.xcodeproj project item embedded in your project, then selecting ‘Get Info’ from the project item’s contextual menu. This will display the Project Info window. Select the ‘Build’ tab. In the ‘Build Products Path’, set the location of the parent project’s build folder.

CorePlotLocation.png CorePlotContextualMenu.png

CorePlotBuildSettings.png

Hopefully, the information here will save someone else a bit of time setting up Core Plot.

Posted in Cocoa, Core Plot | Leave a comment