Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-07 Thread Ken Thomases
On May 6, 2013, at 5:26 PM, Motti Shneor wrote: > Hello Ken, and so-many-thanks for the information. You're welcome. More below… > On 4 במאי 2013, at 07:24, Ken Thomases wrote: > >> Honestly, I doubt that -dealloc is reentered. I suspect you've misdiagnosed >> what is happening or, perhaps,

Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-06 Thread Motti Shneor
Hello Ken, and so-many-thanks for the information. On 4 במאי 2013, at 07:24, Ken Thomases wrote: > On May 2, 2013, at 11:53 AM, Jens Alfke wrote: > >> On May 1, 2013, at 5:10 AM, Motti Shneor wrote: >> >>> Currently, MyB retains itself within its thread, and releases itself just >>> before t

Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-03 Thread Ken Thomases
On May 2, 2013, at 11:53 AM, Jens Alfke wrote: > On May 1, 2013, at 5:10 AM, Motti Shneor wrote: > >> Currently, MyB retains itself within its thread, and releases itself just >> before the thread exits. I know it is bad practice (self retaining objects), >> but I did not yet think of a better

Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Motti Shneor
Hi and thanks Kyle, Fritz, Jens and everyone else On 2 במאי 2013, at 20:31, Kyle Sluder wrote: > On Wed, May 1, 2013, at 05:10 AM, Motti Shneor wrote: >> Hello. >> >> I have two NSObject subclasses - say MyA and MyB. >> >> - Each MyA instance. creates and owns a MyB instance. >> - MyB

Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Kyle Sluder
On Wed, May 1, 2013, at 05:10 AM, Motti Shneor wrote: > Hello. > > I have two NSObject subclasses - say MyA and MyB. > > - Each MyA instance. creates and owns a MyB instance. > - MyB instances create an NSThread, and live their asynchronous life, > communicating with a remote internet server,

Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Jens Alfke
On May 1, 2013, at 5:10 AM, Motti Shneor wrote: > Currently, MyB retains itself within its thread, and releases itself just > before the thread exits. I know it is bad practice (self retaining objects), > but I did not yet think of a better way. > > This way, when the owner releases its MyB

Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Fritz Anderson
On 1 May 2013, at 7:10 AM, Motti Shneor wrote: > - Each MyA instance. creates and owns a MyB instance. > - MyB instances create an NSThread, and live their asynchronous life, > communicating with a remote internet server, and sometimes with their owner > (the MyA object) who lives in the main

Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Motti Shneor
Hello. I have two NSObject subclasses - say MyA and MyB. - Each MyA instance. creates and owns a MyB instance. - MyB instances create an NSThread, and live their asynchronous life, communicating with a remote internet server, and sometimes with their owner (the MyA object) who lives in the

Re: Object Ownership

2010-05-24 Thread Graham Cox
On 24/05/2010, at 12:22 PM, Ken Thomases wrote: > On May 23, 2010, at 7:34 PM, Graham Cox wrote: > >> What I don't understand is why you make the copy. >> >> [NSURL URLWithString] doesn't require a mutable string, it requires a >> string, so your whole method could be reduced to: > > He does

Re: Object Ownership

2010-05-23 Thread Ken Thomases
On May 23, 2010, at 7:34 PM, Graham Cox wrote: > What I don't understand is why you make the copy. > > [NSURL URLWithString] doesn't require a mutable string, it requires a string, > so your whole method could be reduced to: He does have a comment ("do some stuff with aCopy here") indicating th

Re: Object Ownership

2010-05-23 Thread Graham Cox
On 23/05/2010, at 1:18 AM, Michael Jackson wrote: > Hi all, > > First day with Cocoa, so please excuse the basic newbness of this > question. ;) I've read through the documentation about object > ownership and disposal and just wanted to make sure I'm doing >

Re: Object Ownership

2010-05-22 Thread Dave Carrigan
On May 22, 2010, at 8:18 AM, Michael Jackson wrote: > Hi all, > > First day with Cocoa, so please excuse the basic newbness of this > question. ;) I've read through the documentation about object > ownership and disposal and just wanted to make sure I'm doing >

Object Ownership

2010-05-22 Thread Michael Jackson
Hi all, First day with Cocoa, so please excuse the basic newbness of this question. ;) I've read through the documentation about object ownership and disposal and just wanted to make sure I'm doing everything correctly in the following method. - (NSURL *)makeURL:(NSString *)