On Wed, Jun 4, 2008 at 9:38 PM, James Cicenia <[EMAIL PROTECTED]> wrote:
> What the heck is wrong with my declaration?
It's for a method called returnUIForFont:, not returnUIColorForFont:.
Take a few minutes to try to work out what's wrong before asking the
list. Finding your own mistakes is an
OK -
When I put the method ahead of the call it compiled and work.
So I decided to declare it in my header as:
- (UIColor *) returnUIForFont: (NSString *) theString;
Now the compiler complains:
/Users/jcicenia/Documents/iPhone/TOSPhone/ProjectViewController.m:142:
warning: incomplete impleme
On Wed, Jun 4, 2008 at 1:26 PM, James Cicenia <[EMAIL PROTECTED]> wrote:
> Wow..
>
> I didn't know the order of methods was important.
They aren't really.
It is just a matter of the compiler seeing the declaration for a
method/function before it is used. You normally do that by declaring
the meth
If the method is defined above the place you use it, you can avoid
compiler warnings. But the most common and more correct thing to do
is declare the method in the header with the rest of your class so
anyone that imports that header will know the specifics of that method
(and the compiler
It's not the method order, it's declaration vs definition. The
compiler scans the file top to bottom, so you must declare a method's
prototype before you actually use it anywhere, otherwise the compiler
will give you a warning because it hasn't seen the protoype yet.
--
m-s
On 04 Jun, 200
On Jun 4, 2008, at 1:26 PM, James Cicenia wrote:
I didn't know the order of methods was important.
Objective-C is C + a set of syntactic extensions that yields an object
model.
As such, you need to follow the rules of C and ensure that things are
declared prior to use.
b.bum
__
Hi, James,
I'd say, though, that the order of methods isn't actually important,
as long as you've declared them in your @interface context --
generally in your header file. Hope this helps. :)
Cheers,
Andrew
On Jun 4, 2008, at 1:26 PM, James Cicenia wrote:
Wow..
I didn't know t
Wow..
I didn't know the order of methods was important.
thanks
James
On Jun 4, 2008, at 3:20 PM, Hamish Allan wrote:
On Wed, Jun 4, 2008 at 9:14 PM, James Cicenia <[EMAIL PROTECTED]>
wrote:
why does it tell me:
warning: (Messages without a matching method signature will be
assumed to
You have to make sure your header has - (UIColor *)
returnUIColorForFont:(NSString *) theString in it so when you use the
method in other source files the compiler will know what the arguments
and return types to returnUIColorForFont: are. Without this the
compiler has to make assumptions
Class names changed to not perpetuate NDA violation...
On Jun 4, 2008, at 1:14 PM, James Cicenia wrote:
I have the following:
((ProjectListCell *)cell).budgetHealth.textColor = [self
returnNSColorForFont:s];
And here is my method:
- (NSColor *) returnNSColorForFont:(NSString *) theString{
On Wed, Jun 4, 2008 at 9:14 PM, James Cicenia <[EMAIL PROTECTED]> wrote:
> why does it tell me:
>
> warning: (Messages without a matching method signature will be assumed to
> return 'id' and accept...
I'm guessing your method's definition comes after the code that uses
that method, and you have
I have the following:
((ProjectListCell *)cell).budgetHealth.textColor = [self
returnUIColorForFont:s];
And here is my method:
- (UIColor *) returnUIColorForFont:(NSString *) theString{
if([theString compare:@"1"] == NSOrderedSame){
return [UIColor greenColor];
12 matches
Mail list logo