Help with a Swift OS X program

Owen Hartnett owen at clipboardinc.com
Wed Jun 3 17:11:47 EDT 2015


Depending on the room, you may not need one.

There’s  both HDMI and VGA in every room.

Most of the time, there’s a display port/thunderbolt ->HDMI dongle in the room. If not a thunderbolt->VGA would do it I think.

-Owen

> On Jun 3, 2015, at 3:51 PM, Steve Sisak <steve.sisak at ioxperts.com> wrote:
> 
> Hi Dave,
> 
> Just copying the folder to a flash drive should work. Bring it and we’ll try to get it behaving better.
> 
> I’m figuring we’ll take a couple passes though your code and get it working cleanly.
> 
> I know the network side from Obj-C quite well — we’ll count on you and the group to do the conversion to Swift.
> 
> Does anyone remember what class of dongle I need for the projector for a MacBook Pro (Thunderbolt)?
> 
> (DVI or VGA)?
> 
> Thanks,
> 
> -Steve
> 
> 
>> On Jun 3, 2015, at 1:42 AM, David M Rosenberg <rosenberg at acm.org> wrote:
>> 
>> John, Erik, And Steve,
>> 
>> Thank you for your responses, suggestions, and guidance.
>> 
>> All three of you are suggesting that the program needs to be rewritten. I take it that John’s suggestion 3 below is what both Erik and Steve are suggesting. So that’s what I’d like to do. I’ve been doing development on an iMac that I can’t bring the to the meeting with me. I’m using Xcode 6.3.2 under OSX 10.10.3. I can copy the project folder (is that all I need?) to a flash drive and bring that with me to the MacTech group meeting. I hope it will be possible either during or after the meeting to put that on someone’s laptop and that someone will be able to show me how to crate a new project with the right kind of structure. I hope that with your help setting up an appropriate structure, I’ll be able to move my code into it and create a functioning program.
>> 
>> You and Owen will have to tell me whether the sort of help I’m looking for is too elementary/boring/uninteresting/inappropriate to take up the time of the MacTech group meeting. If it is considered appropriate, I’d be happy to discuss what I’m trying to do, why I’m trying to do it, and what I’d like it to look like and hopefully leave the meeting with a reasonable structure that I can continue working on by myself.
>> 
>> Thanks.
>> 
>> /David
>> 
>> 
>>> On Jun 2, 2015, at 7:53 AM, John Shockey <john at johncshockey.com> wrote:
>>> David,
>>> 
>>> My apologies for not getting back to you more quickly. I started a
>>> response, but I'm working under a deadline and it swallowed me up before
>>> I finished it.
>>> 
>>> What I was working on was a bit longer, but what Erik said is correct,
>>> and along the same lines as I was writing.
>>> 
>>> Just because it's important, I'll repeat a part of what he said: You
>>> should never attempt to do synchronous (blocking) programming, and
>>> synchronous network programming in particular, on the main thread.
>>> 
>>> That leaves you at least three possibilities.
>>> 
>>> 1. Move the networking to an alternate thread. I don't think this will
>>> be the best choice. Among other things, you'd need to use lower level
>>> APIs if you really want to do your networking synchronously. Plus,
>>> synchronizing between threads allows all sorts of things to go wrong.
>>> Sometimes it's worth it to use threads, but it's probably too much work.
>>> 
>>> 2. Write a real command line utility, and a UI program that runs it in a
>>> separate process. There are times when this is a good approach, but it
>>> seems like way too much work in your situation.
>>> 
>>> 3. Do your networking asynchronously. It's fairly simple once you
>>> understand how it works, and there's no need for explicit threading.
>>> (Though Cocoa may use threads behind the scenes, you won't have to deal
>>> with it.) You will need to rearrange how you're doing things, but
>>> learning to do it the was Cocoa intends should be worth the effort.
>>> 
>>> Again, what Erik said is correct. I'm just a little more long-winded.
>>> <grin>
>>> 
>>> If you want help figuring out how to use NSURLSession, feel free to
>>> bring your questions to a meeting. We don't have a specific presentation
>>> scheduled this month, so there should be plenty of time. If you can't
>>> make it to a meeting, and if Erik hasn't already helped you
>>> sufficiently, take a look at the documentation for NSURLSession and
>>> friends, and then ask again here.
>>> 
>>> Good luck,
>>> 
>>> John
> 



More information about the MacTechGroup-discuss mailing list