[MonoTouch] trying to work out how to get searches to work properly.

2012-06-05 Thread Alex White
Hi,

I am new to MT and MT.D, I am trying to get my head round how to properly 
structure the search bar with search scope, I have not found any working 
examples of SQLite IList into a the tableview.source of an inherited 
dialogviewcontroller, and then to get the searching to work, I have got the 
first load of the data working ok I am not getting anywhere with subsequent of 
that data.

In my constructor of my inherited class I have the following

base.AutoHideSearch = true;
base.Autorotate = true;
base.EnableSearch = true;


Am I right in thinking that the ILIST<> is persisted at the class level and 
that the searches don't go back out to the database to build the searches but 
work off the loaded data?

I am also needing to get the search scope buttons into the search bar, but I am 
hitting null errors with the following code

string[] buttons = new string[] { "POI", "Road", "Postcode"} ;
UISearchDisplayController POIsearch = new UISearchDisplayController();
POIsearch.SearchBar.ShowsScopeBar = true; <<--- fails here
POIsearch.SearchBar.ScopeButtonTitles = buttons;

I am sure that all of the issues are my lack of understanding and not bugs so 
any example code just to get me going would be great.

Thanks in advance

Alex

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] trying to work out how to get searches to work properly.

2012-06-05 Thread Nic Wise
You may need to show the dialog before it creates the search bar -
this happens with NavigationBars too.

On Tue, Jun 5, 2012 at 12:40 PM, Alex White  wrote:
> Hi,
>
> I am new to MT and MT.D, I am trying to get my head round how to properly
> structure the search bar with search scope, I have not found any working
> examples of SQLite IList into a the tableview.source of an inherited
> dialogviewcontroller, and then to get the searching to work, I have got the
> first load of the data working ok I am not getting anywhere with subsequent
> of that data.
>
> In my constructor of my inherited class I have the following
>
> base.AutoHideSearch = true;
> base.Autorotate = true;
> base.EnableSearch = true;
>
>
> Am I right in thinking that the ILIST<> is persisted at the class level and
> that the searches don't go back out to the database to build the searches
> but work off the loaded data?
>
> I am also needing to get the search scope buttons into the search bar, but I
> am hitting null errors with the following code
>
> string[] buttons = new string[] { "POI", "Road", "Postcode"} ;
> UISearchDisplayController POIsearch = new UISearchDisplayController();
> POIsearch.SearchBar.ShowsScopeBar = true; <<--- fails here
> POIsearch.SearchBar.ScopeButtonTitles = buttons;
>
> I am sure that all of the issues are my lack of understanding and not bugs
> so any example code just to get me going would be great.
>
> Thanks in advance
>
> Alex
>
>
> ___
> MonoTouch mailing list
> MonoTouch@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>



-- 
Nic Wise
t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
Nearest Bus: find when the next bus is coming to your stop. http://goo.gl/Vcz1p
mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] trying to work out how to get searches to work properly.

2012-06-05 Thread Alex White
Hi Nic,

thanks for the reply,

I have tried the following code in the ViewDidAppear and ViewDidLoad and both 
give me a null issue, 

searchBar = new UISearchBar (f){
Delegate = new SearchDelegate (),
ShowsCancelButton = true,
} ;
string[] buttons = new string[] { "POI", "Road", "Postcode"} ; 
searchBar = new UISearchDisplayController();
searchBar.ScopeButtonTitles = buttons;  
searchBar.ShowsScopeBar = true; 
searchBar.SizeToFit();  
this.SearchDisplayController.SearchBar = searchBar; <-- this errors saying 
readonly


I have also tried the following in the events above

string[] buttons = new string[] { "POI", "Road", "Postcode"} ;
UISearchDisplayController POIsearch = new UISearchDisplayController();
POIsearch.SearchBar.ShowsScopeBar = true; <<--- fails here
POIsearch.SearchBar.ScopeButtonTitles = buttons;

I just need to see a working example to be able to see where I am going wrong, 
TBH I have tried so many things now that I am about to drop that part of the 
project until I can find an answer I spent the whole of yesterday googling for 
an answer and nothing worked.

Thanks

Alex

On 5 Jun 2012, at 13:57, Nic Wise wrote:

