I am building an app in SwiftUI and I've encountered a confusing error:
CrashReportError: Preview is missing environment object "TabViewModel"
Mathematically crashed due to missing environment of type: TabViewModel. To resolve this add `.environmentObject(TabViewModel(...))` to the appropriate preview.
It's asking me to insert the modifier but doesn't mention where to put it.
This happened when I used this modifier down in my code.
.overlay(PGDetailView(animation: animation).environmentObject(tabData))
*Note: 'tabData' is used here: #EnvironmentObject var tabData: TabViewModel
Related
I have trouble writing the MSD detector correctly. However, it has no attribute ''create''.
I wrote the following code. But my session crashed for an unknown reason.
msd=cv2.xfeatures2d.MSDDetector()
kps1=msd.detect(I1)
I will appreciate any help.
unfortunately, you've found a bug here.
there should be a ´XXX_create()´ function, but someone forgot to expose it to the python api, by adding a CV_WRAP to the function signature here
(and no, you cannot use the 'ordinary' constructor, it does not produce a valid instance (will segfault, if you call any method on it !!))
please raise an issue here
if you're able to build from src, try to fix it locally, by changing that line to:
CV_WRAP static Ptr<MSDDetector> create(....
Extension 'RapidAPI.vscode-rapidapi-client' CANNOT use API proposal: quickPickSeparators.
Its package.json#enabledApiProposals-property declares: [] but NOT quickPickSeparators.
The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api RapidAPI.vscode-rapidapi-client
anyone knows how to fix it?
Thank you so much
I'm trying to create a Sitelet with SiteletBuilder in C#:
return WebSharper.Sitelets.Content.Page(...)
However, the class Websharper.Sitelet contains Content both as Struct and Class.
So, this does not compile.
Versions of Zafir-Libraries are
Zafir 4.0.152.29-beta5
Zafir.CSharp 4.0.152.29-beta5
Zafir.Html 4.0.56.95-beta5
Zafir.UI.Next 4.0.102.33-beta5
How to reference WebSharper.Sitelets.Content proberly?
Or is this indeed a bug?
Thanks for the report, created ticket: https://github.com/intellifactory/websharper/issues/645
I have been testing with having using WebSharper.Sitelets; and then using with shorter form Content.Page(...). C# can resolve this for some reason, although the name conflict indeed exists in WebSharper.Sitelets.dll
I'm a beginner in programming world and I choose "Swift" to be my first programming language. Everything so far went great but now I'm learning about structures and instances, how to update them and so on and I'm getting mysterious console error and I can not move further with my project.
So problem.
I created struct called "Tiger.swift". There is properties for that struct such as name, age, etc. In "viewController" I created new variable called myTiger and tried to update it properties and after my created println command in console appears something strange. It compiles and tells me that "build was succesfully" but in console appears something like this.
"My Tiger's name is: Tigger, it's age is 3, it's age is 3 and it's image is Optional()"
And this strange thing is "Optional". Because if I later want to update my instances it does not compiles and shows me :
"My Tiger's name is: Tigger, it's age is 3, it's age is 3 and it's image is Optional()
fatal error: unexpectedly found nil while unwrapping an Optional value
(lldb) "
There is a link to Git repository ( https://github.com/llinards/lionsandtigers ) in case there isn't a quick solution or a little bug which accidentally I have made.
I would appreciate any help from you!
Thanks!
I took a closer look at your code:
I changed the image property of your Tiger struct to be optional because you don't have a template or placeholder image (if you have one you can set the initial value to that image).
Your storyboard (including your IBOutlets) very pretty screwed up ... I don't know how that happened, I have never seen anything like this before ...
I uploaded a working copy of you project here (It's hard to show that IB-related stuff here, I just deleted and re-added your labels and views).
The relevant code changes I did are the following:
In your Tiger model object (Tiger.swift) I changed the last line from
var image = UIImage(named:"")
to
var image: UIImage?
The first error you encountered was because UUImage(named:"") returns nil. In Swift a non-optional type must never ever be nil.
In your ViewController a changed the Tiger-initializtion to
Tiger(age: 3, name: "Tigger", breed: "TOne", image: UIImage(named: "t1.jpg"))
Your println() call shows:
My Tiger's name is: Tigger, it's age is 3, it's age is 3 and it's image is Optional(UIImage: 0x7f8d78f43c90)
This is correct since your image is now wrapped into an optional.
I'm trying to figure out which libraries I need to pass to #MirrorsUsed to get my app compiled and working. Sometimes, it's easy to figure out which library may be missing since a descriptive error is thrown such as Uncaught Unsupported operation: Cannot find class for: NgAttr .
Other times, I get a more obscure message, such as NullError: Cannot call "$gt" on null with no clue as to which library I may be omitting. Is there a better approach to this, besides trial and error?
In case you're wondering, this is an angular app and this is how I currently have it configured:
#MirrorsUsed(targets: const[
'angular',
'angular.core',
'angular.core.dom',
'angular.filter',
'angular.perf',
'angular.directive',
'angular.routing',
'angular.core.parser.dynamic_parser',
'angular.core.parser.lexer',
'todo',
'perf_api',
'List',
'NodeTreeSanitizer',
'PlaybackHttpBackendConfig'
],
override: '*')
import 'dart:mirrors';
Use
pub build --mode=debug
this does tree shaking but retains (mostly) the original Dart names.
Then debugging the generated JavaScript usually lets deduce the source of the exception.
EDIT
IMHO these are not necessary anymore, because they were added to #MirrorsUsed in the Angular libs.
'angular',
'angular.core',
'angular.core.dom',
'angular.filter',
'angular.perf',
'angular.directive',
'angular.routing',
'angular.core.parser.dynamic_parser',
'angular.core.parser.lexer',