Re: readInBackgroundAndNotify and rsync output

2011-01-29 Thread Robert DuToit
Thanks Ken, Your thoughtful answer clarified what I have been experiencing. On recent machines readInBackground is definitely a small toll compared to rsync - it is on older slower Macs that the toll got closer to rsync's write and really crunched it. I am trying to accommodate older OS and ppc

Re: readInBackgroundAndNotify and rsync output

2011-01-29 Thread Ken Thomases
On Jan 29, 2011, at 2:16 AM, Robert DuToit wrote: > Thanks Ken, You're welcome. > Your thoughtful answer clarified what I have been experiencing. I'm glad I could help. > On recent machines readInBackground is definitely a small toll compared to > rsync - it is on older slower Macs that the t

Re: readInBackgroundAndNotify and rsync output

2011-01-29 Thread Robert DuToit
Hi Ken, On Jan 29, 2011, at 5:15 AM, Ken Thomases wrote: > On Jan 29, 2011, at 2:16 AM, Robert DuToit wrote: > >> Thanks Ken, > > You're welcome. > >> Your thoughtful answer clarified what I have been experiencing. > > I'm glad I could help. > >> On recent machines readInBackground is defini

Re: readInBackgroundAndNotify and rsync output

2011-01-29 Thread Ken Thomases
On Jan 29, 2011, at 8:01 AM, Robert DuToit wrote: > On Jan 29, 2011, at 5:15 AM, Ken Thomases wrote: > >> You should definitely not be creating subprocesses to run 'tail' or 'ps'. >> 'tail' is just a file reader, and your app can directly open and read the >> file. To monitor whether rsync is

(id) issue, passing different types during initWith:(id)type

2011-01-29 Thread Travis Kirton
Hi, I am creating an aggregate object, for a project, with an initialization method: -(id)initWithString:(id)aString { if(![super init]) { return nil; } if([aString isKindOfClass:[NSString class]]) { self.string = (NSString *)aString;

Re: readInBackgroundAndNotify and rsync output

2011-01-29 Thread Robert DuToit
Thanks Ken, On Jan 29, 2011, at 10:36 AM, Robert DuToit wrote: > Thanks Ken, > On Jan 29, 2011, at 9:29 AM, Ken Thomases wrote: > >> On Jan 29, 2011, at 8:01 AM, Robert DuToit wrote: >> >>> On Jan 29, 2011, at 5:15 AM, Ken Thomases wrote: >>> You should definitely not be creating subproce

Re: (id) issue, passing different types during initWith:(id)type

2011-01-29 Thread Scott Ribe
On Jan 29, 2011, at 8:29 AM, Travis Kirton wrote: > warning: incompatible Objective-C types 'struct CFAString *', expected > 'struct NSString *' when passing argument 1 of 'initWithString:' from > distinct Objective-C type The frameworks contain plenty of initWithString: (NSString*) declaration

Re: (id) issue, passing different types during initWith:(id)type

2011-01-29 Thread Conrad Shultz
That was my thought too. You mention that your CFAString is an NSObject subclass but do not mention what your other class is. On a similar note, you might want to reconsider the name of CFAString. As you are probably aware, Core Foundation classes are prefixed with CF, and there is even a CFStr

Re: Printing a View

2011-01-29 Thread Matt Neuburg
On Thu, 27 Jan 2011 22:53:51 +, "Mirabito, David" said: >Now the view should print a bunch of data (ideally with a header covering >~20% of the first page). > >I get my calls to -knowsPageRange:aRange and -rectForRange:pageNumber just >fine. Retuning (1,2) and then [self view] for both pages p

Re: (id) issue, passing different types during initWith:(id)type

2011-01-29 Thread Matt Neuburg
On Sat, 29 Jan 2011 16:29:53 +0100, Travis Kirton said: >Hi, > >I am creating an aggregate object, for a project, with an initialization >method: > >-(id)initWithString:(id)aString { > if(![super init]) { > return nil; > } > if([aString isKindOfClass:[NSString clas

Re: readInBackgroundAndNotify and rsync output

2011-01-29 Thread Greg Guerin
Robert DuToit wrote: I have been googling around and not sure how to do this - is it with NSData or NSStream perhaps? You can use standard C's stdio lib: fopen(), fread(), fseek(), etc. Objective-C is a superset of C. You can use any C library in Objective-C, exactly the same way you'd

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: (id) issue, passing different types during initWith:(id)type

2011-01-29 Thread Quincey Morris
On Jan 29, 2011, at 07:29, Travis Kirton wrote: > -(id)initWithString:(id)aString { > if(![super init]) { > return nil; > } No, no, wrong, run for cover, incoming apocalypse. Always 'if (!(self=[super init])) ...'. Also, I can't help offering the opinion that using '(i

Re: (id) issue, passing different types during initWith:(id)type

2011-01-29 Thread Travis Kirton
Q, Ah, yes... The apocalypse was a slip... Wrote the function quite quickly. Thanks for the advice. As for my project, the main reason I chose to use (id) instead of anything else is that I am trying to build a set of frameworks that are "somewhat" redundant, for beginners learning cocoa/obj-c

Re: (id) issue, passing different types during initWith:(id)type

2011-01-29 Thread Travis Kirton
Hey Scott and Conrad, I may be getting into some ... bad territory here, but what I am trying to achieve is the following... First, the init method I posted belongs to CFAString. CFAString is an aggregate that contains a reference to an NSString (and other objects) and is also meant to mimic N

NSScrollView, centering document view?

2011-01-29 Thread Todd Heberlein
When working with an NSScrollView, sometimes my document view is smaller than my content/clip view. (the document view's size is dynamically generated depending on the data that needs to be rendered; or the user may make the window much larger than the document view.) In these cases I would lik

Re: NSScrollView, centering document view?

2011-01-29 Thread Quincey Morris
On Jan 29, 2011, at 21:38, Todd Heberlein wrote: > Is there an easy way to do this? Or should I make sure my document view is > always at least as large as the content view and then just center my drawing > inside my document view? I'd recommend the latter. It's not that hard, and it solves som