Re: Code Signing

2009-09-06 Thread Chris Suter
Hi Peter, On Sun, Sep 6, 2009 at 9:00 PM, Peter Hudson wrote: > I notice that when I sign code ( the whole app )  I  land up with 2 > additional items in my /Contents directory in the app bundle. > These items are a folder called _CodeSignature  and an alias called > CodeResources. > > If I delete

Re: "Leaks" utility

2009-06-12 Thread Chris Suter
Hi Ryan, On Fri, Jun 12, 2009 at 9:29 PM, Ryan Joseph wrote: > I wasn't sure where to post this but Cocoa programmers should know as well > as any one else I thought. > > I have just learned about the "leaks" unix utility for detecting memory > leaks but I'm not unix savvy enough to understand a p

Re: Approaches for this Matching Problem?

2009-06-22 Thread Chris Suter
Hi Steve, On Mon, Jun 22, 2009 at 6:10 PM, Steve Cronin wrote: > But what is the right solution?? For finding word boundaries, I think you're supposed to use NSAttributedString's nextWordFromIndex:forward: and doubleClickAtIndex: methods. Bear in mind that some languages don't really have the co

Re: How to fill rectangle under vertical scroller?

2009-06-22 Thread Chris Suter
Hi Quincey, On Mon, Jun 22, 2009 at 2:33 PM, Quincey Morris wrote: > FWIW, the small "gotcha" in the sample code you linked to (AFAICT, since I > never tried it) is that it places the "placard" in the area normally > occupied by a scroll bar. The corner rect that the OP wants to draw is > slightl

Re: Approaches for this Matching Problem?

2009-06-22 Thread Chris Suter
Hi Gerriet, On Mon, Jun 22, 2009 at 10:46 PM, Gerriet M. Denkmann wrote: >> Bear in mind that some languages don't really have the concept of words. > > Could you please elaborate? Maybe some examples? I'm afraid I'm not an expert. I just remember hearing it said at WWDC (so bear in mind, it's s

Re: Detecting that a process has ended?

2009-06-27 Thread Chris Suter
Hi Rick, On Sat, Jun 27, 2009 at 7:22 PM, Ken Thomases wrote: > On Jun 27, 2009, at 4:11 AM, Rick Mann wrote: > >> I'm starting a process via NSTask and launchctl. I can use launchctl list >> to get the process' PID. Is there a way i can get notified if the process >> exits (or dies) without polli

Re: Detecting that a process has ended?

2009-06-27 Thread Chris Suter
Hi Rick, On 27/06/2009, at 7:29 PM, Rick Mann wrote: I think it'll work very well. It's not a GUI process (although most of the techniques in the TN support only processes in the current context). In this case, the kqueues will do just fine. Ah, sorry, I missed that one. Still, i

Re: iTunes 10 UI

2010-09-02 Thread Chris Suter
Hi, On Thu, Sep 2, 2010 at 5:07 PM, Iceberg-Dev wrote: It's not easy. > > 1. If you retrieve a NSButton with the official API, you will not be able > to get the mouse over effect. This is a bug since Mac OS X 10.4 and it has > still not been fixed in Mac OS X. > > 2. The NSButton Apple uses for

Re: Recursive blocks

2011-01-27 Thread Chris Suter
Hi Bill, On Fri, Jan 28, 2011 at 4:51 AM, Bill Bumgarner wrote: > You have measured a situation where the pattern's marginal slowness actually > matters? No, of course not; I don't have a real world use case for it and, I suspect, neither does anyone else. > A Block_copy() is going to often be

Re: Recursive blocks

2011-01-29 Thread Chris Suter
Hi Glen, On Fri, Jan 28, 2011 at 7:03 PM, Glen Low wrote: [snip] > The recursive block allows me to hide the recursion within a method, also to > avoid having to return more than 1 type (BOOL + GKGraph*) from the recursion > i.e. avoiding the ugly GKGraph** smallestCluster parameter. > > On the o

Re: Setting NSObjectController's to file's owner

2008-05-15 Thread Chris Suter
On 15/05/2008, at 5:21 PM, André Pang wrote: I have a nib file containing an NSObjectController. The NSObjectController's content is set to the File's Owner proxy object, and this creates a retain cycle. (The file's owner never gets deallocated because the object controller retains it, a

Re: Issue with displaying URI prefixes on child elements using NSXML

2008-06-11 Thread Chris Suter
On 11/06/2008, at 3:19 PM, Lawrence Johnston wrote: Hey everybody, I've got an issue that I can't figure out. If I'm using this code: NSString *XMLForDisplay { NSXMLElement *root = [NSXMLNode elementWithName:@"root"]; [root addNamespace:[NSXMLNode namespaceWithName:@"a" stringValue:@"http://

Re: argument checks

2008-06-12 Thread Chris Suter
On 12/06/2008, at 4:51 PM, Graham Cox wrote: NSNumber* myNum = nil; /* stuff */ NSAssert( myNum != nil, @"some error message"); [myClass calc:myNum]; Messages to nil are safe - it will treat your number as having a value of 0. Thus as long as you initialise it to nil, your code will

Re: argument checks

2008-06-12 Thread Chris Suter
On 12/06/2008, at 5:29 PM, Graham Cox wrote: On 12 Jun 2008, at 5:03 pm, Chris Suter wrote: In the original example, myNum was being passed as a argument rather than having a message to sent to it and it’s often not safe to pass nil objects as arguments. Hmmm... well, what'

Re: argument checks

2008-06-15 Thread Chris Suter
On 12/06/2008, at 10:01 PM, Graham Cox wrote: But maybe the original point is getting lost? You asserted (pardon the pun) that passing a nil argument was never acceptable My exact words were: “it’s often not safe to pass nil objects as arguments” and I stand by that. I raised the point bec

Re: looking for a crc code

2008-06-15 Thread Chris Suter
On 15/06/2008, at 3:49 AM, Michael Hall wrote: On Jun 14, 2008, at 10:25 AM, Jens Alfke wrote: On 14 Jun '08, at 4:59 AM, Ilan Volow wrote: No mention at all I can find (in the 20 seconds I scanned the first two result pages) of any cocoa CRC implementations. If a newbie were to do a sea

Re: Issue with displaying URI prefixes on child elements using NSXML

2008-06-15 Thread Chris Suter
On 12/06/2008, at 6:54 PM, Nathan Kinsinger wrote: I'm curious about what using elementWithName:URI: is supposed to do when you don't pass a qualified name in, or rather, why have it at all? The URI seems to be redundant if you are already passing the qualified name in. Just as a test (f

Re: getting accurate file modification time?

2008-06-17 Thread Chris Suter
On 18/06/2008, at 1:04 PM, Angelo Chen wrote: Hi, I use the code at end to get modification timestamp of a file including seconds, it works well until I encounter following: I have a file that is in the Document folder, the creation and modification date are both:2008-05-04 22:06:46 +080

Re: Thread safe reference counting

2008-06-29 Thread Chris Suter
On 30/06/2008, at 9:06 AM, atebits wrote: Perhaps I'm blind, but after pouring over every scrap of information I could find, I could not find the answer to this question. Are -retain and -release thread-safe? (Perhaps as atomic increments/ decrements internally?) Yes, -retain and -release

Re: Cocoa says not KVC compliant

2008-07-02 Thread Chris Suter
On 03/07/2008, at 3:13 AM, Milen Dzhumerov wrote: [snip] Any hints on why the class is not KVC-compliant? I've read the docs and it seems to satisfy the bullet points listed (moreover it's even declared as @property so the naming of the setters / getters should be alright). Pointers that

Re: Calculating accurate bounds of stroked paths

2008-07-08 Thread Chris Suter
Hi Graham, On 08/07/2008, at 10:16 PM, Graham Cox wrote: A close second best would be a rect that was the worst case bounds for a given stroke width (it wouldn't need to know the actual path, just its basic bounds), which thus assumed that all angles were acute enough to trigger the mitre

Re: Calculating accurate bounds of stroked paths [SOLVED]

2008-07-09 Thread Chris Suter
Hi Graham, On 09/07/2008, at 4:37 PM, Graham Cox wrote: On 9 Jul 2008, at 4:02 pm, Chris Suter wrote: so you can get a worst case bounds by ignoring the mitre limit. No you can't. If the stroke width is 'w' then you can outset the bounds by w/2 to enclose the path for str

Re: KVO: Observing an aggregate property of a collection?

2008-07-10 Thread Chris Suter
On 11/07/2008, at 7:46 AM, Jens Alfke wrote: How do I set up key-value observing of an aggregate property over an array, like a sum? Say I have a Bulb class with a boolean "lit" property. I have an NSArrayController with an array of Bulbs, being shown in a table view. To compute the numb

Re: Such a newbie question that I'm embarrassed to ask it :-)

2008-07-10 Thread Chris Suter
On 11/07/2008, at 12:36 PM, Dale Jensen wrote: I have the need to modify a menu item title, so I: a) Added a tag to the menu item in IB (selected the menu item, then went to the first "tab" of the Inspector, and added a number in the "Tag" field. I tried both 99 and 1). b) Added this cod

Re: NSArray problems

2008-07-27 Thread Chris Suter
On 28/07/2008, at 12:52 PM, Daniel Richman wrote: [snip] So I'm befuddled. Any ideas? Sorry for the long post. I'd say you've either got a memory management issue, e.g. you're forgetting to retain numbers (are you using garbage collection?), or the debugger is getting confused and printin

Re: NSArray problems

2008-07-27 Thread Chris Suter
On 28/07/2008, at 1:06 PM, Daniel Richman wrote: I'd say you've either got a memory management issue, e.g. you're forgetting to retain numbers (are you using garbage collection?), or the debugger is getting confused and printing something else. That was it! I had forgotten to retain numb

Re: NSDocument and window ivar

2008-07-27 Thread Chris Suter
On 28/07/2008, at 12:26 PM, Todd Heberlein wrote: But I cannot pass messages to the window variable. For example, I cannot send it the "setTitle:" message. If you're looking at changing the document title for a document you should look at overriding NSWindowController's windowTitleForDoc

Re: Setting conditional breakpoint on Cocoa method?

2008-07-28 Thread Chris Suter
Hi Graham, On Mon, Jul 28, 2008 at 5:02 PM, Graham Cox <[EMAIL PROTECTED]> wrote: > Once in a blue moon, I get a console message that a nil string was passed > to [NSConcreteAttributedString initWithString:] I'd like to find out where > this is coming from by setting a breakpoint there, but only

Re: Distributed Objects "connection went invalid while waiting for a reply"

