Re: Thread safety of Bonjour Cocoa classes? (NSNetService, etc.)

2013-02-14 Thread Chris Parker
On 14 Feb 2013, at 11:26 AM, Sean McBride wrote: > Anyone tried using NSNetService and NSNetServiceBrowser on non-main threads > on OS X? > > - the 'Thread Safety Summary' document does not mention these classes. > - NSNetServices.h says "NSNetService instances may be scheduled on NSRunLoops

Re: Dismissing a Popover Internally

2011-07-20 Thread Chris Parker
Hi Gordon, On Jul 20, 2011, at 10:32 AM, Gordon Apple wrote: > UIPopoverController has a UINavigationController. Is there any decent way > to access the UIPopoverController inside a popover view to dismiss it? The > only way I have come up with is to either pass the reference down the chain, T

Re: Synthesised properties and additional actions

2011-06-22 Thread Chris Parker
On 22 Jun 2011, at 11:10 AM, Joanna Carter wrote: >> My book is about iOS 4; there is no GC in that world! ☺ > > Aha! Missed that bit > > But was I finally right? Consider the multi-threaded case where you want property access to be atomic (and remember, properties might not always be object

Re: UIViewControllers being reloaded on didReceiveMemoryWarning... ?

2011-04-13 Thread Chris Parker
round in InGameViewController's implementation of -viewDidUnload and see if you're doing anything that involves '[self view]' (or 'self.view' for you dot-syntax people :) ). .chris -- Chris Parker iOS Frameworks (UIKit) Apple Inc.

Re: [iOS] NSUserDefaults best practices

2011-02-05 Thread Chris Parker
On 5 Feb 2011, at 4:33 AM, Philip Vallone wrote: > After some reading I understand that when creating a Settings Bundle for by > iOS app, that I need to explicitly set the defaults. I was wondering if > anyone had a preference for where you are setting the defaults. For example > in the App De

Re: NSFileManager and Resource Forks

2010-10-27 Thread Chris Parker
What are you really trying to do? In general, resource forks on Mac OS X aren't used anymore. NSFileManager preserves them on file moves and copies for legac. And while the "..namedfork" bits work now, they're unlikely to continue working in the future. .chris On 27 Oct 2010, at 10:52 AM, k...

Re: Register/Function Parm Mapping for 64-bit Was: isTemporaryID unrecognized selector…

2010-09-04 Thread Chris Parker
bjC: second arg of method) Any additional arguments are on the stack. PPC is similar to arm, but things start at $r3 and go a bit further into the registers before moving out to the stack. .chris -- Chris Parker UIKit Apple Inc. ___ Cocoa-dev mai

Re: CALayer -drawInContext and GCD

2010-09-02 Thread Chris Parker
Hi Vincent, On 2 Sep 2010, at 11:29 AM, vincent habchi wrote: > I promise I did not plan to start an Apple internal quarrel! ;) I don't think there's any real quarrel here; David and I are looking at this from two distinct points of view. :) The docs for +[CATransaction flush] make the stateme

Re: CALayer -drawInContext and GCD

2010-09-02 Thread Chris Parker
On 2 Sep 2010, at 8:52 AM, David Duncan wrote: > On Sep 2, 2010, at 7:39 AM, Vincent Habchi wrote: > >> I just wanted to know someone has already tried to successfully send a >> CALayer -drawInContext method to a GCD dispatch queue. I suspect this is not >> possible, because of main loop relat

Re: NSDoc's Magic File Watcher Ruins Core Data Migration [SOLVED]

2010-05-24 Thread Chris Parker
gItemURL:(NSURL **)resultingURL error:(NSError **)error AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; .chris -- Chris Parker iPhone Frameworks Apple Inc. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to

Re: -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (NSDictionaryController)

2010-04-26 Thread Chris Parker
On 26 Apr 2010, at 5:03 PM, Jack Repenning wrote: > On Apr 26, 2010, at 4:34 PM, Chris Parker wrote: > >> if you're setting the deployment target for the nib correctly then IB should >> warn you that you're encoding something that 10.4 knows nothing about. > &g

Re: -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (NSDictionaryController)

2010-04-26 Thread Chris Parker
4u; NSDictionaryController is tagged as being available in 10.5 (Leopard) and later. So Tiger's unarchiver doesn't know what to do with an archived NSDictionaryController. There's a setting in Interface Builder which should warn you about this kind of thing - if you're set

Re: Efficiently iterating files on the iPhone

2010-04-14 Thread Chris Parker
tion because it's basically using what's available in the stat() block and nothing else. You should be fine in just using NSFileManager and asking for fileAttributes using an NSDirectoryEnumerator. And as that gets faster, you'll get faster. If you're that worried about it,

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Chris Parker
is also a good resource. You can also write your own dtrace scripts to track messages to retain/release/autorelease to your own objects and that can help filter down the noise to only those objects of the class which are causing you problems. .chris -- Chris Parker iPhone Frameworks Apple

Re: NSUserDefaults Croaks on Dictionary Containing NSNumber as Key

2009-12-12 Thread Chris Parker
As Clark noted elsewhere, you're using a string key properly with NSUserDefaults itself and NSUserDefaults and CFPreferences both require that the entire subtree of the value be a properly formed property list object. For NSDictionaries that means all keys must be strings for the entire tree. Th

Re: Hardware UUID

2009-11-09 Thread Chris Parker
Please remember that gethostuuid() has all the same caveats mentioned in TN1103. .chris On 8 Nov 2009, at 3:13 PM, Grigutis, John A wrote: Also look at gethostuuid: int gethostuuid(uuid_t id, const struct timespec *wait) I don't think it was around when that technote was last updated. --

Re: Static Analyzer and Core Foundation

2009-09-18 Thread Chris Parker
t's probably complaining about the MDItemCopyAttributeNames() call, which (because it has "Copy" in the name) returns an object you'd have to release. I.e., line 44 allocates two objects, the dictionary which you *are* releasing and the attribute names array, whi

Re: NSUserDefault and Negative numerical arguments (Was: Posting mouse clicks with multiple displays)

2009-08-11 Thread Chris Parker
ir arguments; it's a lot easier than using getopt(3) most of the time. You're correct If you want to process the command line arguments, you can either do so from your main() function, before calling NSApplicationMain(), or you can use NSProcessInfo to examine them once your app is

Re: Clarification on accessors? (was: Yet another memory management question)

2009-07-08 Thread Chris Parker
Because you have no idea what subclassers may do in their overrides of the accessors (e.g. The subclassed accessor may rely on state that's been torn down earlier in -dealloc). It's just not safe, unless you can guarantee that you own the entire inheritance chain. .chris On Jul 8, 2009,

Re: Just implementing -isEqual:, never invoked, causes crash

2009-06-19 Thread Chris Parker
nabled", "YES", 1) ; setenv("NSAutoreleaseFreedObjectCheckEnabled", "YES", 1) ; #endif That should do the job, right? You're too late. The code which sets up zombies fires before main() - you'll need to set this in the envi

Re: NSFileManager's copyItemAtPath:toPath:error: syslogging every directory it finds?

2009-06-01 Thread Chris Parker
th:toPath:error: but does anyone know why I'd be getting that logged? Very confusing. This is a known bug and has been fixed in a future release of the operating system. .chris -- Chris Parker Apple Inc. ___ Cocoa-dev mailing list (Cocoa-dev

Re: Getting localized /Users/Shared Dir Name

2009-05-29 Thread Chris Parker
On 29 May 2009, at 3:49 PM, Erg Consultant wrote: I don't see any methods such as NSSearchPathForDirectoriesInDomains() for getting the localized name of the /Users/Shared directory. Is there one? Once you have any path, you can get the localized components via - [NSFileManager components

Re: NSFileManager reads from invalid memory

2009-03-02 Thread Chris Parker
gurus here point out a flaw, or is this a real bug? [code elided] I was able to reproduce this on 10.5.6 (9G55) - the backtrace shows the crash happening deep in LaunchServices; this is a known bug which has been fixed. .chris -- Chris Parker Cocoa Frameworks Apple Inc

Re: how to archive NSNetService?

2009-01-16 Thread Chris Parker
sing for the same domain all the time, then that's not necessary either). When the user runs the application again, retrieve the dictionary and use those values to call -[NSNetService initWithDomain:type:name:]. That call returns an NSNetService suitable for res

Re: /tmp folder ok?

2009-01-14 Thread Chris Parker
NSTemporaryDirectory() already does (effectively) that, and yields the same resulting folder. You should just use NSTemporaryDirectory(). .chris On Wed, Jan 14, 2009 at 3:44 PM, Graham Cox wrote: > > On 15 Jan 2009, at 10:31 am, Chunk 1978 wrote: > >> so an app doesn't need administrative righ

Re: Remove an object from a defaults suite?

2008-08-28 Thread Chris Parker
t you want here. Another is to use the "persistent domain" capabilities of NSUserDefaults. Pull in the dictionary for the domain, make a mutable copy, modify it, and then write the whole domain back out. This is overkill; use the CFPreferences API instead. .chris -- Chris Parker C

Re: CoreFoundation Command Line Tool - an easy beginner question

2008-08-04 Thread Chris Parker
get you a lot farther. :) As far as parsing arguments go, you may wish to look at using [[NSProcessInfo processInfo] arguments], which gives you an NSArray of NSStrings of the arguments. .chris -- Chris Parker Cocoa Frameworks Apple, Inc. ___ C

Re: plist parsing in c

2008-07-06 Thread Chris Parker
ragraph that talks about not hard-coding the paths. -- Chris Parker Cocoa Frameworks Apple Inc. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-

Re: Bug?:? CFPreferencesSynchronize() Remembers Value from Deleted File

2008-04-29 Thread Chris Parker
Hi Jerry, On 29 Apr 2008, at 5:21 PM, Jerry Krinock wrote: Is this a bug, or just me goofing things up again? No, it's just a bug; you haven't goofed anything up. It's been addressed, but as usual I can't comment on when the fix will appear. .chris -- Chris Par

Re: NSUInteger question

2008-04-09 Thread Chris Parker
On 8 Apr 2008, at 6:19 PM, Christopher Nebel wrote: On Apr 8, 2008, at 5:30 PM, Timothy Reaves wrote: What advantage does NSUinteger have over uint32? I realize that on a 64 bit machine, it would be a uint64. "Advantage"? None, really. It's a question of what you're trying to express

Re: Network communication with NSFileHandle & NSSocketPort

2008-03-19 Thread Chris Parker
ings you'd like to see it do that it doesn't today. .chris -- Chris Parker Cocoa Frameworks Apple Inc. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Conta

Re: FSFindFolder vs NSSearchPathForDirectoriesInDomains

2008-03-10 Thread Chris Parker
; could you please file one? Thanks. .chris -- Chris Parker Cocoa Frameworks Engineer Apple, Inc. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa