last day (19 days later) » 

4:50 PM
hello
Charles
import Foundation
import UIKit
import Parse

class SearchTableViewController: UITableViewController
{


var DataFromParse = [String]() // this array will have all data from Parse





// var searchResults = [String]()

//var resultSearchController = UISearchController()

override func viewDidLoad()
{
super.viewDidLoad()

query() // <---- This is how you called the function query

}




func query()
{

/*
This function will get data from Parse and save all firstnames into DataFromParse array
so try this code
@Charles
this code will get your data from parse then show it in your tableview
you can chat now
because i just vote your question
@Charles
 
user5590773
Finally
 
5:05 PM
hey
finally
 
user5590773
Thanks for your help!
 
user5590773
anyway
 
do you see the code i posted
 
user5590773
I have replaced my code with yours, but I get this error here func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath)

cell.textLabel?.text = DataFromParse[indexPath.row]

return cell
}
 
user5590773
it says it conflicts with previous value
 
5:06 PM
what is the error
 
user5590773
I' guessing the value above it
 
take a screenshot
and upload it
 
user5590773
Can I upload it herE?
 
yeah
pressed upload
 
user5590773
haha I cant find it ! Such a bad day today!
 
5:10 PM
its by the send button
my friend
 
user5590773
I only have a send button...
 
user5590773
nothing next to or above it
 
user5590773
 
user5590773
try that link
 
user5590773
5:12 PM
I dont get that upload button.. must be my reputation again!
 
user5590773
wait, I think i copied it wrong...
 
user5590773
wait no, i did
 
give me a sec
 
user5590773
I'm basically trying to achieve the search on instagram.. I managed to get the search bar to work... but I need it to open a new view when i search
 
user5590773
as I want the page with the search bar to be the homepage, and not a list
 
5:18 PM
you should be doing this on step at the time
you cannot be rushing
import Foundation
import UIKit
import Parse

class SearchTableViewController: UITableViewController
{


var DataFromParse = [String]() // this array will have all data from Parse

override func viewDidLoad()
{
super.viewDidLoad()

self.tableView.delegate = self
query() // <---- This is how you called the function query

}



func query()
{

/*
This function will get data from Parse and save all firstnames into DataFromParse array
*/

let query = PFQuery(className:"_User")
query.findObjectsInBackgroundWithBlock { (results: [PFObject]?, error: NSError?) -> Void in
reason you had the error because you were missing a }
 
user5590773
Ok, so I've run that
 
user5590773
I basically get a table view, is that right?
 
did you see any data from parse
on the tableviewRow
 
user5590773
i.stack.imgur.com/4Bwp0.png I just get that on the simulator
 
user5590773
nothing else seems to happen
 
5:22 PM
did you put the name of cell identifier
go on mainStoryboard
then selected the tableView
 
user5590773
Ye
 
did you do that
 
user5590773
Yep
 
or did you assign the tableView a file
 
user5590773
What if we try to get teh users?
 
user5590773
5:27 PM
the* usernames
 
for x in DataFromParse
{
print(" \(x) \n")
}
put this in the viewDidLoad
to see if you are actually have data from parse
place the code after the query cal
**
call
 
user5590773
Which code
 
for x in DataFromParse
{
print(" \(x) \n")
}
 
user5590773
so I remove it from viewDid Load
 
i said place it
under the query code
 
user5590773
5:35 PM
what should I see?
 
you have to run the code
then look into the console
you should whatever you have inside of the array
 
user5590773
override func viewDidLoad()
{
super.viewDidLoad()

self.tableView.delegate = self
query() // <---- This is how you called the function query

for x in DataFromParse
{
print(" \(x) \n")
}

}
 
user5590773
I put it there? but I get no response in the console...
 
user5590773
so if IT's in the right place something wrong with parse
 
did you ran the code
and did you actually set up Parse Correctly
 
user5590773
5:40 PM
I guess so, as the login and signup works perfectly
 
do me a favor close the project then create a zipfile of it
send it here
with everything because what you send before was not running
send it with all parse object
 
user5590773
 
user5590773
wait
 
user5590773
didnt work
 
this is a new project
and selected the simulator
 
user5590773
I can't share my entire project with you, as theres alot init..
 
user5590773
But thanks for the help anyways, Ill try and figure it out somehow..It's weird
 
6:03 PM
you know what
just send it through google drive
 
user5590773
veasoftware.com/tutorials/2015/6/27/… if you have a quick look at this tutorial, is there not a way to change the code init to connect it up to parse instead of just on xcode?
 
user5590773
I know how to do most of teh connecting it up to parse, its just laying it out in the correct way of that project from the tutorial
 
that's i wanted to see the code you have
so i could point out where you making mistake
 
user5590773
what if i download the project from that tutorial and connect it up to a temporary parse account, so both of us can see it
 
user5590773
then all I'll nee dto do is copy it over
 
user5590773
6:09 PM
Unfortunately I cannot share my project with you, as theres alot of stuff I cannot share..
 
don't copy code
its better to start from scratch where you could learn
don't share it
just start from scratch
 
user5590773
5 mins
 
what do you mean
 
user5590773
Ill do something
 
user5590773
 
user5590773
try that, it should work
 
user5590773
go into parse if you need to: tester@me.com
 
user5590773
password: test123test
 
user5590773
Thank you for helping me anyway..
 
i have to go now .. but later on i could help
you
but you need to go over the basic
such as how to use a tableview by itslelf
how to do simple query
from parse
 
user5590773
6:39 PM
Ok thanks
 
user5590773
9:46 PM
Hi, mate you there? I've still had no luck...I re coded it, and when over it several times..! Just can't figure it out, I dont know if its my code, or the order its in..!
 
11:08 PM
hello
 
user5590773
11:30 PM
Hi
 
user5590773
Hows it going?
 
not bad
did you finish it
 
user5590773
Nope, I feel like smashing my computer!! God know how many times or ways I have tried it!! Just not working out for me
 
user5590773
It must be how I'm ordering the code or I must be missing some!
 
user5590773
I cant find anything on google though...
 
11:42 PM
run the code and send me a pic of xcode
 
user5590773
11:58 PM
Well on my main project I have just resturned to the code I had before which works when I search etc...To try an figure a way to make it work showing a different view.. with this code I'm using a viewController TableView, Cell and a normal Search bar
 
user5590773
It searches and show the data from parse perfectly
 
user5590773
import UIKit
import Parse
@available(iOS 8.0, *)
class SearchViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, UISearchBarDelegate {

@IBOutlet weak var myTableView: UITableView!
@IBOutlet weak var mySearchBar: UISearchBar!
var searchResults = [String]()

override func viewDidLoad() {
super.viewDidLoad()

}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

func searchBarSearchButtonClicked(searchBar: UISearchBar)
 
user5590773
The other code I have is the one you gave me
 
listen you have to do it step by step
you should be focus on getting the data in show it into your tableview
 
user5590773
what do you mean
 
user5590773
11:59 PM
I dont want any data showing, unless the user searches
 
getting data from parse and display into the cell of your tableview
 

  last day (19 days later) »