Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

guitarpoplin

macrumors newbie
Original poster
Dec 23, 2010
2
0
hey guys i have a Property list that has:

Code:
<dict>
			<key>Title</key>
			<string>Texas</string>
			<key>Children</key>
			<array>
				<dict>
					<key>Title</key>
					<string>Dallas</string>
					<key>Children</key>
					<array>
						<dict>
							<key>Title</key>
							<string>Fortworth</string>
							<key>test</key>
							<string></string>
							<key>View</key>
							<integer>2</integer>
						</dict>
					</array>
				</dict>
</array></dict>

i cant figure out how to make a string be a UILabel or anything so i can make 1 view that has everything. cause heres part of my code that opens different views but i wish i had 1 view only that has many UI Labels that i can have but all different when you click different cells.

rootview.m

Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

	//Get the dictionary of the selected data source.
	NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];
	
	//Get the children of the present item.
	NSArray *Children = [dictionary objectForKey:@"Children"];
	
	if([Children count] == 0) {
		NSInteger ViewNumber = [[dictionary objectForKey:@"View"] integerValue];
		switch (ViewNumber) {
			case 1: {
				RootViewController *rvc = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]];
				//Switch the view here
				rvc.view = tbController.view;
				[self.navigationController pushViewController:rvc animated:YES];
				[rvc release];
				}
				break;
			case 2: {
				ImageViewController *ivc = [[ImageViewController alloc] initWithNibName:@"ImageView" bundle:[NSBundle mainBundle]];
				ivc.ImageName = @"Image.jpg";
				[self.navigationController pushViewController:ivc animated:YES];
				[ivc release];
				}
				break;
			case 3: {
				DetailViewController *dvController = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:[NSBundle mainBundle]];
				[self.navigationController pushViewController:dvController animated:YES];
				[dvController release];
				}
				break;
			default: {
				DetailViewController *dvController = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:[NSBundle mainBundle]];
				[self.navigationController pushViewController:dvController animated:YES];
				[dvController release];
				}
				break;
							
		}
	}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.