• 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: TARGET_OS_MAC section generates a compile error on an iPhone project?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TARGET_OS_MAC section generates a compile error on an iPhone project?


  • Subject: Re: TARGET_OS_MAC section generates a compile error on an iPhone project?
  • From: Kyle Sluder <email@hidden>
  • Date: Fri, 27 Aug 2010 14:02:35 -0400

Read this: http://sealiesoftware.com/blog/archive/2010/8/16/TargetConditionalsh.html

--Kyle Sluder
(Sent from the road)

On Aug 27, 2010, at 1:47 PM, Tito Ciuro <email@hidden> wrote:

> Hello,
>
> I have code that's part of a framework and I'd like to port it to iOS. I tried isolating the code like so:
>
> //
> //  RootViewController.m
> //  iPhoneTest
>
> #import "RootViewController.h"
>
> @implementation RootViewController
>
>
> #pragma mark -
> #pragma mark View lifecycle
>
> - (void)viewWillAppear:(BOOL)animated {
>    [super viewWillAppear:animated];
> }
>
> - (NSUInteger)systemPageSize
> {
>    static NSUInteger __sSystemPageSize = NSNotFound;
>
> #if TARGET_OS_MAC
>    if (NSNotFound == __sSystemPageSize) {
>        NSTask *task = [[NSTask alloc] init];
>
>        // <do something here...>
>
>        [task release];
>    }
> #elif TARGET_OS_IPHONE
>
>        // <do something here...>
>
> #endif
>
>    return __sSystemPageSize;
> }
>
> When I compile the standard iPhone boilerplate app from Xcode I get the following error:
>
>> /Users/tciuro/Desktop/iPhoneTest/Classes/RootViewController.m: In function '-[RootViewController systemPageSize]':
>> /Users/tciuro/Desktop/iPhoneTest/Classes/RootViewController.m:23: error: 'NSTask' undeclared (first use in this function)
>> /Users/tciuro/Desktop/iPhoneTest/Classes/RootViewController.m:23: error: (Each undeclared identifier is reported only once
>> /Users/tciuro/Desktop/iPhoneTest/Classes/RootViewController.m:23: error: for each function it appears in.)
>> /Users/tciuro/Desktop/iPhoneTest/Classes/RootViewController.m:23: error: 'task' undeclared (first use in this function)
>> {standard input}:59:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_0" minus "L00000000001$pb"
>> {standard input}:59:symbol: "L_OBJC_SELECTOR_REFERENCES_0" can't be undefined in a subtraction expression
>> {standard input}:54:non-relocatable subtraction expression, "L_OBJC_CLASSLIST_SUP_REFS_$_0" minus "L00000000001$pb"
>> {standard input}:54:symbol: "L_OBJC_CLASSLIST_SUP_REFS_$_0" can't be undefined in a subtraction expression
>> {standard input}:unknown:Undefined local symbol L_OBJC_CLASSLIST_SUP_REFS_$_0
>> {standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_0
>
>
> I know NSTask doesn't exist on iOS, so I was hoping to implement the method that would work for both Mac and iOS by specifying TARGET_OS_MAC and TARGET_OS_IPHONE. What am I missing?
>
> Thanks,
>
> -- Tito
> _______________________________________________
>
> 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: TARGET_OS_MAC section generates a compile error on an iPhone project?
      • From: Tito Ciuro <email@hidden>
References: 
 >TARGET_OS_MAC section generates a compile error on an iPhone project? (From: Tito Ciuro <email@hidden>)

  • Prev by Date: TARGET_OS_MAC section generates a compile error on an iPhone project?
  • Next by Date: Re: TARGET_OS_MAC section generates a compile error on an iPhone project?
  • Previous by thread: TARGET_OS_MAC section generates a compile error on an iPhone project?
  • Next by thread: Re: TARGET_OS_MAC section generates a compile error on an iPhone project?
  • Index(es):
    • Date
    • Thread