I have a 64bit application using ARC, that is serving up a distributed object. The application that uses the proxy object is a 32bit application, so it’s not using ARC. Is this going to create problems for me?
I also want to reuse my classes from the 64bit/ARC application, inside my 32bit application. If those are ARC, how can I integrate them in a non-ARC application?
I would not recommend doing this. Using distributed objects between the 32-bit and 64-bit runtimes appears to be possible, but it has some problems. From the Foundation Constants Reference:
Sure, you can do some basic sanity checks on -[NSArray indexOfObject:], but what if any library or framework you use (which includes Cocoa and Foundation) uses an API that can return NSNotFound? Not to mention that this is only one problem that can occur communicating between 32 and 64-bit runtimes, and the other problems might not be documented.
I tend to shy away from distributed objects because of some of their other problems, but even if you were determined to use them, this seems like a deal breaker to me.
I do not believe that there is anything intrinsic to ARC that would prevent you from using ARC and Distributed Objects together. However, memory management with distributed objects can be tricky. If you needed to break the standard retain-release rules to work around a memory leak between the client and the server, ARC would not let you do so. You’d need to be extra careful to architect your server to avoid this.
Finally, since you can’t use ARC in your 32-bit runtime, you’ll have to write manual retain/release code for those classes. If you plan to eventually move away from the non-ARC code, you can advantage of __has_feature(objc_arc). Otherwise it’s probably better to not use ARC on the files you plan to share between the 32 and 64-bit applications. ARC can be enabled or disabled on a per-file basis.