Contribute some dictionary keys with registerDefaults

2014-06-18 Thread Jonathan Taylor
I currently have a plist which contains some configuration values; at start of day I use the following call to make certain factory settings available to the application through NSUserDefaults: [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary

Re: Contribute some dictionary keys with registerDefaults

2014-06-18 Thread Steve Christensen
When you call -setObject:forKey:, it replaces the entire contents of that key, whether the object is a number, string, dictionary, etc. That’s the same behavior as if you called -setObject:forKey: on a regular dictionary when one of its objects is, itself, a dictionary. Depending on what you

Taking screen shots

2014-06-18 Thread Kevin Meaney
Actually just window shots. I feel like I've been fighting with the screen shot code, and that it shouldn't be this difficult. I get past one problem only to find another. My most recent seems intractable. If drawing to the window happens when the window is not completely on screen and if you

Re: Bindings setup with NSCollectionViews

2014-06-18 Thread Keary Suska
On Jun 17, 2014, at 7:40 PM, Hajder Rabiee wrote: I am having trouble getting the master-detail binding configuration setup correctly. I've sat down far too many hours trying to debug this and I hope anyone can give me a hint on how to solve this issue. The full problem description can be

Re: Taking screen shots

2014-06-18 Thread Kyle Sluder
On Wed, Jun 18, 2014, at 07:12 AM, Kevin Meaney wrote: If drawing to the window happens when the window is not completely on screen and if you drag the window so that it is fully visible on screen so you can see that all the drawing you did is actually drawn and then take a snapshot using

Re: Taking screen shots

2014-06-18 Thread Kevin Meaney
Not really. Can you show some code? dictArray = CGWindowListCopyWindowInfo(kCGWindowListOptionIncludingWindow, (CGWindowID)[self._window windowNumber]); if (dictArray (CFArrayGetCount(dictArray) 0)) windowDict =

Re: Taking screen shots

2014-06-18 Thread Kyle Sluder
On Jun 18, 2014, at 8:24 AM, Kevin Meaney k...@yvs.eu.com wrote: [ snip ] Thanks. But I’m still confused about the timing. What method does this code live in, and when is that method executed relative to the window being dragged completely back on to the screen? --Kyle Sluder

Re: Taking screen shots

2014-06-18 Thread Kevin Meaney
Apologies, The e-mail with the code went out before I was finished editing. The code shown is that taking the screen capture. But what is captured is not what I see in the window. Kevin On 18 Jun 2014, at 16:24, Kevin Meaney k...@yvs.eu.com wrote: Not really. Can you show some code?

Re: Taking screen shots

2014-06-18 Thread Kevin Meaney
The sequence of events are: 1. Drag window so that it is partially offscreen. 2. Draw into the window where part of the drawing happens in the part of the window that is offscreen. 3. Drag the window so that it is fully on screen. Observe that the window shows all the drawing that was

Re: Taking screen shots

2014-06-18 Thread Kyle Sluder
On Jun 18, 2014, at 8:36 AM, Kevin Meaney k...@yvs.eu.com wrote: The sequence of events are: 1. Drag window so that it is partially offscreen. 2. Draw into the window where part of the drawing happens in the part of the window that is offscreen. Ok, what does this mean? In AppKit, you

Re: Taking screen shots

2014-06-18 Thread Kevin Meaney
On Jun 18, 2014, at 8:36 AM, Kevin Meaney k...@yvs.eu.com wrote: The sequence of events are: 1. Drag window so that it is partially offscreen. 2. Draw into the window where part of the drawing happens in the part of the window that is offscreen. Ok, what does this mean? In AppKit, you

Re: Taking screen shots

2014-06-18 Thread Kevin Meaney
SonOfGrab displays in the composited image window the correct image after following the same steps. Kevin On 18 Jun 2014, at 17:01, Kevin Meaney k...@yvs.eu.com wrote: On Jun 18, 2014, at 8:36 AM, Kevin Meaney k...@yvs.eu.com wrote: The sequence of events are: 1. Drag window so that it

Re: NSCoding vs NSSecureCoding

2014-06-18 Thread Sean McBride
On Tue, 17 Jun 2014 08:22:40 -0700, Tony Parker said: NSKeyedArchiver and NSKeyedUnarchiver also support secure coding as of 10.9. Tony, Thanks for the details. Are there any issues in creating an archive on 10.9 and then decoding it on 10.8 or older? Cheers, --

Re: Taking screen shots

2014-06-18 Thread Kyle Sluder
On Wed, Jun 18, 2014, at 09:01 AM, Kevin Meaney wrote: Drawing happens when I receive an xpc message containing a drawing command. To do the drawing I get the NSGraphicsContext from which I pull the graphicsPort which is a special kind of CGContext. I then use CoreGraphics commands to do the

Re: NSCoding vs NSSecureCoding

2014-06-18 Thread Tony Parker
Hi Sean, On Jun 18, 2014, at 9:42 AM, Sean McBride s...@rogue-research.com wrote: On Tue, 17 Jun 2014 08:22:40 -0700, Tony Parker said: NSKeyedArchiver and NSKeyedUnarchiver also support secure coding as of 10.9. Tony, Thanks for the details. Are there any issues in creating an

Re: Cocoa-dev Digest, Vol 11, Issue 339

2014-06-18 Thread Gordon Apple
I¹m not clear as to what your view/nib structure is. If you are using a view nib, I recommend using a custom viewController and, in awakeFromNib, setting a local property (maybe from an IBOutlet) to the array controller. Trying to bind anything to an array controller through a view controller¹s

Re: Bindings setup with NSCollectionViews

2014-06-18 Thread Gordon Apple
Sorry, forgot to update the Subject on previous post On 6/18/14 8:28 AM, cocoa-dev-requ...@lists.apple.com cocoa-dev-requ...@lists.apple.com wrote: Bindings setup with NSCollectionViews ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: Taking screen shots

2014-06-18 Thread Kevin Meaney
This is NOT OK: - (void)handleIncomingDrawCommand:(id)drawCommand { CGContextRef cgContext = [[NSGraphicsContext currentContext] graphicsPort]; ImmediatelyPerformDrawCommand(drawCommand, cgContext); // NO! } Bugger, that is exactly what I'm doing. Basically the tool is intended for

Re: Taking screen shots

2014-06-18 Thread Kevin Meaney
Since the SonOfGrab application works for grabbing the contents of my window, even when it is partially offscreen at the time of taking the screen grab I had a look at what it was doing differently. Basically SonOfGrab was passing in CGRectNull into CGWindowListCreateImage instead of a defined

iOS app restarting from screen one. Why?

2014-06-18 Thread Alex Zavatone
I've seen this only since iOS 7 and haven't been able to figure out what causes this. Many times in many applications on iOS, when an app is in the background and is brought to the front, it doesn't continue from the screen it was left at. In many cases, I've seen the app restarting from

Send msg to object by nameed NSString;

2014-06-18 Thread Trygve Inda
If I have a class: @interface MyClass : NSObject { NSNumber*myNumber; } @property (nonatomic, retain) NSNumber* myNumber; And in the class implementation I have: -(void)doSomething { // it could get this string from anywhere, not always a constant NSString* myString =

Re: Bindings setup with NSCollectionViews

2014-06-18 Thread Hajder Rabiee
The master detail view is bound to BoardArrayController with Controller Key: arrangedObjects The detailed view is bound to BoardArrayController with Controller Key: selection and Model Key Path: lists I have followed the guide here

Re: Cocoa-dev Digest, Vol 11, Issue 339

2014-06-18 Thread Hajder Rabiee
The application consists of one main xib and its File's Owner is a subclass of NSWindowController. Can you further explain as to which binding to an array controller that is not possible? The only places where 'representedObject' is present is in the item prototypes for NSCollectionView. I.e. the

Re: iOS app restarting from screen one. Why?

2014-06-18 Thread Jens Alfke
On Jun 18, 2014, at 11:22 AM, Alex Zavatone z...@mac.com wrote: Does anyone have any info on what causes the app to seemingly unroll it's Navigation Controller stack and start from the first screen again? Probably because the OS quit the app while it was backgrounded, and it’s being

Re: Send msg to object by nameed NSString;

2014-06-18 Thread Jens Alfke
On Jun 18, 2014, at 11:23 AM, Trygve Inda cocoa...@xericdesign.com wrote: Is there a way to access the myNumber property and send it a message knowing only it's name (contained in myString)? You mean like key-value coding? [self valueForKey: @“myNumber”]; —Jens

Re: Send msg to object by nameed NSString;

2014-06-18 Thread Daniel DeCovnick
Yes. You can either use key-value coding: [[self valueForKey:myString] release]; or you can use the ObjC runtime functions to do exactly that. #import objc/runtime.h id value = nil; object_getInstanceVariable(self, [myStr UTF8String], value); // if your ivar is auto synthesized from a

Re: Bindings setup with NSCollectionViews

2014-06-18 Thread Gordon Apple
That part should work. I was referring to the view controller¹s representedObject, if you are using such a view controller in a view nib and trying to bind the collection view to an array controller through the view controller¹s representedObject. On 6/18/14 1:34 PM, Hajder Rabiee

Re: iOS app restarting from screen one. Why?

2014-06-18 Thread Alex Zavatone
Honestly, it seems like it's unrolling the navigation controller for some strange reason when I toggle Personal Hotspot while the app is in the background. Many times I've seen this happen and even when moving various iPhone's Settings panels to the background, then bringing them to the front

RE: iOS app restarting from screen one. Why?

2014-06-18 Thread altotest1
Sent from AOLMail On Wednesday, June 18, 2014 Alex Zavatone z...@mac.com wrote: I've seen this only since iOS 7 and haven't been able to figure out what causes this. Many times in many applications on iOS, when an app is in the background and is brought to the front, it doesn't continue

Re: Bindings setup with NSCollectionViews

2014-06-18 Thread Hajder Rabiee
Actually I already have an alternative (code) solution, instead of binding an IBOutlet to an ArrayController, I could just call setContent on my detailedView in observeValueForKeyPath (see hint in the question). But I would prefer getting it to work through IB only, since everything else is

Re: Send msg to object by nameed NSString;

2014-06-18 Thread Graham Cox
On 19 Jun 2014, at 4:53 am, Daniel DeCovnick danhd...@mac.com wrote: Yes. You can either use key-value coding: [[self valueForKey:myString] release]; [value release]; These invocations of -release appear to be erroneous. Why do you have them there? If you think they should be there as

Re: Send msg to object by nameed NSString;

2014-06-18 Thread Trygve Inda
On 19 Jun 2014, at 4:53 am, Daniel DeCovnick danhd...@mac.com wrote: Yes. You can either use key-value coding: [[self valueForKey:myString] release]; [value release]; These invocations of -release appear to be erroneous. Why do you have them there? If you think they should be

Re: Send msg to object by nameed NSString;

2014-06-18 Thread Graham Cox
On 19 Jun 2014, at 10:57 am, Trygve Inda cocoa...@xericdesign.com wrote: The method propertyKeys (below) is used to simplify and shorten the code in these classes since I want to encode/decode and (upon dealloc), release all the properties. -(void)dealloc { for (NSString* key in [self

Re: Send msg to object by nameed NSString;

2014-06-18 Thread Trygve Inda
On 19 Jun 2014, at 10:57 am, Trygve Inda cocoa...@xericdesign.com wrote: The method propertyKeys (below) is used to simplify and shorten the code in these classes since I want to encode/decode and (upon dealloc), release all the properties. -(void)dealloc { for (NSString* key in

Re: Send msg to object by nameed NSString;

2014-06-18 Thread Trygve Inda
A performance related argument: using property getters and setters in -initWithCoder: and -encodeWithCoder: can bring with them serious performance issues. Might not matter in your case, or in most cases, but it really adds up if you have a large and complex object graph. A recent exercise