1:原文摘自:http://three20.info/article/2010-10-06-URL-Based-Navigation#troubleshooting

Navigation in iPhone apps can be challenging - there is no single prescribed way to open a view and pass data into it. Most applications rely on each view having a particular API that the callers must know. This leads to a lot of boilerplate code to open the same view from multiple locations in your application.

The URL-based navigation in TTNavigator provides a standard way to navigate the user from one view to another, with built-in understanding of some of the standard iPhone interfaces like UINavigationController,UITabBarController, and more.

Table of Contents

Introduction

The concept behind TTNavigator is similar to Ruby on Rails' routing in that you link URL patterns to code in a url map. Callers simply request a url, and TTNavigator will find the appropriate code to run. This means that the url map makes a semantic distinction between what you want to display, and how you want to display it. The most common pattern is to have a single, shared navigator used across your whole application.

Here's an example to get started. Typically this appears in your Application Delegate'sapplicationDidFinishLaunching: selector.

TTNavigator* navigator = [TTNavigator navigator];
navigator.window = window;
 
TTURLMap* map = navigator.URLMap;
[map          from:@"tt://restaurant/(initWithName:)"
  toViewController:[RestaurantController class]];

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-09-10
  • 2021-10-14
  • 2021-07-01
  • 2021-12-09
猜你喜欢
  • 2022-12-23
  • 2022-01-16
  • 2021-04-04
  • 2021-11-07
  • 2021-07-30
  • 2021-11-27
相关资源
相似解决方案