Thursday, 7 March 2013

How to insert attributes data for a entity in CORE DATA in IOS



NSManagedObjectContext *context = [[SharedVars sharedInstance]localContext];
YourEntityClass  *event = (UnsavedForm *)[NSEntityDescription insertNewObjectForEntityForName:@"EntityNameClass" inManagedObjectContext:context];
               
        [event setQuestionId:qArray];
        [event setFormId:[NSNumber numberWithInt:[form.formId intValue]]];
        [event setAnswers:answerString];
        [event setUserId:userID];
        [event setInstanceNo:[NSNumber numberWithDouble:pageStepper.value]];