UA-17470720-3

Jump to content


Photo
- - - - -

STV 5.1.0-beta and ~customProperties


  • Please log in to reply
14 replies to this topic

#1 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 545 posts
  • LocationIreland
Reputation: 136
Popular

Posted 03 September 2015 - 02:11 AM

Hi Tarek,

 

It seems 5.1.0-beta has issues with ~customProperties. With this code:

 

- (void)viewDidLoad {
    [super viewDidLoad];

    self.navigationBarType = SCNavigationBarTypeAddEditRight;


    DGObject *object0 = [[DGObject alloc] initWithNameString:@"ZERO"];
    DGObject *object1 = [[DGObject alloc] initWithNameString:@"ONE"];
    DGObject *object2 = [[DGObject alloc] initWithNameString:@"TWO"];

    NSMutableArray *mutableArray = [NSMutableArray arrayWithObjects:
                                    object0,
                                    object1,
                                    object2,
                                    nil];


    SCClassDefinition *classDefinition = [SCClassDefinition definitionWithClass:[DGObject class] propertyNamesString:@":(~customProperty0,nameString);:(~customProperty1,~customProperty2);:(~customProperty3);"];

    SCPropertyDefinition *propertyDefinition = [classDefinition propertyDefinitionWithName:@"nameString"];
    propertyDefinition.type = SCPropertyTypeTextField;
    propertyDefinition.title = @"Name";

    SCArrayOfObjectsSection *arrayOfObjectsSection = [SCArrayOfObjectsSection sectionWithHeaderTitle:nil items:mutableArray itemsDefinition:classDefinition];


    [self.tableViewModel addSection:arrayOfObjectsSection];
}

 

and using STV 5.0.0 then all the ~customProperties show up, with STV 5.1.0-beta  none of the ~customProperties are shown.

 

 

DGObject.h is:

 

@interface DGObject : NSObject

@property (nonatomic, strong) NSString *nameString;

-(id)initWithNameString:(NSString *)nameString;

@end

 

DGObject.m is:

 

#import "DGObject.h"

@implementation DGObject


-(id)init {
    self = [super init];
    if (self) {
        _nameString = nil;
    }
    return self;
}


-(id)initWithNameString:(NSString *)nameString {
    self = [super init];
    if (self) {
        _nameString = nameString;
    }
    return self;
}

@end

 

 

 

Mmm, interestingly, in my app, using this propertyNamesString:

 

propertyNamesString:@":(setlistName,setlistGig,setlistDate,setlistNote);:(setlistSongs,~addSong,~addDivider,~addEnd);:(~pasteSetlist,setlistImportPlaylist);"

 

then ~addSong, ~addDivider, and ~addEnd all appear correctly, but ~pasteSetlist doesn't when I use 5.1.0-beta.

 

 

HTH

 


  • Adjuramum likes this
Cheers,

Dave

www.dgapps.ie

#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 03 September 2015 - 09:11 AM

Thank you very much Dave for reporting, we'll be fixing this glitch in our next release.



#3 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 545 posts
  • LocationIreland
Reputation: 136
Popular

Posted 10 September 2015 - 11:51 PM

Hi Tarek,

 

I can confirm this is fixed in STV 5.1.0 :-)

 

Thanks!


  • Tarek likes this
Cheers,

Dave

www.dgapps.ie

#4 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 545 posts
  • LocationIreland
Reputation: 136
Popular

Posted 22 October 2015 - 10:37 AM

Hi Tarek,

 

It looks like STV 5.1.3 has broken ~customProperties again, sorry.


Cheers,

Dave

www.dgapps.ie

#5 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 26 October 2015 - 09:11 AM

No worries Dave, but I don't seem to be able to replicate this using our samples (e.g. CalculatedCellsApp). I'll try to replicate using your above code and get back to you ASAP.



#6 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 545 posts
  • LocationIreland
Reputation: 136
Popular

Posted 27 October 2015 - 10:27 PM

Hi Tarek,

 

 

Sorry, I should have investigated further before reporting the problem.

 

It's a different issue from previously. The issue now is that cellActions.willConfigure is not called for a ~customProperty. cellActions.didSelect is called OK. I've not tested other cellActions.


Cheers,

Dave

www.dgapps.ie

