I drag a image.jpg into the assets.xcassets. And I want to read the jpg data in my code by
"var imageData = NSDataAsset(name: "image")?.data"
However, I get an error: "CoreUI: attempting to lookup a named data 'image' with a type that is not a data type in the AssetCatalog". And "imageData" is always nil.
Do I make a mistake or miss sth? Thanks in advance.
"var imageData = NSDataAsset(name: "image")?.data"
However, I get an error: "CoreUI: attempting to lookup a named data 'image' with a type that is not a data type in the AssetCatalog". And "imageData" is always nil.
Do I make a mistake or miss sth? Thanks in advance.