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

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -