Newbie Question on a method signature

2008-06-04 Thread James Cicenia
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];

Re: Newbie Question on a method signature

2008-06-04 Thread Bill Bumgarner
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 *)

Re: Newbie Question on a method signature

2008-06-04 Thread James Cicenia
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

Re: Newbie Question on a method signature

2008-06-04 Thread Andrew Merenbach
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

Re: Newbie Question on a method signature

2008-06-04 Thread Bill Bumgarner
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

Re: Newbie Question on a method signature

2008-06-04 Thread Michael Watson
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,

Re: Newbie Question on a method signature

2008-06-04 Thread Michael Vannorsdel
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

Re: Newbie Question on a method signature

2008-06-04 Thread James Cicenia
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

Re: Newbie Question on a method signature

2008-06-04 Thread Hamish Allan
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