Cell = [tableview dequeuereusablecellwithidentifier: @ "identify"];
If (cell = nil)
{
Cell = [[[uitableviewcell alloc] initwithframe: cgrectzero reuseidentifier: @ "identify"] autorelease];
Cell. Text = _ (passwordlock );
Cell. textalignment = uitextalignmentleft;
Cell. selectionstyle = uitableviewcellselectionstylenone;
Cell. accessorytype = uitableviewcellaccessorydisclosureindicator;
Statelabel = [[uilabel alloc] initwithframe: cgrectmake (235, cell. Frame. Origin. Y + 3, 60, cell. Frame. Size. Height-10)];
Userdefaults = [nsuserdefaults standarduserdefaults];
If ([userdefaults objectforkey: Password])
{
Statelabel. Text = _ (open );
}
Else
{
Statelabel. Text = _ (close );
}
Statelabel. textcolor = [uicolor colorwithred: 0.18 Green: 0.39 Blue: 0.73 ALPHA: 1];
Statelabel. Tag = password_state;
[Cell. contentview addsubview: statelabel];
[Statelabel release];
}
Sometimes, after refreshing, we find that the offset between the text or image position in the cell mainly changes the cell! = Nil code is put out for processing.