Last active
August 29, 2015 14:06
-
-
Save sstadelman/2c646c85966ddb5a9f71 to your computer and use it in GitHub Desktop.
Example with block createEntity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | |
if ([[segue identifier] isEqualToString:@"ReturnInputFromAdd"]) { | |
self.properties = [NSMutableArray array]; | |
prop = [[SODataPropertyDefault alloc] initWithName:@"NAME"]; | |
prop.value = self.nameInput.text; | |
[self.properties addObject:prop]; | |
… | |
prop = [[SODataPropertyDefault alloc] initWithName:@"URL"]; | |
prop.value = self.urlInput.text; | |
[self.properties addObject:prop]; | |
SODataEntityDefault* entity = [[SODataEntityDefault alloc] initWithType:@"RMTSAMPLEFLIGHT.Travelagency"]; | |
for (id<SODataProperty> prop in self.properties) { | |
[entity.properties setObject:prop forKey:prop.name]; | |
} | |
self.travelAgency = entity; | |
if (self.travelAgency) { | |
[[DataController shared] createEntity:self.travelAgency withCompletion:^(BOOL success) { | |
[[DataController shared] fetchTravelAgencyEntitySet]; | |
}]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment