0921 tarbar& Enumeration Lan Yi

Source: Internet
Author: User

The request is a URL-like thing.

It's got a JSON file.

NSString *path =[nsstring stringwithformat:@ "http://apis.juhe.cn/cook/query?key=80996127f667eac43832103850b3b13a &menu=%@ ", Self.accstr];

path= [path stringbyaddingpercentescapesusingencoding:nsutf8stringencoding];

nsurl *url=[nsurl Urlwithstring:path];

NSData *data = [NSData Datawithcontentsofurl:url];

Nsdictionary *dic = [nsjsonserialization jsonobjectwithdata:data options:0 Error:nil];

Request address appears in Chinese

URL encoding is required

Tab Bar

Didselectitem Tabbar's Tag attribute note

Tab Bar Controller

You can add branches to build a Viewcontroller connection select View Controllers

You can add Navigationcontroller to each branch

Select the editer/embled in that you want to add

Storyboard in Connect jump

1present Jump Direct Select previous page press control to select modal/show from the button *

2push Jump directly Select the previous page control line start from the button * Select push/present modally

Pass parameters

Prepareforsegue Sgue refers to the line where the jump is connected.

If you use the segue jump to go into this method before each jump to pass parameters in this method is the argument

Pushviewcontroller *vc=segue.destinationviewcontroller

In this case, pass the parameter

Wiring can be set for each line identifier

Judgment in the code

if (segue.identifier isequaltostring:@ "Identifer") {}

If the button and the line jump do not need to write the event will jump two times more than one page

Enumeration

typedef Enum:nsuinteger {

Meishi,

Dianying,

Jiudian,

Ktv

Xiaochi,

Xiuxianyule,

Liren,

Jiehun

} Categortype;

0921 tarbar& Enumeration Lan Yi

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.