Re: creating a UITableView on an "Utility application" project
Re: creating a UITableView on an "Utility application" project
- Subject: Re: creating a UITableView on an "Utility application" project
- From: Matej Bukovinski <email@hidden>
- Date: Mon, 17 May 2010 20:32:29 +0200
A navigation controller is not something that you can expect to be always there. It has to be created first - ether in code or in interface builder.
The flip isn't managed by a navigation controller. The main view controller is simply presenting modal view controller (every UIViewController can do this).
You can "wrap" your Flipside controller in a navigation controller to get the desired effect. I suggest you take a look at the UINavigationController class documentation to see what it's all about.
In the main controller change the part where you present the flipside view controller (showInfo by default) to someting like:
FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil];
controller.delegate = self;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
[controller release];
navController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:navController animated:YES];
[navController release];
Regards,
Matej Bukovinski
On 17.5.2010, at 19:07, Alejandro Marcos Aragón wrote:
> Hi Matej,
>
> Thanks for your answer. I checked what you said and indeed the pointer is null. What I don't understand, is how this application doesn't have a UINavigationController. How am I switching between the front and back view if there isn't a navigation controller? I used the code you suggested and it works, but that is not what I want. What I want is the default behavior for a UITableView: when the user clicks on a row, a new view slides from the right, and then when the user clicks back, we're back in the view that contains the UITableView.
>
> If I were to create the UINavigationController, where should I do this? In the MainViewController.h? In the FlipsideViewController.h?
>
> Thanks again for the help,
>
> aa
>
> On May 16, 2010, at 6:19 PM, Matej Bukovinski wrote:
>
>> Hi Alejandro,
>>
>> I don't see that you create a UINavigationController in your code and since the unity application template doesn't already provide one I assume self.navigationController in your code is nil. Check with the debugger to make sure.
>>
>> If you're after a standard flip effect I suggest presenting a modal view controller:
>>
>> dvController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
>> [self presentModalViewController:dvController animated:YES];
>>
>> Regards,
>> Matej Bukovinski
>>
>>
>
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden