Re: Can't import a header file? + other warnings
Re: Can't import a header file? + other warnings
- Subject: Re: Can't import a header file? + other warnings
- From: Ondra Cada <email@hidden>
- Date: Tue, 30 Apr 2002 15:58:42 +0200
On Tuesday, April 30, 2002, at 08:34 , Joel Rosenblum wrote:
(Please bear with me, there are a lot of questions here, I'm new to cocoa,
and not finding it very self-explanatory.)
Actually, if you tried to read docs, they would prove to be much
explanatory. Vast majority of these questions is answered there all right.
I downloaded the MOKit from lorax.com for its RegEx capabilities, and I
installed it by dragging the MOKit.framework folder to my
/Library/Frameworks folder, as the Installation Guide told me to. Then,
in the class where I used the RegEx, at the top I put #import "MOKit.h"
but when I built the app, I got a compiler error saying it couldn't find
MOKit.h. Well, I don't know why it can't find it.
Just have a look at all those #import <Cocoa/Cocoa.h> or #import
<Foundation/Foundation.h> lines... I think there needs to be *NO* special
documentation to make absolutely obvious that you wanted
#import <MOKit/MOKit.h>
Also, I'm getting a number of other compiler warnings which I don't
understand:
WindowController.m:11: warning: cannot find method.
WindowController.m:11: warning: return type for `setController:' defaults
to id
WindowController.m:12: warning: cannot find method.
WindowController.m:12: warning: return type for `startAnimating' defaults
to id
It says it can't find the method, but then it says the return type for
that SAME method (which it says it can't find!) defaults to id.
'Course, if it can't FIND it, it has to resort to some reasonable DEFAULT,
which is id.
I don't know why it would default to id, since I know that the return
type is void.
Now you are pulling our legs indeed. Or do you really presume the compiler
contains a telepatic module?
And even though it can't find the method, I'm fairly certain (by use of a
beep) that the method IS being called!
This looks like the first relevant question. The cause is the dynamicness
of ObjC: you can send *ANY* message to *ANY* object, regardless the
message is known or not. If not, compiler just warns, but sends the
message properly anyway -- which is why the appropriate methods gets
called.
This is a line of code I have to format a string, the compiler says
"class factory method not found" referring to "makeStringWithFormat" no
doubt. I must have gotten the syntax wrong, because I don't see the whole
declaration in the Cocoa help.
result = [NSString makeStringWithFormat:@"%f words/min, %f
%f-letter-words/min.", f1, f2, f3];
See NSString.html.
And then it says the return type for makeStringWithFormat defaults to id.
Argh!
What argh?!? Any unknown method defaults to id return value and arguments.
What's the problem?
I made an outlet in IB from one class to another,
You made the outlet in class all right, but it is from one *instance* to
another (object), since you can't set/use class variables from IB.
and connected it in the instance of the containing class, all in IB. I of
course did "Create Files" from the class. The outlet did not work though,
as I was unable to call any of the outlet's methods in code. What might
cause the outlet to not work? All of my other outlets work.
What does that mean?
Where is setVisible:BOOL for controls in the cocoa documentation?
Nowhere. Controls should be always visible. Check list archives, this was
here many times.
How do I set the text of an editfield? I tried setText but that didn't
work, the docs don't seem to mention any way of setting the text for an
NSTextField. Such an elementary function, too...
Such an alamentary answer too -- see NSControl.html.
What is the Ticks function in cocoa? I thought NSTicks() would return the
tick count of the system, but that function doesn't seem to exist. And
where would I search the docs for this?
What are you speaking of? If you want to know the current date, see NSDate.
html. There's no "tick" in a high level API, at least so far as I can say.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.