开发者

Iphone : Problem regarding replacing String?

I Want Replace String ':' by '/',

I am Using this code to replace

NSString *newPath = [imgPath stringByReplacingOccurrencesOfString:@":" withString:@"/"];

But at a time, I get this error

-[__NSCFDictionary stringByReplacingOccurrencesOfString:withString:]: unrecognized selector sent to instance 0x664e650

W开发者_JAVA技巧hat Should I do ?


  1. imgPath is NSDictionary should be NSString.
  2. If imgpath is NSStRING, probably it is released already


I feel there might be some structured organized way the data in your NSString. I faced a similar situation . I had my data with recursive {}. You should replace NSString *imgPath to NSDictionary *dictPath . Having done that read your fields with [dictPath objectForKey:@"key"] than read the fields again in NSString and remove special characters.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