我从API获取数据,这是我的回复
{
author = "Joanne Chiu";
description = "Asian stock markets tumbled Wednesday following overnight declines in the U.S. and Europe. Key markets including Japan, Hong Kong and mainland China fell more than 1.5%. Japan\U2019s Nikkei average shed 1.7% to hit a six-week low, while South Korea\U2019s KOSPI slipped\U2026";
publishedAt = "2018-05-30T05:04:26Z";
source = {
id = "the-wall-street-journal";
name = "The Wall Street Journal";
};
title = "Asian Stocks Down, Following Global Concerns Over Italy's Political Turmoil";
url = https://www.wsj.com/articles/asian-stocks-down-following-global-concerns-over-italys-political-turmoil-1527656546;
urlToImage = https://images.wsj.net/im-12406/social;}
我想将所有数据存储到数据库中......这是我的查询
let query : NSString = NSString(format: "insert into newsData (sourceName, authorName, title, description, url, urlToImage, publishedAt) values (%@, %@, %@, %@, %@, %@, %@)", sourceName, authorName, title, description, url, urlToImage, publishedAt)
但它给我一个语法错误
执行查询时出错" Wall":语法错误'
我认为这是因为特殊性格" - "所以删除它但仍然给我同样的错误