0

after dismissing camera memory raising (as per below image by in Xcode Instruments ) suddenly and blank screen to show in app.

i am opening camera and taking photo and dismissing some times it shows black screen in app

    -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    [picker dismissViewControllerAnimated:YES completion:nil];
    UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];

  [receiptimage setImage: image forState:UIControlStateNormal];

    [receiptButton setTitle:@"Detach" forState:UIControlStateNormal];
    receiptButton.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14.0f];
    receiptButton.titleLabel.textAlignment = NSTextAlignmentCenter;
    [receiptButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 0, 10, 5)];

}
Sandeep Bhandari
  • 19,999
  • 5
  • 45
  • 78
RameshIos
  • 301
  • 1
  • 4
  • 13
  • try to allocate memory using heap instead of stack, memory problems are mostly due to use of stack – shubham mishra May 27 '16 at 11:54
  • @iOS_Ramesh : is your receiptimage has any frame set ??? – Sandeep Bhandari May 27 '16 at 11:54
  • [picker dismissViewControllerAnimated:YES completion:nil]; replace with your strong ref. of image picker controller – Prashant Tukadiya May 27 '16 at 12:01
  • How can i use Heap can you please suggest me - Shubham mishra – RameshIos May 27 '16 at 12:37
  • receipt image is a button.I put weak reference or strong reference also getting same issue – RameshIos May 27 '16 at 13:00
  • show the memory consumption in terms of bytes, the image you have attached doesnt show the memory usage. you need to add more details like device type and iOS version and xcode version you are using. Update your question with these.The code you have is fine. When you dismiss the picker controller, try to print the description of the root view controller. – Teja Nandamuri May 27 '16 at 13:07

0 Answers0