objective c - AQGridView: How to Init cell -


i'm implementing aqgridview based on examples comes it. i'm working xibs, , in example, code is:

 if ( plaincell == nil )         {             plaincell = [[[imagedemogridviewcell alloc] initwithframe: cgrectmake(0.0, 0.0, 200.0, 150.0)                                                  reuseidentifier: plaincellidentifier] autorelease];             plaincell.selectionglowcolor = [uicolor bluecolor];         }          plaincell.image = [uiimage imagenamed: [_imagenames objectatindex: index]];          cell = plaincell;      } 

my code looks this:

- (aqgridviewcell *) gridview: (aqgridview *)ingridview cellforitematindex: (nsuinteger) index   {   static nsstring * filledcellidentifier = @"filledcellidentifier";  aqgridviewcell * cell = nil;  magazinecell * filledcell = (magazinecell *)[gridview dequeuereusablecellwithidentifier: filledcellidentifier];  if ( filledcell == nil ) {   }  filledcell.edicaolabel.text = [[data objectatindex:index] name];  cell = filledcell;  return ( cell ); 

}

the example initwith cgrect, how init cell when work xibs?

generally speaking, 1 doesn't init view when loading xib. same thing inside if (filledcell == nil) in uitableview (although aqgridviewcell instead of uitableviewcell). if "gridcell.xib" has aqgridviewcontroller file owner , tempcell bound laid-out gridcell in ib , you've set identifer filledcellidentifer, can do:

[[nsbundle mainbundle] loadnibnamed:@"gridcell" owner:self options:nil];  filledcell = [self.tempcell autorelease]; 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -