Re: Block Confusion...

2012-02-01 Thread David Duncan
On Jan 31, 2012, at 5:42 PM, Eeyore wrote: > Even if you eventually decide to use weak references (after discovering the > retain/release calls are a drag on performance), making them strong > references now to see if that fixes the behavior can help you diagnose the > problem FYI, using weak

Re: Block Confusion...

2012-01-31 Thread Lee Ann Rucker
On Jan 31, 2012, at 3:49 PM, R wrote: > David, > Class B is a parser. It is passed NSData to parse (weak reference) > and the Array (weak reference) from Class A. The results of the Data > parse are placed into the Array. Class A will be around for the life > of the application. Class B will b

Re: Block Confusion...

2012-01-31 Thread Eeyore
On Jan 31, 2012, at 3:49 PM, R wrote: > David, > Class B is a parser. It is passed NSData to parse (weak reference) > and the Array (weak reference) from Class A. The results of the Data > parse are placed into the Array. Class A will be around for the life > of the application. Class B will

Re: Block Confusion...

2012-01-31 Thread David Duncan
On Jan 31, 2012, at 3:49 PM, R wrote: > I chose this approach rather than delegation. > > Thoughts? Use Delegation instead. -- David Duncan ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator commen

Re: Block Confusion...

2012-01-31 Thread R
David, Class B is a parser. It is passed NSData to parse (weak reference) and the Array (weak reference) from Class A. The results of the Data parse are placed into the Array. Class A will be around for the life of the application. Class B will be released (set to nil) after completing the pars

Re: Block Confusion...

2012-01-31 Thread David Duncan
On Jan 31, 2012, at 9:05 AM, R wrote: > never mind. the class was getting dealloc. Still getting use to ARC and > new ivar techniques. As a point of design here, without further knowledge on why your "ClassB" is keeping a weak reference to the target mutable array (rather than a strong on

Re: Block Confusion...

2012-01-31 Thread R
never mind. the class was getting dealloc. Still getting use to ARC and new ivar techniques. thanks! On Jan 31, 9:16 am, R wrote: > My confusion is that the array in class A is used later in the code, > it is just nil inside the block that is running on another thread. > > On Jan 31, 8:07 a

Re: Block Confusion...

2012-01-31 Thread R
My confusion is that the array in class A is used later in the code, it is just nil inside the block that is running on another thread. On Jan 31, 8:07 am, Fritz Anderson wrote: > On 30 Jan 2012, at 8:56 PM, R wrote: > > > One class creates a STRONG pointer to a NSMutableArray.  It then > > pas

Re: Block Confusion...

2012-01-31 Thread Fritz Anderson
On 30 Jan 2012, at 8:56 PM, R wrote: > One class creates a STRONG pointer to a NSMutableArray. It then > passes that pointer to another class, which has a WEAK reference. > that class is listed below. When I fork a new thread for the > simpleBlock, I lose the pointer. I tried this on a fresh, v

Block Confusion...

2012-01-31 Thread R
I thought I understood block until today Here is my situation: One class creates a STRONG pointer to a NSMutableArray. It then passes that pointer to another class, which has a WEAK reference. that class is listed below. When I fork a new thread for the simpleBlock, I lose the pointer. I t