Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-25 Thread Scott Ribe
s > that used for integer zero depending on the platform. Hmm. So Harbison & Steele (5th Edition) is wrong??? That's a surprise to me. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ C

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-25 Thread Scott Ribe
it simply does not specify what happens when a null pointer is converted to int. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: Parsing PDF

2011-02-13 Thread Scott Ribe
ented many times over the years. I'm reading > the documentation for what support there is in Cocoa for PDF parsing, and > also the PDF spec itself, and it's a pretty big undertaking to get right. I > have a distinct feeling I'm staring at a well-solved problem. Below is skeleton code

Re: -[NSSet containsObject:] returns NO when it should return YES

2011-02-19 Thread Scott Ribe
be terribly popular with the Cocoa crowd, I'd use std::set ;-) -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Re: Problem opening file

2011-02-22 Thread Scott Ribe
ate--assuming here that you're building a regular bundled app and not just a command-line executable... -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple

Re: Outlets Not Connected In awakeFromNib

2011-03-02 Thread Scott Ribe
lers, file's owner, and a second one that you embedded in the navigation controller? -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not p

NSBrowser & column resizing

2011-03-02 Thread Scott Ribe
cell to resize along with the column when the user is resizing the column, not snap to the new size after the user is done resizing. Is there any way to hook into column resizing during the drag? FWIW, I only need to support 10.6, nothing earlier. -- Scott Ribe scott_r...@elevated-dev.com http

Re: NSBrowser & column resizing

2011-03-06 Thread Scott Ribe
On Mar 6, 2011, at 4:01 PM, Raleigh Ledet wrote: > Why not just a headerViewController on NSBrowser proper? That looks like it might be exactly what I want. I missed it when skimming NSBrowser/Delegate docs. Thanks. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (

Re: Is a file open in another application?

2011-03-19 Thread Scott Ribe
older versions of Preview did not always properly close the file when you closed the window. So, no, what Brad wants to do is most definitely not possible. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567

Re: Is a file open in another application?

2011-03-19 Thread Scott Ribe
o > check if Word can also return the path of the file for these documents. Yes, for Word this works. You can get the path of any open document. And unlike some things in Word, this bit seems to work reliably. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.

Re: GCD dispatch workers and termination

2011-03-27 Thread Scott Ribe
On Mar 27, 2011, at 3:14 PM, Ken Thomases wrote: > The problem is that pipes have a fixed buffer in the kernel. And it's small ;-) -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev

Re: constructor cannot be overloaded?

2011-03-30 Thread Scott Ribe
On Mar 30, 2011, at 6:36 PM, Rick Mann wrote: > Hey! Look at that! Under certain conditions... 64-bit builds, rects, points (and I don't know what else maybe) are the same. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-05

Re: file done writing?

2011-04-10 Thread Scott Ribe
hen to read a file that is being written by another app--which is what I think you're asking for--unless the other app provides some protocol for that. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice

Re: Proper way to create a singleton without @synchronized ?

2011-04-17 Thread Scott Ribe
of globals at startup and just use them. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Re: Proper way to create a singleton without @synchronized ?

2011-04-17 Thread Scott Ribe
app initialization? What do you gain? -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Re: Proper way to create a singleton without @synchronized ?

2011-04-17 Thread Scott Ribe
ther than just creating an instance and getting on with it... -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mod

updating a table without interrupting user editing

2011-04-18 Thread Scott Ribe
work 10.4 through 10.6.) -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contac

Re: BSD TCP Programming on iPad

2011-04-27 Thread Scott Ribe
On Apr 27, 2011, at 11:12 AM, lbland wrote: > It is just BSD sockets ... get the book. It is: UNIX Network Programming by > Richard Stevens And for beginners, Effective TCP/IP is a good supplemental book. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 72

Re: BSD TCP Programming on iPad

2011-04-28 Thread Scott Ribe
On Apr 28, 2011, at 2:45 AM, Bing Li wrote: > But I don't > know which frameworks in Cocoa should be added so that Socket and Bind can > be compiled. I think it's CoreFoundation or CoreServices... -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (

Re: No more .ibplugins in Xcode 4, so now what...?

2011-05-16 Thread Scott Ribe
the IB style of interface editing. I hope the right people at Apple realize what a step backward it is. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: Application never becomes frontmost. How?

2011-05-17 Thread Scott Ribe
On May 17, 2011, at 10:15 AM, banned_acco...@lavabit.com wrote: > There's probably > a simple solution to all of this. But I can't find it. Help? NSNonactivatingPanelMask? -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303

Re: Restoring an NSPrintInfo doesn't restore enough

2011-05-24 Thread Scott Ribe
enPageFormat and PMFlattenPrintSettings for other reasons, but of course that means using PMSessionPageSetupDialog and PMSessionPrintDialog (and PMCreateSession and PMCreatePageFormat and PMSessionDefaultPageFormat and PMCreatePrintSettings and PMSessionDefaultPrintSettings)... -- Scott Ribe scott_r...@

Re: Seeding random() randomly

2011-05-26 Thread Scott Ribe
On May 26, 2011, at 9:32 PM, Jens Alfke wrote: > It’s never a good idea to seed a RNG with something guessable like this. Not all applications of random() have anything to do with security... -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 vo

Re: Why does NSArray count return NSUInteger?

2011-05-30 Thread Scott Ribe
rth the picky semantic correctness to use a type which can so easily cause so many bugs. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: Memory Management for an Array

2011-06-12 Thread Scott Ribe
;re writing correct code. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the

Re: After Autoreleasing Still Getting Leaked

2011-06-15 Thread Scott Ribe
? Ouch. And the test? Why would you decide whether to free the block based on its contents? I don't see offhand anything in this method that would cause a leak. But if this code is typical of the rest of the program, then you have bugs all over the place that corrupt memory which can l

Re: After Autoreleasing Still Getting Leaked

2011-06-15 Thread Scott Ribe
allocations, you could experiment with creating some "empty" threads that just sleep() long enough to give you a chance to watch them, and compare the memory usage to what you see with your real threads. -- Scott Ribe scott_r...@elevated-dev.com http://www.elev

Re: After Autoreleasing Still Getting Leaked

2011-06-15 Thread Scott Ribe
is, somewhere later on you're not following the memory management rules with regard to ownership of the receivedMessage string. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailin

Re: After Autoreleasing Still Getting Leaked

2011-06-15 Thread Scott Ribe
> sending unexpected data to your port. To be robust, your code should detect > this and (probably) just ignore the packet. So, come to think of it, what if the packet breaks in the middle of a multi-byte sequence? -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303)

Re: After Autoreleasing Still Getting Leaked

2011-06-15 Thread Scott Ribe
nless you only use 7-bit ASCII--and even then you need the appropriate logic in receivedMessage to recognize message boundaries, append bytes to a buffer until you have a full message, and so on. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/

Re: After Autoreleasing Still Getting Leaked

2011-06-15 Thread Scott Ribe
code and your questions, I really doubt it. So an introductory text on network programming is also in order (Stevens is the classic on this subject). Or you could use higher-level network APIs, to which I believe you were referred a long time ago: CFSocket, maybe NSURL depending on the structure of

Re: After Autoreleasing Still Getting Leaked

2011-06-15 Thread Scott Ribe
se a marker at the end of the data, and collect until you hit the marker. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post adm

Re: How to Management Bytes?

2011-06-19 Thread Scott Ribe
me fundamental understanding of the language you're trying to use. (And by the way, you are probably nowhere near having a stable program. Based on what you've shown us so far, you should be prepared to be debugging for a while.) -- Scott Ribe scott_r...@elevated-de

Re: Automatically mirroring folders

2011-06-19 Thread Scott Ribe
er out those events that you should ignore. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: Activate app but bring only *one* window to the front

2011-06-30 Thread Scott Ribe
tmost. Sounds like you need a floating/utility window of some flavor. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin request

Re: How to get the applicaiton name that loads bundle

2011-06-30 Thread Scott Ribe
On Jul 1, 2011, at 12:25 AM, Chen, Jeff (SDCC) wrote: > Is there anyone who knows this? Haven't done it from a PDE specifically, but in general [NSBundle mainBundle] will give you the bundle of the executing application, and you can go from there. -- Scott Ribe scott_r...@elevated

Re: Dumb question about multi-column NSTableViews

2011-07-04 Thread Scott Ribe
an NSDictionary, > then fetch the value for that key-value pair to set the contents of the > cell)___ For table columns is called "identifier"; you can set it in IB, and get it in code. -- Scott Ribe scott_r...@elevated-dev.com htt

Re: Literal NSStrings

2011-07-04 Thread Scott Ribe
On Jul 4, 2011, at 6:23 PM, William Squires wrote: > ...is a literal NSString autoreleased, or retained? Does it matter? "Does not matter" is the answer. You can retain & release them all you want, they're not going anywhere. -- Scott Ribe scott_r...@elevated-dev.c

Re: Using a Soundex category...

2011-07-06 Thread Scott Ribe
d it seems highly unlikely that someone would think they heard "place" when "face" was spoken to them. Personally, I use Metaphone to find similar strings, then modified Levenshtein to rank them. -- Scott Ribe scott_r...@

Re: getting last accessed date

2011-07-07 Thread Scott Ribe
On Jul 7, 2011, at 9:35 PM, Rick C. wrote: > But it's just giving me today's date. There must be something obvious... Are you sure the last access time is not today? There, how was that for obvious ;-) -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (

Re: getting last accessed date

2011-07-07 Thread Scott Ribe
On Jul 7, 2011, at 11:19 PM, Rick C. wrote: > One more note, seems in terminal "stat aFile" works so I suppose I could use > nstask to do this as well? It does seem odd that the two would produce different results... -- Scott Ribe scott_r...@elevated-dev.com http://www.elevat

Re: Why can't I do "new uint32_t[ size ]"

2011-07-12 Thread Scott Ribe
On Jul 12, 2011, at 12:58 PM, Mark Wagner wrote: > ...because the fragment you posted isn't valid C++: you can't execute > code (the call to "new") outside a function. Sure you can. That's C that only only lets you initialize variables at file scope with consta

Re: Memory management and returned values from methods...

2011-07-15 Thread Scott Ribe
ling events; all you're doing is adding one that will clean up sooner. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post a

Re: A question of memory management style

2011-07-18 Thread Scott Ribe
not be createHandlerWIthXXX, but handlerWithXXX. That might solve your problem. Or not--the analyzer may be looking deeper before getting confused. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Co

NSTask oddity with getting stdout

2011-07-24 Thread Scott Ribe
ionNotification object: curStdErr]; curStdErr = nil; } -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post ad

Re: NSTask oddity with getting stdout

2011-07-25 Thread Scott Ribe
was more similar to your suggestion, but loaded up with some unnecessary complications, and this race condition is a result of a simplification attempt which I did not get quite right. Thanks a lot. This was, IMO, not a trivial question ;-) -- Scott Ribe scott_r...@eleva

Re: Does anyone else dislike Xcode 4?

2011-07-25 Thread Scott Ribe
ous files. Neither. Some of us work on more complex projects than others. That said, it looks like 4.1/4.2 address my complaints quite well. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mai

Re: NSTask oddity with getting stdout

2011-07-25 Thread Scott Ribe
d, you're almost just spinning in a busy loop, getting a probably empty NSData, and calling readInBackgroundAndNotify again, as fast as the runloop can deliver the notifications. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice

Re: NSTask oddity with getting stdout

2011-07-26 Thread Scott Ribe
ion with zero-length data before the pipe was closed. Only a few dozen runs, but still, 0-length data always indicated pipe close. (I modified the command-line process with a couple of obnoxious pauses, before sending anything and before sending the final lines, so that if there's some tim

Re: NSTask oddity with getting stdout

2011-07-26 Thread Scott Ribe
pect that to go into a loop once a data of length 0 comes in, but not before. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: Return causes EXC_BAD_ACCESS

2011-07-28 Thread Scott Ribe
nd therefore should not be able to access memory that it doesn't own > unless the core os does so. No, not even close. It happens when you access a memory address that has not been mapped into your process' memory space. I've given you plenty of terms to google; go f

Re: Return causes EXC_BAD_ACCESS

2011-07-31 Thread Scott Ribe
e address space when it is called, but vfork works as he described. In neither case will modifications to memory by one process by visible by the other. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___

Re: Return causes EXC_BAD_ACCESS

2011-07-31 Thread Scott Ribe
On Jul 31, 2011, at 8:27 AM, Scott Ribe wrote: > No, fork copies the entire address space when it is called, but vfork works > as he described. In neither case will modifications to memory by one process > by visible by the other. Oh, hogwash. Of course copy-on-write is a common opt

Re: My try/catch block isn't catching exceptions on 10.6

2009-11-27 Thread Scott Ribe
If one thread reads imminentList while another is modifying it, you can crash. There are instants during the modification where it will be in an internally inconsistent state. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice

Re: memcpy with 64 bit

2009-12-14 Thread Scott Ribe
onfusing mess that is difficult to follow. Why all the casting back and forth between integers & pointers??? If you need to store an array of pointers, just do so; don't cast them to integers and then back again. -- Scott Ribe scott_r...@killerbytes.com http://www.killerb

Re: Smooth Scrolling for NSScrollView

2009-12-14 Thread Scott Ribe
scrolling, the text is a blur, and you must frequently stop scrolling in order to read a line and get re-oriented in the document. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa

Re: Warning about comparison between pointer and integer

2009-12-16 Thread Scott Ribe
> integerForKey Returns an integer, not a pointer. See the docs. If you want to check if the key exists, then objectForKey will return nil of the key is not found. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 vo

Re: 2D grayscale image from an array of floats

2009-12-17 Thread Scott Ribe
> Thanks, I'm trying that already. I don't need high performance right now, but > just out of curiosity, what would I use if I wanted ultra high performance? You would use the methods of NSBitmapImageRep that allow you to get/set the entire image buffer at once. -- Sc

Re: 2D grayscale image from an array of floats

2009-12-18 Thread Scott Ribe
already doing--then experiment with ways to avoid conversion and/or copying. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin r

Re: NSAlert or what?

2009-12-19 Thread Scott Ribe
s that you'd look for in NSWindow or NSWindowController are actually in NSApplication. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: NS_INLINE and obj = nil;?

2010-01-03 Thread Scott Ribe
> Easily fixed: > > #define GDRelease(x) [(x) release], (x) = nil, (void)0 Not really a good fix; compiler error is preferable to tweaking your macro to allow compilation of nonsense ;-) -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0

Re: Looking up a NSString constant at runtime

2010-01-04 Thread Scott Ribe
I think you're confused: the constant *is* the string; there is no lookup to perform. You can do anything with it that you would do with any other non-mutable string: log it, setStringValue on a text field in the user interface, setMessageText in an alert, and so on. -- Scott Ribe sc

Re: Looking up a NSString constant at runtime

2010-01-04 Thread Scott Ribe
your own lookup table, possibly using some macro magic to avoid having to type the name twice for each entry. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: Looking up a NSString constant at runtime

2010-01-04 Thread Scott Ribe
Ah yes, external symbols in a dynamic library--you do have some chance of looking them up at run time ;-) -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: Printing doc file using cocoa

2010-01-06 Thread Scott Ribe
r application. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ 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: if statement causing 32 Byte leak?

