ios - Importing file is stopping the ability to insert data into database -


in application, user can ask question , can see question , post response. have the questions shown in table view , can push detail view see specific question , post response. detail view, can enter view see other answers. have create segue carries on question id. have import file allows view responses. problem whenever import file, can no longer post response question. when file isn't imported, can post response. causing problem? tableview file:

-(void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender {  if([[segue identifier] isequaltostring:@"showdetails"]){     detailviewcontroller *detailviewcontroller = [segue destinationviewcontroller];     nsindexpath *myindexpath = [self->tableview indexpathforselectedrow];      //int row = [myindexpath row];      nsdictionary *info = [json objectatindex:myindexpath.row];      detailviewcontroller.titledetailmodal = [info objectforkey:@"title"];     detailviewcontroller.bodydetailmodal = [info objectforkey:@"body"];     detailviewcontroller.post_id = [info objectforkey:@"id"]; }  } 

that carries on data detail view. in detail view, can answer question.

#import "detailviewcontroller.h"  //#import "m_responsesviewcontroller.h"  @interface detailviewcontroller ()  @end  -(void) postmessage:(nsstring*) message{  nsdate *today = [nsdate date]; nsdateformatter *dateformat = [[nsdateformatter alloc] init]; [dateformat setdateformat:@"yyyy-mm-dd"]; nsstring *datestring = [dateformat stringfromdate:today];    uialertview *alert = [[uialertview alloc] initwithtitle:@""                                                 message:@"your response has been posted!"                                                delegate:nil                                       cancelbuttontitle:@"ok"                                       otherbuttontitles:nil];  uialertview *alert1 = [[uialertview alloc] initwithtitle:@""                                                  message:@"please fill out information"                                                 delegate:nil                                        cancelbuttontitle:@"ok"                                        otherbuttontitles:nil];    if([message isequal:@""]){     [alert1 show]; } else{      nsmutablestring *poststring = [nsmutablestring stringwithstring:kposturl];      [poststring appendstring:[nsstring stringwithformat:@"?%@=%@", kid, _post_id]];      [poststring appendstring:[nsstring stringwithformat:@"&%@=%@" , kbody , message]];      [poststring appendstring:[nsstring stringwithformat:@"&%@=%@" , kdate , datestring]];       [poststring setstring:[poststring stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]];      nsmutableurlrequest *request = [[nsmutableurlrequest alloc] initwithurl:[nsurl urlwithstring:poststring]];     [request sethttpmethod:@"post"];      postconnection = [[nsurlconnection alloc] initwithrequest:request delegate:self startimmediately:yes];      [alert show];     [_response resignfirstresponder];     _response.text = nil; }  }   -(ibaction)post:(id)sender{  [self.view endediting:yes]; [self postmessage:_response.text];   }         -(void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender {  if([[segue identifier] isequaltostring:@"responses"]){     m_responsesviewcontroller *detailviewcontroller = [segue destinationviewcontroller];      detailviewcontroller.question_id = _post_id;    }  } 

the problem when uncomment "m_responsesviewcontroller.h" import, post message method no longer working in no data being added data base. however, when keep commented out, works.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -