In my iPhone application I use the default navigation based view for it’s main window. But how do I add items to to list view from an array of strings in code? I looked all over the place and couldn’t find anything, so please help.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
take a look at the
UITableViewDataSourceProtocol Reference hereThe function
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPathis responsible for setting values of a cell, like the text-label etc..In this method you can use indexPath.row to get the index of the current cell which would be identical to the index of the object in your
NSArray.You could do it like this (inside the cellForRowAtIndexPath method):