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 11:02:02 +0100
Sorry the last question:
Il giorno 01/dic/05, alle ore 10:53, j o a r ha scritto:
On 1 dec 2005, at 10.48, Andrea Salomoni wrote:
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?
Yes certainly - read the Cocoa / ObjC naming guidelines.
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
Declaring a variable, and populating the variable, are two
completely different things.
Yes but if I declare the IBOutlet variable and I write [myvariable
setStringValue:@"aString"]; I populate it...
The same thing happen if I write [myvariable
performSelectorOnMainThread:@selector(setStringValue:)
withObject:@"aString"];
The problem is that IBOutlet for some strange reason doesn't exist:
the if (nil != myvariable){
NSLog (@"doesn't exist");
}
return true... so the problem is that the outlet doesn't exist....
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:
What I think you need is not the documentation on these particular
methods, but rather a more basic conceptual documentation on what a
thread is, and how it relates to the data it operates on.
I read all Apple documentation, but none explain this particular
problem on outlet.
Anyway thank you for your support, I will serach again for some other
tips...
Andrea
j o a r
_______________________________________________
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