Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. NSMutableArray* surveyQuestionList = [[NSMutableArray alloc] init];
  2.  
  3. [self.feedbackForm.questions enumerateObjectsUsingBlock:^(FeedbackFormQuestion *fq, NSUInteger idx, BOOL *stop)
  4. {
  5. NSDictionary* q;
  6. FeedbackFormTableViewCell *cell = [self.questionsTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:idx inSection:0]];
  7. if([fq.type isEqualToString:@"text"]){
  8. q = @{@"question": fq.question,
  9. @"answer": cell.answerTextView.text};
  10.  
  11. }
  12. else if([fq.type isEqualToString:@"rating"]){
  13. float value= 0;
  14. if(cell.starRatingView.value)
  15. value = cell.starRatingView.value;
  16. q = @{@"question": fq.question,
  17. @"answer": [NSNumber numberWithDouble:value]};
  18. }
  19.  
  20. else{
  21. if(cell.yesButton.selectedButton){
  22. q = @{@"question": fq.question,
  23. @"answer": cell.yesButton.selectedButton.titleLabel.text};
  24.  
  25. }
  26. else{
  27. q = @{@"question": fq.question,
  28. @"answer": @""};
  29. }
  30. }
  31.  
  32.  
  33.  
  34. if(!q)
  35. {
  36. q = @{@"question": fq.question,
  37. @"answer": @""};
  38. }
  39. [surveyQuestionList insertObject:q atIndex:idx];
  40. }];
  41.  
  42. 2017-03-30 17:35:28.090680 FineDine[13965:213311] [aqme] 255: AQDefaultDevice (173): skipping input stream 0 0 0x0
  43. 2017-03-30 17:35:30.027 FineDine[13965:211710] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]'
  44. *** First throw call stack:
  45. (
  46. 0 CoreFoundation 0x000000010cb90d4b __exceptionPreprocess + 171
  47. 1 libobjc.A.dylib 0x0000000111b2521e objc_exception_throw + 48
  48. 2 CoreFoundation 0x000000010caa715f -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 351
  49. 3 CoreFoundation 0x000000010caa6fcb +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
  50. 4 FineDine 0x000000010ba7a083 __44-[FDCustomFeedbackViewController submitForm]_block_invoke + 659
  51. 5 CoreFoundation 0x000000010cb200b2 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 114
  52. 6 CoreFoundation 0x000000010cb1ff6f -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 239
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement