IOS: UITableView with search: displayController not selectable? - ios

I'm a newbie trying to create a simple sample app that takes json data from a website and list it on a UITableView.
Each voice in the UITableView is clickable to show more details.
I started from this example/app because it was clean and working:
http://nscookbook.com/2013/12/ios-programming-recipe-16-2-populating-a-uitableview-with-data-from-the-web-ios-7-and-afnetworking-2-0/
What I was missing was a searching function, so following this other page and adapting code I got it working:
http://www.appcoda.com/search-bar-tutorial-ios7/
The only problem I have is that when I search for something I get correct results filtered, but the list of results it's not clickable (to go to the details view/page) and it does not contain the small 'Rating' subtext.
Basically the filtered list only gets the 'Name' and nothing else of the original array, and the cells are not clickable.
What am I missing?

I solved eventually the issue using a SearchBar without its own display view, so basically refreshing the main tableview (already configured to show all details) if/when something is searched.
The search simply filter the main array and in all functions to display the result I show either the main array or the filtered one.
Thanks!

Related

swift search contents of local HTML files via search bar and display results in tableview

I have a very simple iOS swift app (storyboards) that displays a tableView controller to show a list of items, let's say in this case a list of fruits (Bananas, Cherries, Strawberries, Grapes, Pears).
Tapping on any table cell opens another viewController, loading a webView which displays a local HTML page (located in a directory within the app) of formatted content with respect to that item. So if you tape on "Bananas", it will load a local HTML file with a ton of formatted content regarding Bananas.
I am trying to add a search bar to the tableView controller to allow me to search the contents all of the HTML files within the app for a particular string, and returning a filtered tableView list including only those results that match the string appearing in the end HTML files.
For example, the HTML pages for "Cherries" and "Strawberries" contain the word "red," so if I search for "red" via the search bar, the tableView would filter and only show "Cherries" and "Strawberries" because only those pages have the search term in their respective HTML contents.
Basically, I am trying to make a very simple search engine within the app.
There are a ton of tutorials about how to filter a tableView based on search bar, but those only talk about filtering by the Label, not by the end content.
Is something like this even possible? I don't know where to start.
Trying to avoid databases or anything too complicated as it is a very simple app that just needs a basic content search feature.

Appium doesn't update it's view in list element and subelements

I am working on iOS native app and when trying to read from tableView/tableCells I have a problem getting the updated values. At the first time i enter the page/screen I can see all cells. But , if i create an action that adds another cell to the table view when I try to get the list of cells I see an empty list.
Also, When i change a subelement in that cell I can't see the changed sub element both in inspector and in the code.
I tried switching to a different page and also changing tabs in that page and reread the table/cell and subelements but it didn't help.
I've had this issue before. There is no actual reload elements kind of function that I've seen. However a workaround I've found that works is to simply find an element that exists and it'll reload the elements after it does that.
For example:
yourMethodThatLoadsNewElements();
driver.findElementBy(pathToElementThatExistedBefore);
driver.findElementBy(pathToElementThatWasJustLoaded);

Rails lazy loading

I have an app which has an index page that shows currently 10 search results. Rather than doing the standard lazy load with javascript, similar to the Railscast where new objects are shown when the user gets to the bottom of the page, I would like to have to page have a button on the bottom. When that button is clicked, I would like the next 10 objects from the search results to show and so on. Is there a tutorial for this/how would I do this?
you should use gem like
https://github.com/amatsuda/kaminari or https://github.com/mislav/will_paginate.

How can I add selectable suggestion on textfield

I'm not sure if I use the phrase correctly.
The function I want is that after user typed some characters (or clicked a button), a list will be shown under the textfield.
An easy example is Google search. After you typed "fb" or "faceb", it shows "facebook" in the suggestion list.
The content of the list is stored in an array, which comes from the return of web services.
Thanks
You've got to intercept the keystrokes with UITextView textViewDidChange. Then, with each keystroke, you implement the lookup algorithm and display your list of selections above or below the UITextView where the data entry is occurring. The list has to somehow be "touchable" to select from it.
Ray Wenderlich has a tutorial that shows how this can be done over at his blog
He creates a table below the text field that is touchable.
There is also a sample project there.

MonoTouch.Dialog events and Sections

i need one more help.
First question is: I understood that the sections, text, images, etc on a MonoTouch.Dialog will be created dynamically. But can i have buttons as well? If yes, how can i have the events of that button binded.
Second question is : Basically i have a search text, and a button, on the click of the button, the text is sent to the Twitter-url, to get the tweets, these tweets need to be displayed, now they contain, images, texts, and reply and a favourite. Can the search result and the Search Button+Edit box, be the part of one ViewController?
But can i have buttons as well?
Element in the DialogViewController often act like buttons. But if you want a real UIButton you can do something like: Monotouch.Dialog two tables
Can the search result and the Search Button+Edit box, be the part of one ViewController?
I don't see any problem doing that. Use the code from the above link and add a EntryElement.
the text is sent to the Twitter-url, to get the tweets, these tweets need to be displayed
Have you looked at TweetStation ? It's an open source application that is based on MonoTouch.Dialog. It can likely help you answer questions on both fronts.

Resources