dataSource outlet

I'm wondering how to use outlet, dataSource on a UITableView class. I'm stuck because I can't view any data on the table. Does anyone know how? I've looked at other websites, but their tips don't work. I tried to add the dataSource to the UITableView class, using the interface builder application


The dataSource property of a UITableView is a delegate what you assign to the tableView... Then the tableView calls that assigned class when it comes to collecting data.. In order to get data to display on the tableView you need to implement the UITableViewDataSource delegate methods...

A good place to start would be checking out the UITableView Class Reference: - UITableView Class Reference - UITableViewDelegate Protocol Class Reference - UITableViewDataSource Protocol Class Reference

Also, take a look at this sample code:

The UITableViewDataSource and UITableViewDelegate are usually set on the ViewController. If you are using a UITableView within a UIViewController you need to implement the delegate and datasource in the interface file (*.h)

@interface YourViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>

Once you have the delegate declared you can implement 3 methods to make the tableview work

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

Need Your Help

iPhone MDM implmentation on Windows & C# - Export .mobileconfig using command-line

c# iphone certificate mdm

I have successfully created Configuration Profile using this C# code and iPhone Configuration Utility. Now, I need to export this Configuration Profile to .mobileconfig file using any command-line

Draw an image partially from bottom to top image-processing

I have the code below to draw a partial image according to the value given in numericalUpDown control:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.