Re: Reformatting percent string to two decimal places

2008-04-08 Thread James Bucanek
> NSString* newValue = [formatter stringFromNumber:fv ]; > [formatter release]; > > return [NSString stringWithFormat:@"[EMAIL PROTECTED]@", newValue, @"%"]; > } > > Is this the best way to do this? It works just fine, but I was wondering if

Re: looking for sample code to read UUID from a disk volume.

2008-04-09 Thread James Bucanek
= FSEventsCopyUUIDForDevice(device); CFStringRef uuidStr = CFUUIDCreateString(uuid); CFRelease(uuid);// CF copy rule return ((NSString*)uuidStr); -- James Bucanek ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do n

Re: zlib in 10.4 and 10.5

2008-06-08 Thread James Bucanek
can't manage). Any endian issues with zlib? zlib compresses bytes, not words, so there are no inherent endian issues when using zlib. Your actual data is another matter; You'll have the same endian issues you would storing/moving uncompressed data betw

Re: Struct, Object, or Dictionary?

2008-07-01 Thread James Bucanek
ed/allocated or if you must have a non-object data blob that you need to pass around by value (e.g. NSRect). Dictionaries are good for dynamic structures, where you don't necessarily know or care about what kind or how many values it contains. -- James Bucanek __

Re: Getting mouse moved events on overlay windows

2008-07-04 Thread James Bucanek
to translate the tracking rects to the coordinate system of the parent window and attach the tracking rects to the parent window instead. The parent window then receives the various mouseMoved: events and passes them back to the child window for handling. A little klud

Mystery Thread - how to debug

2008-07-15 Thread James Bucanek
64 __spin_lock 7464 __spin_lock I'm *assuming* that this is the worker thread exiting. But since there's no symbolic information associated with my application I can't figure out what thread this belongs to, what selector it will/did execute, or why the heck it

Replacement for openUntitledDocumentOfType:display:

2008-07-24 Thread James Bucanek
stead. But that method doesn't take a docType parameter. This application has several flavors of File > New that each create a different document type. What's the 10.4/10.5 equivalent method for creating a new document of a specific type?

Re: Notification Sent When Window Is Ordered Back?

2008-12-14 Thread James Bucanek
robably because it's resignKeyWindow: not windowDidResignKey: -- James Bucanek ___ 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-dev-ad

Re: Subclassing NSUserDefaultsController

2009-09-20 Thread James Bucanek
namically changes its EUID to the user you need to affect, or be a pre-configured SUID->user (probably the easiest solution) that always runs as that particular user. Your process could launch the helper then communicate what changes you need to make via inter-process messaging. -- J

Re: enable/disable/check file Sharing from code

2009-09-21 Thread James Bucanek
Georg Seifert <mailto:georg.seif...@gmx.de> wrote (Monday, September 21, 2009 2:50 AM +0200): Is there a way to enable and disable file sharing from code. Almost all background services are universally controlled by launchd. See man launchctl, launchd, et al. -- James B

Re: Oh notification, where are you?

2009-09-23 Thread James Bucanek
mily *definitely* needs a run loop as it queues a deferred message to a run loop's input source. -- James Bucanek ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact th

Re: [__NSFastEnumerationEnumerator nextObject] unexpectedly not very fast!

2009-09-25 Thread James Bucanek
of functions are optimized internally and probably don't use enumerator objects or fast enumeration. But that's just a guess. The rule is, as always, don't worry about it unless it's a problem, then profile it, find the bottleneck, and work around it. -- James Bucanek _

Re: [Q] is NSFileHandle's writeData method faster than the FSWriteFork?

2008-08-02 Thread James Bucanek
cessing the data) I was able to improve the performance of my application by 350%. -- James Bucanek ___ 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 coc

Re: [Q] is NSFileHandle's writeData method faster than the FSWriteFork?

2008-08-04 Thread James Bucanek
the 1st and the 3rd options, because the 2nd option will not be easily applicable withouth refactoring the current code a lot. - Align the data to be written in memory to page boundaries (man valloc). - Write data in multiples of page size blocks (man getpagesize) - Turn off caching (see

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
nd I'm wondering why this even came up. There is no such thing as a "private" method in Objective-C. The @private, @protected, @public keywords only work on instance variables. So if the super class implements -close, there should never be anything stopping your subclass from

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
parts where you call [super close] will be broken. The OP did override -close in their subclass and were attempting to call [super close] from the subclass' -close method. The OP stated that they couldn't simply use [super close] because -close was "private," which didn&#

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
Shawn Erickson <mailto:[EMAIL PROTECTED]> wrote (Tuesday, August 5, 2008 12:38 PM -0700): On Tue, Aug 5, 2008 at 12:18 PM, James Bucanek <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> wrote (Tuesday, August 5, 2008 5:41 AM +0100): My super

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
nted by the superclass, I would suggest something like try { [(id)super close]; // call superclass' -close, if implemented ... } catch { if (method not implemented exception) // code that gets called if superclass doesn't implement -c

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
Charles Steinman <mailto:[EMAIL PROTECTED]> wrote (Tuesday, August 5, 2008 4:20 PM -0700): --- On Tue, 8/5/08, James Bucanek <[EMAIL PROTECTED]> wrote: In your original code, you had SEL closeSelector = @selector(close); if ([SuperSocket instancesRespondToSelector:c

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
if (method not implemented exception) superMightImplemtnClose = NO; // code that gets called if superclass doesn't implement -close ... } } else { // code that gets called if superclass doesn't implement -close ... } -- James Bucanek ___

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
Ken Thomases <mailto:[EMAIL PROTECTED]> wrote (Tuesday, August 5, 2008 9:34 PM -0500): On Aug 5, 2008, at 10:20 PM, James Bucanek wrote: First rule of optimization: Don't! Get the code working and profile it. Then if, and only if, it's a significant performance bottlene

Re: How do I make one thread wait until another thread exits?

2009-02-13 Thread James Bucanek
dtionLock lockWhenCondition:OPERATION_FINISHED]; [operation->condtionLock unlock]; (note that I usually encapsulate this in a -(void)waitUntilFinished method) James -- James Bucanek ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do no

Problem deploying a NSCollectionView in Leopard

2010-01-02 Thread James Bucanek
tell that's not even getting instantiated. Everything else is done with bindings. Anyone have a clue as to why this won't fly on Leopard? -- James Bucanek ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: iPhone: validate a NSString for US zipcode

2010-01-08 Thread James Bucanek
force, comparison of objects. It's easy to demonstrate all of this by setting a breakpoint in the -hash and -isEqual: methods of the objects added to a collection. For ZIP code membership, an NSIndexSet makes a lot more sense. -- James Bucanek ___

Re: Differentiate FAT16 and FAT32

2010-01-11 Thread James Bucanek
list are filesystem geniuses, but some have publicly admitted that they can't keep up with Cocoa-dev -- for which I sympathize. -- James Bucanek ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: Can a model key path binding access a super class property

2010-01-17 Thread James Bucanek
); return value; // <-- set breakpoint here } Now you can set a breakpoint or log every access to that property. You shouldn't have any problem verifying if the correct messages are being sent (or not), by whom, and then work backwards from there. -- James Bucanek __

Re: Scope of NSOperations

2010-02-04 Thread James Bucanek
e correct or must NSOperations be retained in scope explicitly until the operation is finished? It's OK for GC, but if you're using retained memory you're missing an autorelease. Fix your init, and you'll probably be OK. -- James Bucanek

Re: cross-process file open notifications

2010-02-08 Thread James Bucanek
frameworks/dylibs is that their code is only loaded once, and is then repeatedly mapped into the address space of multiple processes. So watching to see when the file is opened might not tell you if a process has loaded it, and it almost certainly won't tell you what process did