> You may need to show the dialog before it creates the search bar -
> this happens with NavigationBars too.
> 
> On Tue, Jun 5, 2012 at 12:40 PM, Alex White  wrote:
>> Hi,
>> 
>> I am new to MT and MT.D, I am trying to get my head round how to properly
>> structure the search bar with search scope, I have not found any working
>> examples of SQLite IList into a the tableview.source of an inherited
>> dialogviewcontroller, and then to get the searching to work, I have got the
>> first load of the data working ok I am not getting anywhere with subsequent
>> of that data.
>> 
>> In my constructor of my inherited class I have the following
>> 
>> base.AutoHideSearch = true;
>> base.Autorotate = true;
>> base.EnableSearch = true;
>> 
>> 
>> Am I right in thinking that the ILIST<> is persisted at the class level and
>> that the searches don't go back out to the database to build the searches
>> but work off the loaded data?
>> 
>> I am also needing to get the search scope buttons into the search bar, but I
>> am hitting null errors with the following code
>> 
>> string[] buttons = new string[] { "POI", "Road", "Postcode"} ;
>> UISearchDisplayController POIsearch = new UISearchDisplayController();
>> POIsearch.SearchBar.ShowsScopeBar = true; <<--- fails here
>> POIsearch.SearchBar.ScopeButtonTitles = buttons;
>> 
>> I am sure that all of the issues are my lack of understanding and not bugs
>> so any example code just to get me going would be great.
>> 
>> Thanks in advance
>> 
>> Alex
>> 
>> 
>> ___
>> MonoTouch mailing list
>> MonoTouch@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monotouch
>> 
> 
> 
> 
> -- 
> Nic Wise
> t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
> b. http://www.fastchicken.co.nz/
> 
> Earnest: Self-employed? Track your business expenses and income.
> http://earnestapp.com
> Nearest Bus: find when the next bus is coming to your stop. 
> http://goo.gl/Vcz1p
> mobileAgent (for FreeAgent): get your accounts in your pocket.
> http://goo.gl/IuBU
> Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
> London Bike App: Find the nearest Boris Bike, and get riding! 
> http://goo.gl/Icp2

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] trying to work out how to get searches to work properly.

2012-06-05 Thread Jeff Stedfast
Hi Alex,

When you create a UISearchDisplayController, you can pass it a UISearchBar.

I will say that using a UISearchDisplayController can be very confusing the
first time you use it, so I might suggest taking a look at
https://github.com/jstedfast/MonoTouch.SQLite

You'll see how I setup a UISearchDisplayController in the
AllInOneUITableViewController (mostly what this class does is to simplify
the use of UITableViewControllers so that you don't have to create all the
different delegate classes, etc).

Jeff

On Tue, Jun 5, 2012 at 10:51 AM, Alex White  wrote:

> Hi Nic,
>
> thanks for the reply,
>
> I have tried the following code in the ViewDidAppear and ViewDidLoad and
> both give me a null issue,
>
> searchBar = new UISearchBar (f){
> Delegate = new SearchDelegate (),
> ShowsCancelButton = true,
> } ;
> string[] buttons = new string[] { "POI", "Road", "Postcode"} ;
> searchBar = new UISearchDisplayController();
> searchBar.ScopeButtonTitles = buttons;
> searchBar.ShowsScopeBar = true;
> searchBar.SizeToFit();
> this.SearchDisplayController.SearchBar = searchBar; <-- this errors
> saying readonly
>
>
> I have also tried the following in the events above
>
> string[] buttons = new string[] { "POI", "Road", "Postcode"} ;
> UISearchDisplayController POIsearch = new UISearchDisplayController();
> POIsearch.SearchBar.ShowsScopeBar = true; <<--- fails here
> POIsearch.SearchBar.ScopeButtonTitles = buttons;
>
> I just need to see a working example to be able to see where I am going
> wrong, TBH I have tried so many things now that I am about to drop that
> part of the project until I can find an answer I spent the whole of
> yesterday googling for an answer and nothing worked.
>
> Thanks
>
> Alex
>
> On 5 Jun 2012, at 13:57, Nic Wise wrote:
>
> You may need to show the dialog before it creates the search bar -
> this happens with NavigationBars too.
>
> On Tue, Jun 5, 2012 at 12:40 PM, Alex White  wrote:
>
> Hi,
>
>
> I am new to MT and MT.D, I am trying to get my head round how to properly
>
> structure the search bar with search scope, I have not found any working
>
> examples of SQLite IList into a the tableview.source of an inherited
>
> dialogviewcontroller, and then to get the searching to work, I have got the
>
> first load of the data working ok I am not getting anywhere with subsequent
>
> of that data.
>
>
> In my constructor of my inherited class I have the following
>
>
> base.AutoHideSearch = true;
>
> base.Autorotate = true;
>
> base.EnableSearch = true;
>
>
>
> Am I right in thinking that the ILIST<> is persisted at the class level and
>
> that the searches don't go back out to the database to build the searches
>
> but work off the loaded data?
>
>
> I am also needing to get the search scope buttons into the search bar, but
> I
>
> am hitting null errors with the following code
>
>
> string[] buttons = new string[] { "POI", "Road", "Postcode"} ;
>
> UISearchDisplayController POIsearch = new UISearchDisplayController();
>
> POIsearch.SearchBar.ShowsScopeBar = true; <<--- fails here
>
> POIsearch.SearchBar.ScopeButtonTitles = buttons;
>
>
> I am sure that all of the issues are my lack of understanding and not bugs
>
> so any example code just to get me going would be great.
>
>
> Thanks in advance
>
>
> Alex
>
>
>
> ___
>
> MonoTouch mailing list
>
> MonoTouch@lists.ximian.com
>
> http://lists.ximian.com/mailman/listinfo/monotouch
>
>
>
>
>
> --
> Nic Wise
> t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
> b. http://www.fastchicken.co.nz/
>
> Earnest: Self-employed? Track your business expenses and income.
> http://earnestapp.com
> Nearest Bus: find when the next bus is coming to your stop.
> http://goo.gl/Vcz1p
> mobileAgent (for FreeAgent): get your accounts in your pocket.
> http://goo.gl/IuBU
> Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
> London Bike App: Find the nearest Boris Bike, and get riding!
> http://goo.gl/Icp2
>
>
>
> ___
> 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


Re: [MonoTouch] trying to work out how to get searches to work properly.

2012-06-05 Thread Alex White
Hi Jeff,

Thanks very much for the link, I had a quick look at your project the other day 
but it was just a fleeting glance, nice work in there, what do you recommend, I 
am using SQLite databases already pre-populated with data, so my quick look 
suggests that I should copy al of the contents of the 
MonoTouch.SQLite / MonoTouch.SQLite folder then, take the 
sampletableviewcontroller.cs and use that as a template for each table that I 
want to expose, or should I just try and figure out how you have done stuff and 
make changes to my program, it is early days for this project so big changes 
can happen without too many issues.

Thanks again

Alex 

 
On 5 Jun 2012, at 16:31, Jeff Stedfast wrote:

