Tuesday, December 24, 2013

I wrote a tableview Why not display a directory

- (Void) viewDidLoad {
/ / 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;
}
Reply:
You say a directory mean? Printed classes do you determine the classes do not have a problem?
Reply:
cited a floor volcan1987 reply:
level directory you say what does it mean? Printed classes do you determine the classes do not have a problem?

I mean classes that I wrote in untitled.plist level directory under the directory, printing only what novice classes this matter first to write something more advice under Thanks! !
Reply:
NSLog ("% @", classes);
So print to see what classes are not a problem
There is your classes in the @ property attribute is added to retain the right

Reply:
reference to the third floor volcan1987 reply:
NSLog ("% @", classes);
So print to see what classes are not a problem
There is your classes in the @ property attribute is added to retain the right


@ Property is such a @ property (nonatomic, retain) NSArray * classes; should be no problem
When asked NSLog ("% @", classes); should put what is a problem which it
(Ask is not it a little 2 Hey O (∩ _ ∩) O ~)

Reply:
- (Void) viewDidLoad {
/ / 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;
Here once put,
- (NSInteger) numberOfSectionsInTableView: (UITableView *) aTableView {
/ / Into classes part
Here once put,
Then open gdb, look inside the console to print out data when classes are not what you want
Reply:
reference to the third floor volcan1987 reply:
NSLog ("% @", classes);
So print to see what classes are not a problem
There is your classes in the @ property attribute is added to retain the right


Printkill
quit
Reply:
reference to the 6th floor xiaoerlang_1 reply:
reference to the third floor volcan1987 reply:
NSLog ("% @", classes);
So print to see what classes are not a problem
There is your classes in the @ property attribute is added to retain the right


Printkill
quit

Did not print out the data it shows you that the classes are empty, of course, can not display a directory of what you say
Reply:
reference to the third floor volcan1987 reply:
NSLog ("% @", classes);
So print to see what classes are not a problem
There is your classes in the @ property attribute is added to retain the right

Oh Yeah so that means I have less to write what chant! ~
Reply:
reference to the 8th floor xiaoerlang_1 reply:
reference to the third floor volcan1987 reply:
NSLog ("% @", classes);
So print to see what classes are not a problem
There is your classes in the @ property attribute is added to retain the right

Oh Yeah so that means I have less to write what chant! ~

Ah, if you are sure there untitled.plist data, then it is you are doing data processing or assignment of a location problem, a good check under the bar
Reply:
reference to the 9th floor volcan1987 reply:
reference to the 8th floor xiaoerlang_1 reply:

Ah, if you are sure there untitled.plist data, then it is you are doing data at ......

This is in the class has a sub-item under this and all shows are ordered 0-2, 0-2. 0 to 2 such that there is no upper-level class
Checked a couple of days to write right now should be less afraid of what
Reply:
reference to the 10th floor xiaoerlang_1 reply:
reference to the 9th floor volcan1987 reply:
References to the 8th floor xiaoerlang_1 reply:

Ah, if you are sure there untitled.plist data, then it is you are doing data at ......

This is in the class has a sub-item under this and all shows are ordered 0-2, 0-2. 0 to 2 such that there is no upper-level class
Checked a couple of days to write right now should be less afraid of what

Did you code, can not help you, you look carefully it is definitely not value problem classes, you can only get here now to see if you can show the
Reply:
reference to the 11th floor volcan1987 reply:
reference to the 10th floor xiaoerlang_1 reply:

References to the 9th floor volcan1987 reply:
References to the 8th floor xiaoerlang_1 reply:

Ah, if you are sure there untitled.plist data, then it is you are doing data at ......

This is in the class has a sub-item under this and all shows are ordered 0-2, 0-2. 0 to 2 such that there is no upper-level class
Checked a couple of days ......

Oh thank you very much to the point has to express his appreciation thank you haha
Reply:
cited a floor volcan1987 reply:
level directory you say what does it mean? Printed classes do you determine the classes do not have a problem?

Under your convenience add my qq do to help me solve this problem did not understand the whole chant it
1037431533
Reply:
cited a floor volcan1987 reply:
level directory you say what does it mean? Printed classes do you determine the classes do not have a problem?

On this issue I have not solved your next qq can be added to help me do thank you for the really urgent need my qq is 1037431533

No comments:

Post a Comment