Professional Documents
Culture Documents
Fetching Data From Firebase Not Working Simulator Crash "Thread 1: EXC - BAD - ACCESS (Code 2, Address 0x16e607fe0) "
Fetching Data From Firebase Not Working Simulator Crash "Thread 1: EXC - BAD - ACCESS (Code 2, Address 0x16e607fe0) "
1. Products
1.
2.
Raza Ahmed
3.
4.
5.
6.
7.
fetching data from firebase not working Simulator crash "Thread 1:
EXC_BAD_ACCESS (code=2, address=0x16e607fe0)"
Ask Question
Asked today
Modified today
Viewed 4 times
my Swift code does not fetch the data from firebase loggin user. in the LoginForiOSApp file he gives
the error "Thread 1: EXC_BAD_ACCESS (code=2, address=0x16e607fe0)" the code from the
LoginForiOSApp file is
"wugfdbhsjcknamnjedwbfuvybdhaklmwdneiubfwywidjnqoxkamXWNODEFUBIWQDNJOKMxnoe
fwuibnjqoksmlnoewfjbiunjokasmnojcwefubicdjosakmcnojvbeirugdjnwcsknojwcksmnovjdsckmlnojb
eiruywdcnjoiwburycdjnoibuwrwudjnosacibuvwdcjnsaocibvuwdcjnsobiwuvdcjnso" <- is niks
import SwiftUI
import Firebase
@mainyour text
struct LoginForiOS: App {
init(){
FirebaseApp.configure()
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
} `
VStack(spacing: 12){
TextField("Email", text: $emailID)
.textContentType(.emailAddress)
.border(1, .gray.opacity(0.5))
.padding(.top,5)
Button("Register Now"){
createAccount.toggle()
}
.fontWeight(.bold)
.foregroundColor(.black)
}
.font(.callout)
.vhAlign(.bottom)
}
.vhAlign(.top)
.padding(15)
.overlay(content: {
LoadingView(show: $isLoading)
})
//MARK: Register View VIA Sheets
.fullScreenCover(isPresented: $createAccount) {
RegisterView()
}
//MARK: Displaying Alert
.alert(errorMessage, isPresented: $showError, actions: {})
}
func loginUser(){
isLoading = true
closeKeyboard()
Task{
do{
// With the help of Swift Concurrency Auth can be done with Single Line
try await Auth.auth().signIn(withEmail: emailID, password: password)
print("User Found")
try await fetchUser()
}
}
}
func resetPassword(){
Task{
do{
// With the help of Swift Concurrency Auth can be done with Single Line
try await Auth.auth().sendPasswordReset(withEmail: emailID)
print("Link Sent")
}catch{
}
}
}
I builded the app and i just have to wait and then he gives the error "Thread 1: EXC_BAD_ACCESS (code=2,
address=0x16e607fe0)"
ios
swift
iphone
xcode
Share
Edit
Follow
New contributor
Add a comment
Report this ad
Links
Images
Styling/Headers
Lists
Blockquotes
Code
HTML
Tables
Advanced help
ZIYAXSERVERS is a new contributor. Be nice, and check out our Code of Conduct.
ios
swift
iphone
xcode
or ask your own question.
The Overflow Blog
CEO update: Eliminating obstacles to productivity, efficiency, and learning
Announcing more ways to learn and grow your skills
Featured on Meta
Accessibility Update: Colors
2022: a year in moderation
Collectives: The next iteration
Temporary policy: ChatGPT is banned
We’re bringing advertisements for technology courses to Stack Overflow
Related
11
12
Question feed
STACK OVERFLOW
Questions
Help
PRODUCTS
Teams
Advertising
Collectives
Talent
COMPANY
About
Press
Work Here
Legal
Privacy Policy
Terms of Service
Contact Us
Cookie Settings
Cookie Policy
STACK EXCHANGE NETWORK
Technology
Culture & recreation
Life & arts
Science
Professional
Business
API
Data
Blog
Facebook
Twitter
LinkedIn
Instagram
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. rev 2023.1.31.43211
Your privacy
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance
with our Cookie Policy.