[futurebasic] Re: [FB] ABEmailForName

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2010 : Group Archive : Group : All Groups

From: Bernie <fblist.bw@...>
Date: Sat, 10 Jul 2010 13:45:38 +0100
Robert P wrote:

> Bernie wrote:
> 
>> not sure why gcc throws up an 'incompatible pointer type' warning if I omit the '(CFStringRef)' cast before kABEmailHomeLabel.
> 
>> // ABGlobalsC.h
>> system CFStringRef kABEmailHomeLabel
> 
>> fn HIViewSetText( sConsoleHITextView, fn EmailForName( @"Ron", @"Barrow", (CFStringRef)kABEmailHomeLabel ) )
> 
> It's true that ABGlobalsC.h declares a CFStringRef:
>   extern CFStringRef const kABEmailHomeLabel;  // Home email
> But when you compile everything as Objective-C you pick up the other personality of kABEmailHomeLabel, in ABGlobals.h
>    extern NSString * const kABEmailHomeLabel;  // Home email
> The cast is then necessary to pacify the compiler.
> 
> It wouldn't happen if you split off your Obj-C code into its own *.m and *.h files, and turned off the 'Compile as Objective-C' checkbox.

Okey dokey. Thanks Robert.

Bernie