character - strange behavior of xcode 4.2 -
strange , funny think going on
code:
-(void)savefile { nsfilemanager *filemng = [nsfilemanager defaultmanager]; if(![filemng fileexistsatpath:self.appfilespath]) { nserror *error = nil; bool success = [filemng createdirectoryatpath:self.appfilespath withintermediatedirectories:yes attributes:nil error:&error]; if(!success) { nslog([error localizeddescription]); } } nslog([nsstring stringwithformat:@"%@",self.appfilespath]); [filemng createfileatpath:self.filefullpath contents:self.filedata attributes:nil]; [self.filedata writetofile:self.filefullpath atomically:yes]; } and line
nslog([nsstring stringwithformat:@"%@",self.appfilespath]); should give me this
file://localhost/users/user/library/application%20support/iphone%20simulator/5.0/applications/bf35b859-514b-45aa-8e3a-b2ce65bd82b6/documents/appfiles directory appfiles should created under ../documents/ directory, it's not there...
and nslog gives me this: file://localhost/users/user/library/application瑳楲杮楗桴潆浲瑡:敲敬獡e摡䕤瑮楲獥牆浯楄瑣潩慮祲:扯敪瑣潆䭲祥:汣獡s獩楋摮晏汃獡㩳氀湥瑧h畡潴敲敬獡e敳佴橢捥㩴潦䭲祥:敲潭敶扏敪瑣潆䭲祥:湩整敧噲污敵戀潯噬污敵爀浥癯䅥汬扏敪瑣s湩瑩猀慨敲䥤獮慴据e敲楧瑳牥敎睴牯䑫晥畡瑬䙳牯灁䥰㩄挀灯y摡佤橢捥㩴洀楡䉮湵汤e畢摮敬摉湥楴楦牥椀䕳畱污潔瑓楲杮:桳牡摥潃普杩牵瑡潩n潣湵牴䑹晥畡瑬潆..few more screens of bush..帴㽻椽絩8筞㴿楩}ㅶ䀶㨰帴㽻椽絩椸㈱䀀䜢佅楐數偬楯瑮"㽻搽絤䀸㨰4㉶䀴㨰笴㴿摤㡽䀀倢剂煥敵瑳牥"ㅶ䀶㨰⌴匸㈱䀀㰢䕇协灵潰瑲摥楔敬敓獴敓癲牥牐硯䑹汥来瑡㹥"㍶䀶㨰笴㴿摤㡽㉤椴㈳瘀㘱㐺㡀ㅩ2㉶䀸㨰帴㽻搽絤䤸㈱ㅤ椶㐲瘀㈱㐺癞8ㅀ䀶㨰帴㡶ㅣ2筞硟捰损湯敮瑣潩彮㵳}ㅀ䀶㨰䀴常彻䍟剆湵潌灯紽㈱帀彻䍟剆湵潌灯紽䀸㨰4筞彟䙃畒䱮潯㵰}癞䀸㨰4ㅀ䀲㨰帴㡶瘀〲㐺㡀ㅀ䤲㘱䀀㰢华慃档䑥汥来瑡㹥"㉀䀸㨰䀴笸㴿摤ㅽ2㽻搽絤㠲㐺㽻搽絤常㉤4㽻∽慬楴畴敤搢氢湯楧畴敤搢}upport/iphone 貌Š߈imulator/5.0/applications/caf90a92-5b85-4fc0-8482-3702c3e98f8d/documents/appfiles
when run code second time, if condision skiped, ../documents/ directory stil empty
来瑡㹥"㉀䀸 - mean wtf, first time this, restarting xcode, mac did't help, simulator set english, happen in other projects, keyboard setting ant nationalization looks ok, realy have no clue wrong
any ideas?
you can not nslog string. string argument takes format (like in printf) interpeted specially. in case, reading random memory because %20s means interpret next argument pointer null-terminated string of wide characters , print right-aligned in 20 columns; , chinese because of unicode occupied chinese hieroglyphs.
this correct way it:
nslog(@"%@", self.appfilespath);
Comments
Post a Comment