Hey
I'm trying to get a hang of iOS programming and Objective-C by trying to realize my app idea.
From now on everything is going very well. I've got an Navigation controller, Tableview and a subview when a row is pressed.
I'm getting my data from a plist and putting it in an Array first:
So i'm populating my tableview with the "diceNamen". en then when a row is selected at intexPath:
So I'm basicly pushing my data to my other controller and putting the clickedDice (Name that i've clicked in my tableview) to my title and then getting the strings with it that are in my plist file.
My plist file is setted up like this:
So the problem is that when i'm trying to use the array that i've pushed to my other view, It's all in one object. so there are 3 string in an array in my second view array ..
Does anyone know a better way to do this ? Or a solution for getting 3 strings out of that array and putting it in one array.
I'm tried it with a for loop, but it keeps giving me (null)..
Grz
I'm trying to get a hang of iOS programming and Objective-C by trying to realize my app idea.
From now on everything is going very well. I've got an Navigation controller, Tableview and a subview when a row is pressed.
I'm getting my data from a plist and putting it in an Array first:
Code:
NSString *path = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"plist"];
NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
self.rootControllerData = dict;
NSArray *array = [[self.rootControllerData allKeys] sortedArrayUsingSelector:@selector(compare:)];
self.diceNamen = array;
So i'm populating my tableview with the "diceNamen". en then when a row is selected at intexPath:
Code:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
DicingViewController *dicingView = [[DicingViewController alloc] initWithNibName:@"DicingViewController" bundle:nil];
dicingView.clickedDice = [self.diceNamen objectAtIndex:indexPath.row];
dicingView.dicingTemp= [[NSArray alloc] initWithObjects:[rootControllerData objectForKey:[self.diceNamen objectAtIndex:indexPath.row]], nil];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[self.navigationController pushViewController:dicingView animated:YES];
}
So I'm basicly pushing my data to my other controller and putting the clickedDice (Name that i've clicked in my tableview) to my title and then getting the strings with it that are in my plist file.
My plist file is setted up like this:
Code:
Dictionary
-Array
--String
--String
-Array
--String
aso..
So the problem is that when i'm trying to use the array that i've pushed to my other view, It's all in one object. so there are 3 string in an array in my second view array ..
Does anyone know a better way to do this ? Or a solution for getting 3 strings out of that array and putting it in one array.
I'm tried it with a for loop, but it keeps giving me (null)..
Grz
Last edited: