Re: A simple question about nsthread
Re: A simple question about nsthread
- Subject: Re: A simple question about nsthread
- From: Andrea Salomoni <email@hidden>
- Date: Thu, 1 Dec 2005 10:49:00 +0100
Thank you Joar,
Il giorno 01/dic/05, alle ore 10:24, j o a r ha scritto:
On 1 dec 2005, at 10.18, Andrea Salomoni wrote:
What's this? Is "theClass" the name of the class? You should
always name classes with a leading capital letter!
Why? In Apple's examples no one class in named with capital
letters, and I really don't think using capital will fix the
thread problem.
You're wrong - every single Cocoa class is named with a capital
letter. Three actually: "NSSomeClass".
And it will help you fix the thread problem, because it will help
us help you more efficiently.
Yes understand.... thank you for tip but you mean I have to name my
classes in this way too?
Before calling back to the main thread, verify that (nil !=
myTextField)!
yes this does not return true... so the outlet doesn't exist....
But really cannot understand why.
In the main thread the outlet is fine.... but in this class not.
How can I do?
The outlet is probably populated when you load the corresponding
nib file, and I can't see from your code snippet that you ever do
that?
In the header file of myClass I have:
IBOutlet NSTextField * myTextField;
I though this should be enough... but maybe I wrong
Is possible to send a message to an outlet in a thread inside
another class that isn't the controller?
I think that the simple answer to that question is "yes". That
said, the thread is not "inside another class". You should probably
try to find some documentation to help you improve your
understanding of threads vs. objects.
Yes I did and all documentation says to use [receiver
perormSelectorOnMainThread: method .
In another app I made i did the same and works fine, but this method
is in the controller class and the outlet exist.
I cannot find another documentation about it, because all the
documentations tell me the same: use performSelectorOnMainThread:
j o a r
Thank you again Joar
Andrea
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden