Wally,

I don't see you assigning the UIRefreshControl you created to the
UITableView's RefreshControl property. You've got a local var refresh but
unless the table view itself has the widget assigned, it won't work... you
could probably just ditch your field and assign to the
TableView.RefreshControl property directly?

cd


On Thu, Dec 13, 2012 at 11:46 AM, Wally McClure <
theevilprogram...@hotmail.com> wrote:

>  I am trying to get the UIRefreshControl to work in a UITableView.  I've
> been reading the content at Craig Dunn's blog on the UIRefreshControl.  It
> would seem to me that I would need to add a UIRefreshControl into the
> UITableViewController.  Unfortunately, that is a no go.  I don't seem to
> get the effect that I am looking for as the HandleValueChanged event is
> never called.  What do I need to do to go about using the UIRefreshControl
> and a UITableView?
>
>     public class MyTableController : UITableViewController
>     {
>         TwitterSearch ts;
>         UIRefreshControl refresh;
>
>         public MyTableController ()
>         {
>         }
>
>         public override void ViewDidLoad ()
>         {
>
>             base.ViewDidLoad ();
>         }
>
>         public override void ViewDidAppear (bool animated)
>         {
>             base.ViewDidAppear (animated);
>             ts = new TwitterSearch();
>             ts.StartSearch("MonoTouch", new AsyncCallback(ProcessResult));
>             refresh = new UIRefreshControl ();
>             refresh.ValueChanged += HandleValueChanged;
>         }
>
>         void HandleValueChanged (object sender, EventArgs e)
>         {
>             Console.WriteLine ("HandleValueChanged");
>             ts.StartSearch("MonoTouch", new AsyncCallback(ProcessResult));
>
>         }
>
>         void RefreshData(IAsyncResult iar)
>         {
>
>             List<Tweet> twtL = ts.ProcessRestXmlLINQHttpResponse (iar);
>             var td = new TweetListData (twtL);
>             InvokeOnMainThread (delegate {
>                 TableView.DataSource = td;
>                 TableView.ReloadData ();
>                 if ( refresh.Refreshing )
>                 {
>                     refresh.EndRefreshing();
>                 }
>             });
>         }
>
>         void ProcessResult(IAsyncResult iar){
>             RefreshData (iar);
>         }
>
>     }
>
>
> _______________________________________________
> MonoTouch mailing list
> MonoTouch@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>
>
_______________________________________________
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to