开发者

issue with StringByReplacingOccurrencesOfString options:NSCaseInsensitiveSearch

开发者 https://www.devze.com 2023-01-15 13:45 出处:网络
The options:NSCaseInsensitiveSearch is crashing my app when I have it in the following. Does anyone know why this might be?

The options:NSCaseInsensitiveSearch is crashing my app when I have it in the following. Does anyone know why this might be?

NSString* string3 = [[[[tvQ.text stringByReplacingOccurrencesOfString:@"\n"
    withString:@" " options:NSCaseInsensitiveSearch range:wholeString]
        stringByReplacingOccurrencesOfString:@"&" withString:@"and"]     
            stringByReplacingOccurrencesOfString:@"ç" withString:@"c"] 
                stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];

Error from X-Code: error: 'wholeString' no开发者_StackOverflow中文版t defined


shouldn't your 'wholeString' be a string which you have to declare before the call of this function? or, if you want to search the whole string, then shouldn't it be your tvQ.text ?

0

精彩评论

暂无评论...
验证码 换一张
取 消