Re: Why Wasn't Memory Collected?

2011-06-11 Thread Bing Li
Der Stephen and Nick, I solved the problem in this way. - (void) Send { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; char *message = [self createSendMessage]; [self send:message]; [pool drain]; } It also works. How do you think about the solution? Best, Bing

Re: Why Wasn't Memory Collected?

2011-06-11 Thread Stephen J. Butler
On Sat, Jun 11, 2011 at 1:03 PM, Bing Li wrote: >        NSData *data = [xmlDoc XMLData]; >        NSString *xmlStr = [[[NSString alloc] initWithData:data > encoding:NSUTF8StringEncoding] autorelease]; >        xmlStr = [xmlStr stringByAppendingString:@"\n"]; >        const char *xmlChar = [xmlStr

Re: Why Wasn't Memory Collected?

2011-06-11 Thread Nick Zitzmann
On Jun 11, 2011, at 11:39 PM, Bing Li wrote: > I add a sub-autoreleasepool immediately outside the method that created XML. > Once if the XML is sent, the memory should be released, right? Now the amount > of memory consumed is very limited, almost no change in Activity Monitor. > > So I guess

Re: Why Wasn't Memory Collected?

2011-06-11 Thread Bing Li
Dear Nick, I appreciate so much for your reply! I add a sub-autoreleasepool immediately outside the method that created XML. Once if the XML is sent, the memory should be released, right? Now the amount of memory consumed is very limited, almost no change in Activity Monitor. So I guess sub-auto

Re: tools for writing help books

2011-06-11 Thread Martin Hewitson
I've been using iWeb together with this link: http://www.ehow.com/how_7515811_do-add-xcode-project.html Martin On 10, Jun, 2011, at 01:14 AM, Matt Neuburg wrote: > On Wed, 08 Jun 2011 09:33:50 +0200, Michael Thon said: >> What tools to y'all recommend for writing content for the help viewer on

layoutSubviews doesn't always work (iOS 4.3 on iPad Simulator)

2011-06-11 Thread Brian Bruinewoud
Hi All, I have an app that consists of a scroll view subclass which contains a single subview. In the scroll view subclass I override layoutSubviews based on Apple sample code (see below). The intention of layoutSubviews is to centre the subview in the scrollview when the subview is smaller tha

Re: Printing graphics plus text

2011-06-11 Thread Eli Bach
On Jun 10, 2011, at 11:58 PM, Scott Steinman wrote: > Please forgive me if my question is stupid. It's frustrating being a Cocoa > noobie after 30 years of scientific programming, but I'm doing my best to > learn. > > I'm working on an application that displays a diagram I have drawn in a >

Re: iOS: encoding a custom view with a shape in it

2011-06-11 Thread Steve Christensen
And also to clarify, are you "freeze drying" a view or the objects it draws? You should be doing the latter since that's part of your model. On Jun 11, 2011, at 6:47 PM, Steve Christensen wrote: > How do the results differ between what you saw before and after saving the > document? Is everyth

Re: iOS: encoding a custom view with a shape in it

2011-06-11 Thread Steve Christensen
How do the results differ between what you saw before and after saving the document? Is everything wrong? or just the scaling, the rotation, what? And to draw an object, are you using an affine transform just to rotate it or for scaling and/or translation as well? On Jun 9, 2011, at 4:25 PM, D

Re: Getting CGColor components

2011-06-11 Thread Development
:\ I think I have it figured out All colors work except white and black. I had to detect those and build the rgb manually On Jun 11, 2011, at 4:12 PM, Development wrote: > According to all the examples I have found the following code should give me > the RGB components of any UIColor.CGColo

Getting CGColor components

2011-06-11 Thread Development
According to all the examples I have found the following code should give me the RGB components of any UIColor.CGColor I pass to it However I get back a scrambled and often inaccurate array of color values which turns out to be useless. CGFloat colors[[widgetArray count]*4];

Re: Why Wasn't Memory Collected?

2011-06-11 Thread Nick Zitzmann
On Jun 11, 2011, at 12:03 PM, Bing Li wrote: > Dear all, > > I sent a large number, e.g., 200,000, of XML to a remote node. Each time, > the XML was created by the following method. Because of the large number, I > noticed the consumed memory was large (more then 1G!) from Activity Monitor. > Ev

Re: Mac OS Leopard: how to spawn an child "application"?

2011-06-11 Thread Nick
Thank you. I am sorry, I should have tested how it behaves with ordinary applications before. I just realized that I was wrong about the source of the issue i am having. [NSTask launchTaskForPath] works perfectly on both systems, for both GUI (bundled .app) and command line applications - it works

Why Wasn't Memory Collected?

2011-06-11 Thread Bing Li
Dear all, I sent a large number, e.g., 200,000, of XML to a remote node. Each time, the XML was created by the following method. Because of the large number, I noticed the consumed memory was large (more then 1G!) from Activity Monitor. Even after the sending was done, the memory was still kept in

Re: Mac OS Leopard: how to spawn an child "application"?

2011-06-11 Thread Greg Guerin
Nick wrote: This "per user" idea does not let me use any advertisement-based IPCs (like user domain sockets or bonjour). I need some "per user only" IPC - so other user's instance of the process does not interfere with the current user's one. A Unix domain socket can be placed anywhe

Re: Mac OS Leopard: how to spawn an child "application"?

2011-06-11 Thread Ken Thomases
On Jun 11, 2011, at 11:59 AM, Nick wrote: > i have an agent and a corresponding per-agent process (this per-agent > process, apart from doing its main job and displaying gui when its clicked, > displays an icon in dock which can change colors). Of course, the agent is > spawned for every logge

Re: Mac OS Leopard: how to spawn an child "application"?

2011-06-11 Thread Kyle Sluder
On Sat, Jun 11, 2011 at 9:59 AM, Nick wrote: > I found parent-child connected (socketpair) sockets/pipes to be the easiest > way to set up a conversation between an agent and that peruser application > in Dock.  And in Snow Leopard it works. Okay, it makes one thing easy (IPC) and another thing h

Re: Mac OS Leopard: how to spawn an child "application"?

2011-06-11 Thread Nick
Ken, i have an agent and a corresponding per-agent process (this per-agent process, apart from doing its main job and displaying gui when its clicked, displays an icon in dock which can change colors). Of course, the agent is spawned for every logged in user. I found parent-child connected (socket

Re: Mac OS Leopard: how to spawn an child "application"?

2011-06-11 Thread Ken Thomases
On Jun 11, 2011, at 10:32 AM, Nick wrote: > In Mac OS 10.6 (Snow Leopard) it is pretty simple to launch another > application from within my application (in a way that my application becomes > a "parent" process to the child) - i either may call [NSTask launchTask], or > call fork()/exec() - eithe

Mac OS Leopard: how to spawn an child "application"?

2011-06-11 Thread Nick
Hi In Mac OS 10.6 (Snow Leopard) it is pretty simple to launch another application from within my application (in a way that my application becomes a "parent" process to the child) - i either may call [NSTask launchTask], or call fork()/exec() - either way, my process and the launched process-appl

Close: Solved: visibleRect returns bogus results, why?

2011-06-11 Thread Alexander Reichstadt
My bad, I made an NSInteger into an NSUInteger the wrong way hence returning an amount of rows for an NSTableview that was incorrect, so the tableview really grew to that size. Am 11.06.2011 um 15:03 schrieb Alexander Reichstadt: > No, it's not solved. This works, because it always gives me the

Re: Solved: visibleRect returns bogus results, why?

2011-06-11 Thread Alexander Reichstadt
No, it's not solved. This works, because it always gives me the same rectangle. As far as I can see this call is broken. As soon as a user drags the scrollbar freely, the numbers go all bunkers as if the visible rectangle had an origin which was a hundred miles down the screen. As a result rowsI

Solved: visibleRect returns bogus results, why?

2011-06-11 Thread Alexander Reichstadt
Never mind, what works reliably is: NSRect theRect = [[[self view] enclosingScrollView] visibleRect]; Am 11.06.2011 um 14:39 schrieb Alexander Reichstadt: > Hi, > > > I have a view with view controller. The controller receives scroll changes. > visibleRect returns bogus, so I tracked it

visibleRect returns bogus results, why?

2011-06-11 Thread Alexander Reichstadt
Hi, I have a view with view controller. The controller receives scroll changes. visibleRect returns bogus, so I tracked it with NSLog and confirmed this. I use this code: NSRect theRect = [[self view] visibleRect]; NSLog(@"%@",NSStringFromRect(theRect)); When I scroll using the scrollwheel

Re: NSInputStream created from NSData - expected it to close at end of data, did not happen

2011-06-11 Thread Jodischlange
Am 11.06.2011 um 05:01 schrieb Ken Thomases: > On Jun 10, 2011, at 7:35 PM, jodischla...@gmx.de wrote: > >> I want the TCPServer to return some data block to each client that connects. >> I basically just want to put the bytes of the NSData object one after >> another on the outputstream that i

Re: NSInputStream created from NSData - expected it to close at end of data, did not happen

2011-06-11 Thread Jodischlange
Am 11.06.2011 um 03:19 schrieb Jens Alfke: > > On Jun 10, 2011, at 5:35 PM, jodischla...@gmx.de wrote: > >> I want the TCPServer to return some data block to each client that connects. >> I basically just want to put the bytes of the NSData object one after >> another on the outputstream that

Re: NS_BUILD_32_LIKE_64

2011-06-11 Thread Quincey Morris
On Jun 11, 2011, at 00:54, Gerriet M. Denkmann wrote: > The 64-Bit Transition Guide for Cocoa just says: > "The NS_BUILD_32_LIKE_64 macro is useful when binary compatibility is not a > concern, such as when building an application." > > So: why is this NS_BUILD_32_LIKE_64 not always defined (as

Re: NS_BUILD_32_LIKE_64

2011-06-11 Thread Lee Ann Rucker
If it's only NSLog formatting that's an issue, a trick we use for cross-platform printfs is a conditional macro (this is off the top of my head; ours is conditional on Windows or Mac/Linux): #if __LP64__ #define FMT_NSUInt "%lu" #else #define FMT_NSUInt "%u" #endif NSLog(@"u = "FMT_NSUInt" etc"

NS_BUILD_32_LIKE_64

2011-06-11 Thread Gerriet M. Denkmann
When I define NS_BUILD_32_LIKE_64=1 I can simply write: NSUInteger u = 12; NSLog(@"u = %lu", u ); Otherwise I would need to use a cast like: NSLog(@"u = %lu", (unsigned long)u ); or even more clumsy: #if __LP64__ NSLog(@"u = %lu", u ); #else NSLog(@"u = %u", u ); #endif The 64