nsbundle - Objective-C / Load cell from xib / Need explanation -
ok, know how load custom cell xib, via code:
nsarray *nib = [[nsbundle mainbundle] loadnibnamed:@"custpmcellview" owner:self options:nil]; cell = (customcell *)[nib objectatindex:0];
but can explain first row do?
i feel stupid typing every time , not knowing how works.
nsarray *nib = [[nsbundle mainbundle] loadnibnamed:@"custpmcellview" owner:self options:nil];
loadnibnamed
returns views under xib. holding in array. here view under custpmcellview fetched , saved in array nib.
cell = (customcell *)[nib objectatindex:0];
we getting first view array, our desired view, , casting , assigning cell object.
we need assign new view each cell in uitableview
, purpose every time new cell needed, , using above code snippet.
edit
[nsbundle mainbundle]
, explained @ what meaning of [nsbundle mainbundle] in iphone?
Comments
Post a Comment