#define THEROWLENGTH 16
#define Unicodestart 9728-1
+ (NSString *) Replaceunicode: ( NSString *) Unicodestr {
NSString *tempstr1 = [unicodestr stringbyreplacingoccurrencesofstring:@ "\\u" withstring:@ "\\u"];
NSString *TEMPSTR2 = [tempStr1 stringbyreplacingoccurrencesofstring:@ "\" "withstring:@" \\\ ""];
NSString *TEMPSTR3 = [[@] "" STRINGBYAPPENDINGSTRING:TEMPSTR2] stringbyappendingstring:@ "" "];
NSData *tempdata = [TempStr3 datausingencoding:nsutf8stringencoding];
nsstring* returnstr = [Nspropertylistserialization propertylistfromdata:tempdata
Mutabilityoption:nspropertylistimmutable
Format:null
Errordescription:null];
NSLog (@ "Output =%@", returnstr);
return [Returnstr stringbyreplacingoccurrencesofstring:@ "\\r\\n" withstring:@ "\ n"];
}
-(void) Showunicodeicon
{
j = therowlength;
Dispatch_async (Dispatch_get_global_queue (dispatch_queue_priority_default, 0), ^{
Nstimer *timerrun = [Nstimer timerwithtimeinterval:3 target:self selector: @selector (timeshow) Userinfo:nil Repeats:YES ];
[[Nsrunloop Currentrunloop] Addtimer:timerrun formode:nsrunloopcommonmodes];
[[Nsrunloop Currentrunloop] run];
[[Nsrunloop Currentrunloop] rununtildate:[nsdate datewithtimeintervalsincenow:20.0]]; Main thread waits, but yields the main thread time slice, then returns after 10 seconds
});
}
-(void) timeshow
{
Nsmutablestring *stirn2= [nsmutablestring stringwithcapacity:0];
for (int i = 1; I <= J; i++) {
i = 1 adjustment at Unicodestart Place
[Stirn2 appendformat:@ "\\u%x", Unicodestart + i% therowlength + (Therowlength * (i/therowlength))];
NSLog (@ "The string is # #%@", stirn2);
NSString *unicodestringshow = [[self class] replaceunicode:stirn2];
if (i% Therowlength = = 0) {
NSLog (@ "The Unicode is%@", unicodestringshow);
Back to main thread
Dispatch_async (Dispatch_get_main_queue (), ^{
Refresh UI
_label.font = [Uifont fontwithname:@ "Helvetica" size:40.f];
_label.textalignment = Nstextalignmentleft;
_label.numberoflines = 0;//number of rows is set to 1, default line number is 1 when not set
[_label SizeToFit];
_label.text = [NSString stringwithstring:unicodestringshow];
});
}
NSLog (@ "The Unicode is%@", unicodestring);
if (i% Therowlength = 0 && (i!= 0)) {
Empty this string
[Stirn2 setstring:@ "];
NSLog (@ "The string is ===%@", stirn2);
}
}
J + + 16;
NSLog (@ "%@", @ "Timeshow");
}