#7 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 29 October 2015 - 10:35 AM

Got that now, thank you Dave.


  • Dave Guerin likes this

#8 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 545 posts
  • LocationIreland
Reputation: 136
Popular

Posted 18 November 2015 - 09:16 AM

Hi Tarek,

 

Just wondering if there was going to be a new STV release sometime soon ish with a fix for this?


Cheers,

Dave

www.dgapps.ie

#9 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 18 November 2015 - 10:16 AM

We were shooting for the end of next week to release STV 5.2. Is that ok with you?



#10 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 545 posts
  • LocationIreland
Reputation: 136
Popular

Posted 18 November 2015 - 10:29 AM

Hi Tarek, 

 

Yes, end of next week will be great. I've got around the issue temporarily by using cellActions.willDisplay as that is getting called OK.


Cheers,

Dave

www.dgapps.ie

#11 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 545 posts
  • LocationIreland
Reputation: 136
Popular

Posted 04 December 2015 - 10:18 AM

Hi Tarek,

 

 

cellActions.willConfigure is still NOT being called for a ~customProperty in STV 5.2.0.

 

willDisplay and didSelect are getting called OK, I've not tested for any other cellActions on a ~customProperty.


Cheers,

Dave

www.dgapps.ie

#12 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 05 December 2015 - 08:38 AM

Hi Dave,

 

This is actually working in our tests. To check, I just added a new custom property called '~customProperty' to our TasksApp sample. In MasterViewController.m, I inserted the following code:

 

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    SCDataDefinition *taskDef = [self dataDefinitionWithIBName:@"Task"];
    
    SCPropertyDefinition *customPDef = [taskDef propertyDefinitionWithName:@"~customProperty"];
    customPDef.cellActions.willConfigure = ^(SCTableViewCell *cell, NSIndexPath *indexPath)
    {
        NSLog(@"~customProperty willConfigure called!");
    };
}

 

This test has actually been passing in the previous version too, so I am not sure what is it that's specific to your code that's not getting willConfigure called. Are you able to replicate in TasksApp?



#13 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 545 posts
  • LocationIreland
Reputation: 136
Popular

Posted 07 December 2015 - 04:28 AM

Hi Tarek,

 

I've gone back and looked at the non working code and some working code and it looks like willConfigure is not getting called when I've set a uiElementNibName for a ~customProperty.

 

I'd give you some example code to add to the TaskApp sample but I couldn't get the code you gave above to work and still don't know enough about STV storyboards and how to link them to code to get it to work. 


Cheers,

Dave

www.dgapps.ie

#14 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 545 posts
  • LocationIreland
Reputation: 136
Popular

Posted 07 December 2015 - 04:33 AM

Here's some code, based on my initial code from the start of this thread:

 

- (void)viewDidLoad {
    [super viewDidLoad];

    self.navigationBarType = SCNavigationBarTypeAddEditRight;


    DGObject *object0 = [[DGObject alloc] initWithNameString:@"ZERO"];
    DGObject *object1 = [[DGObject alloc] initWithNameString:@"ONE"];
    DGObject *object2 = [[DGObject alloc] initWithNameString:@"TWO"];

    NSMutableArray *mutableArray = [NSMutableArray arrayWithObjects:
                                    object0,
                                    object1,
                                    object2,
                                    nil];


    SCClassDefinition *classDefinition = [SCClassDefinition definitionWithClass:[DGObject class] propertyNamesString:@":(~customProperty0,nameString);:(~customProperty1,~customProperty2);:(~customProperty3);"];
    classDefinition.requireEditingModeToEditPropertyValues = YES;


    SCPropertyDefinition *customProperty0PropertyDefinition = [classDefinition propertyDefinitionWithName:@"~customProperty0"];
    customProperty0PropertyDefinition.type = SCPropertyTypeTextField;
    customProperty0PropertyDefinition.title = @"Custom Zero";
    customProperty0PropertyDefinition.existsInNormalMode = NO;
    customProperty0PropertyDefinition.existsInEditingMode = YES;

    customProperty0PropertyDefinition.cellActions.willConfigure = ^(SCTableViewCell *cell, NSIndexPath *indexPath) {
        NSLog(@"customProperty0PropertyDefinition cellActions willConfigure");
    };


    SCPropertyDefinition *nameStringPropertyDefinition = [classDefinition propertyDefinitionWithName:@"nameString"];
    nameStringPropertyDefinition.type = SCPropertyTypeTextField;
    nameStringPropertyDefinition.title = @"Name";

    nameStringPropertyDefinition.cellActions.willConfigure = ^(SCTableViewCell *cell, NSIndexPath *indexPath) {
        NSLog(@"nameStringPropertyDefinition cellActions willConfigure");
    };

    SCPropertyDefinition *customProperty1PropertyDefinition = [classDefinition propertyDefinitionWithName:@"~customProperty1"];
    customProperty1PropertyDefinition.type = SCPropertyTypeTextField;
    customProperty1PropertyDefinition.title = @"Custom One";
    customProperty1PropertyDefinition.existsInNormalMode = NO;
    customProperty1PropertyDefinition.existsInEditingMode = YES;
    customProperty1PropertyDefinition.uiElementNibName = @"Custom1Cell";

    customProperty1PropertyDefinition.cellActions.willConfigure = ^(SCTableViewCell *cell, NSIndexPath *indexPath) {
        NSLog(@"customProperty1PropertyDefinition cellActions willConfigure");
    };

    SCPropertyDefinition *customProperty2PropertyDefinition = [classDefinition propertyDefinitionWithName:@"~customProperty2"];
    customProperty2PropertyDefinition.type = SCPropertyTypeTextField;
    customProperty2PropertyDefinition.title = @"Custom Two";
    customProperty2PropertyDefinition.existsInNormalMode = NO;
    customProperty2PropertyDefinition.existsInEditingMode = YES;

    customProperty2PropertyDefinition.cellActions.willConfigure = ^(SCTableViewCell *cell, NSIndexPath *indexPath) {
        NSLog(@"customProperty2PropertyDefinition cellActions willConfigure");
    };

    SCPropertyDefinition *customProperty3PropertyDefinition = [classDefinition propertyDefinitionWithName:@"~customProperty3"];
    customProperty3PropertyDefinition.type = SCPropertyTypeTextField;
    customProperty3PropertyDefinition.title = @"Custom Three";
    customProperty3PropertyDefinition.existsInNormalMode = NO;
    customProperty3PropertyDefinition.existsInEditingMode = YES;

    customProperty3PropertyDefinition.cellActions.willConfigure = ^(SCTableViewCell *cell, NSIndexPath *indexPath) {
        NSLog(@"customProperty3PropertyDefinition cellActions willConfigure");
    };

    SCArrayOfObjectsSection *arrayOfObjectsSection = [SCArrayOfObjectsSection sectionWithHeaderTitle:nil items:mutableArray itemsDefinition:classDefinition];

    [self.tableViewModel addSection:arrayOfObjectsSection];
}

 

 

 

and the logging output:

 

 

2015-12-07 12:25:31.688 STV[17073:5597779] 0x7fdf23d0a2b0 (AppDelegate.m:16) -[AppDelegate application:didFinishLaunchingWithOptions:] 
2015-12-07 12:25:31.689 STV[17073:5597779] Sensible TableView Version 5.2.0
2015-12-07 12:25:31.716 STV[17073:5597779] 0x7fdf23d0a2b0 (AppDelegate.m:47) -[AppDelegate applicationDidBecomeActive:] 
2015-12-07 12:25:36.718 STV[17073:5597779] (ViewController.m:56) nameStringPropertyDefinition cellActions willConfigure
2015-12-07 12:25:38.175 STV[17073:5597779] (ViewController.m:47) customProperty0PropertyDefinition cellActions willConfigure
2015-12-07 12:25:38.175 STV[17073:5597779] (ViewController.m:77) customProperty2PropertyDefinition cellActions willConfigure
2015-12-07 12:25:38.176 STV[17073:5597779] (ViewController.m:87) customProperty3PropertyDefinition cellActions willConfigure

You'll note that "customProperty1PropertyDefinition cellActions willConfigure" is missing.


  • Tarek likes this
Cheers,

Dave

www.dgapps.ie

#15 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 08 December 2015 - 04:55 AM

Thanks Dave, able to replicate now.


  • Dave Guerin likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users