Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSMutableArray* surveyQuestionList = [[NSMutableArray alloc] init];
- [self.feedbackForm.questions enumerateObjectsUsingBlock:^(FeedbackFormQuestion *fq, NSUInteger idx, BOOL *stop)
- {
- NSDictionary* q;
- FeedbackFormTableViewCell *cell = [self.questionsTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:idx inSection:0]];
- if([fq.type isEqualToString:@"text"]){
- q = @{@"question": fq.question,
- @"answer": cell.answerTextView.text};
- }
- else if([fq.type isEqualToString:@"rating"]){
- float value= 0;
- if(cell.starRatingView.value)
- value = cell.starRatingView.value;
- q = @{@"question": fq.question,
- @"answer": [NSNumber numberWithDouble:value]};
- }
- else{
- if(cell.yesButton.selectedButton){
- q = @{@"question": fq.question,
- @"answer": cell.yesButton.selectedButton.titleLabel.text};
- }
- else{
- q = @{@"question": fq.question,
- @"answer": @""};
- }
- }
- if(!q)
- {
- q = @{@"question": fq.question,
- @"answer": @""};
- }
- [surveyQuestionList insertObject:q atIndex:idx];
- }];
- 2017-03-30 17:35:28.090680 FineDine[13965:213311] [aqme] 255: AQDefaultDevice (173): skipping input stream 0 0 0x0
- 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]'
- *** First throw call stack:
- (
- 0 CoreFoundation 0x000000010cb90d4b __exceptionPreprocess + 171
- 1 libobjc.A.dylib 0x0000000111b2521e objc_exception_throw + 48
- 2 CoreFoundation 0x000000010caa715f -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 351
- 3 CoreFoundation 0x000000010caa6fcb +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
- 4 FineDine 0x000000010ba7a083 __44-[FDCustomFeedbackViewController submitForm]_block_invoke + 659
- 5 CoreFoundation 0x000000010cb200b2 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 114
- 6 CoreFoundation 0x000000010cb1ff6f -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 239
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement