Skip to content

Conversation

@chfuller-petsmart
Copy link
Contributor

This simply fixes incorrect imports that prevent the code from compiling on a brand new Xcode project. (Apple changed the default setup for new Xcode projects related to imports and also removed the precompiled header). This PR allows the code to compile on a brand new Xcode project without any config changes. Thanks!

@chfuller-petsmart chfuller-petsmart mentioned this pull request Mar 13, 2015
@anirudh24seven
Copy link
Contributor

@chfuller-petsmart Can you explain a little more? A screenshot of the errors would help.

If I am not wrong, you shouldn't be facing any compile issues on a brand new Xcode project.

@chfuller-petsmart
Copy link
Contributor Author

Hi. Sure. New Xcode projects no longer have precompiled prefix headers. The prefix headers traditionally included both Foundation and UIKit. So any classes that utilized them were always free to do so. But now, each class that uses those frameworks needs to explicitly import the ones it needs. The HSAppearance and HSAttachment classes use UIKit but are not importing it, so the build fails. Now as far as the HSDeskGear, HSHappyFoxGear and HSZenDeskGear classes go, they are simply using a non-namespaced import for an AFNetworking class, and this also prevents the build on a new Xcode project. Using a namespaced import, meaning prefacing with "AFNetworking", allows the compiler to locate those classes within the AFNetworking framework.

See attached screenshot. This is a brand new Xcode project with AFNetworking added as a framework.

Once I change the imports as they are in this pull request, all the errors are fixed.

Thanks!

screen shot 2015-03-17 at 10 45 20 am

@chfuller-petsmart
Copy link
Contributor Author

It should be noted that this test was done without Cocoapods. When including AFNetworking via Cocoapods, the AFNetworking imports do work as is. But the imports should be fixed so that HelpStack will compile on both Cocoapods and non-Cocoapods projects.

@chfuller-petsmart
Copy link
Contributor Author

Hi, just thought I'd check in on this PR. Does the information I provided seem accurate? Or am I missing anything? Please just let me know if you need any further details. Thanks!

@anirudh24seven
Copy link
Contributor

Hey @chfuller-petsmart. Sorry for the delay. Will look into this as soon as I can.

@chfuller-petsmart
Copy link
Contributor Author

Hi @anirudh24seven. Simply checking in again. Have you had a chance to review this PR?

anirudh24seven added a commit that referenced this pull request Jun 12, 2015
@anirudh24seven anirudh24seven merged commit 4d5aab2 into happyfoxinc:develop Jun 12, 2015
@anirudh24seven
Copy link
Contributor

Thanks for the PR @chfuller-petsmart!

anirudh24seven added a commit that referenced this pull request Jun 12, 2015
Develop: Merge pull request #44 from PetSmartLab/fix-imports
@chfuller-petsmart
Copy link
Contributor Author

Thanks @anirudh24seven!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants