GTMNSString+HTML uses object in struct - ios

Probably pretty simple but i was just wondering I'm using GTMNSString+HTML.m / .h
Found here
And I'm hitting a ARC snag. I'm unable to put Obj-C objects into struct's in ARC. Could someone help explain to me what the issue is putting an NSString inside a struct, and how I might fix this?
Thanks!

Ok well dumb of me. Pretty easy to get around.
If you have this problem just head over to your Build Phases, and add -fno-objc-arc the line that the GTMNSString+HTML.m is in this should let you build like a champ.

Related

Returning hundreds of errors when including SwiftyJSON

ErrorI am learning swift at the moment and recently tried to use SwiftyJSON to parse JSON data. However, following a tutorial, when I dragged the SwiftyJSON.swift file into my project window, it immediately shows 100+ errors in the SwiftyJSON file. Because of this, I am unable to use SwiftyJSON in my projects and can't gather data from the web. I am using Xcode 8.2 and learning Swift 3.0.
Has anyone else had this problem, and have a solution to it?
Sorry if this is a really dumb question by the way.
Edit: Error Image Linked
This is a VERY, very easy fix, so don't worrry!
In your SwiftyJSON.swift file, at the very top, there is some weird WebResource text that should either be removed, or at the very least commented out.
Below is what your SwiftyJSON.swift file should look like:
As opposed to:
Hope this helps! Very simple mistake, but easy to miss because its at the top of the huge Permissions comment block!

iOS: #import AnyModule not found after editing class using cocoapods

I have an Obj-C/Swift project setup that imports modules using cocoapods. In any class where I am importing a framework using the #import function I get the error message SomeModule not found. However, when I build/run it compiles fine, and the framework works and functions as expected.
The problem here is that it messes me up when I'm trying to write code below the error (i.e., objects appear as ints because the error above messes up the compiler; function auto complete doesn't work, etc). What's weird, if I cmd+s to save the class, the error messages go away. Then the second I start typing again, they reappear.
I've gone as far as removing all of my cocoapods and reinstalling them, but to no avail. This has only been an issue since installing xcode 8.
Anyone have any insight into this?
Thanks in advance.
Sorry for super late response - the only way I found to get around this was to use the "old" style of framework import; i.e., ... it seems like some Frameworks just don't play nicely with the #import declaration. #pablo-martinez
If someone has a better solution please feel free to share.

Can't see debug info Xcode 6.4?

I think I've accidentally removed some kind of setting or something on a project level. In project A I can see debug info, but in project B I can't see a damn thing while debugging. Local variables can't be expanded to see what they contain, and neither variabels located in self.
As stated earlier, it works fine in one project, but not at all in another. I have no idea what I've done, or how to solve it. I asked around with a few coworkers and none has experienced this before. Kind of need to fix this in order to work efficiently.
Here is a screenshot displaying what I mean:
I don't have any variables in self here, but if I add some or store some, it doesn't work anyway. I can't see anything in self since I can't expand it at all.
Help appreciated!
I found the solution for this. Or rather I found the issue. The issue seems to be with either Xcode 6.4 and above, or GoogleMaps in general. When importing GoogleMaps SDK the debugger stops working properly. Simple as that. Comment out your import of GoogleMaps SDK and the debugger will be back to normal.
Another way of solving this is to bridge GoogleMaps SDK from ObjC to Swift rather than importing it in Swift. I didn't try this, but I saw this as a possible solution here: https://code.google.com/p/gmaps-api-issues/issues/detail?id=8524
Hope it helps someone. Took me days to find this information.

Is `Convert to Objective-C ARC` useless?

In XCode (version 5.1.1 in my case), when you click Edit/Refactor/Convert to Objective-C ARC, what exactly is supposed to happen?
My goal here was to convert my old code to use ARC.
I basically set Objective-C Automatic Reference Counting to Yes, then I did the above to "refactor" my code. It failed and I ended up spending 5 hours commenting out anything with autorelease, retain, release etc... from my code.
When I finally got all that done, I was able to proceed with the Convert to Objective-C ARC operation, which ended up telling me that no changes to my code were necessary, which was true because I had done it all manually.
Is it supposed to do what I did manually, but automatically? Why didn't it?
By turning "Automatic Reference Counting" on manually you told the compiler that the project was already using ARC. Therefore, conversion did nothing - you told the compiler it was already converted.
Obviously all the non-ARC features you used were now errors and you had to fix them.
The normal method is that you do not change to Automatic Reference counting. The compiler will then check out your code, make sure that it can convert everything (it won't convert your code if the static analyser finds reference counting bugs, or when things are too complicated), you fix all the things that it refuses to convert, and once everything is Ok you convert everything.
And the answer to your question is "NO".

Experiencing (ARC) Semantic Issue?

All day, I have been cleaning up an old project of mine.
I have a lot of needless features that I want to get rid of to avoid the app from getting to cramped (including an intro screen that I would like to redesign).
Anyways, I've created a new project and I've been transferring over bits of code, piece by piece to keep everything clean.
All of the code seems to be in the same place as my previous project, however, I am now receiving numerous Semantic Issue (occasional ARC Semantic Issue) errors upon building the app.
Is there any stupid mistake I am making that someone else has encountered themselves? Or am I doing something frantically wrong. Newbie here, I apologize in advance.
If anyone is willing to take a deeper look into the issue, I'd be happy to send the project. :)
You don't seem to have imported the Core Data headers into your app delegate.
#import <CoreData/CoreData.h>

Resources