Showing posts with label iPad. Show all posts
Showing posts with label iPad. Show all posts

Friday, March 31, 2017

Radio 2017 - Progress March

I don't want to admit it, but no, not a lot of progress on this. No long vacation excuses this time, just busy with life. What can I say?

I did get to review the WWDC videos regarding storyboards. I (re-)discovered a few interesting things:
  • Set the main storyboard in the info.plist - I had done this.
  • You can build up window content by using content segues to multiple view controllers. I didn't have a need for this yet, but I'm sure it's coming.
  • Control-Drag directly from a menu or button to a window content view. This will produce a segue to the view controller. Easy and useful. The host view controller receives a method call prepareForSegue:sender: before the window appears for the segue. I'm not using this because there doesn't seem to be a way to associate the document window for this action when it appears on the application menu. 
So, my main question became -- how does all the other document stuff work? When you select File / Save, how does that get to the NSPersistentDocument class? Turns out, it uses a basic target/action to the First Responder. 

I just had to figure out is how to add my action method for my modes window to the First Responder. That turns out to be easy. Select the First Responder icon of the main menu. Then, use the Attributes inspector, and you'll see a list of User-Defined actions. The weird thing is, though, once you've defined them, they disappear from this list.
No matter, just add an action, then edit it to be the method name you want. Then wire it up to the menu with control-drag as before. Implement the method anywhere in the responder chain. I implemented this in my document class. And my mode window comes up correctly, and I have a unique instance of it for each document. Cool.

Next is the hard part -- trying to figure out how to associate the managed object context of the document with the modes view controller. This is were it gets weird. The window controller has a property document which points to the document for that window. How you get to that value from the view controller is something I have not figured out yet. 

Tuesday, February 28, 2017

Radio 2017 - Progress February

Well, I can't say that I've made much of any progress since the last posting. I took a 10-day trip to Israel to visit Bethlehem, Masada, Galilee, Jericho, Jerusalem -- all the holy sites. The trip was very intensive, and after I returned home it took me about a week to recover and then catch up on all my missed work.

I did spend a little time going over my test programs trying to figure out the right way to write Cocoa code for MacOS X document-based apps with Storyboards. What I'm doing seems too complicated.

So, I've decided I need to go back and find the WWDC videos regarding using storyboards with MacOS X, and it also might be useful to view the the ones for iOS docment-based apps as well, to see if that gives me any insight.

With any luck, I'll make much more progress in March.

Tuesday, January 31, 2017

Radio 2017 - Progress January

Quick progress report on the Radio 2017 project. I've managed to get started on the casual logging program. I've created the basic framework and a local Git repository. An early cut of the Core Data model is in place. You can't do much more than run the program and create, save and close documents so far.

I have discovered that Storyboards on MacOS don't quite seem ready for prime time. First, there's a bug that windows don't cascade when creating a new document. Second, the split of the original NSDocument class into NSViewController and NSPersistentDocument subclasses creates something of a conundrum. The NSPersistentDocument owns the Managed Object Context, but the NSViewController subclass is the place that owns all of the UI actions.

To make things worse, the main menus actions only appear to be able to effectively target the application delegate. If you want to target something in the NSViewController or NSDocument, you have to write a handler in the application delegate to find the current document view controller and call the right method.

I've figured out the proper way to do the menu actions, but I'm still puzzling out how to handle the managed object context from the view controller actions.

None of this is rocket science, but it's certainly slowed things down, as I have had to create separate projects in order to figure out the most appropriate way to do things.

I'm still learning Swift. The nuances of optionals and when to use the various operators is something that will come with practice. The compiler is keeping me on the straight and narrow.

Monday, December 26, 2016

The Radio 2017 Project

My long-time friend Chris, K4JCW, invented the term GUP. It's an acronym for Great, Unfinished Project. Naturally, any unfinished project can always be great. Because, well, it is unfinished. If it lacks greatness at the moment, there's always a chance it could be added. The greatness of any project reaches maximum before it starts.

A couple of months ago, I got to thinking about some of my unfinished software projects. I've already talked about my casual logging program. While I've made a few small enhancements over the years, it's basically the same program I wrote in 2006. There are others I've been meaning to write for the Mac for several years.

