I am working on an in app purchase app. I would like fill a table view with a list of products,
and put a BUY button on the right hand side of each entry. Does anyone have the UITableView – fu necessary to do this?
Thanks!
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.
Create a custom class that extends UITableViewCell
In the corresponding NIB
CustomTblCell.xibdrag and drop UILabel and UIButton elements (side-by-side).Finally, in your method
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPathinitialize and return the CustomTblCellHope this helps!
Here is a code snippet for the
cellForRowAtIndexPath:method I mentioned aboveIf you have many rows in your table such that the user has to scroll through the table use ‘dequeueReusableCellWithIdentifier`. This optimizes the code to reuse the same customTblCell object which is now not in user view. The deque method takes a String as input arg (customTableCellIdentifier). Make sure this matches the Identifier string you specify in the IB while creating the CustomTblCell