Post

Replies

Boosts

Views

Activity

Receiving this error 'EXC_BREAKPOINT (code=1, subcode=0x1051904b8)' when trying to use a PhotoPicker.
I'm going insane over this, I'm using Xcode 13 beta 6 on the M1 MacBook Air. Every time I pick an image, I receive this error message. At this point I don't know what I can do because the message is so vague. Please help me.     @Binding var image: UIImage          func makeUIViewController(context: Context) -> UIImagePickerController {         let imagePicker = UIImagePickerController()         imagePicker.delegate = context.coordinator         return imagePicker     }          func updateUIViewController(_ uiViewController: UIImagePickerController, context: Context) {              }          func makeCoordinator() -> Coordinator {         Coordinator(parent: self)     }          final class Coordinator: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate {                   var parent: PhotoPicker                  init(parent: PhotoPicker){             self.parent = parent         }                  func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {             if let image = info[.originalImage] as? UIImage {                 parent.image = image             }else{                              }             picker.dismiss(animated: true, completion: nil)         }     } }          @State private var isPresented: Bool = false     @State private var avatarImage = UIImage(systemName: "person") ?? UIImage()          var body: some View {         VStack {             Image(uiImage: avatarImage)                 .resizable()                 .scaledToFill()                 .frame(width: 150, height: 150)                 .clipShape(Circle())                 .padding()                 .onTapGesture {                     isPresented = true                 }                          Spacer()         }         .navigationTitle("Profile")         .sheet(isPresented: $isPresented) {             PhotoPicker(image: $avatarImage)         }     } }
4
0
5.4k
May ’22
Choosing an image on ImagePicker crashes app (Mac M1, Big Sur)
I receive this error *** -[NSURL URLByAppendingPathExtension:]: component, components, or pathExtension cannot be nil. ( 0   CoreFoundation                      0x000000010d5f7fba __exceptionPreprocess + 242 1   libobjc.A.dylib                     0x000000010f159ff5 objc_exception_throw + 48 2   Foundation                          0x000000010ece639e -[NSURL(NSURLPathUtilities) URLByDeletingPathExtension] + 0 3   PhotosUI                            0x0000000139be495f -[PUPhotoPickerExtensionHostContext _UIImagePickerControllerInfoDictionaryFromPhotoPickerInfoDictionary:] + 2203 4   PhotosUI                            0x0000000139be3f36 -[PUPhotoPickerExtensionHostContext didSelectMediaWithInfoDictionary:] + 34 5   Foundation                          0x000000010edaebd7 __NSXPCCONNECTION_IS_CALLING_OUT_TO_EXPORTED_OBJECT_S1__ + 10 6   Foundation                          0x000000010edad90f -[NSXPCConnection _decodeAndInvokeMessageWithEvent:flags:] + 2268 7   Foundation                          0x000000010edaef06 message_handler + 206 8   libxpc.dylib                        0x0000000117233cf8 _xpc_connection_call_event_handler + 56 9   libxpc.dylib                        0x000000011723407c _xpc_connection_mach_event + 891 10  libdispatch.dylib                   0x0000000116e577ee _dispatch_client_callout4 + 9 11  libdispatch.dylib                   0x0000000116e7180a _dispatch_mach_msg_invoke + 550 12  libdispatch.dylib                   0x0000000116e5ddb1 _dispatch_lane_serial_drain + 307 13  libdispatch.dylib                   0x0000000116e726c8 _dispatch_mach_invoke + 555 14  libdispatch.dylib                   0x0000000116e5ddb1 _dispatch_lane_serial_drain + 307 15  libdispatch.dylib                   0x0000000116e5ec9d _dispatch_lane_invoke + 490 16  libdispatch.dylib                   0x0000000116e6aa7a _dispatch_workloop_worker_thread + 872 17  libsystem_pthread.dylib             0x000000011732a45d _pthread_wqthread + 314 18  libsystem_pthread.dylib             0x000000011732942f start_wqthread + 15 ) struct ImagePicker: UIViewControllerRepresentable {          @Binding var uiImage: UIImage?          func makeUIViewController(context: Context) -> UIImagePickerController {         let imagePicker = UIImagePickerController()         imagePicker.allowsEditing = true         imagePicker.delegate = context.coordinator         return imagePicker     }          func makeCoordinator() -> Coordinator {         Coordinator(parent: self)     }          func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) { }          class Coordinator: NSObject, UINavigationControllerDelegate, UIImagePickerControllerDelegate {                  var parent: ImagePicker                  init(parent: ImagePicker){             self.parent = parent         }                  func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {             if let image = info[.editedImage] as? UIImage {                 parent.uiImage = image             }             picker.dismiss(animated: true, completion: nil)         }     } } A few people have said this is because of the Mac M1 chip, is there a nice fix for this?
0
0
771
Aug ’21
Receiving this error 'EXC_BREAKPOINT (code=1, subcode=0x1051904b8)' when trying to use a PhotoPicker.
I'm going insane over this, I'm using Xcode 13 beta 6 on the M1 MacBook Air. Every time I pick an image, I receive this error message. At this point I don't know what I can do because the message is so vague. Please help me.     @Binding var image: UIImage          func makeUIViewController(context: Context) -> UIImagePickerController {         let imagePicker = UIImagePickerController()         imagePicker.delegate = context.coordinator         return imagePicker     }          func updateUIViewController(_ uiViewController: UIImagePickerController, context: Context) {              }          func makeCoordinator() -> Coordinator {         Coordinator(parent: self)     }          final class Coordinator: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate {                   var parent: PhotoPicker                  init(parent: PhotoPicker){             self.parent = parent         }                  func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {             if let image = info[.originalImage] as? UIImage {                 parent.image = image             }else{                              }             picker.dismiss(animated: true, completion: nil)         }     } }          @State private var isPresented: Bool = false     @State private var avatarImage = UIImage(systemName: "person") ?? UIImage()          var body: some View {         VStack {             Image(uiImage: avatarImage)                 .resizable()                 .scaledToFill()                 .frame(width: 150, height: 150)                 .clipShape(Circle())                 .padding()                 .onTapGesture {                     isPresented = true                 }                          Spacer()         }         .navigationTitle("Profile")         .sheet(isPresented: $isPresented) {             PhotoPicker(image: $avatarImage)         }     } }
Replies
4
Boosts
0
Views
5.4k
Activity
May ’22
Follow/Feed system using CloudKit
How would I get around creating a follow/feed system. I can work this out using Firebase, but since I'm new to CloudKit I can't wrap my head around the database structure. Any help would be greatly appreciated. :)
Replies
0
Boosts
0
Views
649
Activity
Nov ’21
Choosing an image on ImagePicker crashes app (Mac M1, Big Sur)
I receive this error *** -[NSURL URLByAppendingPathExtension:]: component, components, or pathExtension cannot be nil. ( 0   CoreFoundation                      0x000000010d5f7fba __exceptionPreprocess + 242 1   libobjc.A.dylib                     0x000000010f159ff5 objc_exception_throw + 48 2   Foundation                          0x000000010ece639e -[NSURL(NSURLPathUtilities) URLByDeletingPathExtension] + 0 3   PhotosUI                            0x0000000139be495f -[PUPhotoPickerExtensionHostContext _UIImagePickerControllerInfoDictionaryFromPhotoPickerInfoDictionary:] + 2203 4   PhotosUI                            0x0000000139be3f36 -[PUPhotoPickerExtensionHostContext didSelectMediaWithInfoDictionary:] + 34 5   Foundation                          0x000000010edaebd7 __NSXPCCONNECTION_IS_CALLING_OUT_TO_EXPORTED_OBJECT_S1__ + 10 6   Foundation                          0x000000010edad90f -[NSXPCConnection _decodeAndInvokeMessageWithEvent:flags:] + 2268 7   Foundation                          0x000000010edaef06 message_handler + 206 8   libxpc.dylib                        0x0000000117233cf8 _xpc_connection_call_event_handler + 56 9   libxpc.dylib                        0x000000011723407c _xpc_connection_mach_event + 891 10  libdispatch.dylib                   0x0000000116e577ee _dispatch_client_callout4 + 9 11  libdispatch.dylib                   0x0000000116e7180a _dispatch_mach_msg_invoke + 550 12  libdispatch.dylib                   0x0000000116e5ddb1 _dispatch_lane_serial_drain + 307 13  libdispatch.dylib                   0x0000000116e726c8 _dispatch_mach_invoke + 555 14  libdispatch.dylib                   0x0000000116e5ddb1 _dispatch_lane_serial_drain + 307 15  libdispatch.dylib                   0x0000000116e5ec9d _dispatch_lane_invoke + 490 16  libdispatch.dylib                   0x0000000116e6aa7a _dispatch_workloop_worker_thread + 872 17  libsystem_pthread.dylib             0x000000011732a45d _pthread_wqthread + 314 18  libsystem_pthread.dylib             0x000000011732942f start_wqthread + 15 ) struct ImagePicker: UIViewControllerRepresentable {          @Binding var uiImage: UIImage?          func makeUIViewController(context: Context) -> UIImagePickerController {         let imagePicker = UIImagePickerController()         imagePicker.allowsEditing = true         imagePicker.delegate = context.coordinator         return imagePicker     }          func makeCoordinator() -> Coordinator {         Coordinator(parent: self)     }          func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) { }          class Coordinator: NSObject, UINavigationControllerDelegate, UIImagePickerControllerDelegate {                  var parent: ImagePicker                  init(parent: ImagePicker){             self.parent = parent         }                  func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {             if let image = info[.editedImage] as? UIImage {                 parent.uiImage = image             }             picker.dismiss(animated: true, completion: nil)         }     } } A few people have said this is because of the Mac M1 chip, is there a nice fix for this?
Replies
0
Boosts
0
Views
771
Activity
Aug ’21