Re: Self describing NSObjects.

2015-02-04 Thread Richard Heard
Or you can call _ivarDescription on the object in question. -R > On 4 Feb 2015, at 10:54:49 AM, Pascal J. Bourguignon > wrote: > > >> On 04 Feb 2015, at 19:43, Alex Zavatone wrote: >> >> All too often, I have a simple data class that is just a bunch of properties >> of cocoa collections. >>

Re: Best solution for game loop on OSX?

2013-12-16 Thread Richard Heard
Perhaps CVDisplayLink is what you are looking for. -R On 13 Dec 2013, at 1:57:15 PM, Alex Hall wrote: > Hello list, > I am attempting to use OpenAL to move a sound source around. To do so > smoothly, though, will require a loop, so I can update the position in small > increments many times per

Re: iOS Storyboard - on boarding - skip

2013-10-18 Thread Richard Heard
Seems like a case where it would make more sense to push the controllers explicitly. ie: YNYourNextStepViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:YNYourNextStepViewControllerIdentifier]; [self.navigationController presentViewController:vc animated:YES complet

Re: Detect a Retina display

2013-06-20 Thread Richard Heard
No retina devices can run 10.6, therefore you can safely assume 1.0. This means you can use a runtime check for the selector, and if its not available default to a 1.0 multiple eg: > - (NSRect)backingBounds { > if ([self respondsToSelector:@selector(convertRectToBacking:)]){ >

Re: choose core data store file at app launch

2013-03-29 Thread Richard Heard
So you can easily recreate this behaviour yourself by doing this on launch. -(void)applicationDidFinishLaunching:(NSNotification *)aNotification{ if (([NSEvent modifierFlags] & NSAlternateKeyMask) != 0){ //holding down option on launch //Do the optional path stuff } else {

Re: Objective-C Question

2013-03-14 Thread Richard Heard
Your logic is clearly flawed. This only seems to replace occurrences of $ with the word DOLLAR. Also, if you are dealing with large strings, you could always use one of the below idioms to reduce memory pressure. @autoreleasepool { } or NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] i

Re: Turning off screen shot ability

2013-03-07 Thread Richard Heard
Seeing as this uses non public APIs, i would STRONGLY recommend not using it in any shipping applications. However, for interests sake alone this is how DVD Player appears to do it. https://github.com/heardrwt/RHAdditions/blob/master/RHAdditions/NSWindow%2BRHPreventCaptureAdditions.m -Richard

Re: Turning off screen shot ability

2013-03-06 Thread Richard Heard
Brad, I dug into DVD Players symbols and it would appear to be using private API of the Core Graphics Services variety. http://cocoadev.com/wiki/CoreGraphicsPrivate Specifically CGSSetWindowCaptureExcludeShape() Hope this helps. -Richard On 06/03/2013, at 11:06:59 PM, Scott Ribe wrote:

Re: How to implement readonly property

2012-12-08 Thread Richard Heard
Greg, So, from what you are saying, either of these snippets should be valid, right? > +(id)sharedInstance{ > static id _sharedInstance = nil; > > if (!_sharedInstance){ > @synchronized([self class]){ > if (!_sharedInstance){ > id sharedInstance = [[s

Re: kABHomeLabel … and companions

2012-09-21 Thread Richard Heard
On iOS you would be looking for ABPersonCopyLocalizedPropertyName() on the Mac you would be looking for ABCopyLocalizedPropertyOrLabel(). -Richard On 13/09/2012, at 9:33:06 PM, Erik Stainsby wrote: > I understand that ABAddressBook methods are concerned with ABPerson and > ABGroup entities,