I am using google protobuf in my iOS project and as it turns out, the files generated by protoc does not adhere to ARC. It does retain, dealloc and such. I am using the protobuf-objc from here. Please let me know if anyone else has gone through the same issues and resolved.
Thanks in advance for the help.
The quickest solution for you is probably to disable ARC for just the generated files. Check out this question:
How can I disable ARC for a single file in a project?
Related
can someone help me with below screenshot. I have imported the corelocation framewok in build phases-> link binary with libraries. what else should i be doing? i have also tried self.locationManager and still i have the same problem.
now it seems to be working withou tme having to do any settings change. But i removed also removed one method locationManager.locationServicesEnabled which was a depricated method.
I have an app and accompanying extension, with a cocoa touch framework in the same project containing most of the shared code. The problem I'm faced with is that the cocoapods that the framework depends on are not found when compiling the app extension. The framework target compiles just fine, but when I compile the extension target I get a bunch of 'unresolved identifier' errors.
The problem does not seem to be that the framework is not being linked as I can access classes defined within it just fine from the extension. I have looked at other questions such as this one, but nothing I've seen seems to solve my problem.
Any help would be greatly appreciated!
EDIT:
The problem was solved by creating a separate bridging header for the extension. Hope this can help someone else!
EDIT 2:
Unfortunately this solution causes the warning
Class AFHTTPRequestOperation is implemented in both path/myFramework and
path/myWidget.appex/myWidget. One of the two will be used. Which one is undefined.
An explanation of why this happens and how to avoid it would by much appreciated.
Your extension needs its own bridging header. Add one, import the cocoapod, follow this answer if you need to here, go.
Upon importing the JSONKit.h and JSONKit.m files into my project , i get the following errors. I have browsed and browsed but none seems to have encountered these problems ?
All i did was import the files and build and then i get this
Is it something i forgot to import or ...??????
You can disable ARC(automatic reference count) in JSONKit files.
Generally step is :
Go to your project settings, under Build Phases > Compile Sources
Select the files you want ARC disabled and add -fno-objc-arc compiler flags. You can set flags for multiple files in one shot by selecting the files then hitting "Enter" key.
Please refer to this post: iOS 5 Best Practice (Release/retain?) for more details.
Hope it helps.
Edit
After discussion, we also have some other options to solve the problem. For example, you can convert JSONKit to ARC compatible. But according to Mike Weller's statement, it will be very hard to convert because JSONKit uses malloc to manage memory.
I think use -fno-objc-arc compiler flag is a low-risk and convenient way to solve the problem.
tangqiaoboy's answer will resolve those errors but you can also consider using the class NSJSONSerialization. It makes it really easy do convert NSDictionarys and NSArrays to JSON and vice-versa.
Good luck!
You can convert your project into ARC compatible, by following steps
Go to Edit menu -> Refactor -> Convert to Objective-C ARC...
Or If you do not want to use ARC in your current project then follow tangqiaoboy 's steps.
I am creating an iOS app which uses both ASIHTTPRequest and ShareKit. Both APIs have a Reachability.h and Reachability.m file... thus this is creating a Mach-O duplication error. Is there a special way to avoid this?
Thanks
I had this issue a little while back and figured out an easy fix.
You have two options.
1) If the versions of the two Reachability sets are the same, you could just delete one set. I don't think you should even have to change any headers.
2) If the versions are different, rename one set of Reachability files something like "MyReachability". Obviously you will have to clean up all references to the renamed class as well.
Hope that helps!
I know this is not a programming question, and I need help with setting up Chipmunk. I have already wasted half a day on this and tried solutions from other similar postings...
But can anyone help me with the following errors ?
You're not linking against the library that contains cpSpaceStep, cpInitChipmunk or cpSpaceNew. It looks like that is cocos2d. Make sure you've got the cocos2d library added to your project and that it is part of the "Link binary with libraries" build phase.
Delete the library and add once again. I have faced this issues couple of times.
Hope this helps.
I got the issue resolved with just initializing a project under chipmunk. I had write/copy all the methods from my previous class, and it took some time to do that... but it was worth it in the end !