Skip to content

Remove string format property, replace with setFormat: method #11

@dataxpress

Description

@dataxpress

Instead of having a separate NSString* format, only expose the formatBlock property, and make a setFormat: method that sets up the right format block only at set time instead of on every iteration.

This will ultimately improve performance, as a single block call each time is much faster than regular expression searches every frame.

So, it would look something like:

-(void)setFormat:(NSString*)format
{
    self.formatBlock = ^(NSString*) ^(float val) {
        return [NSString stringWithFormat:format,val];   
    };
}

Note - something will have to deal with formats that pass in %d or %i (as the current regex does) - perhaps find these and then cast to int if it has those? maybe two different blocks? just ideas

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions