Re: presentViewController completion block usage

2013-04-16 Thread Diederik Meijer | Ten Horses
An additional thought: when you put references to the presentingVC's properties in the completion block you may get retain cycle warnings. This is caused by the fact that blocks keep strong references to objects. Passing data back to the referring VC could also be done in viewWillDisappear, coul

Re: presentViewController completion block usage

2013-04-12 Thread Koen van der Drift
On Apr 12, 2013, at 10:00 AM, Roland King wrote: > The completion block is really for your view controller to know when it is > entirely finished presenting or entirely finished dismissing a view > controller so that it can do some cleanup work, if it needs to. They often > don't. Got it! T

Re: presentViewController completion block usage

2013-04-12 Thread Roland King
On 12 Apr, 2013, at 9:50 PM, Koen van der Drift wrote: > > On Apr 12, 2013, at 9:30 AM, Roland King wrote: > >> Did you have a particular use-case in mind? > > I am using the modalVC to set/change parameters for a calculation. These > parameters are properties of the presentingVC, which a

Re: presentViewController completion block usage

2013-04-12 Thread Koen van der Drift
On Apr 12, 2013, at 9:30 AM, Roland King wrote: > Did you have a particular use-case in mind? I am using the modalVC to set/change parameters for a calculation. These parameters are properties of the presentingVC, which also has a 'Start Calculation' button. So when I open the modalVC, the

Re: presentViewController completion block usage

2013-04-12 Thread Roland King
On 12 Apr, 2013, at 8:50 PM, Koen van der Drift wrote: > When a modal UIViewController is dismissed, Apple recommends to use the > delegate pattern to pass data back to the presenting UIViewController. I am > using that and it works just fine. But I was wondering if the same (passing > dat

presentViewController completion block usage

2013-04-12 Thread Koen van der Drift
When a modal UIViewController is dismissed, Apple recommends to use the delegate pattern to pass data back to the presenting UIViewController. I am using that and it works just fine. But I was wondering if the same (passing data back) can be achieved using the completion block. Right now, I just