Re: Distributed object vending problem

2010-09-22 Thread Kirk Kerekes
Others seem to have found http://www.thotzy.com/THOTZY/Distributed_Objects_Demo.html -- to be useful. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the

Re: NSTextView

2010-09-22 Thread Martin Hewitson
Hi Albert, You might try appending the text directly to the text storage: NSMutableAttributedString *attstr = [[[NSMutableAttributedString alloc] initWithString:someText] autorelease]; [[textView textStorage] beginEditing]; [[textView

Re: NSTextView

2010-09-22 Thread jonat...@mugginsoft.com
On Sep 22, 2010, at 4:03 AM, albert jordan wrote: I have setup an NSTextView in an NSScrollView item in interface builder, and my window controller objects has an IBOutlet that is linked to TextView of the item (if I connect it to the NSScrollView, I don't get any text). Anytime

Efficiently adding a bunch of items to an NSMutableArray

2010-09-22 Thread Oleg Krupnov
Hi, I have a NSMutableArray and need to add a number of elements to it, and their quantity I know in advance (in fact, they come from another array). I think that if I add them one-by-one in a loop, the array will have to reallocate its internal memory frequently. This seems inefficient. I'd

Re: Efficiently adding a bunch of items to an NSMutableArray

2010-09-22 Thread Jean-Daniel Dupas
Le 22 sept. 2010 à 14:46, Oleg Krupnov a écrit : Hi, I have a NSMutableArray and need to add a number of elements to it, and their quantity I know in advance (in fact, they come from another array). I think that if I add them one-by-one in a loop, the array will have to reallocate its

Re: What's the point of @properties?

2010-09-22 Thread Uli Kusterer
On Sep 19, 2010, at 9:52 PM, Jim Thomason wrote: So basically, I get a language built-in version of a macro, and an option to use a new syntax that I'm not interested in anyway. Is there something else I'm not seeing or some other utility to them that I don't yet understand? One point

Re: Efficiently adding a bunch of items to an NSMutableArray

2010-09-22 Thread Uli Kusterer
On Sep 22, 2010, at 2:46 PM, Oleg Krupnov wrote: I think that if I add them one-by-one in a loop, the array will have to reallocate its internal memory frequently. This seems inefficient. I think and seems are bad advice. What do Shark/Instruments say? Does it take long? Does this code run so

Re: NSRunLoop behavior

2010-09-22 Thread Keary Suska
On Sep 21, 2010, at 8:30 PM, Rafael Cerioli wrote: Ok, thank you for your answer. So, you are telling me that [self performSelector:@selector(waitUntilReady) withObject:nil afterDelay:1] is an input source ? What exactly is the input source, my selector or the timer that when fired, will

Re: Animating a non-standard layer property

2010-09-22 Thread Matt Neuburg
On Tue, 21 Sep 2010 23:52:21 -0400, Scott Anguish sc...@cocoadoc.com said: can you please file a bug on this? custom animations are missing at the moment (sadly) but adding that and the @dynamic would be a very useful bug. But, not to beat a dead horse or anything, the Core Animation-related

Question about UITableView and loading some XML

2010-09-22 Thread Eric E. Dolecki
I have a view that contains a UITableView. I am loading an XML file and parsing it, getting a list of names. I populate a NSMutableArray with those. I want to stuff them into the tableview, however the table's delegate methods fire before the XML is done, so if I do a [array count] it will be 0

Re: Question about UITableView and loading some XML

2010-09-22 Thread Luke Hiesterman
[tableView reloadData]; Luke Sent from my iPhone. On Sep 22, 2010, at 8:20 AM, Eric E. Dolecki edole...@gmail.com wrote: I have a view that contains a UITableView. I am loading an XML file and parsing it, getting a list of names. I populate a NSMutableArray with those. I want to stuff them

NSTableView display issue

2010-09-22 Thread koko
I have an NSTableView in an NSSplitView. I call -reloadData and -setNeedsDisplay:YES The table does not redisplay with the new data until the split view is resized. From that point forward it behaves properly with subsequent - reloadData and -setNeedsDisplay:YES calls. Is there something

Re: NSTextView

2010-09-22 Thread albert jordan
Hi Martin, THanks so much for the suggestion. The approach improves the situation, but unfortunately does not resolve it. But understand now that this is the issue, I'm going to see if there will be another work around. Thanks again. Albert On Sep 22, 2010, at 3:38 AM, Martin Hewitson

Re: Efficiently adding a bunch of items to an NSMutableArray

2010-09-22 Thread Quincey Morris
On Sep 22, 2010, at 05:46, Oleg Krupnov wrote: I have a NSMutableArray and need to add a number of elements to it, and their quantity I know in advance (in fact, they come from another array). I think that if I add them one-by-one in a loop, the array will have to reallocate its internal

Re: NSTextView

2010-09-22 Thread Kyle Sluder
On Wed, Sep 22, 2010 at 10:43 AM, albert jordan albertjor...@me.com wrote: Hi Martin, THanks so much for the suggestion. The approach improves the situation, but unfortunately does not resolve it.   But understand now that this is the issue, I'm going to see if there will be another work

Re: NSTableView display issue

2010-09-22 Thread Quincey Morris
On Sep 22, 2010, at 10:28, k...@highrolls.net wrote: I have an NSTableView in an NSSplitView. I call -reloadData and -setNeedsDisplay:YES The table does not redisplay with the new data until the split view is resized. From that point forward it behaves properly with subsequent

Re: Question about UITableView and loading some XML

2010-09-22 Thread Eric E. Dolecki
Thanks all :) Google Voice: (508) 656-0622 Twitter: eric_dolecki XBoxLive: edolecki PSN: eric_dolecki http://blog.ericd.net On Wed, Sep 22, 2010 at 12:48 PM, Luke Hiesterman luket...@apple.comwrote: [tableView reloadData]; Luke Sent from my iPhone. On Sep 22, 2010, at

Re: NSOperation and threadDictionary

2010-09-22 Thread Rick Mann
On Sep 22, 2010, at 11:17:25, Julien Poissonnier wrote: On Sep 22, 2010, at 12:52 AM, Rick Mann wrote: Does iOS (and Mac OS X) clean up thread-local storage upon the completion of an NSOperation? It seems dangerous to rely on every operation to clean up its own mess. It also seems that

Question in regards to iTunes XML

2010-09-22 Thread Eric E. Dolecki
I've been asked to take the iTunes XML file from a few people and provide a picker to choose which one to use. That's the easy part. So I have a few of the XML files and slapped them on a server, etc. however each one averages about 5MB in size. I am not linking to actual media obviously, but I'd

Re: NSOperation and threadDictionary

2010-09-22 Thread Kyle Sluder
On Wed, Sep 22, 2010 at 11:31 AM, Rick Mann rm...@latencyzero.com wrote: Pity. We have a singleton object that creates a subclass of NSOperation, which then calls back a method on the singleton that's intended to be run on a separate thread (provided indirectly by the NSOperation). That

Re: Question in regards to iTunes XML

2010-09-22 Thread Hank Heijink (Mailinglists)
On Sep 22, 2010, at 2:38 PM, Eric E. Dolecki wrote: I've been asked to take the iTunes XML file from a few people and provide a picker to choose which one to use. That's the easy part. So I have a few of the XML files and slapped them on a server, etc. however each one averages about 5MB in

Re: Question in regards to iTunes XML

2010-09-22 Thread Eric E. Dolecki
Thanks. This is for internal use, so it's going to be Wifi. This is for testing only really (a UI). Good to know 5MB XML isn't too big for iPhone/Touch. Google Voice: (508) 656-0622 Twitter: eric_dolecki XBoxLive: edolecki PSN: eric_dolecki http://blog.ericd.net On Wed, Sep

Re: NSOperation and threadDictionary

2010-09-22 Thread Rick Mann
I knew that wasn't clear. We have a method on the singleton that returns an MOC. If the thread is the main thread, it returns the main MOC. If not, it creates a new MOC, and returns that. Then we subsequently pass that MOC around to the various methods responsible for doing the work of creating

Re: NSTableView display issue

2010-09-22 Thread koko
Besides bindings and KVO issues, anything else to look at? I am not using bindings nor is this KVO. -koko On Sep 22, 2010, at 12:12 PM, Quincey Morris wrote: On Sep 22, 2010, at 10:28, k...@highrolls.net wrote: I have an NSTableView in an NSSplitView. I call -reloadData and

Re: NSTableView display issue

2010-09-22 Thread Keary Suska
On Sep 22, 2010, at 1:01 PM, k...@highrolls.net wrote: Besides bindings and KVO issues, anything else to look at? I am not using bindings nor is this KVO. Have you verified that the NSTableView instance you are calling is non-nil *and* the expected object? On Sep 22, 2010, at 12:12 PM,

Re: NSTableView display issue

2010-09-22 Thread Wim Lewis
On Sep 22, 2010, at 12:01 PM, k...@highrolls.net wrote: Besides bindings and KVO issues, anything else to look at? I am not using bindings nor is this KVO. On occasion I've seen a things like this happen if a data source method has raised an exception. It's generally not safe to throw an

Re: Efficiently adding a bunch of items to an NSMutableArray

2010-09-22 Thread Ken Thomases
On Sep 22, 2010, at 05:46, Oleg Krupnov wrote: It seems that the -addObjectsFromArray: method may be what I need, but the docs do not make it clear if it's internally optimized to do only a single memory re-allocation. I'll add my two cents: you should almost always use the method that

Re: What's the point of @properties?

2010-09-22 Thread Matt Neuburg
On Wed, 22 Sep 2010 15:16:19 +0200, Uli Kusterer witness.of.teacht...@gmx.net said: One point nobody mentioned so far: You can use different names for your public property (e.g. an IBOutlet) and your internal storage (i.e. the instance variable). I like to avoid name collisions between local

Re: GC, plain C structs, and when to use __strong

2010-09-22 Thread Clark S. Cox III
On Sep 21, 2010, at 4:13 PM, Quincey Morris wrote: On Sep 21, 2010, at 15:37, Sean McBride wrote: If I have a plain C struct that contains some Obj-C object pointers like: struct { int boring; NSString* string; } MyStruct What must I do to be safe in GC? a) I know I must allocate

Re: NSTableView display issue

2010-09-22 Thread koko
Yes, it is the same instance and it is not nil. On Sep 22, 2010, at 1:23 PM, Keary Suska wrote: Have you verified that the NSTableView instance you are calling is non-nil *and* the expected object? ___ Cocoa-dev mailing list

Re: NSTableView display issue

2010-09-22 Thread koko
There are no exceptions noted in any log. On Sep 22, 2010, at 1:28 PM, Wim Lewis wrote: On Sep 22, 2010, at 12:01 PM, k...@highrolls.net wrote: Besides bindings and KVO issues, anything else to look at? I am not using bindings nor is this KVO. On occasion I've seen a things like this

Re: NSTextView

2010-09-22 Thread albert jordan
Thanks Kyle for the suggestion, I still get the app to hang. if I bypass writing to the text view things work fine, so I'm certain it's this operation that hangs the application.Based on everyone's feedback, below is what I've come up with so far. adbLog is the culprit TextView.The

Re: NSTableView display issue

2010-09-22 Thread koko
Is it possible that the views contained in the split view perhaps not being wholly nested or having some overlap issue can cause this problem? I don't want to take it apart and reassemble unless there is some possibility of success. -koko On Sep 22, 2010, at 2:54 PM, k...@highrolls.net

NSTimer memory management

2010-09-22 Thread slasktrattena...@gmail.com
Hi, Is this an over-release? timer = [ [NSTimer scheduledTimerWithTimeInterval: ...] retain]; ... [timer invalidate]; [timer release]; I've seen this pattern so many times I figured it was correct, although it doesn't seem to comply with the memory management rules (i. e. the timer is first

Re: NSOperation and threadDictionary

2010-09-22 Thread Roland King
I did something similar to this a couple of weeks ago - posted about it but under a heading about NSManagedObjectWillSave notifications. If you have a singleton with a method which returns an MOC, you can store the MOCs you create in a CFDictionary in the singleton with the NSThread as key.

Re: NSOperation and threadDictionary

2010-09-22 Thread Roland King
Seems reasonable. The only problem I foresee is that if the system is recycling threads for subsequent NSOperations, I don't think you'll get the NSThreadWillExitNotification, because the thread itself never exits. Do you care? In my case I only care that the MOC is appropriate for the

Re: NSOperation and threadDictionary

2010-09-22 Thread Rick Mann
On Sep 22, 2010, at 17:00:13, Roland King wrote: Seems reasonable. The only problem I foresee is that if the system is recycling threads for subsequent NSOperations, I don't think you'll get the NSThreadWillExitNotification, because the thread itself never exits. Do you care? In my

Re: NSOperation and threadDictionary

2010-09-22 Thread Rick Mann
On Sep 22, 2010, at 16:45:51, Roland King wrote: I did something similar to this a couple of weeks ago - posted about it but under a heading about NSManagedObjectWillSave notifications. If you have a singleton with a method which returns an MOC, you can store the MOCs you create in a

Re: NSTimer memory management

2010-09-22 Thread koko
- (void)invalidate Discussion This is the only way to remove a timer from an NSRunLoop object. The NSRunLoop object removes and releases the timer, either just before the invalidate method returns or at some later point. On Sep 22, 2010, at 5:38 PM, slasktrattena...@gmail.com wrote:

Re: What's the point of @properties?

2010-09-22 Thread Matt Neuburg
On or about 9/22/10 5:06 PM, thus spake Ken Ferry kenfe...@gmail.com: Šbut previously you could only make an IBOutlet called cancelButton by having an ivar called cancelButton. That's just not so. Let's not mix apples and oranges. * An outlet is a thing in the nib. * IBOutlet is not an

Re: NSTimer memory management

2010-09-22 Thread Dave Keck
Is this an over-release? timer = [ [NSTimer scheduledTimerWithTimeInterval: ...] retain]; ... [timer invalidate]; [timer release]; No, you're not over-releasing the timer. I've seen this pattern so many times I figured it was correct, although it doesn't seem to comply with the memory

Re: NSTimer memory management

2010-09-22 Thread Jeff Johnson
It might be informative to see the entire backtrace and/or the entire source for the class, but in any case, I believe that the issue is target:self. According to the NSTimer documentation, The target object is retained by the timer and released when the timer is invalidated. Your object

[ANN] Release: NanoStore 1.0 for Mac and iOS

2010-09-22 Thread Tito Ciuro
NanoStore 1.0 © Webbo, L.L.C., 2010. All rights reserved. September 21, 2010 Today, Webbo is pleased to announce the release of NanoStore: http://sourceforge.net/projects/nanostore/ NanoStore is a Cocoa wrapper for SQLite, a C library that implements an embeddable SQL database engine. With

Re: NSTimer memory management

2010-09-22 Thread Scott Ribe
On Sep 22, 2010, at 7:50 PM, Jeff Johnson wrote: The NSTimer API is somewhat unfortunate. It would probably be better to have a delegate API where the delegate is not retained. However, that ship has sailed. What you need to do is avoid the retain cycle. What I sometimes do is to create a

Re: [ANN] Release: NanoStore 1.0 for Mac and iOS

2010-09-22 Thread Thomas Davie
On 23 Sep 2010, at 03:51, Tito Ciuro wrote: Today, Webbo is pleased to announce the release of NanoStore: http://sourceforge.net/projects/nanostore/ NanoStore is a Cocoa wrapper for SQLite, a C library that implements an embeddable SQL database engine. With NanoStore, you store data