Reputation: 1
In my app, I have a screen it is like a submit form, which contains dropdown picker, textfields and buttons. There are two buttons one is to pick image from gallery and other one to pick image from camera. My problem is after filling all the textfields, I am picking an image from gallery and after dismiss from the presented gallery screen. All my outlets are not visible it means become transparent. This occurs only in iOS 12 version but in iOS 11 version it is working fine. Please help. My screen as below.
Before uploading image
After uploading image
Coding language is objective C.
My outlets are as below.
@property (strong, nonatomic) IBOutlet UITextField *txtSubmit;
@property (strong, nonatomic) IBOutlet UITextField *txtVisitDate;
@property (strong, nonatomic) IBOutlet UITextField *txtCalimType;
@property (strong, nonatomic) IBOutlet UITextField *txtInvoiceAmount;
@property (strong, nonatomic) IBOutlet UITextField *txtServiceProvoider;
@property (strong, nonatomic) IBOutlet UITextField *txtReceiptsNo;
@property (strong, nonatomic) IBOutlet UITextField *txtDescription;
@property (strong, nonatomic) IBOutlet UIView *btnSnapClick; //weak
@property (strong, nonatomic) IBOutlet UIButton *btnCameraclick; //weak
@property (nonatomic, retain) UIImagePickerController *mediaPicker;
@property (strong, nonatomic) IBOutlet UIButton *btnUpload;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *CollectionContanst; //weak
@property (strong, nonatomic) IBOutlet UIButton *btnSubmitWithRadious; //weak
@property (strong, nonatomic) IBOutlet UICollectionView *collectionView;
@property (strong, nonatomic) IBOutlet UIBarButtonItem *sidebarButton; //weak
@property (strong, nonatomic) UIWindow *window;
My dismiss code is as below.
[self dismissViewControllerAnimated:YES completion:NULL];
I got error when i try to view in View debugger, as below.
Error: Unable to capture view hierarchy. Details: Log Title: Data source expression execution failure. Log Details: (null)
Log Method: -[DBGDataSourceConnectionLibViewDebugger _executeLLDBExpression:forRequest:onPotentialThread:iteration:]_block_invoke_2 Method: -[DBGViewDebugger updateDebugHierarchy]_block_invoke_2 Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide. 2018-11-16 15:12:32.872415+0530 NTUCAdeptCliniFlex[213:3848] Error: DebugHierarchyRequest - Failed to unarchive request data with error: Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}
Even though the screen is blank, when i click somewhere it is displaying as below.
when i clicked somewhere on the screen
Xcode 9.2
- (void)zcImagePickerController:(ZCImagePickerController *)imagePickerController didFinishPickingMediaWithInfo:(NSArray *)info {
BOOL isValidImage = YES;
[self dismissPickerView];
for (NSDictionary *imageDic in info) {
UIImageView *imageView = [[UIImageView alloc] initWithImage:[imageDic objectForKey:UIImagePickerControllerOriginalImage]];
imageView.contentMode = UIViewContentModeScaleAspectFit;
NSData *imageData = UIImageJPEGRepresentation(imageView.image, 0.4);
double imgLength = (imageData.length);
double imgLengthKb = imgLength/1024;
if(imgLengthKb <= maxFileSize){
dispatch_async(dispatch_get_main_queue(), ^{
//update your UI stuff here.
NSString *base64 = [imageData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
int randomID = arc4random() % 900000 + 100000;
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"dd_MM_yyyy"];
[dateFormat setLocale:[NSLocale localeWithLocaleIdentifier:@"en_US"]];
NSDate *currentDate = [NSDate date];
NSString *dateString = [dateFormat stringFromDate:currentDate];
NSString *fileName = [NSString stringWithFormat:@"%@%@%@%d%@", @"ios_upload_",dateString,@"_",randomID,@".jpg"];
NSDictionary *dictContact =[NSDictionary dictionaryWithObjectsAndKeys:base64,@"File64ByteStream",fileName,@"FileName", nil];
[_imageViewArray addObject:dictContact];
self.CollectionContanst.constant=128; //128
});
}else{
isValidImage = NO;
}
}
[_collectionView reloadData];
// dispatch_async(dispatch_get_main_queue(), ^{
// [_collectionView reloadData];
// });
if(isValidImage == NO){
[self showAlertonImage];
}
}
- (void)dismissPickerView {
[self dismissViewControllerAnimated:NO completion:nil];
}
The above code is used to pick image from gallery.
Even i used view hierarchy debugger, it looks blank. Please check the below attachment This image is from view hierarchy
Upvotes: 0
Views: 538