Re: get class of a method's returned object

2015-02-24 Thread BareFeetWare
Hi Kyle, Yes, I am running this on iOS. Sorry, I didn't make that clear. Yes, you are quite right. _shortMethodDescription only shows (id) as the return class, so even this private method doesn't help me. I shall now abandon all hope 😉 Thank you for your attempts. Much appreciated. Thanks, To

Handle js cookies in WebView

2015-02-24 Thread Juanjo Conti
Hi there! I'm still trying to have private cookie jars at Max Os X for my app: http://stackoverflow.com/questions/28456789/separate-cookie-jar-per-webview-in-os-x At this point, I have translated from objc to swift the BSHTTPCookieStorage class mentioned in the SO question (to get a better unders

Re: Displaying multiple errors in NSOpenPanel beginSheetModalForWindow:completionHandler:

2015-02-24 Thread Steve Mills
On Feb 24, 2015, at 11:18:04, Kyle Sluder wrote: > > This sounds like the kind of thing -[NSDocument > performActivityWithSynchronousWaiting:usingBlock:] was designed for, > though it's a rather tricky API. Here's my stab at it: Interesting stuff, and highly confusing. :) > - (IBAction)showMyOp

Re: Convert CGFloat to NSNumber

2015-02-24 Thread Marco S Hyman
> On Feb 24, 2015, at 10:16 AM, Quincey Morris > wrote: > > The following work, too (Xcode 6.1.1): > > let f1: NSNumber = font.pointSize > let f2 = font.pointSize as NSNumber > > ... > > (Things may have changed in Swift 1.2, though.) > Works fine in 1.2, too. $ swift Welcome

Re: Convert CGFloat to NSNumber

2015-02-24 Thread Quincey Morris
On Feb 24, 2015, at 08:14 , Charles Jenkins wrote: > > A structure?!? I did look it up in the documentation, and all I found was > “the basic type for all floating-point values.” That the basis of all > floating-point types could be a structure never occurred to me. That’s not really what the

Re: Displaying multiple errors in NSOpenPanel beginSheetModalForWindow:completionHandler:

2015-02-24 Thread Kyle Sluder
On Tue, Feb 24, 2015, at 03:09 AM, Steve Mills wrote: > Just doing it that way puts up lots of overlapping alert sheets without > waiting for the user to respond. While that certainly would keep the user > on their toes, it's not at all right. I've tried using a semaphore to > wait for the alert (c

Re: Convert CGFloat to NSNumber

2015-02-24 Thread Kyle Sluder
On Tue, Feb 24, 2015, at 04:57 AM, Charles Jenkins wrote: > My latest fruitless attempt has involved trying to simply cast the value > into something for which NSNumber has a corresponding init(): > >     let size:Float = font.pointSize as Float >     let points = NSNumber( float: size ) You nee

Re: Convert CGFloat to NSNumber

2015-02-24 Thread Roland King
> On 25 Feb 2015, at 00:14, Charles Jenkins wrote: > > A structure?!? I did look it up in the documentation, and all I found was > “the basic type for all floating-point values.” That the basis of all > floating-point types could be a structure never occurred to me. Thanks! > > Swift is a lan

Re: Convert CGFloat to NSNumber

2015-02-24 Thread Charles Jenkins
A structure?!? I did look it up in the documentation, and all I found was “the basic type for all floating-point values.” That the basis of all floating-point types could be a structure never occurred to me. Thanks! Swift is a language I want to like, but currently it makes the easy stuff hard

Re: How to translate this form objc to swift? (__unsafe_unretained)

2015-02-24 Thread Jonathan Hull
Off the top of my head (written in mail): for (key,value) in headers { request.setValue(value, forHTTPHeaderField: key) } Thanks, Jon > On Feb 23, 2015, at 6:55 AM, Juanjo Conti wrote: > >NSUInteger count = [headers count]; >__unsafe_unretained id keys[count], values[count]; >

Re: [RESOLVED] What's wrong with this code, why is the label invisible?

2015-02-24 Thread dangerwillrobinsondanger
One should add that you could make the value of a metric a calculation of what's left after other elements are determined. It's a fairly advanced approach that can be tricky. But, it's one way to compensate for font and font size variation. I would highly recommend Erica Sadun's book on AutoLa

Re: [RESOLVED] What's wrong with this code, why is the label invisible?

2015-02-24 Thread Roland King
> On 24 Feb 2015, at 20:06, Aaron Lewis wrote: > > Thanks Roland. No problem. > > I never know about the contentView and intrinsicContentSize property, > learned something new today. > You enlightened me a lot. > > So I tried to use interface editor before but got the same result. Now > I s

Re: Convert CGFloat to NSNumber

2015-02-24 Thread Roland King
> On 24 Feb 2015, at 18:57, Charles Jenkins wrote: > > I’m surprised how painful it is to do trivial things in Swift. I’ve stopped being surprised at this. Between the anal type checking and the spew of optionals I spend all my time fiddling around trying to get a ‘?’ in the right place or

Re: Displaying multiple errors in NSOpenPanel beginSheetModalForWindow:completionHandler:

2015-02-24 Thread Ken Thomases
On Feb 24, 2015, at 3:09 AM, Steve Mills wrote: > I've been trying tons of different things, but can't make this work. I'm > running an NSOpenPanel with beginSheetModalForWindow:completionHandler: to > choose a destination folder. In the completionHandler I'm processing 1 or > more files by co

[RESOLVED] Re: What's wrong with this code, why is the label invisible?

2015-02-24 Thread Aaron Lewis
Thanks Roland. I never know about the contentView and intrinsicContentSize property, learned something new today. You enlightened me a lot. So I tried to use interface editor before but got the same result. Now I see why. I didn't set a minimal height for the label: @"V:|-0-[imageView]-0-[label(

Convert CGFloat to NSNumber

2015-02-24 Thread Charles Jenkins
I’m surprised how painful it is to do trivial things in Swift. All I want to do is convert NSFont.pointSize to an NSNumber, but I can’t figure out any syntax the Swift compiler will accept. My latest fruitless attempt has involved trying to simply cast the value into something for which NSNumbe

Re: Latest Documentation for adding Applescript Support to an Objective-C Project

2015-02-24 Thread Shane Stanley
On 24 Feb 2015, at 8:40 pm, Dave wrote: > > I’m wondering why I got a warning when I downloaded the sample Apps then? Sounds odd. I just downloaded a couple again, with no problems other than build settings that needed to be updated. -- Shane Stanley __

Re: What's wrong with this code, why is the label invisible?

2015-02-24 Thread Roland King
> On 24 Feb 2015, at 16:44, Aaron Lewis wrote: > > Can someone please take a look at this? > > http://stackoverflow.com/questions/28690947/why-is-this-uiimage-and-uilabel-collapsed > > In short words, the UILabel is invisible when I use a image in the > UIImageView. > It works if I only set b

Re: Latest Documentation for adding Applescript Support to an Objective-C Project

2015-02-24 Thread Dave
> On 23 Feb 2015, at 23:29, Shane Stanley wrote: > > On 24 Feb 2015, at 12:21 am, Dave wrote: >> >> From searching online it looks like things have changed quite recently? > > Not in terms of how it's implemented in apps. I’m wondering why I got a warning when I downloaded the sample Apps th

Displaying multiple errors in NSOpenPanel beginSheetModalForWindow:completionHandler:

2015-02-24 Thread Steve Mills
I've been trying tons of different things, but can't make this work. I'm running an NSOpenPanel with beginSheetModalForWindow:completionHandler: to choose a destination folder. In the completionHandler I'm processing 1 or more files by copying them to the chosen folder. When an error appears for

What's wrong with this code, why is the label invisible?

2015-02-24 Thread Aaron Lewis
Can someone please take a look at this? http://stackoverflow.com/questions/28690947/why-is-this-uiimage-and-uilabel-collapsed In short words, the UILabel is invisible when I use a image in the UIImageView. It works if I only set backgroundColor. I already add a constraint on it .. I couldn't rea