http://www.raywenderlich.com/81615/introduction-to-realm.
I'm mainly interested in implementing UISearchControllerDelegate and UISearchResultsUpdatingprotocols and changes to tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) associated with implementing a searchBar. Does anyone has a simple working example of a TableViewController with Search using Realm and written in Swift?
updateSearchResultsForSearchController()
I've implemented
updateSearchResultsForSearchController()
function, but it calls an exeption: *Terminating app due to uncaught
exception 'Invalid predicate expressions', reason: 'Predicate expressions
must compare a keypath and another keypath or a constant value'*
суббота, 4 апреля 2015 г., 10:03:14 UTC+6 пользователь Nursultan Bagidolla
написал:
On Sat, Apr 4, 2015 at 4:03 AM UTC, Nursultan Bagidolla <bagi...@gmail.com> wrote:
Hello! I'm trying to implement a tableView searching for my iOS app. There are very few examples of using search function with this database and I'm kinda lost. There are no official guides for filtering results with Realm and the one I was trying to use is this one:http://www.raywenderlich.com/81615/introduction-to-realm.
I'm mainly interested in implementing
UISearchControllerDelegateandUISearchResultsUpdatingprotocols and changes totableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath)associated with implementing a searchBar. Does anyone has a simple working example of a TableViewController with Search using Realm and written in Swift?
--
You received this message because you are subscribed to the Google Groups "Realm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-cocoa...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-cocoa/e1f624ce-007f-4000-929d-41b1d0f56b99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
let searchPredicate = NSPredicate(format: "SELF CONTAINS[c] %@", searchController.searchBar.text)
let array = phrases.objectsWithPredicate(searchPredicate)
searchResults = array as RLMResultsNursultan,
The issue there is with the predicate you're constructing. Instead of SELF, you should be using the name of a string property on your object, i.e. NSPredicate(format: "stringProperty CONTAINS[c] %@",
searchController.searchBar.text). Hope that helps!
--
Samuel Giddins
On Tue, Apr 7, 2015 at 7:40 AM UTC, Nursultan Bagidolla <bagi...@gmail.com> wrote:
let searchPredicate = NSPredicate(format: "SELF CONTAINS[c] %@",
searchController.searchBar.text)
let array = phrases.objectsWithPredicate(searchPredicate)
searchResults = array as RLMResults
понедельник, 6 апреля 2015 г., 22:27:43 UTC+6 пользователь Samuel Giddins
написал:
On Mon, Apr 6, 2015 at 4:27 PM UTC, Help <he...@realm.io> wrote:
Hi Nursultan,
Can you share the NSPredicate that causes that exception to be thrown?
--
Samuel Giddins
On Sat, Apr 4, 2015 at 4:15 AM UTC, Nursultan Bagidolla <bagi...@gmail.com> wrote:I've implemented
updateSearchResultsForSearchController()
function, but it calls an exeption: *Terminating app due to uncaught
exception 'Invalid predicate expressions', reason: 'Predicate expressions
must compare a keypath and another keypath or a constant value'*
суббота, 4 апреля 2015 г., 10:03:14 UTC+6 пользователь Nursultan Bagidolla
написал:
On Sat, Apr 4, 2015 at 4:03 AM UTC, Nursultan Bagidolla <bagi...@gmail.com> wrote:Hello! I'm trying to implement a tableView searching for my iOS app. There are very few examples of using search function with this database and I'm kinda lost. There are no official guides for filtering results with Realm and the one I was trying to use is this one:--http://www.raywenderlich.com/81615/introduction-to-realm.
I'm mainly interested in implementing
UISearchControllerDelegateandUISearchResultsUpdatingprotocols and changes totableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath)associated with implementing a searchBar. Does anyone has a simple working example of a TableViewController with Search using Realm and written in Swift?
You received this message because you are subscribed to the Google Groups "Realm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-cocoa...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-cocoa/e1f624ce-007f-4000-929d-41b1d0f56b99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.