Welcome, Guest
Username Password: Remember me

Combining Classdefs on the same screen..
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: Combining Classdefs on the same screen..

Combining Classdefs on the same screen.. 1 year, 3 months ago #1

Hi Tarek, I have this code:

SCClassDefinition *pDef = [SCClassDefinition definitionWithEntityName:@"PEntity" withManagedObjectContext:self.managedObjectContext
withPropertyNames:[NSArray arrayWithObjects:@"pItem1", @"pItem2", @"pItem3", nil]];
 
SCClassDefinition *tDef = [SCClassDefinition definitionWithEntityName:@"TEntity" withManagedObjectContext:self.managedObjectContext
withPropertyNames:[NSArray arrayWithObjects:@"tItem1", @"tItem2", @"tItem3", nil]];
 
[tDef propertyDefinitionWithName:@"tDefTitle"].attributes = [SCObjectAttributes attributesWithObjectClassDefinition:pDef];
 
SCClassDefinition *vDef = [SCClassDefinition definitionWithEntityName:@"VEntity" withManagedObjectContext:self.managedObjectContext
withPropertyNames:[NSArray arrayWithObjects:@"vItem1", @"vItem2", @"tNames", nil]];
[vDef propertyDefinitionWithName:@"tNames"].attributes = [SCObjectAttributes attributesWithObjectClassDefinition:tDef];



I would like to show "tItem1,2 and 3" in the vDef class instead of tNames. Can you refer to items from one class in another? Can you show me what that would look like?

Thanks again.
Last Edit: 1 year, 3 months ago by daviddelmonte.

Re: Combining Classdefs on the same screen.. 1 year, 3 months ago #2

I've tried some variations of this, but I'm missing the point somewhere..

Here's my latest attempt...

// Create the VEntity class def
SCClassDefinition *vDef = [SCClassDefinition definitionWithEntityName:@"VEntity" withManagedObjectContext:self.managedObjectContext
withPropertyNames:[NSArray arrayWithObjects:@"vItem1", @"vItem2", @"tItem1", @"tItem2", @"tItem3", nil]];
 
[verbDef propertyDefinitionWithName:@"tItem1"].attributes = [SCObjectAttributes attributesWithObjectClassDefinition:tItem1Def];
[verbDef propertyDefinitionWithName:@"tItem2"].attributes = [SCObjectAttributes attributesWithObjectClassDefinition:tItem2Def];
[verbDef propertyDefinitionWithName:@"tItem3"].attributes = [SCObjectAttributes attributesWithObjectClassDefinition:tItem3Def];

Re: Combining Classdefs on the same screen.. 1 year, 3 months ago #3

Never Mind Tarek!!! I got it..

I had to change (simplify) my model but now it works as I just posted...

Getting there..

David

Re: Combining Classdefs on the same screen.. 1 year, 3 months ago #4

Great David, glad you figured it out
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: Combining Classdefs on the same screen.. 1 year, 3 months ago #5

I've similar question showing two entity on the same screen

Person(p1,p2,p3,p4..)<-->>Address(a1,a2,a3,a4,...) (1 to many relationship)
The code is working fine. But when I select address cell , the screen comes with new address detail entry screen. I would like to display the address entry screen on the same person screen entry. May be the person and address in diff sperate sections.
Also the same thing to display after entering data for both person and address .How do I achieve? APpreciate your help
  • rajdn
  • OFFLINE
  • Senior Boarder
  • Posts: 47
  • Karma: 0

Re: Combining Classdefs on the same screen.. 1 year, 2 months ago #6

Hi Raj,

You will be able to easily do that in STV 2.0 final release, which we expect to release by the 10th of March. I hope this goes well with your schedule.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72
  • Page:
  • 1
  • 2
Time to create page: 1.94 seconds