Function - How to use static int value in swift

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

Basically I am doing some computation for which I need to have an Int variable initiating with 0 in cellForRowAtIndexPath everytime I reload the table view.

In Objective-C, I used this in cellForRowAtIndexPath of UITableView

static int rowSum= 0; 
rowSum += [[myArray objectAtIndex:indexPath.Row] intValue];

How do we do this in Swift language ? The suggested link does not do that.

Answers

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/31100355/how-to-use-static-int-value-in-swift

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils