Good morning to everyone, I have a trouble with storage of Date() format.
I wrote this code and I convert Date() as a string in a swift file with string array:
var dayOfRecord = Date()
var dataOK: String {
return DateFormatter.localizedString(from: dayOfRecord, dateStyle: .short, timeStyle: .none)
}
In another swift file (AddView) I wrote this code:
DatePicker("", selection: $dayOfRecord, displayedComponents: .date)
Now I have to store this information in an array of other strings but return an error:
Cannot find '$dayOfRecord' in scope
Where is my error?
Thanks!
Post
Replies
Boosts
Views
Activity
Hi everyone, I'm coding my first app and I have this trouble in debug when I open library photo on simulator:
2023-04-06 17:51:06.802034+0200 (appName)[69971:1574727] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x600003cea6c0 'accessoryView.bottom' _UIRemoteKeyboardPlaceholderView:0x7fb11612be90.bottom == _UIKBCompatInputView:0x7fb11613bf30.top (active)>",
"<NSLayoutConstraint:0x600003c31810 'assistantHeight' SystemInputAssistantView.height == 45 (active, names: SystemInputAssistantView:0x7fb115746a40 )>",
"<NSLayoutConstraint:0x600003cea440 'assistantView.bottom' SystemInputAssistantView.bottom == _UIKBCompatInputView:0x7fb11613bf30.top (active, names: SystemInputAssistantView:0x7fb115746a40 )>",
"<NSLayoutConstraint:0x600003cea3f0 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x7fb11612be90]-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x7fb115746a40 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600003cea3f0 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x7fb11612be90]-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x7fb115746a40 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
Could it be a problem generated by the simulator?
Thanks!
Good morning to everyone!
Now my app is working but in console I have this error:
2023-03-21 07:27:25.423880+0100 PizzaList[89927:3378610] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x60000311bb10 'accessoryView.bottom' _UIRemoteKeyboardPlaceholderView:0x7f7bcad5c1e0.bottom == _UIKBCompatInputView:0x7f7bca946620.top (active)>",
"<NSLayoutConstraint:0x600003117c00 'assistantHeight' SystemInputAssistantView.height == 45 (active, names: SystemInputAssistantView:0x7f7bc9f36bb0 )>",
"<NSLayoutConstraint:0x60000311b890 'assistantView.bottom' SystemInputAssistantView.bottom == _UIKBCompatInputView:0x7f7bca946620.top (active, names: SystemInputAssistantView:0x7f7bc9f36bb0 )>",
"<NSLayoutConstraint:0x60000311b840 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x7f7bcad5c1e0]-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x7f7bc9f36bb0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000311b840 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x7f7bcad5c1e0]-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x7f7bc9f36bb0 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
I must import UIKit, I think. Right?
Thanks!
Hi Devs, I'm new to coding and studying with an old course on Xcode 11.
When building the application, a variable with its declaration is inserted in a line of the SceneDelegate file (let contentView = ) which however no longer exists.
How is it resolved? I couldn't go on anymore.
Thank you all.
Good morning, I have a problem. I'm a newbie on coding and I'm studying Swift with an old course online with Xcode 11 but I have Xcode 14 and some things are different.
I'm building a test app to learn code but now I don't view the canvas, is in error, and the diagnostic give me this:
API Misuse: Attempt to serialize store access on non-owning coordinator (PSC = 0x600000dd9880, store PSC = 0x0)
SchemeBuildError: Failed to build the scheme "PizzaList"
API Misuse: Attempt to serialize store access on non-owning coordinator (PSC = 0x600000dd9880, store PSC = 0x0)
Compile asset catalogs:
CoreData: error: API Misuse: Attempt to serialize store access on non-owning coordinator (PSC = 0x600000dd9880, store PSC = 0x0)
CoreData: error: API Misuse: Attempt to serialize store access on non-owning coordinator (PSC = 0x600000dd9880, store PSC = 0x0)
/* com.apple.actool.errors */
: error: ERROR: Identical key for two renditions
(E)Key
element: Grouped/Packed Images
part: Artwork Image
value: (null)
identifier: 0
dimension1: 0
state: (null)
scale: 2
idiom: phone
subtype: 0
gamut: sRGB
target: any
sizeClassHorizontal: universal
sizeClassVertical: universal
graphicsFeatureSetClass: GLES2,0
memoryClass: 0
target: any
appearance: (null)
localization: (null)
glyphWeight: (null)
tglypSize: (null)
deployment: any
What is the problem?
Thanks to all!