ios - NSInvalidArgumentException with stringByAppendingPathComponent -


I have a bundle setting with a string: version

My bundle settings version = 2.9 1

In my project, if I use this code, then everything is good:

  NSString * path = [documentsDirectory stringBeeAppendingPathComponent: @ "ma / V_2 .9.1 / gm / stability_lays/ifocus.xml "];  

If I use this code:

  NSString * path = [documentsDirectory stringBeeAppendingPathComponent: (@ "MA / V _% @ / GMA / Fixtures_lays / iFocus Xml ", version)];  

I have this error:

* Canceling the ATI 'NSINIDAErgement exception' due to the exception exception, reason: '- [UITextField length]: 0x9753190 '

sent to unknown selector, for example, because you already have your own There is no use to use multiple / stringbapping path companions in the string, so you can also use it:

  NSString * path = [document Rectori Stringbafing Format: @ "ma / V_%@/gma2/fixture_layers/ifocus.xml", version];  

Another option, which gives you the advantage of a stringbapping path comparison, is to break it down properly:

  NSString * path = [[[ Stringbapping Path Companent: @ "Jima 2"] stringbapping path comparison: @ "fiction_lays"] stringByAppendingPathComponent: [[Document Directory stringbapping path comparison: @ "Ma"] stringbappingpathiconant: [NSString stringWithFormat: @ "V_% @"]] : @ "Ifocus.xml"];  

But it's ugly.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -