Re: Debugger Variable window

2010-04-16 Thread Tony Romano
yes, just a typo. Thanks On Apr 16, 2010, at 9:38 PM, Rob Ross wrote: > > On Apr 16, 2010, at 6:06 PM, Tony Romano wrote: > >>> MyObjectA >>> { >>> NSURL url; >>> } > > > Is this just a typo? Shouldn't you be writing: > > MyObjectA > { > NSURL *url; > } > > ? > > Rob >

Re: Debugger Variable window

2010-04-16 Thread Rob Ross
On Apr 16, 2010, at 6:06 PM, Tony Romano wrote: MyObjectA { NSURL url; } Is this just a typo? Shouldn't you be writing: MyObjectA { NSURL *url; } ? Rob ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post a

Re: Zeroing out instance variables

2010-04-16 Thread Wade Tregaskis
>> 3. bzero(individual + individualIvarsOffset, individualIvarsSize); > > This should cast "individual" to void* before doing the pointer arithmetic, > of course. And of course by "void*" you meant "uint8_t*". Pointer arithmetic is undefined on voids... it happens to be supported by gcc & cla

Re: Zeroing out instance variables

2010-04-16 Thread Graham Cox
On 17/04/2010, at 7:05 AM, Ben Haller wrote: > So, thoughts? Am I insane? Is the above scheme safe? Is there a better > way? Thanks for any feedback! > > (I think this question is appropriate for cocoa-dev rather than the > objc-language list, but my apologies if I have posted to the wron

Re: How to empty the Trash programmatically?

2010-04-16 Thread Graham Cox
On 17/04/2010, at 4:41 AM, Quincey Morris wrote: > We keep shooting ourselves in the foot on this list by not first asking > enough questions. Why should we though? If a poster can't muster the effort to sketch an outline of why they want to do a certain thing, it falls into the category of n

Fwd: Debugger Variable window

2010-04-16 Thread Tony Romano
Adding to Coco devs as well. Begin forwarded message: > From: Tony Romano > Date: April 16, 2010 4:50:10 PM PDT > To: Xcode Users > Subject: Debugger Variable window > > Today is spring cleaning and I've ignored this problem for too long :-) I've > searched many times and really have not fou

Re: Zeroing out instance variables

2010-04-16 Thread Paul Sanders
Another way might be to provide a method in each class or subclass called, say, zeroIVars and code it as (typed in mail): - (void) zeroIVars { static ThisClass *clean_instance_of_this_class; assert ([self isMemberOfClass: [ThisClass class]); if (clean_instance_of_this_class == nil)

Re: Zeroing out instance variables

2010-04-16 Thread Ben Haller
3. bzero(individual + individualIvarsOffset, individualIvarsSize); This should cast "individual" to void* before doing the pointer arithmetic, of course. So, thoughts? Am I insane? Is the above scheme safe? Is there a better way? Thanks for any feedback! I should note that the s

Zeroing out instance variables

2010-04-16 Thread Ben Haller
Hi all. I've got a situation where I need to reuse some Obj-C objects. Basically, I'm allocating and deallocating these very lightweight objects in staggering numbers, more or less continuously, for minutes to hours at a time, and so the performance overhead of the allocations really do

Re: HUD window widgets

2010-04-16 Thread Sean McBride
On Fri, 16 Apr 2010 22:43:23 +0200, vincent habchi said: >I'd like to add some widgets in a HUD window, like, for example, a small >pop-up button, with a non-white menu background, small non-black text, >etc. How can I achieve this? By subclassing NSPopUpButtonCell? Yes. Or take a look at this:

Re: HUD window widgets

2010-04-16 Thread Dave DeLong
I know of three frameworks that provide controls for use in HUD windows (in order of recommendation): BWToolkit - http://www.brandonwalkin.com/bwtoolkit/ BGHUDAppKit - http://www.binarymethod.com/bghudappkit/ HMBlkAppKit - http://shiira.jp/hmblkappkit/en.html Cheers, Dave On Apr 16, 2010, at 2

HUD window widgets

2010-04-16 Thread vincent habchi
Hi again, I'd like to add some widgets in a HUD window, like, for example, a small pop-up button, with a non-white menu background, small non-black text, etc. How can I achieve this? By subclassing NSPopUpButtonCell? Thanks, Vincent ___ Cocoa-dev m

Re: How to empty the Trash programmatically?

2010-04-16 Thread Paul Sanders
> As long as it is obvious that this empties the system-wide trash. After > all, Mail.app and other programs have their own trashes, and you > wouldn't want a user to think they're emptying a local trash and > suddenly delete a file they meant to recover. In case it wasn't obvious, my earlier "rm

Re: How to empty the Trash programmatically?

2010-04-16 Thread Uli Kusterer
On 16.04.10 11:29, Matt Gough wrote: To be fair though, if it is a user-initiated emptying and it is done via Finder, then I think it is fine to initiate a Trash emptying from another app. What isn't fine is for it to be done behind the user's back. As long as it is obvious that this empties

Re: MVC question about updating the Model

2010-04-16 Thread Kyle Sluder
On Fri, Apr 16, 2010 at 11:24 AM, Quincey Morris wrote: > I think that in this case, if the auto-updating can *safely and correctly* be > encapsulated within a single object, then it's preferable and simpler just to > do so. This is true, but it does depend on your definition of "safely and cor

Re: How to empty the Trash programmatically?

2010-04-16 Thread Quincey Morris
On Apr 16, 2010, at 11:03, Raffael Cavallaro wrote: > Again, someone who doesn't have an expert knowledge of the intended operation > of the Finder and an equally experienced knowledge of user expectations > shouldn't be doing this. In the [possibly] few moments that remain before this thread i

Re: MVC question about updating the Model

2010-04-16 Thread Quincey Morris
On Apr 16, 2010, at 11:00, Kyle Sluder wrote: > And this is when I become a fan of splitting the "model" layer into a > "model object" layer and a "model controller" layer. I think that in this case, if the auto-updating can *safely and correctly* be encapsulated within a single object, then it'

Re: How to empty the Trash programmatically?

2010-04-16 Thread Paul Sanders
> Please don't hardcode those paths. Use system APIs like > FindFolder > instead to locate the trash directory for a given volume. Well, OK, but you get the idea. Paul Sanders. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not p

Re: How to empty the Trash programmatically?

2010-04-16 Thread Jens Alfke
On Apr 16, 2010, at 10:43 AM, Paul Sanders wrote: rm -rf ~/.Trash/* For volumes other than the startup volume it is a little more complicated: rm -rf /Volumes/volume_name/.Trashes/uid/* Please don't hardcode those paths. Use system APIs like FindFolder instead to locate the trash direc

Re: How to empty the Trash programmatically?

2010-04-16 Thread Raffael Cavallaro
On Apr 16, 2010, at 1:43 PM, Paul Sanders wrote: > > But emptying the trash will delete files on *other mounted volumes* as > > well, not just the disk being examined. > > rm -rf ~/.Trash/* > > For volumes other than the startup volume it is a little more complicated: > > rm -rf /Volumes/vo

Re: MVC question about updating the Model

2010-04-16 Thread Kyle Sluder
On Fri, Apr 16, 2010 at 10:51 AM, Quincey Morris wrote: > For timed updates, you seem to have a choice of putting the timer in your > data model, or putting the timer in your window controller. One good way to > decide this is to ask yourself this question: And this is when I become a fan of sp

Re: MVC question about updating the Model

2010-04-16 Thread Quincey Morris
On Apr 16, 2010, at 06:30, Matt DeFoor wrote: > This is where I'm having difficulty determining what should be > standard practice. Would it be better to post a notification that > indicates the resource should update itself? Or is it good enough to > leave it as is? > > One other approach I've c

Re: How to find all clipping siblings for a view?

2010-04-16 Thread Kyle Sluder
On Fri, Apr 16, 2010 at 10:37 AM, Corbin Dunn wrote: > You can't control it in IB (short of removing the view and adding it back > in). But in code, you can just call -addSubview:positioned:relativeTo: to > move views around in the Z order. IB has Send Forward/Backward items on its Layout menu.

Re: How to find all clipping siblings for a view?

2010-04-16 Thread Paul Sanders
> Also, IB had (has?) a bug where it would unarchive views in the > reverse order from which they were stored in the nib. IB does allow > you to reorder subviews, so if you are still being bitten by this you > could build your interface and then reorder the views such that they > are backwards. The

Re: How to empty the Trash programmatically?

2010-04-16 Thread Paul Sanders
> But emptying the trash will delete files on *other mounted volumes* as well, > not just the disk being examined. rm -rf ~/.Trash/* For volumes other than the startup volume it is a little more complicated: rm -rf /Volumes/volume_name/.Trashes/uid/* The Finder seems to notice when you do this

Re: How to find all clipping siblings for a view?

2010-04-16 Thread Corbin Dunn
On Apr 16, 2010, at 8:38 AM, Joar Wingfors wrote: > > > On 15 apr 2010, at 13.06, Alexander Bokovikov wrote: > >> This is because my view uses QuickDraw to redraw itself, but those functions >> draw on screen directly (AFAIU) and don't take into account other views, >> located above current

Re: How to empty the Trash programmatically?

2010-04-16 Thread Jayson Adams
On Apr 16, 2010, at 9:46 AM, Kyle Sluder wrote: > On Fri, Apr 16, 2010 at 9:30 AM, Jayson Adams wrote: >> >> These kinds of preachy know-it-all rants are really tiresome, but >> unfortunately they happen a lot on this list. > > They happen a lot on this list because that kind of attention is

Re: How to empty the Trash programmatically?

2010-04-16 Thread Raffael Cavallaro
On Apr 16, 2010, at 12:30 PM, Jayson Adams wrote: > He couldn't possibly be asking because he wants to create a Finder/desktop > replacement app (like the Finder works so well we don't need one of those). Before replacing the Finder with a "superior" implementation one might want to be aware o

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Roland King
Nice try Kyle but that bug is still outstanding with apple as open and I maintain that the UITextField doesn't respond to the method it's sending its delegate and the hang in that case, if we're talking about the same case, is due to a different interaction. It may be that having self as delegat

Re: How to find all clipping siblings for a view?

2010-04-16 Thread Kyle Sluder
> It works OK with non layer-backed views in my experience, but you do get a > build warning if sibling views overlap in a nib.  Sibling views are drawn in > the order they appear in the parent's list of subviews (or possibly the > inverse order, I don't precisely recall).  The exact effect you

Re: How to empty the Trash programmatically?

2010-04-16 Thread Kyle Sluder
On Fri, Apr 16, 2010 at 9:30 AM, Jayson Adams wrote: > Hey all of you of limited vision standing on your soapboxes - give me a > break!  He couldn't possibly be asking because he wants to create a > Finder/desktop replacement app (like the Finder works so well we don't need > one of those).  Th

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Kyle Sluder
On Fri, Apr 16, 2010 at 9:25 AM, Jens Alfke wrote: > That’s true in general, but in this case he’s setting the parser’s delegate > to itself. Which is weird, but should mean that the object can’t possibly > outlive the delegate :) Well there's yer problem! :D The first step is not making an obje

Re: Does XCode 3.2 Documentation Browser Stink?

2010-04-16 Thread Chris Tracewell
Noted... I'll file the bug report but will spare the xcode-users subscribers the post as you answered my question. Thank you. --Chris On Apr 15, 2010, at 5:28 PM, Kyle Sluder wrote: > On Thu, Apr 15, 2010 at 4:48 PM, Chris Tracewell wrote: >> Okay, so now that I flew off the handle in this r

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Alexander Spohr
Am 16.04.2010 um 00:43 schrieb Dominic Dauer: > With the purpose to test these simple class I just did the following in the > controller class of one view: > > -(BOOL)textFieldShouldBeginEditing:(UITextField *)textField { > > XMLParser *parser = [[XMLParser alloc] initWithContentsOfURL:[

Re: How to empty the Trash programmatically?

2010-04-16 Thread Jayson Adams
On Apr 16, 2010, at 12:22 AM, Graham Cox wrote: > Don't. > > The only app that the user wants to empty the trash is Finder, not yours. If > they want it emptied (or emptied securely), they'll go to the Finder and use > the menu there. It's OK for your app to move stuff to the trash as long as

Re: How to empty the Trash programmatically?

2010-04-16 Thread Jens Alfke
On Apr 16, 2010, at 9:07 AM, Oleg Krupnov wrote: > No, Jens, your feeling is wrong. I'm developing an app for disk space > management, particularly for freeing up disk space. Actually you can > take a look: http://www.daisydiskapp.com. The new version of the app I > am developing will allow delet

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Jens Alfke
On Apr 16, 2010, at 8:53 AM, Kyle Sluder wrote: > Ross is probably right. You need to nil out weak references before releasing > things. Since you don't know if the NSXMLParser is going to live beyond your > releasing it, you don't know if it's going to later try messaging its > delegate. If t

Weird CG Error when closing window...

2010-04-16 Thread Jean-Nicolas Jolivet
Each time I close a window, I get the following error: : kCGErrorInvalidConnection: CGSGetSurfaceBounds: Invalid connection It shows up once or twice, usually twice... I have no idea what could be causing it, I tried setting a breakpoint at CGErrorBreakpoint as suggested but the stack trace was

Re: How to find all clipping siblings for a view?

2010-04-16 Thread Paul Sanders
> Historically Cocoa did not support overlapping sibling views at all, so there > was no concept of z-order > (other than a child view being in front of its parent.) There is some support > for it now, but I’m not > sure how extensive it is, e.g. whether it only applies to layer-backed views > o

Re: How to empty the Trash programmatically?

2010-04-16 Thread Oleg Krupnov
> The only app that the user wants to empty the trash is Finder, not yours. If > they want it emptied (or emptied securely), they'll go to the Finder and use > the menu there. It's OK for your app to move stuff to the trash as long as > it's clear to the user that will happen, but emptying it is

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Kyle Sluder
On Apr 16, 2010, at 2:58 AM, Dominic Dauer wrote: Ok. Sorry for that. I never worked with the debugger. Whenever I hear this from a programmer, I cringe. It's like hearing a carpenter say, "I've never used a screwdriver." After I entered bt or backtrace I got the following message: P

Re: How to find all clipping siblings for a view?

2010-04-16 Thread Joar Wingfors
On 15 apr 2010, at 13.06, Alexander Bokovikov wrote: > This is because my view uses QuickDraw to redraw itself, but those functions > draw on screen directly (AFAIU) and don't take into account other views, > located above current view. > > Could anybody show the right way to go? The right

MKMapView crashes if released to early / in the wrong moment

2010-04-16 Thread Alexander Spohr
Hi list. MKMapView is crashing on 3.x if you release it too early, when any of its animations are still in progress. (rdar://7408284) I had crashes in #1 0x32d209c0 in -[MKDotBounceAnimation animationDidStop:finished:] () #1 0x0226f34e in typeinfo name for MKTileRequester () #1 0x314b986a in

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Jens Alfke
On Apr 16, 2010, at 2:58 AM, Dominic Dauer wrote: > After I entered bt or backtrace I got the following message: > > Program received signal: “EXC_BAD_ACCESS”. > #0 0x93e0bedb in objc_msgSend () > #1 0x in ?? () > > This is all. OK, that means the stack got corrupted before the cra

Re: How to empty the Trash programmatically?

2010-04-16 Thread Jens Alfke
On Apr 15, 2010, at 11:45 PM, Oleg Krupnov wrote: > But the progress-bar window will still pop up… Every once in a while a question on cocoa-dev gives me the uncomfortable feeling that someone is trying to get help in writing a piece of malware. This is one of them. No offense if that’s not yo

Re: How to find all clipping siblings for a view?

2010-04-16 Thread Jens Alfke
On Apr 16, 2010, at 3:16 AM, Alexander Bokovikov wrote: > Thanks, it looks like I've found it. The only question is why Cocoa has no > Z-order term? Historically Cocoa did not support overlapping sibling views at all, so there was no concept of z-order (other than a child view being in front o

Problem with setting dylib paths to ship them in my app bundle

2010-04-16 Thread Parimal Das
Hello I am using a third-party library, which has 2 dylibs in it. Say, libABC.dylib and libXYZ.dylib On doing a $ otool -L libABC.dylib libABC.dylib: libABC.dylib (compatibility version 1.0.0, current version 1.0.0) libXYZ.dylib (compatibility version 0.0.0, current version 0.0.0) /us

Re: How to empty the Trash programmatically?

2010-04-16 Thread Raffael Cavallaro
On Apr 16, 2010, at 4:46 AM, Jeremy Pereira wrote: > +1 to that. Any application that emptied my Trash programmatically would > find itself being the first new item in there. ditto. The whole reason the trash exists is so users do not accidentally lose data. It gives them the opportunity to

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Ross Carter
On Apr 16, 2010, at 5:58 AM, Dominic Dauer wrote: > Ok. Sorry for that. I never worked with the debugger. > After I entered bt or backtrace I got the following message: > > Program received signal: “EXC_BAD_ACCESS”. > #0 0x93e0bedb in objc_msgSend () > #1 0x in ?? () > Just a wild g

Re: MVC question about updating the Model

2010-04-16 Thread Graham Cox
On 16/04/2010, at 11:30 PM, Matt DeFoor wrote: > One other approach I've considered is whether the Model should have > the ability to update itself at all. Should the controller be > responsible for updating the resource always? No, because if another controller is able to affect the model, the

Re: MVC question about updating the Model

2010-04-16 Thread Joanna Carter
Hi Matt > I have multiple resource objects that are represented in an > NSOutlineView. These resource objects can be updated by their own > triggered timer or potentially on demand by the user via the View (a > button is clicked in the UI). > > At first, I thought that the resource object should

MVC question about updating the Model

2010-04-16 Thread Matt DeFoor
I'm having a problem deciding on how a Model object should be updated. I have multiple resource objects that are represented in an NSOutlineView. These resource objects can be updated by their own triggered timer or potentially on demand by the user via the View (a button is clicked in the UI). A

Re: How to empty the Trash programmatically?

2010-04-16 Thread Jeremy Pereira
On 16 Apr 2010, at 10:29, Matt Gough wrote: > > On 16 Apr 2010, at 09:46:27, Jeremy Pereira wrote: > >> On 16 Apr 2010, at 08:22, Graham Cox wrote: >> >>> Don't. >>> >>> The only app that the user wants to empty the trash is Finder, not yours. >>> If they want it emptied (or emptied securely

Re: How to find all clipping siblings for a view?

2010-04-16 Thread Alexander Bokovikov
On Friday, April 16, 2010 at 2:40 PM Norbert M. Doerner wrote: NSView *rootView; NSArray *mySubViews rootView = [theWindow contentView]; mySubViews = [rootView subviews]; Thanks, it looks like I've found it. The only question is why Cocoa has no Z-order term? I've read in the doc that it is i

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Dominic Dauer
Ok. Sorry for that. I never worked with the debugger. After I entered bt or backtrace I got the following message: Program received signal: “EXC_BAD_ACCESS”. #0 0x93e0bedb in objc_msgSend () #1 0x in ?? () This is all. Dominic ___ Cocoa-

Re: How to empty the Trash programmatically?

2010-04-16 Thread Matt Gough
On 16 Apr 2010, at 09:46:27, Jeremy Pereira wrote: > On 16 Apr 2010, at 08:22, Graham Cox wrote: > >> Don't. >> >> The only app that the user wants to empty the trash is Finder, not yours. If >> they want it emptied (or emptied securely), they'll go to the Finder and use >> the menu there. It

Re: How to empty the Trash programmatically?

2010-04-16 Thread Jeremy Pereira
On 16 Apr 2010, at 08:22, Graham Cox wrote: > Don't. > > The only app that the user wants to empty the trash is Finder, not yours. If > they want it emptied (or emptied securely), they'll go to the Finder and use > the menu there. It's OK for your app to move stuff to the trash as long as > i

Re: How to find all clipping siblings for a view?

2010-04-16 Thread Norbert M. Doerner
For some reason I need to do a job which NSWindow usually does, when it redraws itself (AFAIU) - I need to find all its views, which have z- order higher than my view, then get their bounding rectangles, unite them, subtract from the window content view bounding rectangle and sect the result w

Re: How to empty the Trash programmatically?

2010-04-16 Thread Graham Cox
Don't. The only app that the user wants to empty the trash is Finder, not yours. If they want it emptied (or emptied securely), they'll go to the Finder and use the menu there. It's OK for your app to move stuff to the trash as long as it's clear to the user that will happen, but emptying it is

Re: How to empty the Trash programmatically?

2010-04-16 Thread Dave Keck
Forgive me for posting before reading all of your original message - having done so I see my response doesn't help much. Sorry for the noise. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: How to empty the Trash programmatically?

2010-04-16 Thread Dave Keck
> But the progress-bar window will still pop up... I would consider that a part of the high-level concept of "emptying the trash." NSFileManager is probably what you're looking for, in combination with the mentioned AppleScript to update the trash icon: http://pastie.org/922743 Needs error-c