I'm still very new to iOS development, so bear with me. 

I've got a TableView using static cells to contain options (click to check), I am able to select the cells fine. I'd like to assign a value (identifier) to each cell, so that when a cell is selected or de-selected I can add/remove it from an array. Then, once the editing has finished, use the references stored in the array to update the respective CoreData attributes.

My google skills have failed me today, so a push in the right direction would be very much appreciated.

Thanks. 


Question: inserting period after every 3 chars in a string
Answer: You can insert a comma after every nth character like this:

&gt;&gt;&gt; my_str = 'qwertyuiopaq'
&gt;&gt;&gt; ','.join(my_str[i:i+3] for i in range(0, len(my_str), 3))
'qwe,rty,uio,paq'


This should work for any arbitrary length of strings too.

Edit: Written as a function in a similar style to @mhawke's answer, with an option to change the grouping/characters.

&gt;&gt;&gt; def f_comma(my_str, group=3, char=','):
...     my_str = str(my_str)
...     return char.join(my_str[i:i+group] for i in range(0, len(my_str), group))
... 
&gt;&gt;&gt; f_comma('qwertyuiopaq')
'qwe,rty,uio,paq'
&gt;&gt;&gt; f_comma('qwertyuiopaq', group=2)
'qw,er,ty,ui,op,aq'
&gt;&gt;&gt; f_comma('qwertyuiopaq', group=2, char='.')
'qw.er.ty.ui.op.aq'