> Hi Alex,
> 
> When you create a UISearchDisplayController, you can pass it a UISearchBar.
> 
> I will say that using a UISearchDisplayController can be very confusing the 
> first time you use it, so I might suggest taking a look at 
> https://github.com/jstedfast/MonoTouch.SQLite
> 
> You'll see how I setup a UISearchDisplayController in the 
> AllInOneUITableViewController (mostly what this class does is to simplify the 
> use of UITableViewControllers so that you don't have to create all the 
> different delegate classes, etc).
> 
> Jeff
> 
> On Tue, Jun 5, 2012 at 10:51 AM, Alex White  wrote:
> Hi Nic,
> 
> thanks for the reply,
> 
> I have tried the following code in the ViewDidAppear and ViewDidLoad and both 
> give me a null issue, 
> 
> searchBar = new UISearchBar (f){
>   Delegate = new SearchDelegate (),
>   ShowsCancelButton = true,
> } ;
> string[] buttons = new string[] { "POI", "Road", "Postcode"} ; 
> searchBar = new UISearchDisplayController();
> searchBar.ScopeButtonTitles = buttons;
> searchBar.ShowsScopeBar = true; 
> searchBar.SizeToFit();
> this.SearchDisplayController.SearchBar = searchBar; <-- this errors saying 
> readonly
> 
> 
> I have also tried the following in the events above
> 
> string[] buttons = new string[] { "POI", "Road", "Postcode"} ;
> UISearchDisplayController POIsearch = new UISearchDisplayController();
> POIsearch.SearchBar.ShowsScopeBar = true; <<--- fails here
> POIsearch.SearchBar.ScopeButtonTitles = buttons;
> 
> I just need to see a working example to be able to see where I am going 
> wrong, TBH I have tried so many things now that I am about to drop that part 
> of the project until I can find an answer I spent the whole of yesterday 
> googling for an answer and nothing worked.
> 
> Thanks
> 
> Alex
> 
> On 5 Jun 2012, at 13:57, Nic Wise wrote:
> 
>> You may need to show the dialog before it creates the search bar -
>> this happens with NavigationBars too.
>> 
>> On Tue, Jun 5, 2012 at 12:40 PM, Alex White  wrote:
>>> Hi,
>>> 
>>> I am new to MT and MT.D, I am trying to get my head round how to properly
>>> structure the search bar with search scope, I have not found any working
>>> examples of SQLite IList into a the tableview.source of an inherited
>>> dialogviewcontroller, and then to get the searching to work, I have got the
>>> first load of the data working ok I am not getting anywhere with subsequent
>>> of that data.
>>> 
>>> In my constructor of my inherited class I have the following
>>> 
>>> base.AutoHideSearch = true;
>>> base.Autorotate = true;
>>> base.EnableSearch = true;
>>> 
>>> 
>>> Am I right in thinking that the ILIST<> is persisted at the class level and
>>> that the searches don't go back out to the database to build the searches
>>> but work off the loaded data?
>>> 
>>> I am also needing to get the search scope buttons into the search bar, but I
>>> am hitting null errors with the following code
>>> 
>>> string[] buttons = new string[] { "POI", "Road", "Postcode"} ;
>>> UISearchDisplayController POIsearch = new UISearchDisplayController();
>>> POIsearch.SearchBar.ShowsScopeBar = true; <<--- fails here
>>> POIsearch.SearchBar.ScopeButtonTitles = buttons;
>>> 
>>> I am sure that all of the issues are my lack of understanding and not bugs
>>> so any example code just to get me going would be great.
>>> 
>>> Thanks in advance
>>> 
>>> Alex
>>> 
>>> 
>>> ___
>>> MonoTouch mailing list
>>> MonoTouch@lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/monotouch
>>> 
>> 
>> 
>> 
>> -- 
>> Nic Wise
>> t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
>> b. http://www.fastchicken.co.nz/
>> 
>> Earnest: Self-employed? Track your business expenses and income.
>> http://earnestapp.com
>> Nearest Bus: find when the next bus is coming to your stop. 
>> http://goo.gl/Vcz1p
>> mobileAgent (for FreeAgent): get your accounts in your pocket.
>> http://goo.gl/IuBU
>> Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
>> London Bike App: Find the nearest Boris Bike, and get riding! 
>> http://goo.gl/Icp2
> 
> 
> ___
> MonoTouch mailing list
> MonoTouch@lists.ximian.com
> http://list

Re: [MonoTouch] trying to work out how to get searches to work properly.

2012-06-05 Thread Jeff Stedfast
Hi Alex,

You could just reference the MonoTouch.SQLite sub-project in your own
project, you don't need to copy the source code anywhere (although you
*could* also do it that way if you want).

This is what I do in my FlightLog app (also on github if you are interested
- take a look at the AircraftViewController and the FlightLogViewController
to see how they use it).

As far as your last question, that really depends on whether or not my
SQLiteTableViewController meets your needs. If it doesn't, you could at
least use it to help you figure out how to use UISearchDisplayController by
messing around with the sample app.

Hope that helps,

Jeff

On Tue, Jun 5, 2012 at 12:40 PM, Alex White  wrote:

> Hi Jeff,
>
> Thanks very much for the link, I had a quick look at your project the
> other day but it was just a fleeting glance, nice work in there, what do
> you recommend, I am using SQLite databases already pre-populated with data,
> so my quick look suggests that I should copy al of the contents of the
> MonoTouch.SQLite / MonoTouch.SQLite folder then, take the
> sampletableviewcontroller.cs and use that as a template for each table that
> I want to expose, or should I just try and figure out how you have done
> stuff and make changes to my program, it is early days for this project so
> big changes can happen without too many issues.
>
> Thanks again
>
> Alex
>
>
> On 5 Jun 2012, at 16:31, Jeff Stedfast wrote:
>
> Hi Alex,
>
> When you create a UISearchDisplayController, you can pass it a UISearchBar.
>
> I will say that using a UISearchDisplayController can be very confusing
> the first time you use it, so I might suggest taking a look at
> https://github.com/jstedfast/MonoTouch.SQLite
>
> You'll see how I setup a UISearchDisplayController in the
> AllInOneUITableViewController (mostly what this class does is to simplify
> the use of UITableViewControllers so that you don't have to create all the
> different delegate classes, etc).
>
> Jeff
>
> On Tue, Jun 5, 2012 at 10:51 AM, Alex White  wrote:
>
>> Hi Nic,
>>
>> thanks for the reply,
>>
>> I have tried the following code in the ViewDidAppear and ViewDidLoad and
>> both give me a null issue,
>>
>> searchBar = new UISearchBar (f){
>> Delegate = new SearchDelegate (),
>>  ShowsCancelButton = true,
>> } ;
>> string[] buttons = new string[] { "POI", "Road", "Postcode"} ;
>> searchBar = new UISearchDisplayController();
>> searchBar.ScopeButtonTitles = buttons;
>> searchBar.ShowsScopeBar = true;
>> searchBar.SizeToFit();
>> this.SearchDisplayController.SearchBar = searchBar; <-- this errors
>> saying readonly
>>
>>
>> I have also tried the following in the events above
>>
>> string[] buttons = new string[] { "POI", "Road", "Postcode"} ;
>> UISearchDisplayController POIsearch = new UISearchDisplayController();
>> POIsearch.SearchBar.ShowsScopeBar = true; <<--- fails here
>> POIsearch.SearchBar.ScopeButtonTitles = buttons;
>>
>> I just need to see a working example to be able to see where I am going
>> wrong, TBH I have tried so many things now that I am about to drop that
>> part of the project until I can find an answer I spent the whole of
>> yesterday googling for an answer and nothing worked.
>>
>> Thanks
>>
>> Alex
>>
>> On 5 Jun 2012, at 13:57, Nic Wise wrote:
>>
>> You may need to show the dialog before it creates the search bar -
>> this happens with NavigationBars too.
>>
>> On Tue, Jun 5, 2012 at 12:40 PM, Alex White 
>> wrote:
>>
>> Hi,
>>
>>
>> I am new to MT and MT.D, I am trying to get my head round how to properly
>>
>> structure the search bar with search scope, I have not found any working
>>
>> examples of SQLite IList into a the tableview.source of an inherited
>>
>> dialogviewcontroller, and then to get the searching to work, I have got
>> the
>>
>> first load of the data working ok I am not getting anywhere with
>> subsequent
>>
>> of that data.
>>
>>
>> In my constructor of my inherited class I have the following
>>
>>
>> base.AutoHideSearch = true;
>>
>> base.Autorotate = true;
>>
>> base.EnableSearch = true;
>>
>>
>>
>> Am I right in thinking that the ILIST<> is persisted at the class level
>> and
>>
>> that the searches don't go back out to the database to build the searches
>>
>> but work off the loaded data?
>>
>>
>> I am also needing to get the search scope buttons into the search bar,
>> but I
>>
>> am hitting null errors with the following code
>>
>>
>> string[] buttons = new string[] { "POI", "Road", "Postcode"} ;
>>
>> UISearchDisplayController POIsearch = new UISearchDisplayController();
>>
>> POIsearch.SearchBar.ShowsScopeBar = true; <<--- fails here
>>
>> POIsearch.SearchBar.ScopeButtonTitles = buttons;
>>
>>
>> I am sure that all of the issues are my lack of understanding and not bugs
>>
>> so any example code just to get me going would be great.
>>
>>
>> Thanks in advance
>>
>>
>> Alex
>>
>>
>>
>> ___
>>
>> MonoTouch mailing list
>>
>> MonoTouch@lists.ximian.com
>>
>> http://lists.x