-
Re: JSON problem in App Development with Swift's project "Restaurant"
vitalik2602 Aug 18, 2017 5:10 AM (in response to pegasusroe)Hi!
Have the same problem. Did you solved it ?
-
Re: JSON problem in App Development with Swift's project "Restaurant"
mobiapp Sep 7, 2017 10:25 PM (in response to pegasusroe)there's a mistake in the JSON – you've got a trailing comma after the last menu item. If you plug it into JSONLint you'll see the issue
-
Re: JSON problem in App Development with Swift's project "Restaurant"
mkfdeveloper Oct 15, 2017 3:01 PM (in response to pegasusroe)Have you found a solution? I saw a fix on reddit but haven't tried yet. I fixed the JSON but that didn't seem to fix the problem.
https://www.reddit.com/r/swift/comments/6l80gj/json_problem_in_app_development_with_swifts/
-
Re: JSON problem in App Development with Swift's project "Restaurant"
mkfdeveloper Oct 15, 2017 4:42 PM (in response to mkfdeveloper)Replying to my own issue in case someone encounters this:
(1) Addressing localhost will work from the local device, such as the xcode simulator, but not if you're using an external iPhone or iPad to run your code.
(2) JSON file has a trailing comma, needs to be deleted.
(3) Server file is broken, the reddit link above has the correct fix.
Please let me know if you find a better solution to this!
-
Re: JSON problem in App Development with Swift's project "Restaurant"
tonytero Sep 18, 2018 11:44 PM (in response to mkfdeveloper)hi, it look like you go through it. i am stuck on this for days
so far i am delete the trailing comma on menu.json
save the OpenRestaurant.py file and run it on terminal.
my terminal show this after start the python file: [
Bottle v0.12.13 server starting up (using WSGIRefServer())...
Listening on http://localhost:8090/
]
But when i try to aceess to localhost:8090, it shown: [
Error: 404 Not Found
Sorry, the requested URL 'http://localhost:8090/' caused an error:
Not found: '/'
]did i do anything wrong? any comment is greatly appreciated
i stuck at here and cant proceed further
-
-
-
Re: JSON problem in App Development with Swift's project "Restaurant"
balkes Dec 8, 2017 5:33 AM (in response to pegasusroe)There is indeed an extra comma at the end of the JSON file, but the simple fix for localhost is to simply replace the substring in the baseURL with the IP of your Mac
-
Re: JSON problem in App Development with Swift's project "Restaurant"
tonytero Sep 18, 2018 11:45 PM (in response to balkes)hi, i am new to this. you said "simple fix for localhost is to simply replace the substring in the baseURL with the IP of your Mac"
may i ask how to do this? where to find the substring in the baseURL?
-
-
Re: JSON problem in App Development with Swift's project "Restaurant"
NorthmanV Mar 31, 2018 4:47 AM (in response to pegasusroe)I guess I found a solution:
Right-click on the OpenRestaurant icon - Choose Show package - Contents - Mac OS - Open Restaurant.
The server begins work for me.
-
Re: JSON problem in App Development with Swift's project "Restaurant"
josegil Sep 6, 2018 3:18 PM (in response to NorthmanV)I was stuck on it but your workaround solve my troubles. It works like a charm.
Thank you very much!
-
-
Re: JSON problem in App Development with Swift's project "Restaurant"
lobstaboy Jan 3, 2019 10:51 PM (in response to pegasusroe)The app runs and pulls up the table views, but the categories are not displayed. I am getting this error message:
nw_socket_handle_socket_event [C1.1:2] Socket SO_ERROR [61: Connection refused]
nw_socket_handle_socket_event [C1.2:2] Socket SO_ERROR [61: Connection refused]
TIC TCP Conn Failed [1:0x283551bc0]: 1:61 Err(61)
Task <767BD871-B6DD-4CD8-87CA-84322344BF6B>.<1> HTTP load failed (error code: -1004 [1:61])
Task <767BD871-B6DD-4CD8-87CA-84322344BF6B>.<1> finished with error - code: -1004
I tried to run the file from the Reddit post, but it comes up with the same result. The server seems to be working, it doesn't look like it does exactly in the book, but going to the local server site shows: The restaurant is up and running! I think it may still blocking the HTTP even though I added the exception (and tried others) in info.plst.