Date: Wed, 19 Sep 2012 14:53:13 -0700 (PDT) From: levigroker To: cocoapods@googlegroups.com Message-Id: In-Reply-To: <87CFCE39-1CBE-4C51-A042-E99A5863180A@gmail.com> References: <3aaa1028-9993-4e9d-9194-6e297ebf6484@googlegroups.com> <87CFCE39-1CBE-4C51-A042-E99A5863180A@gmail.com> Subject: Re: Manual edits to Pods-prefix.pch? MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_241_30967401.1348091593125" ------=_Part_241_30967401.1348091593125 Content-Type: multipart/alternative; boundary="----=_Part_242_6328803.1348091593125" ------=_Part_242_6328803.1348091593125 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Thanks for the reply Fabio. This kind-of works... since now I get this: #import #ifdef __OBJC__ #import #endif as my .pch file, which is suboptimal. I agree with you, that a formal way to handle this seems to make more sense. Cheers, Levi On Wednesday, September 19, 2012 2:54:22 PM UTC-6, Fabio Pelosin wrote: > > For the time being you can add something like to following code to the > bottom of your Podfile. However, given the popularity of library that use > conditional compiling for configuration I wonder if we should have a formal > way to specify this information in the Podfile. > > > post_install do | installer | > prefix_header = config.project_pods_root + 'Pods-prefix.pch' > text = "#import \n" + prefix_header.read > prefix_header.open('w') *{* |file| file.write(text) *}* > end > > > > > On 19/set/2012, at 22:18, levigroker > > wrote: > > Hi all, > > I've a project which includes the AFNetworking pod, which requires the > SystemConfiguration framework or it will not include certain symbols > (AFNetworking code has #ifdef _SYSTEMCONFIGURATION_H sprinkled in) so it > needs to be compiled with the SystemConfiguration.h header included. > However, if I simply do a 'pod install' the Pods-prefix.pch does not > include the #import and my app > will crash with an "unrecognized selector sent to instance" exception when > my code tries to call the missing symbols. > > If I manually add the #import statement to the Pods-prefix.pch, the all is > well, but if I then do a 'pod install' again, this mod gets reverted, and I > can't help but think there's a Cocoapods "way" to do this (tho I'm also > wondering why it doesn't pick up this requirement automatically too). > > Suggestions? > > Thanks, > > Levi > > > ------=_Part_242_6328803.1348091593125 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thanks for the reply Fabio.

This kind-of works... since = now I get this:

#import <SystemConfigurati= on/SystemConfiguration.h>

#ifdef __OBJC__

#i= mport <UIKit/UIKit.h>

#endif


as = my .pch file, which is suboptimal.

I agree with yo= u, that a formal way to handle this seems to make more sense.
Cheers,

Levi

On Wednesday, Se= ptember 19, 2012 2:54:22 PM UTC-6, Fabio Pelosin wrote:
For the t= ime being you can add something like to following code to the bottom of you= r Podfile. However, given the popularity of library that use conditional co= mpiling for configuration I wonder if we should have a formal way to specif= y this information in the Podfile.


=
post_ins=
tall do | installer<=
/span> |=
  prefix_header =3D config.project_pods_root + 'Pods-prefix.pch'
  text<= span style=3D"font-size:12px;line-height:16px"> =3D "#impo= rt <SystemConfiguration/SystemConfiguration.h>\n" = + prefix_header.r= ead
  prefix_header.open('w') { |file| <= span style=3D"margin:0px;padding:0px;border:0px">file.write(text) }
end

=

On 19/set/2012, at 22:18, levigroker <levi= g...@gmail.com> wrote:

= Hi all,

I've a project which includes the AFNetwor= king pod, which requires the SystemConfiguration framework or it will not i= nclude certain symbols (AFNetworking code has #ifdef _SYSTEMCONFIGURATION_H= sprinkled in) so it needs to be compiled with the SystemConfiguration.h he= ader included. However, if I simply do a 'pod install' the Pods-prefix.pch = does not include the #import <SystemConfiguration/SystemConfigurati= on.h> and my app will crash with an "unrecognized selector sent to insta= nce" exception when my code tries to call the missing symbols.
If I manually add the #import statement to the Pods-prefix.pch= , the all is well, but if I then do a 'pod install' again, this mod gets re= verted, and I can't help but think there's a Cocoapods "way" to do this (th= o I'm also wondering why it doesn't pick up this requirement automatically = too).

Suggestions?

Thanks= ,

Levi


------=_Part_242_6328803.1348091593125-- ------=_Part_241_30967401.1348091593125--