小编She*_*ar 的帖子

cloudkit错误未收到资产的authToken

为什么在运行以下代码时出现此错误?:

“内部错误”(1/1000);“未收到资产的authToken”

我认为这与setObject最后一行中的代码有关。

let documentsDirectoryPath:NSString = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as NSString
var imageURL: URL!

let imageData = UIImageJPEGRepresentation(self.newImage, 1.0)
let path:String = documentsDirectoryPath.appendingPathComponent(self.newImage.description)
try? UIImageJPEGRepresentation(self.newImage, 1.0)!.write(to: URL(fileURLWithPath: path), options: [.atomicWrite])
imageURL = URL(fileURLWithPath: path)
try? imageData?.write(to: imageURL, options: [.atomicWrite])

let imageAsset:CKAsset? = CKAsset(fileURL: URL(fileURLWithPath: path))


curImages = record["Images"] as! [CKAsset]
curImages.append(imageAsset!)

print("saving image")
record.setObject(curImages as CKRecordValue?, forKey: "Images")
Run Code Online (Sandbox Code Playgroud)

ios swift cloudkit

3
推荐指数
1
解决办法
264
查看次数

反应原生地图标记不显示

我正在尝试在我的 MapView 上显示标记。我已经按照示例进行操作,但没有任何标记显示在地图上,尽管我可以将地图居中并显示位置指示器。我已经从 react-native-maps 导入了 MapView 和 Marker。任何帮助,将不胜感激。

  constructorprops: any {
    super(props);
    this.state = {
        region: defaultRegion,
        markers: [
            {
                coordinate: {
                    latitude: 37.298984,
                    longitude: -122.050362
                },
                title: "Best Place",
                description: "Description1",
                id: 1
            },
            {
                coordinate: {
                    latitude: 37.297803,
                    longitude: -122.050037
                },
                title: "Best Place2",
                description: "Description 2",
                id: 2
            }
        ]
    };
}

centerLocation = () => {};

componentDidMount() {
    this.centerLocation();
}

render() {
    return (
        <MapContainer>
            <MapView
                style={styles.map}
                showsUserLocation={true}
                region={this.state.region}
            />
            <CenterButton centerLocation={this.centerLocation} />
            {this.state.markers.map((marker: any) => …
Run Code Online (Sandbox Code Playgroud)

location google-maps marker reactjs react-native

2
推荐指数
2
解决办法
1万
查看次数

标签 统计

cloudkit ×1

google-maps ×1

ios ×1

location ×1

marker ×1

react-native ×1

reactjs ×1

swift ×1