Re: Computing the height for a UITableViewHeaderFooterView

2013-08-06 Thread Rick Mann
Unfortunately, that won't compute the height of the UITableViewHeaderFooterView, which has two different labels with different text characteristics, and who know what positioning within. On Aug 5, 2013, at 18:57 , synelang synel...@gmail.com wrote: Try this : (never tested) •

Re: Computing the height for a UITableViewHeaderFooterView

2013-08-06 Thread Diederik Meijer | Ten Horses
The way is handled something similar is by first calculating the label size for the dynamic string (which you probably need anyway), then using the returned value in the heightForHeaderInSection (or recalculating it with a method call), followed by calling reloadData on the tableView. The code

Re: Checking if NSURL exists

2013-08-06 Thread Uli Kusterer
On Aug 5, 2013, at 8:41 PM, Jerry Krinock je...@ieee.org wrote: As Jens explained, your does not have a clean answer. Doing a HEAD request is optimal (huge reduction in network traffic) if you can accept NO answers from a tiny percentage of sites which will won't return data to a HEAD

Re: Computing the height for a UITableViewHeaderFooterView

2013-08-06 Thread Kyle Sluder
On Tue, Aug 6, 2013, at 02:21 AM, Diederik Meijer | Ten Horses wrote: The way is handled something similar is by first calculating the label size for the dynamic string (which you probably need anyway), then using the returned value in the heightForHeaderInSection (or recalculating it with a

Thread safety, some basic questions about accessing mutable objects across threads

2013-08-06 Thread Nick Rogers
Hi, Please look at the following situations: 1. Created a mutable array in main thread, can I read its values in a secondary thread safely, while no other thread is modifying this mutable array? 2. I need to add objects to this mutable array from a secondary thread, and no other thread is

Re: Any way to delay drawing after scrolling?

2013-08-06 Thread Steve Mills
On Aug 5, 2013, at 12:34:11, Kyle Sluder k...@ksluder.com wrote: Try turning off copies-on-scroll on your scroll view. That seems to do the trick. Thanks. I'm grabbing its state, turning it off, scrollPoint, then setting it back. -- Steve Mills office: 952-818-3871 home: 952-401-6255 cell:

Re: Thread safety, some basic questions about accessing mutable objects across threads

2013-08-06 Thread Abdul Sowayan
Nick, In your secondary you can use dispatch_async or dispatch_sync to schedule a block of code to execute on the main thread. Below is a simple example: dispatch_async(dispatch_get_main_queue(), ^{ // put your code to modify mutable array here }); I hope this helps. Thanks, Abdul

Re: Any way to delay drawing after scrolling?

2013-08-06 Thread Kyle Sluder
On Aug 6, 2013, at 9:00 AM, Steve Mills smi...@makemusic.com wrote: On Aug 5, 2013, at 12:34:11, Kyle Sluder k...@ksluder.com wrote: Try turning off copies-on-scroll on your scroll view. That seems to do the trick. Thanks. I'm grabbing its state, turning it off, scrollPoint, then setting

Re: Thread safety, some basic questions about accessing mutable objects across threads

2013-08-06 Thread Kyle Sluder
On Aug 6, 2013, at 8:39 AM, Nick Rogers roger...@mac.com wrote: Hi, Please look at the following situations: 1. Created a mutable array in main thread, can I read its values in a secondary thread safely, while no other thread is modifying this mutable array? Yes, but the second half

Re: Any way to delay drawing after scrolling?

2013-08-06 Thread Steve Mills
On Aug 6, 2013, at 11:09:51, Kyle Sluder k...@ksluder.com wrote: If scrolling your view always requires a redraw, I’d just turn it on in the nib and leave it on. No, it doesn't always need to do this. This is only needed when scaling our view, when the new scroll loc is calculated and set.

Re: Thread safety, some basic questions about accessing mutable objects across threads

2013-08-06 Thread Jens Alfke
On Aug 6, 2013, at 8:39 AM, Nick Rogers roger...@mac.com wrote: 1. Created a mutable array in main thread, can I read its values in a secondary thread safely, while no other thread is modifying this mutable array? Yes. Most non-thread-safe objects don’t care what threads you call them on,

Reloading table view header or footer

2013-08-06 Thread Rick Mann
I've been struggling with updating the content of a table view footer. I ended up creating a custom view that I hang on to, returning that from the delegate method, and then changing its content. But I'm looking at the Personal Hotspot UI in Settings, and I see that the section footer changes

Re: Reloading table view header or footer

2013-08-06 Thread Alex Zavatone
Have you tried any of these? reloadSections:withRowAnimation reloadRowsAtIndexPaths, perhaps? Or reloadSectionIndexTitles? Set an observer to the data record that is being used to populate that cell, then create a little method in your TV class that is triggered when that data value changes.

Re: Reloading table view header or footer

2013-08-06 Thread Rick Mann
On Aug 6, 2013, at 14:24 , Alex Zavatone z...@mac.com wrote: reloadSections:withRowAnimation reloadRowsAtIndexPaths, perhaps? Or reloadSectionIndexTitles? Set an observer to the data record that is being used to populate that cell, then create a little method in your TV class that is

Re: Thread safety, some basic questions about accessing mutable objects across threads

2013-08-06 Thread David Duncan
On Aug 6, 2013, at 8:39 AM, Nick Rogers roger...@mac.com wrote: 1. Created a mutable array in main thread, can I read its values in a secondary thread safely, while no other thread is modifying this mutable array? 2. I need to add objects to this mutable array from a secondary thread, and