-1

It happens no matter I run it under release mode or debug mode. If it is due to the automatic shutdown by iOS, there should be a re-start. But my app is unable to do that. the output on the console: Message from debugger: Terminated due to signal 9

But I don't think disabling camera will cause a memory issue. My Root.plist is like this: screenshot of plist

However, if I choose "don't allow" at the popup when first launching, the app is running normally.

Wanda
  • 3
  • 3

1 Answers1

0

Do you have code snippet? Or full error message?

Let me take a guess. In your code where you access the camera, you should check the camera permission before you just use it. I think that's where the problem would be. For how to do that, check [question]: Detect permission of camera in iOS But I might be wrong. need more info. And I also think you didn't correctly set your plist, you need to add following attributes in you plist.

Photo :

Key: Privacy - Photo Library Usage Description    
Value: $(PRODUCT_NAME) photo use

Microphone :

Key: Privacy - Microphone Usage Description    
Value: $(PRODUCT_NAME) microphone use

Camera :

Key: Privacy - Camera Usage Description   
Value: $(PRODUCT_NAME) camera use

And one more thing, when you encounter a crash or any weird behavior, look for its reason, look into its log, look deeply into its err message. search for the error code, put exception breakpoints to find exactly where the crash happens, etc. And then, post questions related to how you cannot solve those materials/experiments you went through. That is more effective than just agonize yourself over the app behavior.

Community
  • 1
  • 1
Elvin
  • 1,133
  • 6
  • 15