How can I store comments for a post using Parse & Swift? - ios

I'm honestly stumped as to how I could do this. I've been searching and trying out different methods for the past day or so and none have worked. What I'm basically trying to do is store comments for a post (Each row represents a post). I've been reading through the Parse documentation and have tried to implement some of the things that they have there into my code in order to achieve this, but that hasn't worked out either. If anybody could help me out, I'd be extremely greatful.

This exact task is the example provided in the documentation.
http://docs.parseplatform.org/ios/guide/#relational-data
You need to create a new class called "Comments" and then refrence its parent post as one of it's columns.

Related

Reserving rows from Parse using Pointers

I'm trying to retrieve rows from a class called Consultations using a column called userPointer. It should be straight forward but I've been struggling with this for couple of days:
Let us for example say I would like to get the first object
where userPointer = ttnRYrdu0J
Note: I will replace ttnRYrdu0J with PFUser.current() later to be dynamic if this works.
I wrote the code like this:
Unfortunately it doesn't work, however when I use any other columns such as objectId or type it works fine.
Any help please!!
Thanks
I've got the answer I used PFUser.current() instead of hard coding it which is what I want at the end because I want to show the consultations of the current user and it worked! I'm still confused why it is not working when I hard code the value but I got what I want.

Google Slides API: replaceAllLinks?

In my implementation, I go through a loop to duplicate a slide and then update the text and images of each new slide using ReplaceAllText and ReplaceAllImages. I can do that in one batchUpdate. I wish I could do the same and "ReplaceAllLinks" but could not find anything to do that. Any ideas ?
You want to replace all links in a Google Slides using Slides API.
If my understanding is correct, how about this answer? Please think of this as just one of several possible answers.
Issue and workaround:
Unfortunately, in the current stage, there is no methods for directly achieving "ReplaceAllLinks". So it is required to use a workaround. In this answer, I would like to propose the following workaround.
Retrieve the object IDs you want to replace the link using the method of presentations.get.
Replace the links of the retrieved object IDs using updateTextStyle and updateShapeProperties of the method of presentations.batchUpdate.
In this case, 2 API calls are required.
References:
UpdateTextStyleRequest
UpdateShapePropertiesRequest
If I misunderstood your question and this was not the direction you want, I apologize.

How to merge streams in flutter?

I'm trying to query 2 collections from firebase and put it in a streambuilder.
There are lot of questions like this,but a lot of them are unsolved,or I just didn't really found the right one.
So,I got a users,and a salons collection in Firebase.
user1 contains his name,age,etc and he have another collection called favsalons. In salons are the description of salons like name,owner,etc
In app I want to list out the favsalons with their datas.
In SQL it would look something like this : Select salons.name,salons.owner From salons,user Where userID=user1 and favsalonsID=salonsID
Since I'm new to flutter,and to the non SQL databases,I got no clue how to do it.
Is there a simple solution?
You can't... You need to modify the structure of your data.
Watch the firebase team explanation.
Solved with simply nesting two streambuilders.

How to delete a column in Parse.com using Swift

How do I delete a column in Parse using Swift? I am new to Parse. I have looked at the Parse documentation, but could not figure it. After trying many variations of the docs in my code nothing has worked. If it is not possible to delete a column, then how do I delete a row.
In your example code, QuestionsandAnswers is an object, not a class.
If you really intend to delete a class, that is now possible with the Schema API that the Parse team just released: http://blog.parse.com/announcements/releasing-the-schema-api/
Here is the specific documentation for removing a class which you can do with cURL or Python: https://parse.com/docs/rest/guide#schemas
Good luck (and be careful). :)

Need assistance getting (parsing?) these JSON data into Xcode

Before I start, I would like to say that I'm quite a newbie to Xcode and the C Language, and I'm trying my best to learn as much as I can. I have researched for about 2 days now before posting this question but could not find anything helpful :( I am genuinely stuck and would appreciate ANY help. This is most likely a very simple/basic question:
Basically, I am trying to get this data (LINK) which is apparrently in UTF-8 JSON and display it on a simple label on Xcode. However, I do not know how to get that data and parse it at all. I've followed a tutorial online with success, but that deals with JSON objects rather than arrays (which I think I am dealing with).
I would HIGHLY appreciate it if someone could extract/parse the data from the first link given into a basic label on Xcode in code format.Preferably with commentary on what most lines of code are doing for my own benefit, as this would really help me understand how it works. Hopefully from there, I would be able to make good progress.
Once again this is highly appreciated!
Thank YOu.
Here's a sample of the JSON URL for convenience if you don't want to click the link:
[4,"1.0",1343920773538]
[1,"Spring Gardens","59581","275","Barkingside",1343920940000,1343920940000]
[1,"Spring Gardens","59581","275","Barkingside",1343921717000,1343921717000]
[1,"Spring Gardens","59581","549","Loughton",1343921858000,1343921858000]
[1,"Spring Gardens","59581","275","Barkingside",1343922204000,1343922204000]
[2,"Spring Gardens","59581","8a56a0ab37b72b400137cb7cfd954038_29222",0,3,"Bus routes serving this stop are subject to change during the Olympics and Paralympics games. For more information visit www.tfl.gov.uk/buses for more information.",1344668400000]
Use JSONObject like that tutorial shows, you should get a NSDictionary or NSArray at the end which will contain all your values just map those to the label in the end.
If you dont wan to do that, save the response in a char array and navigate through it while checking for [ or " characters when you find one read the chars until the next occurrence and save all the data you read into an array or something but this is messy and involves atleast 3-4 hours of writing your own custom logic for JSON data decryption, you should use JSONObject which is pretty simple
Hi i have this same problem. I have been looking for a json solution and currently i found that the best way to deal with this data is to parse is as csv instead. The solution seems straight up when you try to parse it as CSV instead of JSON

Resources