This summer, after the Apple World Wide Developers Conference (WWDC), I studied the updated Swift 3 language. It seemed to me that Swift was probably mature enough to start using. I also caught up on several videos, including those on how to use storyboards in MacOS applications, something that was certainly not possible ten years ago.

I decided it is time to develop some new Mac software. I've labeled this the Radio 2017 project, as I hope to be done within the year 2017. I have identified the need for the following applications:
  • Casual Logging Program - very basic logging program with import / export to ADIF, control of the Elecraft K2/K3, support for RTTY and PSK operating, as well as CW keying, automation via AppleEvents / Automator
  • Contest Logging Program - logging program with contests, supporting main ARRL, CQ and NA contests. Import / export to Cabrillo, ADIF. Support for CW keying and RTTY and PSK operating.
  • SDR Software to use with SoftRock Lite II - I purchased the SoftRock Lite II to use with the K3 IF frequency. This would serve as a pan adapter / spectrum analyzer.
  • Remote Control Server  and Client - to allow me to operate my Gwinnett station from anywhere.
  • QSL Tracking Software - track paper QSLs against awards.
All of these would be useful to me. There are probably a couple of utility applications to consider as well.

In writing this software, I've decided to stick to a few goals:

  • Swift 3 - the applications should be written almost entirely in Swift 3. (There are a few APIs -- notably Core Audio -- that are more appropriately accessed with Objective C/C++. I'll likely use Swift-callable wrapper classes for those)
  • Storyboards - the UI should be constructed using storyboards.
  • UI Guidelines - applications should follow the latest Mac UI guidelines.
  • Store-ready - should these applications turn out well, my stretch goal is to publish them on the Macintosh App store.
The hardest part of this sort of project is maintaining focus and motivation. I hope to help that by publishing my progress here each month. Wish me luck!

Monday, March 2, 2015

Another Kind of Monopoly

Back in the 1990s and early 2000s, Microsoft ruled personal computing with market share. At their peak around 2004, more than 90% of personal computing devices ran some variant of Windows. Even before this, they wielded enormous influence. It took a long time to topple Microsoft from the top of the stack. All during this time I was a staunch Macintosh supporter. I felt that this sort of monopolistic market was unnatural -- that consumers would be better supported in a market with three or four major competitors, rather than just one.

I happened to catch this short blog article referenced from the Stocks app on my iPhone under AAPL. It states that Apple has captured 88.7% of the profits from the Forth Quarter 2014 Smartphone sales. Apple has no where near 80+% of the Smartphone market share --  nearly 20% in Q4 2014, but more typically around 15%.

Seems this is another kind of monopoly -- not of share, but of profits. Google Android captured the remaining  11.3% of the profits, and other vendors lost money.

I'm not sure how I feel about this. It doesn't have the permanence that Microsoft seemed to have in the late 90s, since profits can change from quarter to quarter. But, unlike Microsoft, Apple seems to be in a mode where it is continuously re-inventing itself. And with the Smartphone cash cow, it has plenty of resources to do so.

And yet, Microsoft's hegemony wasn't permanent either -- the market eventually pivoted out from under them. I wonder where the market will pivot next.

Tuesday, July 16, 2013

My On-Again, Off-Again Relationship with Cocoa

My personal logging program.
It's been a long time ago, but I did Mac development when it was new. I started in August 1984, which was pretty much on the ground floor. My employer switched me back and forth between Mac and DOS, and later Windows development. I really loved doing Mac development in those days. But, in 1994, they abruptly ended all Mac work and later that year filed Chapter 11. I left the company about six months later.

I found another job that was part-Mac, part-Windows. That lasted until they laid me off in 2002, just after WWDC. Those were pretty dark times to be a Mac developer. The Windows hegemony was nearly complete -- with over 90% of personal computers running Microsoft's operating system.

Apple tried very hard to get developers ramped up on Mac OS X. Although you could certainly port over a classic MacOS application using Carbon, the writing was on the wall. Cocoa was the future. At WWDC 2001, Apple seeded every developer with the book Learning Cocoa with Objective-C by Davidson. And in 2002, again with Building Cocoa Applications by Garfinkel and Mahoney. I'm sure these tomes jumpstarted many developers.

I tried. I worked nearly all the problems in both books. In those days, there was no Xcode, just Project Builder and Interface Builder. And they were pretty klunky compared to Metrowerks CodeWarrior. But I only had one machine that could run Mac OS X in those days. I was still fooling around with CodeWarrior and PowerPlant. At least, until I got laid off.

The best I could do at the time was a job that was solely Windows. I figured I'd take it as a bridge job, and here I am still at it ten years later. But, that's another story.

I still love the Mac. My whole family uses Macs. I use mine each day. 

Back in the fall of 2003, I started uploading all my logbooks to Logbook of the World (LotW). All my electronic contest logs were pretty easy, even one Field Day log that had a corrupt binary file was eventually rescued and uploaded. 

The hardest part was entering all the hand-written logs. Some time in 2005, I finished this job. While my contest contacts were in electronic form, I was still hand-writing my casual contacts. By spring of 2006, it was time to give the hand-written logbooks the heave-ho. 

I decided I wanted a Mac program. So, I set about to write one. Back to those Cocoa books again. I wrote a very simple program designed to replace the paper log and not much else. You can see a screen image of it above.

With that immediate problem solved, it seems like I forgot what I learned. A couple of years later, when the iPhone SDK came out, one of the best ways to learn Cocoa was the Aaron Hillegass book, Cocoa Programming for Mac OS X. I managed to get one the earliest copies of the third edition, and was again working my way through a Cocoa book.

But, life intervened, and I never did quite finish all the problems. I've since gotten a couple of other books on iOS programming (and I still need to work my way through those, too). What amazes me is how quickly these books go out of date. They try to hand-hold you through every step in using XCode -- except that XCode has likely changed since the book was printed.

All this came to a head recently a work when another team asked me to put together a presentation on how to get started with iOS programming. This team had an iOS application that was developed by an outside consultant, and they needed to take over development.

Well, despite the absence of recent experience, I manage to put together a pretty good introduction. It was heavy on the things I understood well, such as Objective-C, Interface Builder and many of the design patterns used in Cocoa. If anything was lacking, it was details on the classes in the Cocoa Touch framework. But I felt like I gave them the tools to figure it out.

I've used a number of different object-oriented frameworks over the years, MacApp 2 and 3, TCL, PowerPlant, and even a smattering of MFC before tackling Cocoa. Like any framework, understanding really comes from experience -- the more you use the framework, the better your understanding will be.

Now, where is that book...?

Sunday, October 21, 2012

Surfacing...

Paul Thurrott wrote an article about the impending release of Windows 8, Windows RT and Surface. He's got one thing right, Microsoft has a problem. Apple and Google have gotten a big head start, and Microsoft is coming to the game late. Windows Phone 7, while technically interesting, hasn't gained any traction in the market. They are betting a lot on Windows 8.

But, there's one thing that bothers me. It's this assertion of Thurrott that devices like the iPad aren't computers:
Windows RT is not a computer operating system. Windows RT is an operating system for mobile devices.
Surface with Windows RT is not a computer. It is mobile computing device, like an iPad. It is a tablet, a hybrid device that bridges the gap between real PCs and media tablets, where you can work and play.
Who came up with this "media tablet" name, anyway? As if devices like the iPad are only useful for consuming, not creating? It's the same journalists who have spent 20 years reporting on the personal computer market -- who have been focusing on the desktop for so long they can't see anything else.

The computer marketplace has always been about change. We had huge mainframes at first, and then came the minicomputers. They weren't anything like the mainframes, and journalists didn't think they were computers, either. And just as these minicomputers started to build a big market, they came out with microcomputers.

It's been a long time since we called them microcomputers. That's where the micro in Microsoft comes from. They weren't viewed as "real" computers either. And then they, too, took over the market.

And those microcomputers have gotten smaller and smaller while at the same time getting more and more powerful. My iPhone 4S has more memory and computing power than the supercomputer I used at college 30 years ago. Why can't it be a "real" computer?

Sure, an iPad doesn't look like former PCs. It's mostly screen and battery. But it's a natural evolution of the personal computer. There's no reason you can't use an iPad, or a device like it to do "real" computing.

Indeed, the iPad is the new face of computing. Just like the microcomputer before replaced the minicomputer -- tablets like the iPad will replace the PC. It's just a matter of time.

Saturday, June 23, 2012

Scratching the (Microsoft) Surface

Microsoft announced this week a new line of tablet computers running Windows. The announcement event had more than it's share of balky demos and unresponsive machines. The most curious thing, however, was the most distinctive feature of the Surface devices -- the embedded keyboard/cover. Although Microsoft had "hands-on" event, none of those present were actually permitted to try the keyboard. Add to this the fact that no pricing was announced and it just gives the entire event a forced feel -- like the products just weren't quite ready to announce.

John Gruber has perhaps the best analysis of this: "I presume Microsoft timed this event to jump ahead of anything Google might be announcing at their I/O conference next week — and the consensus seems to be that Google is going to announce much the same idea: their own Google-branded, Google-designed tablet that will put them in direct competition not just with Apple but with their own OS licensees."

Contrast this with Apple's announcement of the iPad. There were certainly plenty of rumours that Apple had been developing a tablet device. They had been circulating for years. In fact, the Apple rumour mill had gotten very tired of this story by the time of the announcement in January 2010. But Apple's announcement event was smooth and polished, full pricing information was given and pre-orders were taken within 60 days.

There's no doubt that the iPad has been a complete breakthrough product. And despite a host of challengers introduced in the last two years, none have really made an impact. Currently, there is no "tablet" market. Not yet. There's only an iPad market. 

I welcome Surface, just as I've welcomed the other iPad competitors. Competition is a good thing. When Windows Phone Series 7 was introduced during PDC '10, I thought it was a good thing. Frankly, I'm disappointed that it hasn't done better in the market. It's natural for any market to have three or four strong competitors, all pushing each other to produce better and better products and more attractive prices.

On this note, the personal computer market was a complete anomaly for over two decades. At first, it was dominated by the IBM PC. However, due to bad management, IBM had leaked enough technical details to allow their product to be copied, so the market became dominated with PC "clones." IBM tried to remedy this situation by introducing the Micro-channel Architecture, which required vendors to license certain technology in order to produce clones. (I fondly remember walking around COMDEX in the late 80's, finding some cool ISA hardware board, and then asking them if they had an MCA version available) But the market had already been wrested from IBM's hands, and placed in those of Microsoft, who's MS-DOS ran on all those clones.

Microsoft leveraged that OS monopoly into another, with Windows. Soon Microsoft dictated the hardware requirements to the clone makers, and stifled any upstart OS that threatened to emerge. Sure, there were competitors, such as Apple, who made arguably better computers, but they held an insignificant portion of the market. But it didn't last.

The problem with monopolies like this is they tend to stifle innovation. The best example is Microsoft itself -- with Internet Explorer. Microsoft recognized in late 1994 that the internet was a threat to their OS monopoly. They bought the Spyglass browser and turned it into Internet Explorer 1 in August 1995. There ensued a frenzy of innovation effort which brought us to IE 6 within six years. And then -- nothing for over five years. By 2001, Microsoft had achieved complete market dominance with an 85-90% market share in the browser space. Only when competition appeared again in the form of Mozilla and WebKit-based browsers did they again release new version of Internet Explorer. 

And, today, the browser market space is dominated by four strong competitors, each with 20-25% market share. That's a normal market.

There's too many writers in the computer press who are used to the anomaly -- with one competitor completely dominating the market. After all, it makes their job eaiser. All they have to do is follow the market dominator.

You'd think the press would embrace Apple's dominance in the tablet space. But no, it can't possibly be Apple. Apple was too long the beleaguered also-ran. By 1997, the press had given them up for dead. And there was certainly a lot of evidence for that. 

Apple proved it could successfully dominate the market with the iPod, another product many competitors tried unsuccessfully to compete with. Yet the press still looks to Microsoft.

After Apple announced the iPhone, Palm's Ed Colligan said, "PC guys are not going to just figure this out. They're not going to just walk in." Of course, the funny thing is -- they did. And not just once with iPhone, but a second time with Android. There's always room, even in a crowded market, for innovative products.

So, while I welcome the Surface to the market, I'm not really considering buying one. But I welcome the innovation it brings -- because this benefits all consumers. If nothing else, I can't wait for the next iPad...