2008-07-28 Thread Chris Suter
Hi Hamish, On Tue, Jul 29, 2008 at 7:35 AM, Hamish Allan <[EMAIL PROTECTED]> wrote: > For anyone searching the archives for "connection went invalid while > waiting for a reply": > > I never found out why this message was appearing, but I found a workaround. > > Instead of calling [client callbac

Re: Checking for hackintosh

2008-07-30 Thread Chris Suter
On Thu, Jul 31, 2008 at 12:00 PM, Michael Ash <[EMAIL PROTECTED]> wrote: > On Tue, Jul 29, 2008 at 10:22 PM, John Joyce > <[EMAIL PROTECTED]> wrote: > > Does anybody have a means or a tool for checking for hackintoshes? > > I really don't approve of such things and would like to leave clever > > m

Re: Checking for hackintosh

2008-07-30 Thread Chris Suter
On Thu, Jul 31, 2008 at 1:00 PM, Matt Burnett <[EMAIL PROTECTED]>wrote: > Then shouldn't you be able to determine if they are using a hackintosh by > the descriptions of support requests they are submitting? Sure, if customers are willing to disclose that they're running on a Hackintosh which is

Re: Distributed Objects "connection went invalid while waiting for a reply"

2008-07-31 Thread Chris Suter
Hi Hamish, On Thu, Jul 31, 2008 at 10:16 PM, Hamish Allan <[EMAIL PROTECTED]> wrote: > On Tue, Jul 29, 2008 at 3:33 AM, Chris Suter <[EMAIL PROTECTED]> wrote: > > > It sounds to me like you've got some kind of timing issue and that the > delay > > that y

Re: How to tell whether an executable supports GC?

2008-08-07 Thread Chris Suter
On Fri, Aug 8, 2008 at 2:48 PM, André Pang <[EMAIL PROTECTED]> wrote: > Hi all, is there a reasonably easy way to programmatically determine > whether a particular executable on-disk supports garbage collection? Cocoa > methods aren't necessary; all C functions are welcome. Poking around in an >

Re: simple string to NSData question

2008-08-07 Thread Chris Suter
On Fri, Aug 8, 2008 at 3:49 PM, Ken Thomases <[EMAIL PROTECTED]> wrote: > On Aug 7, 2008, at 2:15 PM, phil swenson wrote: > > I'm trying to parse an xml file, so to get started I put the xml in a >> String: >> >> NSString *xml = @"> >> encoding=\"UTF-8\"?>LarryFurg"; >> >> >> Now I need to move t

Re: Disc write speed options

2008-08-13 Thread Chris Suter
On Wed, Aug 13, 2008 at 1:04 AM, Matthew Mashyna <[EMAIL PROTECTED]> wrote: > I'm trying to figure out how I can ask a DRDevice what burn speeds it's > capable of so I can offer a choice to the user. When I call the status and > info messages I don't see anything that looks useful. How can I get a

Re: how to delete the current user's directory?

2008-09-01 Thread Chris Suter
Hi Chris, On Tue, Sep 2, 2008 at 11:00 AM, Chris Hanson <[EMAIL PROTECTED]> wrote: > On Sep 1, 2008, at 3:46 AM, XiaoGang Li wrote: > >> hi, list, I have an uninstaller application , which is used to delete >> the files installed; and also i have a file which located in the current >> user's d

Re: NSTableView/NSOutlineView variable row height

2008-09-02 Thread Chris Suter
Hi Kevin, On Tue, Sep 2, 2008 at 3:58 AM, Kevin Meaney <[EMAIL PROTECTED]> wrote: I feel like I am missing something that should be obvious. Pointers would be > helpful or a suggestion for something else to try. Here's some code I wrote a while back that we use. It works back to 10.3.7 (possibl

Re: How to create a GUID?

2008-09-08 Thread Chris Suter
On Mon, Sep 8, 2008 at 8:28 PM, I. Savant <[EMAIL PROTECTED]> wrote: > On Sep 7, 2008, at 10:44 PM, Adam R. Maxwell wrote: > > In addition to all the CFUUID solutions, there's also [[NSProcessInfo >> processInfo] globallyUniqueString]; a one-liner, but not thread safe. >> > > This, according to

Re: How to determine if the system is started up from firewire disk

2008-09-09 Thread Chris Suter
On Wed, Sep 10, 2008 at 10:10 AM, Ryota Tsukiashi <[EMAIL PROTECTED]>wrote: > I am writing a cocoa application for our firweire device. I need to > know if the system is started up from firewire disk. For PowerPC with > Mac OSX 10.4/10.5, I have used information from "nvram boot-device". > For Int

Fwd: Memory cleanup when init fails?

2008-09-23 Thread Chris Suter
On Wed, Sep 24, 2008 at 5:05 AM, j o a r <[EMAIL PROTECTED]> wrote: > > On Sep 23, 2008, at 10:39 AM, Greg Parker wrote: > >> You should first clean up anything you already did in your -init, then >> call [super dealloc]. [self dealloc] or [self release] are bad because they >> might call some subc

Re: sending email with attachement from cocoa

2008-09-26 Thread Chris Suter
On Sat, Sep 27, 2008 at 4:11 AM, has <[EMAIL PROTECTED]> wrote: > Alexander Cohen wrote: > >> Is there a way to use a url request to open mail with all its fields >> completed but most importantly, contain an image attachement? > > > Nope. If you want to send an email in the background, you'll need

Re: Panel in framework

2008-03-04 Thread Chris Suter
On 05/03/2008, at 1:59 PM, Kyle Sluder wrote: On Tue, Mar 4, 2008 at 9:49 PM, Brad Peterson <[EMAIL PROTECTED]> wrote: That is, I want to display the panel modally, but the panel only exists as part of a framework I'm using in my app. Methinks you don't quite understand what frameworks are

Re: KVO autonotifying complaining about custom setter return value

2008-03-04 Thread Chris Suter
On 05/03/2008, at 2:10 PM, Kyle Sluder wrote: On Tue, Mar 4, 2008 at 11:49 AM, Jim Turner <[EMAIL PROTECTED]> wrote: In attempting to use a custom setter for a object, I'm getting the following message in the console the first time that object is instantiated: KVO autonotifying only supports

Re: KVO autonotifying complaining about custom setter return value

2008-03-05 Thread Chris Suter
On 06/03/2008, at 10:10 AM, Jim Turner wrote: Ok first, mmalc, thank you for taking the time to point out exactly what I needed to see to understand where I was going wrong. My problem stemmed from the misguided idea that properties were required for KVC/KVO. Chris' comment about "using non-d

Re: Deferring a selector until later, but before painting

2008-03-05 Thread Chris Suter
On 06/03/2008, at 12:12 PM, John Stiles wrote: There are many times in my code where I want to defer a selector's execution until the next time the event loop runs, which is a perfect match for -performSelector:withObject:afterDelay:, passing a delay of 0.0. However, this executes after th

Re: Launch Daemon Best Practices?

2008-03-11 Thread Chris Suter
On 12/03/2008, at 10:16 AM, Karl Moskowski wrote: Why not do it the other way round? Update settings via distributed objects, and have the daemon write them to /Library/Preferences. Good idea. Thanks, Hamish. I'm not so sure it's a good idea. The problem is that it relies on your daemon r

Re: Launch Daemon Best Practices?

2008-03-11 Thread Chris Suter
On 12/03/2008, at 12:39 PM, Karl Moskowski wrote: Why would that location be wrong? If your preferences aren't user specific, I don't think they should be there. You also shouldn't be running your daemon as root unless you absolutely have to. After Hamish's original response, I thought

Re: Convenience initializer not working: "unrecognized selector"

2008-03-12 Thread Chris Suter
On 13/03/2008, at 2:25 PM, K. Darcy Otto wrote: But if I do this, I get the unrecognized selector error: Fraction *frac1 = [Fraction initWith:2 over:2]; Try [[Fraction alloc] initWith:2 over:2] - Chris ___ Cocoa-dev mailing list (Cocoa-dev@lists

Re: Strange retainCount from NSTimer

2008-03-13 Thread Chris Suter
On 14/03/2008, at 12:37 PM, Brian Greenstone wrote: But that shouldn't be, right? Shouldn't the retainCount of theTimer be 1 after scheduledTimerWithTimeInterval? Then shouldn't it be bumped up to 2 after adding the timer to the Run Loop? It appears that the retain count is starting at

Re: Where's the buffer overrun?

2008-03-19 Thread Chris Suter
On 20/03/2008, at 10:38 AM, Nick Zitzmann wrote: char **returnArray = NSZoneMalloc([self zone], length); should be: char **returnArray = NSZoneMalloc([self zone], length * sizeof (char *)); - Chris ___ Cocoa-dev mailing list (Cocoa-

Re: Where's the buffer overrun?

2008-03-19 Thread Chris Suter
On 20/03/2008, at 11:00 AM, Andrew Farmer wrote: On 19 Mar 08, at 16:50, Chris Suter wrote: On 20/03/2008, at 10:38 AM, Nick Zitzmann wrote: char **returnArray = NSZoneMalloc([self zone], length); should be: char **returnArray = NSZoneMalloc([self zone], length * sizeof (char

Re: Where's the buffer overrun?

2008-03-19 Thread Chris Suter
On 20/03/2008, at 12:31 PM, Nick Zitzmann wrote: On Mar 19, 2008, at 6:49 PM, Hamish Allan wrote: I, for one, am surprised that NSMutableData works this way, given that a) the method name specifically requests that no copy is made, and b) there's no particular reason for it to behave that w

Re: Best practice for overridden initializers in subclasses

2008-03-25 Thread Chris Suter
On 26/03/2008, at 11:09 AM, Quincey Morris wrote: Unless there is some special runtime magic going on, this seems not absolutely safe. Your '[self release]' is going to eventually lead to a call of '[super dealloc]' and theoretically you can't safely call the superclass's dealloc if you ha

Re: Getting a list of all classes, etc...

2008-03-27 Thread Chris Suter
On 27/03/2008, at 4:59 PM, Graham Cox wrote: This worked well (after a little tweaking!) thanks - got the whole caboodle running now. I note that NSObject's superclass is NULL, so I had to switch the order of the while() test in order to correctly detect plain NSObjects (admittedly this wi

Re: Getting a list of all classes, etc...

2008-03-27 Thread Chris Suter
On 28/03/2008, at 3:23 AM, Ken Thomases wrote: On Mar 26, 2008, at 11:43 PM, Graham Cox wrote: I have a class that can contain different objects which all derive from a class R. The container can accept instances of any subclass of R. Each subclass of R implements a CLASS method for a par

Re: Cocoa GUI app invocation from CLI with arguments

2008-03-31 Thread Chris Suter
On 01/04/2008, at 9:40 AM, Mac QA wrote: On 3/31/08, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: You can get cli arguments at anytime using NSProcessInfo. - [[NSProcessInfo processInfo] arguments]; Awesome! This looks to be a much better method than parsing argv inside main before calling

Re: NSAssert and Unused Variable

2008-04-02 Thread Chris Suter
On 03/04/2008, at 11:30 AM, Jens Alfke wrote: I seem to recall a pragma or macro that can be used to tell the compiler "I know this variable is unused, don't complain about it", though I don't remember the details... Apple gcc only: #pragma unused (var) or _Pragma("unused(var)") The im

Re: Autorelease question

2008-04-03 Thread Chris Suter
On 04/04/2008, at 11:47 AM, Jens Alfke wrote: It's true that the very outermost pool on the main thread is created in main(); I don't think that's normally the case. For a Cocoa application created by the Xcode template, it won't create an autorelease pool for you. Obviously, there won't

Re: Autorelease question

2008-04-03 Thread Chris Suter
On 04/04/2008, at 12:45 PM, Dmitry Markman wrote: thanks a lot for the answer, Jens but that how my problem began :-) from creating my own NSAutoreleasePool here is my code [snip] You're releasing things you shouldn't be. Take some time to read the memory management documentation. - Chr

Re: Autorelease question

2008-04-03 Thread Chris Suter
On 04/04/2008, at 1:25 PM, Dmitry Markman wrote: how can you explain that NSString *nsFontName = [NSString stringWithCString:fontName encoding:NSMacOSRomanStringEncoding]; can be released, but NSString *textString = [NSString stringWithCString:"Hello From Cocoa" encoding:NS

Re: How to create process independent of current process AND that takes command line arguments?

2008-04-03 Thread Chris Suter
On 04/04/2008, at 3:50 PM, Chris Markle wrote: Preferably using Cocoa stuff, how can I create a separate process that is independent of my current process (that is I don't want the process to be a child of my current process) AND that can take command line arguments. I looked at NSTask and NSWo

Re: How to create process independent of current process AND that takes command line arguments?

2008-04-03 Thread Chris Suter
On 04/04/2008, at 4:01 PM, Jens Alfke wrote: On 3 Apr '08, at 9:50 PM, Chris Markle wrote: Preferably using Cocoa stuff, how can I create a separate process that is independent of my current process (that is I don't want the process to be a child of my current process) AND that can take

Re: How to create process independent of current process AND that takes command line arguments?

2008-04-03 Thread Chris Suter
On 04/04/2008, at 5:24 PM, Chris Markle wrote: Chris S., Why do you not want it to be a child? The reason I ask is that if your requirement is that the spawned process isn't terminated when the parent dies, then NSTask will suffice. Whilst processes it spawns are children, they're in a d

Re: Objective-C Instance Variable Names

2008-04-06 Thread Chris Suter
On 07/04/2008, at 9:39 AM, John Stiles wrote: You can't be KVC compliant if you use prefixes like m_, so this limits your potential for using things like bindings. I think you can be KVC compliant but you have to define setters and getters for everything. - Chris _

Re: NSTreeController KVO

2008-04-06 Thread Chris Suter
On 07/04/2008, at 10:30 AM, Hamish Allan wrote: Hi, I have an NSOutlineView bound to an NSTreeController, in turn bound to an NSMutableArray whose contents are: [snip] Have you seen this:

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

2008-04-09 Thread Chris Suter
On 10/04/2008, at 5:05 AM, Herb Petschauer wrote: And note that only a GUID partition table scheme will yield partitions with a UUID. The old style Apple Partition Map will not (so any legacy or even current PPC machines). No this is incorrect. Volumes have a UUID of their own and is diffe

Re: Tips to deploy applications to multiple Mac OS X versions

2008-04-10 Thread Chris Suter
One caveat, though, is that you should probably have a runtime check for the minimum OS version you expect so that you don't end up with a crash if someone tries to use your nifty Leopard features on Tiger. Adding something to main() would probably be easiest, either checking against NSAppK

Re: How to fetch remote file?

2008-04-15 Thread Chris Suter
On 15/04/2008, at 8:12 PM, Mike Abdullah wrote: NSURLDownload would be the one. Or you can just use +[NSData dataWithContentsOfURL:]. - Chris smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.ap

Re: Weird build error

2008-04-17 Thread Chris Suter
On 18/04/2008, at 9:15 AM, Michael Vannorsdel wrote: Change it to: - (void)TestFunction { switch (1) { case 1: { NSMutableArray *myArray=[[NSMutableArray alloc] init]; break;

Re: Weird build error

2008-04-17 Thread Chris Suter
On 18/04/2008, at 9:54 AM, Kyle Sluder wrote: GCC is alerting you to the fact that the switch at the end of the statement is unnecessary. That's not what GCC is trying to do; GCC is trying to alert you to the fact that it's invalid syntax. As I just said in my earlier e-mail, labels must

Re: "Safe" frameworks for privileged tools?

2008-04-23 Thread Chris Suter
On 24/04/2008, at 4:35 AM, Michael Watson wrote: Yes, it's a helper tool. It runs for a couple of seconds (under normal conditions) and exits immediately. It interacts with the file system by reading information about some directories, so its launched duration is, of course, bound to the r

Re: Resource Fork - is this a good use/the right thing to do?

2008-04-23 Thread Chris Suter
On 24/04/2008, at 11:53 AM, Daniel DeCovnick wrote: I'm pretty sure the resource fork size limits are rather large... EV Nova's data files, in which everything is stored in the resource fork, go up to 13.8 MB. Also, it's a definite advantage that the resource fork is well-documented. That'

Re: Resource Fork - is this a good use/the right thing to do?

2008-04-23 Thread Chris Suter
On 24/04/2008, at 2:28 PM, Graham Cox wrote: On 24 Apr 2008, at 12:59 pm, Chris Suter wrote: The limits for resource forks are the same as for data forks Not true - the ResourceMap contains some 24-bit pointers, or at least it used to, as well as some 16-bit length fields as well

Re: Resource Fork - is this a good use/the right thing to do?

2008-04-23 Thread Chris Suter
On 24/04/2008, at 4:14 PM, Daniel DeCovnick wrote: Honestly, I don't care how the data is stored, as long as I've got some reliable place to store file-specific data such that it can be reliably tied to the file (cross-user/cross-computer concerns are primary, cross-platform concerns are s

Re: Calculating file size

2008-04-28 Thread Chris Suter
On 29/04/2008, at 2:58 AM, Aaron Burghardt wrote: When I learned of it, roughly in the timeframe of Jaguar or Panther, there was a document with a title like "Mac OS X System Overview", or something similar--I think that it where I read about it. I'm sure it was documented in somewhere in

Re: Immediate memory release

2008-04-30 Thread Chris Suter
On 01/05/2008, at 12:27 PM, Jens Alfke wrote: On 30 Apr '08, at 5:53 PM, Graham Cox wrote: If throws an exception won't that mean that is leaked? (and all of its contents up to that point too; applies to both of our code examples). Yup. You can work around that by using @finally:

Re: How to send email without using email client

2008-05-08 Thread Chris Suter
On 08/05/2008, at 8:10 PM, vinitha ks wrote: I'm working with mac 10.5 and xcode3.0.I've to send email from an application with out using any email client.When i try to use message framework,It doesn't work.(deliverMessage always returns no)Is there any any way to send email from my applicat

Re: Memory allocation issues with NSObject and NSString

2009-01-18 Thread Chris Suter
Hi Bill, On Mon, Jan 19, 2009 at 3:21 PM, Bill Bumgarner wrote: > foo = @""; // foo is a reference to the empty string > foo = [[NSString alloc] init]; // foo is a reference to the empty string > > The second is retained. The first is not. The first is a constant string > and, thus, -retain/-r

Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare

2009-01-27 Thread Chris Suter
Hi Graham, On Wed, Jan 28, 2009 at 10:07 AM, Graham Cox wrote: > It's a good habit IMO to always > take the address in these cases to make it clear in your code what your > intentions were when you wrote it. I'm afraid I have to disagree with this approach. In my opinion, it's more likely that

Re: NSTask Leaking...

2009-01-29 Thread Chris Suter
Hi Mr Gecko, On Fri, Jan 30, 2009 at 6:33 AM, Mr. Gecko wrote: > I'm just going to use sscrypto framework for it... You don't need to use a third party framework for crypto stuff. There are common hashing functions built in to libSystem. Look at the CC_crypto man page. If you need other crypto

Re: Memory management question in Objective-C 2.0 @property notation

2009-02-04 Thread Chris Suter
Hi Kiel, On Thu, Feb 5, 2009 at 4:10 PM, Kiel Gillard wrote: > However, doing this will yield a memory leak: > self.name = [[NSString alloc] init]; > > ...because the property definition tells the compiler the methods it > synthesizes should retain the value. You're right that it will leak in t

Re: Code Signing Examples

2009-02-20 Thread Chris Suter
Hi Tom, (Sorry Tom for the duplicate—I meant to send this to the list earlier. Also, cross posting is generally frowned upon and the best list for code signing questions is the apple-cdsa list.) On Sat, Feb 21, 2009 at 1:47 AM, Tom Fortmann wrote: > Can anyone point me to sample code on how to v

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Chris Suter
On Tue, Oct 14, 2008 at 9:13 PM, Graham Cox <[EMAIL PROTECTED]> wrote: > Isn't the problem here with the init method, rather than alloc? It's a problem with both. > NSString et. al. return id because they are class clusters (and because it's > the > established convention), I believe the fact

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Chris Suter
On Tue, Oct 14, 2008 at 8:17 PM, Oleg Krupnov <[EMAIL PROTECTED]> wrote: > You are right, casting from alloc worked, thank you. > > Is it the recommended practice to always cast after alloc? > > I still have a question in this regard. > > If the alloc returns id, then, from the compiler's perspecti

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Chris Suter
On Tue, Oct 14, 2008 at 7:43 PM, Oleg Krupnov <[EMAIL PROTECTED]> wrote: > In my project I have two different, totally unrelated classes. > > @interface ClassA : NSObject{} > > -(id)initWithContext:(ContextA*)context; > > @end > > > @interface ClassB : NSObject{} > > -(id)initWithContext:(ContextB*

Re: Not so long filenames

2008-10-14 Thread Chris Suter
On Wed, Oct 15, 2008 at 7:00 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: > So again my question: why it is too long in this context and where is this > documented? This looks like a bug in the kernel code. It looks like it checks the UTF8 string length against kHFSPlusMaxFileNameChars (rat

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-15 Thread Chris Suter
On Wed, Oct 15, 2008 at 9:03 PM, John Engelhart <[EMAIL PROTECTED]> wrote: > > On Oct 14, 2008, at 7:11 AM, Chris Suter wrote: >> >> You can't override the type for existing methods. For example, >> initWithString: always returns an id. You can define them as r

Re: tearing my hair, ok here is a compilable example.

2008-10-16 Thread Chris Suter
On Thu, Oct 16, 2008 at 7:54 PM, Chris Idou <[EMAIL PROTECTED]> wrote: > I disagree. I changed both to be NSObjects, and nothing changed. I think it is to do with it being a subclass of NSObjectController. Changing it to an NSObject makes it work for me. -- Chris

Re: Finding out that a volume is going away before it does

2008-10-27 Thread Chris Suter
On Tue, Oct 28, 2008 at 1:50 AM, Francis Devereux <[EMAIL PROTECTED]> wrote: > My code works on 10.4 8A428 PPC (after I changed mainRunLoop to > currentRunLoop), but this probably isn't much help to you because > DiskArbitration.framework is private on 10.3. You can use it fine on 10.3. As far as

Re: When does Cocoa get "No more!" from malloc?

2008-10-30 Thread Chris Suter
> An internet search shows me that the error message... > > malloc: *** mmap(size=2097152) failed (error code=12) > > is quite common. > > What is the significance of the number 2097152, besides the fact that it is > 2^21? It's just the amount of memory in bytes it was trying to allocate when it

Re: When does Cocoa get "No more!" from malloc?

2008-10-30 Thread Chris Suter
On Fri, Oct 31, 2008 at 1:28 AM, Michael Ash <[EMAIL PROTECTED]> wrote: > Apparently it asks for 2MB at a time. For tiny regions (for blocks <= 16 bytes), it looks like it appears to allocate 1 MB chunks. For small regions (blocks <= 512 bytes), I think it's around 8MB blocks. I think the 2 MB mu

Re: Mysterious warning

2008-11-12 Thread Chris Suter
On Wed, Nov 12, 2008 at 10:20 PM, Graham Cox <[EMAIL PROTECTED]> wrote: > I just added some fairly old C++ lex/bison code to my app, code that has > been in use for a long time elsewhere and works fine. My app is compiling > with much stricter warnings than many of my other projects though, and thi

Re: Mysterious warning

2008-11-12 Thread Chris Suter
On Thu, Nov 13, 2008 at 4:46 PM, Daniel Hyde <[EMAIL PROTECTED]> wrote: >> The order of evaluation of the arguments to a function is undefined so >> you have a problem where you're taking the address of wptr and you're >> pre-decrementing it. > > That doesn't look problematic to me -- decrementing

Re: NSArrayController bound to an array of strings

2008-11-16 Thread Chris Suter
On Mon, Nov 17, 2008 at 4:45 AM, Meik Schuetz <[EMAIL PROTECTED]> wrote: > Dear all, > If have seen lots of examples in which a NSTableView is bound to an > NSArrayController which is bound to an array of entity objects, having > various properties. However I am now trying to bind a table column to

Re: newbie NSMutable dictionary subclass question

2008-11-16 Thread Chris Suter
> Why does that crash when the first does not? Are subclasses required to > have member variables, or can they just have new functions? Mine don't have > any variables, maybe that is the problem? See:

Re: Development workflows for signed code?

2008-12-09 Thread Chris Suter
On Tue, Dec 9, 2008 at 4:12 AM, Jack Repenning <[EMAIL PROTECTED]> wrote: > My experiments so far seem to show that none of those things happens. In > fact, even if I modify one of the files, so that "codesign -v" no longer > likes the bundle, it still seems to work. Is "codesign -v" the only > (L

Fwd: Background Process?

2009-03-10 Thread Chris Suter
Hi Kyle, On Wed, Mar 11, 2009 at 12:35 PM, Kyle Sluder wrote: > It will put unnecessary burden on the processor, > and therefore reduce battery life on mobile machines, by doing nothing > in the runloop until the timer fires. Whilst it probably is a bad idea to use an NSTimer to solve the probl

Re: Background Process?

2009-03-10 Thread Chris Suter
Hi Kyle, On Wed, Mar 11, 2009 at 1:19 PM, Kyle Sluder wrote: > While NSTimers are not normal input sources, the frameworks are free > to add any input source to the runloop that they wish.  And in order > for your timer to fire, you need to keep the runloop awake, using at > least a dummy input

Re: Background Process?

2009-03-10 Thread Chris Suter
Hi Darren, On Wed, Mar 11, 2009 at 2:28 PM, Darren Minifie wrote: > Can't somebody write a small app and and profile it to get a conclusive > answer?  I'd do it but I'm lazy.  I am interested in the outcome though. Well, I did do that and ran it under Shark: zero CPU usage. I also ran another te

Re: Background Process?

2009-03-10 Thread Chris Suter
Hi Kyle, On Wed, Mar 11, 2009 at 5:02 PM, Kyle Sluder wrote: > Well, there is a sentence directly below that list that says the following: > > "Because timers and other periodic events are delivered when you run > the run loop, circumventing that loop disrupts the delivery of those > events." >

  1   2   >