• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Conditionally declaring a BOOL in a .m file to be accessed in a .c function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conditionally declaring a BOOL in a .m file to be accessed in a .c function


  • Subject: Re: Conditionally declaring a BOOL in a .m file to be accessed in a .c function
  • From: Alex Zavatone <email@hidden>
  • Date: Tue, 20 Sep 2016 23:04:13 -0500

Unknown type.  But bool works.

Thanks, Ryan.

Sent from my iPad. Please pardon typos.

On Sep 20, 2016, at 11:58 AM, Ryan Dignard <email@hidden> wrote:

> This doesn't work?
> in the .m file at file scope
> BOOL condition = NO;
>
> in the .c file at file scope
> extern BOOL condition;
>
> On Tue, Sep 20, 2016 at 8:14 AM, Alex Zavatone <email@hidden> wrote:
>> I've been beating my head against the wall on this one.
>>
>> I'm trying to evaluate a condition and declare or conditionally #define a macro within an Objective-C method function that can be checked within a c function.
>>
>> Ideally, I'd just like a #define, but this
>>  like it to be a BOOL or, since this is going to be checked in c, a bool.
>>
>> I've tried all sorts of combinations of #define and extern and checking with #if and #ifdef if I can even get this to compile.
>>
>> The C file can't import the header of the Obj-C file or else I've got a few hundred errors on my hands.
>>
>> I can't even get the #define to be recognized in the C file.
>>
>> Any pointers here on how to proceed?
>>
>> Goal:
>> I'm looking to declare or define a "thing" from a .m method that is scoped so that it can be checked within a c file that can not import the .h file for that .m file.
>>
>> Will I need an intermediate file and class for this?
>>
>> Thanks.
>> Alex Zavatone
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Conditionally declaring a BOOL in a .m file to be accessed in a .c function
      • From: Alex Zavatone <email@hidden>
References: 
 >Conditionally declaring a BOOL in a .m file to be accessed in a .c function (From: Alex Zavatone <email@hidden>)
 >Re: Conditionally declaring a BOOL in a .m file to be accessed in a .c function (From: Ryan Dignard <email@hidden>)

  • Prev by Date: Re: Conditionally declaring a BOOL in a .m file to be accessed in a .c function
  • Next by Date: Re: Conditionally declaring a BOOL in a .m file to be accessed in a .c function
  • Previous by thread: Re: Conditionally declaring a BOOL in a .m file to be accessed in a .c function
  • Next by thread: Re: Conditionally declaring a BOOL in a .m file to be accessed in a .c function
  • Index(es):
    • Date
    • Thread