Re: How to wire up document exporting?

2015-01-29 Thread Charles Jenkins
Thanks, Quincey. I really do want an export feature, and I think you've given me enough good information to get me started :-) --  Charles On January 28, 2015 at 20:42:31, Quincey Morris (quinceymor...@rivergatesoftware.com) wrote: On Jan 28, 2015, at 16:16 , Charles Jenkins wrote: I need t

Re: Allow tap events outside a custom UIPresentationController on iPad(iOS 8)

2015-01-29 Thread Mazzaroth M.
I forgot to add the overridden methods: - (CGRect)frameOfPresentedViewInContainerView { CGRect presentedViewFrame = CGRectZero; CGRect containerBounds = [[self containerView] bounds]; presentedViewFrame.size = [self sizeForChildContentContainer:(UIViewController *)[self presentedViewC

Re: NSString stringByAbbreviatingWithTildeInPath and Sandboxing

2015-01-29 Thread Jon Baumgartner
I’m happy to do this, but is this really a bug? I was just thinking there might be an alternate way to accomplish this. On 1/27/2015 4:03 PM, Kyle Sluder wrote: Could you please file a Radar describing your use case and share the number here? ___

Re: NSString stringByAbbreviatingWithTildeInPath and Sandboxing

2015-01-29 Thread Kyle Sluder
Even in a sandbox, you can get the user’s home directory using getpwuid(3) as mentioned in the docs: https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/DesigningYourSandbox/DesigningYourSandbox.html So you could just search through your string and rep

Re: drawRect runs twice, bounds are changed in between

2015-01-29 Thread N!K
Thank you. On Jan 28, 2015, at 8:30 PM, Graham Cox wrote: > >> On 29 Jan 2015, at 3:05 pm, N!K wrote: >> >> NSBezierPath* temp; is in the list of declarations. >> This snippet is in drawRect: >> >> NSAffineTransform* tfm = [[NSAffineTransform alloc] init]; >> [tfm scaleXBy:sca

Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Graham Cox
NSControl has properties target, action. I want to subclass NSControl but my custom control doesn't use a cell internally. I want to inherit the target, action properties so that I can hook these up for my custom subclass in IB (If I don't inherit NSControl, IB is unaware that I have target, ac

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Roland King
> On 30 Jan 2015, at 07:44, Graham Cox wrote: > > NSControl has properties target, action. > > > If I redeclare the storage, to use my own storage ivars via @synthesize, the > properties have to be nonatomic, but the original properties don't define > this, so the compiler complains that the

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Graham Cox
> On 30 Jan 2015, at 11:12 am, Roland King wrote: > > I don't see this in a quick test I just typed into Xcode. I did this in the > .h file > > @interface RKControl : NSControl > @property SEL action; > @property (weak) id target; > @end > > > and .m > > #import "RKControl.h" > @implement

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 16:26 , Graham Cox wrote: > > 'atomic' attribute on property 'action' does not match the property inherited > from 'NSControl' The 10.10 SDK uses real @property declarations, but doesn’t specify atomicity, which means the property defaults to atomic. You said before that "t

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Roland King
> On 30 Jan 2015, at 08:26, Graham Cox wrote: > > >> On 30 Jan 2015, at 11:12 am, Roland King wrote: >> >> I don't see this in a quick test I just typed into Xcode. I did this in the >> .h file >> >> @interface RKControl : NSControl >> @property SELaction; >> @property (weak) id ta

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Roland King
> > The only difference I see is that I'm declaring my ivars as part of the > @interface, not the @implementation - is that a new thing? I didn't know you > could do that (though it makes sense). > oh and that was Xcode 4.2 + 64-bit runtime. It was one of the changes I appreciated in ObjC 2.

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Graham Cox
> On 30 Jan 2015, at 11:40 am, Roland King wrote: > > I can get that warning too, but only if I explicitly declare the property > 'nonatomic', like this > > @property (readwrite, nonatomic ) SEL action; // 'atomic' attribute on > property 'action' does not match the property inherited from 'N

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Roland King
> On 30 Jan 2015, at 08:38, Quincey Morris > wrote: > > On Jan 29, 2015, at 16:26 , Graham Cox > wrote: >> >> 'atomic' attribute on property 'action' does not match the property >> inherited from 'NSControl' > > The 10.10 SDK uses real @property declarations,

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 17:03 , Graham Cox wrote: > > Regarding 'nonatomic', in previous times, I've had a different warning when I > used @synthesize with an assigned ivar and the property was not 'nonatomic'. > Maybe that's changed but as a result of it I got conditioned to always > including no

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 17:18 , Roland King wrote: > > I can find this > http://lists.apple.com/archives/objc-language/2013/Apr/msg00119.html > , is > that what you were remembering or is there something stronger my google-fu >

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Greg Parker
> On Jan 29, 2015, at 5:29 PM, Quincey Morris > wrote: > > On Jan 29, 2015, at 17:18 , Roland King wrote: >> >> I can find this >> http://lists.apple.com/archives/objc-language/2013/Apr/msg00119.html >> , is >> that what

Modifying row rect indent in NSOutlineView

2015-01-29 Thread Andrew White
I have an NSOutlineView on OS X 10.10. For non-group row, the indent appears to change where each row starts but the rounded rect surrounding each row always starts on the left margin. I want to modify it so that the left edge of the rectangle is indented (at least for certain children). Exi

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 19:47 , Greg Parker wrote: > > `atomic` makes a big difference for a strong or weak property of object type > because objects have retain counts. Er, I feel stupid but I don’t understand. How do the retain counts affect this? On the one hand, properties are not the only pla

Re: Modifying row rect indent in NSOutlineView

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 20:45 , Andrew White wrote: > > I tried subclassing NSOutlineView and catching frameOutlineOfCellAtRow, > adding to theRect.origin.x and subtracting from theRect.size.width. This > didn't seem to make a difference. I have verified that the overridden > function is being c

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Ken Thomases
On Jan 29, 2015, at 10:54 PM, Quincey Morris wrote: > On Jan 29, 2015, at 19:47 , Greg Parker wrote: >> >> `atomic` makes a big difference for a strong or weak property of object type >> because objects have retain counts. > > Er, I feel stupid but I don’t understand. How do the retain count

copyWithZone archive/unarchive

2015-01-29 Thread Trygve Inda
I have a custom class (MyCustomClass) and within another class I need to have MyCustomClass be a property whereby I make a copy (vs retaining). MyCustomClass is quite complex and so I was considering using: -(id)copyWithZone:(NSZone *)zone { MyCustomClass* copy = [NSKeyedUnarchiver unarchiveOb

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 21:16 , Ken Thomases wrote: > > the getter has to do the equivalent of retain+autorelease atomically I was thinking that the same would have to be true of local variable accesses, too, but I see (if I see) the difference is that references from local variables are already r

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Ken Thomases
On Jan 29, 2015, at 11:53 PM, Quincey Morris wrote: > On Jan 29, 2015, at 21:16 , Ken Thomases wrote: >> >> the getter has to do the equivalent of retain+autorelease atomically > > I was thinking that the same would have to be true of local variable > accesses, too, but I see (if I see) the

Re: Modifying row rect indent in NSOutlineView

2015-01-29 Thread Andrew White
On 30/01/2015 16:04, Quincey Morris wrote: On Jan 29, 2015, at 20:45 , Andrew White mailto:andrew.wh...@audinate.com>> wrote: I tried subclassing NSOutlineView and catching frameOutlineOfCellAtRow, adding to theRect.origin.x and subtracting from theRect.size.width. This didn't seem to make a d

Re: copyWithZone archive/unarchive

2015-01-29 Thread Jens Alfke
> On Jan 29, 2015, at 9:44 PM, Trygve Inda wrote: > > However, naming conventions expect copy to not > be autoreleased so should the above really be: > > return ([copy retain]); Yes, if you're really still not using ARC ;-) —Jens ___ Cocoa-dev mail

Re: Modifying row rect indent in NSOutlineView

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 22:24 , Andrew White wrote: > > The code I've inherited uses this to draw rounded rects on the background of > each row. So if I want to modify the width and position of those rects, I > need to feed information about the item in outlineView:rowViewForItem into > the row v

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 22:21 , Ken Thomases wrote: > > Huh? It has to be an autorelease and not a release because the object needs > to survive to the caller's scope. "Release" meant “eventual relinquishment of ownership”. Since we’re talking about ARC, I wasn’t assuming that it would be an actu

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Ken Thomases
On Jan 30, 2015, at 12:49 AM, Quincey Morris wrote: > On Jan 29, 2015, at 22:21 , Ken Thomases wrote: >> >> Huh? It has to be an autorelease and not a release because the object needs >> to survive to the caller's scope. > > "Release" meant “eventual relinquishment of ownership”. Sorry if