/ / Get untitled. The location of this file
pliseNSString * path = [[NSBundle mainBundle] pathForResource: @ "untitled"
ofType: @ "plist"];
/ / This file will be loaded
NSDictionary * dict = [[NSDictionary alloc] initWithContentsOfFile: path];
self.movieTitle = dict;
[Dict release];
/ / The contents inside sort
NSArray * array = [[movieTitle allKeys] sortedArrayUsingSelector: @ selector (compare :)];
self.classes = array;
[Super viewDidLoad];
self.clearsSelectionOnViewWillAppear = NO;
self.contentSizeForViewInPopover = CGSizeMake (320.0, 600.0);
}
- (NSInteger) numberOfSectionsInTableView: (UITableView *) aTableView {
/ / Into classes part
return [classes count];
}
- (NSInteger) tableView: (UITableView *) aTableView numberOfRowsInSection: (NSInteger) section {
/ / Returns the number of rows tableview row
NSString * test = [classes objectAtIndex: section];
NSArray * movieSection = [movieTitle objectForKey: test];
return [movieSection count];
}
- (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {
static NSString * CellIdentifier = @ "CellIdentifier";
/ / Dequeue or create a cell of the appropriate type.
UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: CellIdentifier] autorelease];
cell.accessoryType = UITableViewCellAccessoryNone;
}
NSString * test = [classes objectAtIndex: [indexPath section]];
NSArray * movieSection = [movieTitle objectForKey: test];
/ / Configure the cell.
cell.textLabel.text = [movieSection objectAtIndex: [indexPath row]];
return cell;
}
- (NSString *) tableView: (UITableView *) tableView
titleForHearderInSection: (NSInteger) section {
NSString * test = [classes objectAtIndex: section];
return test;
}
This file has untitled.plist menu classes and why the secondary menu item appears only after running the second-level menu, there is no urgency to solve the scores level menu
Reply:
Less write a function that does not give Sections assignment
Reply:
How to write, you can say the next newbie! ! Thank you
Reply:
Oh, did not see what the problem is not untitled.plist defined problems?
Safety code for its structure should be: each key corresponds to an array!
Reply:
this is
untitled.plist
Reply:
this is
untitled.plistKey Type Value
root Dictionary
classes1 Array
item0 String 1.1
item0 String 1.2
item0 String 1.3
classes2 Array
item0 String 2.1
item0 String 2.2
item0 String 2.3
classes3 Array
item0 String 3.1
item0 String 3.2
item0 String 3.3
Reply:
His grandmother did, the more I called 'r'
No comments:
Post a Comment