So I'm trying to use AFNetworking library for REST services on a project I want to build on my 2006 Macbook. The Macbook is a first-gen 2006 32-bit Core Duo w/ snow leopard.
I'm fairly new to Objective-C development and I'm following the tutorial to get started with AFNetworking here: https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking
Using xcode 4.2 my problem is that right away when I create a new project and try and build I get: Semantic Issue - Synthesized property 'window' must either be named the same as a compatible ivar or must explicitly name ivar.
I checked the Build Settings of my new project and for some reason xcode by default assumes 64-bit Intel architecture when my machine is 32bit?! weird. I swapped it to 32-bit and this is where the error came up.
So I can correct this Semantic Issue now by explicitly creating my own window instance var in AppDelegate via:
NSWindow * _window;
I read about this on building out for 32bit objc: Synthesizing a property without instance variables which seems VERY common (lack of ivar declarations) in lots of public github project code I see. Is everyone forcing 64-bit on us now or just too lazy to create the instance vars? :(
So my problem is that it looks like AFNetworking library was built out for 64-bit Intel because when I add AFNetworking to my project I get the same Semantic Issue ivar errors all over the place. Looking at the library code there are no explicit instance variables declared throughout the code for any properties.
Am I completely screwed here? I could fix this situation by manually creating instance vars for all the properties but this would be such a pain for long-term project maintenance.
I guess what I'm wishing here is that there was some sort of compiler flag that I could add that would fix this all in one-shot?? but I'm guessing that I'm out of luck and it's simply time to trash this Macbook and pickup a new modern one.
Automatically synthesized instance variables require the "modern" Objective-C runtime which is only available on 64-bit machines. So, unfortunately you are correct that you can't just set a compiler flag to fix this. The solution is indeed to add instance variable declarations for the properties in the class(es) you're trying to use.
I'm not sure that's so difficult that it's worth throwing out your computer... That said, the conveniences offered by the modern runtime are pretty tempting to developers, and you're not likely to see a lot of new code going forward that maintains support for 32-bit Macs. Apple only sold 32-bit Intel Macs for a short time, and Lion requires a 64-bit Mac, so the proportion of people using 32-bit Macs is already quite small, and rapidly getting smaller.