UA-17470720-3

Jump to content


Photo
- - - - -

SCClassDefinition dynamic definition


  • Please log in to reply
2 replies to this topic

#1 gayraud

gayraud

    Jr. Member

  • STV 5.0 Pro
  • PipPip
  • 28 posts
Reputation: 0
Neutral

Posted 07 July 2016 - 05:01 AM

I want to have a "dynamic setup" of my SCClassDefinition and I have problem refreshing the display.

I explain a bit more :

I have a "settings" view where the user can switch on/off the display of some fields for edition (displayHeart for instance).

So I created the array of propertyNames as follow 

 

    NSMutableArray *fields=[NSMutableArray array];

    

    [fields addObject:@"date"];

    [fields addObject:@"value"];

    if (displayHeart) [fields addObject:@"heart"];

    [fields addObject:@"notes"];

    

    SCClassDefinition *measureClassDef = [SCClassDefinition definitionWithClass:[Measure class]

                                                                  propertyNames:fields];

 
When the app is starting from scratch (viewDidLoad executed) the form is well generated, but if I move my code into viewWillAppear the redefinition of SCClassDefinition has no effect.
How can I 'refresh' the display ?
 
Another elegant solution will be to hide (not display) the corresponding line on the UITableView but I dont know either how I can do that


#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 443
Popular

Posted 07 July 2016 - 12:45 PM

Hi gayraud,

 

So where are you implementing this 'viewWillAppear'? Is it on the same view controller that has these fields?



#3 gayraud

gayraud

    Jr. Member

  • STV 5.0 Pro
  • PipPip
  • 28 posts
Reputation: 0
Neutral

Posted 11 July 2016 - 09:39 PM

Hello Tarek,

 

At first implementation the SC Class Definition was on the viewDidLoad, and in order to make this 'dynamic' behavior' I move it to the 'viewWillAppear' on the same controller yes.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users