Skip to content

关于搜索栏奔溃的问题 #12

Description

@cattlelovegrass

当没有字符串 ( 或者 )出现的时候,你用NSarray [1]是崩溃的
NSString *searchString = searchBar.text;

    if([searchString containsString:@"("]) {
        NSArray *array  = [[searchBar text]componentsSeparatedByString:@"("];
        NSString *second = array[1];
        if([second containsString:@")"]) {
            self.req_security_id = [second componentsSeparatedByString:@")"][0];
            NSLog(@"array:%@",self.req_security_id );
            [self getData];

        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions