Ultime
News

Ultimi
Articoli

Numeri
Fortunati

eLibrary

Xcode: Create a list of items with db data

xcode

- First of all create or elect a Controller class to control your data and add this string into the declaration "" to control its working behavior and its datasource management
- Drag a Table View object into your View
- Declare into your Controller a UITableView variable.
- Link the object with the variable
- Drag a Table View Cell object under the Table View and put inside the objects to view in each cell
- Create a new Objective-C class subclass of UITableViewCell and declare properties of the objects to use in each of the items in the list
- In the Identity Inspector of the Table View Cell object select the class just made as Custom Class
- In the Attributes Inspector of the Table View Cell object set the field "Identifier" the name of the Class
- Now it'll be possible to link each object outlet with the variables declared in the UITableViewCell class
- Include the cell h file in the h controller file
- Create a NSMutableArray object to store all the objects retrieved from the db
- Insert the code to manage the Table View using the NSMutableArray:
< >< >- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
< >< >- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

  • 04/12/2012
  • Fonte: Titano
twitter facebook Seguici anche su

Tutti gli articoli