This article introduces how to add a pop-up box in the iPhone implementation pop-up box view. Based on this, enter the table information in the pop-up box and you can select multiple items.
Implementation result:
The implementation process is to add table information in the pop-up box, click the previous selection box, click the button to change the image, and add the corresponding content to the corresponding array for data processing.
Main ImplementationCode:
# Import "tableviewcell. H"
@ Implementation Tableviewcell
@ Synthesize mylable , Mybutton , Checked , Mytabledelegate ;
- ( ID ) Initwithstyle :( Uitableviewcellstyle ) Style reuseidentifier :( Nsstring *) Reuseidentifier {
If (( Self = [ Super Initwithstyle : Style reuseidentifier : Reuseidentifier ]) {
}
Return Self ;
}
- ( Void ) Setselected :( Bool ) Selected animated :( Bool ) Animated {
[ Super Setselected : Selected animated : Animated ];
}
- ( Void ) Dealloc {
[ Self . Mybutton release ];
[ Self . Mylable release ];
[ Super Dealloc ];
}
-( Ibaction ) Onclickbutton :( ID ) Sender
{
Self . Checked = ! Self . Checked ;
Uiimage * Checkimage = ( Self . Checked ) ? [ Uiimage Imagenamed : @ "Checked.png" ] : [ Uiimage Imagenamed : @ "Unchecked.png" ];
[ Mybutton setimage : Checkimage forstate : Uicontrolstatenormal ];
If ( Mytabledelegate ! = Nil ) {
[ Mytabledelegate checkedbutton : Sender Checked : Self . Checked ];
}
}
@ End
A protocol is also implemented for data storage. Fashion Java-JavaScript mogujie.com women's clothing
Source code: Http://easymorse-iphone.googlecode.com/svn/trunk/table/iphone.sprintview/