Three20 urlmap object transfer method

Source: Internet
Author: User

The original is like this: http://three20.info/article/2010-10-06-URL-Based-Navigation#nativeparams

 

[map from:@"tt://menu/(initWithMenu:)"  toSharedViewController:[MenuController class]];

[map from:[Contact class] name:@"view" toURL:@"tt://contact/view/(uid)"];

Two methods:

1.

@interface Contact : NSObject { } @property (nonatomic, retain) NSNumber* uid;@property (nonatomic, retain) NSString* firstName;@property (nonatomic, retain) NSString* lastName; @end

 

Contact * acontact = [contact alloc]
Initwithfirstname: @ "Johnny" lastname: @ "Appleseed" uid: 1];
Nsstring * url = [acontact urlvaluewithname: @ "View"]

Then

Ttopenurl (URL );

 

2.

NSArray *arr = [...load up with data...];[[TTNavigator navigator] openURLAction:[[TTURLAction actionWithURLPath:@"tt://restaurant/Chotchkie's"]  applyQuery:[NSDictionary dictionaryWithObject:arr forKey:@"arraydata"]]];

Then write in the Controller code corresponding to TT: // Restaurant

-(id) initWithName: (NSString*)name query:(NSDictionary*)query {  for (MyObject* item in [query objectForKey:@"arrayData"])    //... do something with item ...  }   // ...}

 

Reprint please explain the source: http://www.cnblogs.com/hubj/archive/2012/05/20/2509596.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.