Re: Show count of Core Data to-many relationship in NSTableView cell with bindings?

2015-02-06 Thread Steve Mills
On Feb 6, 2015, at 01:56:24, Quincey Morris quinceymor...@rivergatesoftware.com wrote: You can’t bind *through* an array or set collection class. However, you can use these:

Re: Show count of Core Data to-many relationship in NSTableView cell with bindings?

2015-02-06 Thread Ken Thomases
On Feb 6, 2015, at 1:43 AM, Steve Mills sjmi...@mac.com wrote: I have a Core Data entity called Keyword that has a to-many relationship to another entity called Image. In a table that displays these Keywords, I want one column to show the number of Images that use that particular Keyword. I

Re: ARC dealloc best pratice

2015-02-06 Thread Alex Zavatone
Here's where I am confused. I thought you were running into problems on the Mac, but I see you mention iOS 5.1 and 6.0 while you mention that you are running into problems with NSViewController. If you were running into problems on iOS, I'd expect to see UIViewController, not

Re: ARC dealloc best pratice

2015-02-06 Thread Jonathan Mitchell
On 6 Feb 2015, at 17:34, Kyle Sluder k...@ksluder.com wrote: Dealloc is too late for a lot of this stuff. I try to keep -dealloc as pure as possible; that is, -dealloc should only be concerned with memory management. I agree that dealloc is far from perfect. What it does have going for it

Re: ARC dealloc best pratice

2015-02-06 Thread David Duncan
On Feb 6, 2015, at 12:46 PM, Jens Alfke j...@mooseyard.com wrote: On Feb 6, 2015, at 11:55 AM, Jonathan Mitchell jonat...@mugginsoft.com wrote: The tableView.delegate is not a zeroing weak ref - in the lingo of ARC it is unsafe_unretained I believe self can be deallocated leaving

Re: ARC dealloc best pratice

2015-02-06 Thread Jens Alfke
On Feb 6, 2015, at 11:55 AM, Jonathan Mitchell jonat...@mugginsoft.com wrote: The tableView.delegate is not a zeroing weak ref - in the lingo of ARC it is unsafe_unretained I believe self can be deallocated leaving tableView.delegate as a dangling pointer. This is still a weak

Re: ARC dealloc best pratice

2015-02-06 Thread Jonathan Mitchell
On 6 Feb 2015, at 20:46, Jens Alfke j...@mooseyard.com wrote: Come to think of it, I'm surprised that AppKit delegates are still unsafe-unretained. Why haven't these been converted to safe weak references yet? I presume that AppKIt (all of it?) is not compiled using ARC and hence doesn’t

Re: ARC dealloc best pratice

2015-02-06 Thread Jonathan Mitchell
On 6 Feb 2015, at 21:31, Greg Parker gpar...@apple.com wrote: Come to think of it, I'm surprised that AppKit delegates are still unsafe-unretained. Why haven't these been converted to safe weak references yet? Some classes are incompatible with (safe zeroing) weak references. For

Re: ARC dealloc best pratice

2015-02-06 Thread Jens Alfke
On Feb 6, 2015, at 2:00 PM, Greg Parker gpar...@apple.com wrote: Swift adds unowned references. These references are non-retaining. They differ from weak references and unsafe unretained references: unowned references fail with a runtime error if you try to access the pointed-to object

Re: ARC dealloc best pratice

2015-02-06 Thread Greg Parker
On Feb 6, 2015, at 1:48 PM, Jonathan Mitchell jonat...@mugginsoft.com wrote: On 6 Feb 2015, at 21:31, Greg Parker gpar...@apple.com wrote: Come to think of it, I'm surprised that AppKit delegates are still unsafe-unretained. Why haven't these been converted to safe weak references yet?

Re: ARC dealloc best pratice

2015-02-06 Thread Jonathan Mitchell
On 6 Feb 2015, at 17:34, Jens Alfke j...@mooseyard.com wrote: On Feb 6, 2015, at 6:48 AM, Jonathan Mitchell jonat...@mugginsoft.com wrote: // remove observers // unregister for notifications I have to confess I'm still not completely certain whether these are needed

Re: ARC dealloc best pratice

2015-02-06 Thread Greg Parker
On Feb 6, 2015, at 12:46 PM, Jens Alfke j...@mooseyard.com wrote: On Feb 6, 2015, at 11:55 AM, Jonathan Mitchell jonat...@mugginsoft.com wrote: The tableView.delegate is not a zeroing weak ref - in the lingo of ARC it is unsafe_unretained I believe self can be deallocated leaving

Re: ARC dealloc best pratice

2015-02-06 Thread Greg Parker
On Feb 6, 2015, at 3:27 PM, Jens Alfke j...@mooseyard.com wrote: On Feb 6, 2015, at 2:00 PM, Greg Parker gpar...@apple.com mailto:gpar...@apple.com wrote: Swift adds unowned references. These references are non-retaining. They differ from weak references and unsafe unretained

Re: ARC dealloc best pratice

2015-02-06 Thread Greg Parker
On Feb 6, 2015, at 1:18 PM, Jonathan Mitchell jonat...@mugginsoft.com wrote: On 6 Feb 2015, at 20:46, Jens Alfke j...@mooseyard.com wrote: Come to think of it, I'm surprised that AppKit delegates are still unsafe-unretained. Why haven't these been converted to safe weak references yet?

[CIImageAccumulator image]: getting the BMP representation destroys the image contents

2015-02-06 Thread Nick
Hello, I am playing with the CIMicroPaint sample code ( https://developer.apple.com/library/mac/samplecode/CIMicroPaint). This is basically a simple paint editor (you can draw on a view with a mouse using CoreImage). I would like to save whatever is drawn into a file. So what I do is call this,

Connecting a button to MyView zeros integers

2015-02-06 Thread N!K
I would like to connect a button to MyView class, but Xcode 6.1.1 only allows control-dragging a button to AppDelegate to create an IBAction. I have not encountered this previously. Looking for a workaround, I found this recommendation in a couple of Stack Overflow and other web pages as well

Re: Connecting a button to MyView zeros integers

2015-02-06 Thread Roland King
I have no idea what stackoverflow is suggesting here but it looks entirely wrong as usual for that junky site. You're just creating a standalone I referenced object. Right click your view in IB then wait a second and right click it again. I think it's right clicks. You will then get the

Re: ARC dealloc best pratice

2015-02-06 Thread Jonathan Mitchell
On 6 Feb 2015, at 17:34, Jens Alfke j...@mooseyard.com wrote: On Feb 6, 2015, at 6:48 AM, Jonathan Mitchell jonat...@mugginsoft.com wrote: // remove observers // unregister for notifications I have to confess I'm still not completely certain whether these are needed under

Re: Is it possible for a WebView to not share sessions with Safari on Mac OS X?

2015-02-06 Thread Juanjo Conti
I'm using 10.9 and they do share. Do you know if a screen saver can be sandboxed? On Fri, Feb 6, 2015 at 11:36 AM, Mike Abdullah mabdul...@karelia.com wrote: On 6 Feb 2015, at 14:30, Juanjo Conti jjco...@carouselapps.com wrote: At the moment if I open, for example, gmail.com in a WebView,

Re: Is it possible for a WebView to not share sessions with Safari on Mac OS X?

2015-02-06 Thread Mike Abdullah
On 6 Feb 2015, at 14:15, Juanjo Conti jjco...@carouselapps.com wrote: As a first look it seems that no. Or, at least, the default behavior is to share sessions but I'd like to find the way around this. Any ideas? Any approach I can try? I now that in Cocoa Touch the default is the

Re: Is it possible for a WebView to not share sessions with Safari on Mac OS X?

2015-02-06 Thread Mike Abdullah
On 6 Feb 2015, at 14:30, Juanjo Conti jjco...@carouselapps.com wrote: At the moment if I open, for example, gmail.com http://gmail.com/ in a WebView, and I'm logged in (in that site) when I open it in Safari, the WebView shows me logged in. I'd like the WebView to be independent from

Is it possible for a WebView to not share sessions with Safari on Mac OS X?

2015-02-06 Thread Juanjo Conti
As a first look it seems that no. Or, at least, the default behavior is to share sessions but I'd like to find the way around this. Any ideas? Any approach I can try? I now that in Cocoa Touch the default is the oposite. -- Juanjo Conti jjconti http://goog_2023646312@carouselapps.com

Re: Is it possible for a WebView to not share sessions with Safari on Mac OS X?

2015-02-06 Thread Juanjo Conti
At the moment if I open, for example, gmail.com in a WebView, and I'm logged in (in that site) when I open it in Safari, the WebView shows me logged in. I'd like the WebView to be independent from Safaria and shows the login form. After logging in using the WebView, I'd like to save that session

Re: Is it possible for a WebView to not share sessions with Safari on Mac OS X?

2015-02-06 Thread Mike Abdullah
On 6 Feb 2015, at 14:41, Juanjo Conti jjco...@carouselapps.com wrote: I'm using 10.9 and they do share. Do you know if a screen saver can be sandboxed? My understanding is screensavers get loaded as a plug-in/bundle into another app by the system, so it’s up to that system program to be

ARC dealloc best pratice

2015-02-06 Thread Jonathan Mitchell
I have a mid sized (200+ nib files and associated NSView + NSWindow controllers) ARC enabled app. I have Zombie objects ON and have chased down a number of issues, most of which can be traced back to an incorrectly defined dealloc. My recent experiences have demonstrated the treacherous nature

Re: ARC dealloc best pratice

2015-02-06 Thread Kyle Sluder
On Fri, Feb 6, 2015, at 08:48 AM, Jonathan Mitchell wrote: So I want to have a best practice template to follow in my dealloc. At present the template looks like so. When I need a dealloc I paste this in and fill in the blanks - (void) dealloc { // remove observers //

Re: ARC dealloc best pratice

2015-02-06 Thread Jens Alfke
On Feb 6, 2015, at 6:48 AM, Jonathan Mitchell jonat...@mugginsoft.com wrote: // remove observers // unregister for notifications I have to confess I'm still not completely certain whether these are needed under ARC. I remember reading something about at least one of these being

Convert to NSString from

2015-02-06 Thread Raglan T. Tiger
I have read that the recommended string encoding to use when converting strings from CString and Str to NSString is NSUTF8StringEncoding. However, in too many cases this returns nil. I have found that using NSMacOSRomanStringEncoding always returns an NSString. What is the 'best practice' for

Re: Convert to NSString from

2015-02-06 Thread Jens Alfke
On Feb 6, 2015, at 9:48 AM, Raglan T. Tiger r...@crusaderrabbit.net wrote: What is the 'best practice' for converting to NSString? The best practice is to know how the string data was encoded, and pass that encoding to the NSString initializer. There isn't any single encoding constant