I finally "solved" the issue by creating a new cocoa class, and just copy past exact the same code in this new class, problem solved...
Post
Replies
Boosts
Views
Activity
I found another question on this forum, which solves my issue:
[[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.001]];
Posted 4 years ago by lemonmojo
Finally found the solution myself, just had to make an IBOutlet from class B instead of (instantiate the class B).
Thank you janabanana I will try your suggestions.
Thank you janabanana,but I have to deal also with multiline strings, so this is not a real solution for me.
Sorry I forgot a line of code in my explanation:As PBK mentionned too.// create a paragraph style to define my text alignmentNSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];paragraphStyle.alignment = NSTextAlignmentRight;[userAttributes setObject:paragraphStyle forKey:NSParagraphStyleAttributeName];// create an NSAttributedString and add text properties to itNSAttributedString *attrString = [[NSAttributedString alloc] initWithString:myString attributes:userAttributes];// draw the "attributed string" at a given point[attrString drawAtPoint:NSMakePoint(myXTLval,myYTLval)];Thank you both for feedback.But this is how it still not work.