2010-01-10 Thread Scott Ribe
Also, an isAutoReleased message would be worthless. At any point in time, you have no idea how many times library routines that you've called might have retained/released/autoreleased, nor should you care. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Scott Ribe
lot of time when trying to > track down a spurious release! I just override retain, release, autorelease and set breakpoints on them to discover what's going on. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice __

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Scott Ribe
e a reference to an object when the object is being dealloc'd. At all other times of course, there may be references in autorelease pools which were correctly put there by library code after a retain. -- Scott Ribe scott_r...@killerbytes.com http://www.killer

Re: if statement causing 32 Byte leak?

2010-01-11 Thread Scott Ribe
> If I was going to ask Apple for help here, I'd ask for a debug API that uses > the Leaks engine to find things that still have pointers to my object at > dealloc time. Good idea. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303)

Re: if statement causing 32 Byte leak?

2010-01-11 Thread Scott Ribe
puts the break more or less closer to the bug than the current NSZombie stuff. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admi

Re: if statement causing 32 Byte leak?

2010-01-11 Thread Scott Ribe
se pools. However it has not often been my experience that the last release is my actual bug. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: Enabling NSZombieEnabled programatically

2010-01-11 Thread Scott Ribe
> ...but was never able to... So, would this work? static int zombiefoo = EnableZombies(); void EnableZombies() { NSZombieEnabled = ... } That would move it back to before main() is entered, though not necessarily before various Obj-C classes are loaded. -- Scott Ribe scot

Re: Enabling NSZombieEnabled programatically

2010-01-11 Thread Scott Ribe
Typed too fast, duh, it would obviously have to be: static int zombiefoo = EnableZombies(); int EnableZombies() { NSZombieEnabled = ... return 0; } -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice

Re: Custom sheet question - which variable?

2010-01-11 Thread Scott Ribe
You may want the [NSBundle loadNibNamed: @"MyCustomSheet" owner: self] call in effect made from within the init method of your NSWindowController subclass. In which case, you may want to use NSWindowController's initWithWindowNibName method. -- Scott Ribe scott_r...@kille

Re: Enabling NSZombieEnabled programatically

2010-01-11 Thread Scott Ribe
> This is not a valid initializer. Initializers must be constant expressions. Oops, my C++ is showing ;-) -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-

Re: Custom sheet question - which variable?

2010-01-11 Thread Scott Ribe
> In what AppDelegate method do I need to run that code? > applicationDidFinishLaunching? init? You don't need to do that before the window is needed; you can do it from the menu item, or from a method of the controller of the window on which the sheet will be shown. -- Scott R

Re: How to show progress indicator for background job

2010-01-19 Thread Scott Ribe
ce/Concept ual/AppleHIGuidelines/XHIGWindows/XHIGWindows.html#//apple_ref/doc/uid/2 961-SW6> I don't see anything about progress indicators though. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-d

Re: Global in NSApplication

2010-01-27 Thread Scott Ribe
ent it, if necessary, for a shared library perhaps, takes a bit more work. But if it's your own class, it might be good enough to just have a "don't do that" attitude, (or a check in Debug -init that throws an exception) ;-) -- Scott Ribe scott_r...@killerbytes.com http://w

Re: Global in NSApplication

2010-01-27 Thread Scott Ribe
for using a singleton pattern. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Re: Global in NSApplication

2010-01-27 Thread Scott Ribe
> Calling a singleton method from multiple threads does not make multiple > instances. The code you posted has a race condition, and can create multiple instances when called from different threads. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567

Re: Global in NSApplication

2010-01-27 Thread Scott Ribe
; take into account the intended use of the class and use simple means if they are appropriate. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: Uncaught exceptions not terminating my app

2010-01-28 Thread Scott Ribe
s new in Snow Leopard. At this point I have no idea whether that's true for all exceptions or just certain types, and whether or not it requires the developer tools to be installed. But perhaps something to check into: examine logs for exceptions thrown by your app... -- Scott Ribe scott

Re: updating NSView on separate thread

2010-02-01 Thread Scott Ribe
Do you really really have to lock the UI? Are you sure? -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: using a tableview delegate

2010-02-08 Thread Scott Ribe
> I learned two things - keep my code organized and documented, and remove > unused code. Also, in any new project, go ahead and turn on breaks on all exception throws--this often flags little screw ups before you even have a chance to notice that something's wrong ;-) -- Scott R

Re: Is a good practice to alloc an object and defer the initialization to another object?

2010-02-10 Thread Scott Ribe
> id obj; > if (.) > obj = [Class1 alloc]; > else > obj = [Class2 alloc]; > obj = [obj initWithFoo:.... bar:]; -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev maili

Re: What classes have -init?

2010-02-11 Thread Scott Ribe
> ...but it still would have been useful, sometimes > eliminating the need to override multiple initializers. Are you missing the point of the designated initializer? Or have you dealt with classes that did not have one, or did not use it properly? -- Scott Ribe scott_r...@killerbytes.co

Re: What classes have -init?

2010-02-11 Thread Scott Ribe
uld in no way > interfere with a designated initializer. I get your point now ;-) -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post a

Re: How a window was closed?

2010-03-03 Thread Scott Ribe
tton *b = [[self window] standardWindowButton: NSWindowCloseButton]; [b setAction: closeSel]; [b setTarget: closeTarget]; [[self window] performClose: sender]; [closeTarget autorelease]; It's generally an awful thing to do, but I had to debug some issues around window closi

Re: Message from view to viewController

2009-05-29 Thread Scott Ribe
need to learn the difference between declaration (.h) and implementation (.m). -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requ

Re: Message from view to viewController

2009-05-29 Thread Scott Ribe
ed at the identifiers several times. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Cont

Re: How to lock an object?

2009-06-05 Thread Scott Ribe
ur data and send it off to be displayed to the user, you've lost control over whether or not that data gets copied. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@li

Re: How to tell if a Panel is Open

2009-06-09 Thread Scott Ribe
Sounds like you're creating a new window controller when you create the sheet. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: [NSTask] -launch return

2009-06-09 Thread Scott Ribe
How are you attempting to monitor the child process? -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: [NSTask] -launch return

2009-06-10 Thread Scott Ribe
> err = GetProcessForPID( pid, &psn ); As others have pointed out, this depends on the process reaching a certain state, not just being launched. Perhaps use something like getpgid? -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-056

Re: Using non-id sender in IBAction methods

2009-06-10 Thread Scott Ribe
> I never thought of trying this before, but it seems that having a more > narrowly defined sender also limits the kind of controls IB lets you > connect *from*, at least in the Cocoa IB and presumably in the iPhone > IB as well. Likewise for IBOutlets... -- Scott

Re: program crashes because of a variable declaration

2009-06-11 Thread Scott Ribe
> Does anyone know how this could be? Yes, you are corrupting memory somewhere. Depending on the exact layout of objects (& ivars) in memory, this corruption may go unnoticed, or may cause a crash. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-056

Re: [NSTask] -launch return

2009-06-12 Thread Scott Ribe
not magically produce a 3rd option. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Re: How to tell if a Panel is Open [solved]

2009-06-12 Thread Scott Ribe
eed to carry around a state variable to remember when you've put up a sheet. But you still seem to have gotten 2 controllers instantiated on 1 window, and this is going to cause you other problems in the future. So you probably still need to figure out why your first technique was

Re: Load File Faster.

2009-06-29 Thread Scott Ribe
> How can I make the application load that 6,3MB property list file > faster? Don't abuse property lists; if you need a database, use a database. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___

Re: [IB] - how to delete action or outlet?

2009-07-18 Thread Scott Ribe
in. The action (or > outlet) still exists in the object properties list. > > I think the only way to remove it is to edit XIB file manually - not a > simple way, isn't it? Once you have removed from source files and saved, then in the inspector panel, on the connections tab, you ca

<    1   2   3   4   5   6   7   8   >