Updating Helpbook bundle in OSX application - objective-c

I am on MacOS Mojave (10.14), not iOS. Xcode 10, Objective-C.
I have an application with an already implemented Helpbook. Everything works fine.
Now i need to update the help book.
I recreated the helpbook bundle. Replaced the old one in Xcode with the new one (create folder references).
When i build the app and open the package contents, the new helpbook is included. Great. But the app shows the old one.
What have i done:
Clean derived data with XCode closed
Clean product/folder
Logged out/in (assuming theres some kind of cache)
Cleaned the helpbook cache and restarted (see script below)
Still the old help book.
What am i missing?
Helpbook cache cleaning script i use (credits: http://macergun.blogspot.com/2011/06/dealing-with-help-viewer-cache.html)
rm -rf ~/Library/Caches/com.apple.help*
rm -rf ~/Library/Preferences/com.apple.help*
rm -rf ~/.Trash/*
killall helpd
defaults write com.apple.helpindexer IndexAnchors YES

Related

New project with GULP

I made a project using GULP and I downloaded several modules with the NPM cmd. For a new project, should I copy/paste my old project with the files "gulpfile.js", "package.json" and the folder "node_module" or i have to redownload all the modules ? I tried to copy/paste and it worked perfectly, but maybe there is an another way to do it (like download each module with one command line) ?
Thank you !
Copying your old package.json file into your new project is perfectly reasonable when you also use a copy of your existing gulpfile.
Now, instead of copying your node_module folder just run npm install. It does exactly the same thing as copying and pasting but with the added bonus of checking package versions, deprecated dependencies, and so on...
Quick tip: If you ever run into problems as I have deleting/removing packages given that theirs paths might be longer than what the OS allows use the tool rimraf. Install it globally and then you can call rimraf on anything. CAUTION! this tool will erase everything no questions asked

Cocoapods Errors : Resource.sh not found

Folks,
Cocoapods : 0.39.0
FYI I have done enough research and I was able to take care of errors like:
Podfile.lock not found.
.menifest not found
and others while building my project.
Which still seem hack to me but as long as they let me build I dont care.
But one real problem is this :
Pod-resources.sh not found and this one is in the pod directory.
so for sure Its not in my source control as I dont check in pods dir into my project.
I have done more than enough weokspace deletion, podlock deletion, who pods dir deletion and pod install. but this problem is still there.
I am using apptentive which has a resource bundle, which need to be copied to the app binary.
At the moment I have disable Apptentive thru out the project to speed up the development and keep looking for solution.
Links that I have read are follows :
https://github.com/CocoaPods/CocoaPods/issues/2303
is from July 10, 2014 : seem too old to rely on.
CocoaPods Errors on Project Build
Error:"The sandbox is not in sync with the Podfile.lock..." after installing RestKit with cocoapods
The sandbox is not in sync with the Podfile.lock-ios
Error:"The sandbox is not in sync with the Podfile.lock..." after installing RestKit with cocoapods
How I solved my partial problem : delete workspace file, Pods Dir and .lock file. If this can help anybody.
Culprit was the path. It seem how Cocoapods is handling is different than earlier.
What it dont do is updating your project file for Copy Resources phase:
it seems they have update the path and now it has "/Target Support Files/Pods-ProjectName/" in it.
Older path: "${SRCROOT}/Pods/Pods-ProjectName-resources.sh"
New Path: "${SRCROOT}/Pods/Target Support
Files/Pods-projectName/Pods-Project-resources.sh"
So if you are having same errors like me you need to do is :
remove workspace file
remove .podlock file
remove .menifest file
do Pod install
update the path in build phase in xcode project file as shown above.
Now Build the project/workspace
Hope this will save someone's time.
You might have to add a PODS_ROOT user-defined build setting, as described here.

Workspace missing linked files from working copy

Not a Pro with Xcode, here is my problem. I have main project and Pods project. Last time it was checked in 1 year ago with older cocoapod and older Xcode.
Now I installed everything and checked in in latest Xcode with latest cocoapod. I was able to refresh pods and everything compiles and works fine. However, I do get those weird warnings. How do I clean it up and remove this from appearing?
I beleive it is related to how Pod's linking/headers used to work and how it works now. But how do I clean it up?
file:///Users/c/Documents/DMD/Pods/BuildHeaders/GoogleProtobuf/google/protobuf/io/coded_stream_inl.h: warning: Missing file: /Users/c/Documents/DMD/Pods/BuildHeaders/GoogleProtobuf/google/protobuf/io/coded_stream_inl.h is missing from working copy
I found it. I'm new to Xcode so I didn't realize what it really means. It's source-control related. I had those files checked in previously but not they are not needed and Xcode manages it but then complains that I don't have them locally but do have them in SVN. I had to commit those "deletions" and all is well.
Figured I won't delete question, maybe it will help another newbie
in terminal.
cd yourProject/Pods
then
sudo find . -type d -name .svn | xargs rm -rf
remove all svn files.

Rails database.yml disappear in development

I have a Rails 3.2.x app which I recently removed database.yml out of version control in git bit adding /config/database.yml to .gitignore in my app directory and did a git rm --cached config/database.yml in my app directory. I have the database.yml file on my production and staging server under app/shared/config/database.yml and I symlink to it via my Capistrano deploy.rb file.
In my dev environment on my master branch I recreated the database.yml file and I can continue development, but every so often the file disappears from the directory entirely and I have to recreate it. Note, I have Sublime Text 2 open usually with database.yml being one of the files that I have open most of the time.
Things will run fine for a while but all of a sudden the file will disappear from the master branch config directory on my local disk and I have to recreate it.
What could be causing this file to disappear randomly? git ignores it and I just use a local copy in my master branch. Could this be from switching branches? Or because my text editor has it open?
It's not a huge deal because I have a backup copy and I can just drop in, but this only started since I pulled it out of version control/git.
Any thoughts on why this is happening? There are times when I need to demo the app and don't want to have any "hiccups".
Any help is greatly appreciated. I don't want to have to commit database.yml back to version control, that's for sure but this problem is perplexing as to why it disappears randomly.

Should xcworkspace be in gitignore

I am using GitHubObjectiveCGitIgnore
When I go in sourcetree to commit I see :
project.xcworkspace
This file is not ignored using Github .gitignore file.
I am not sure do I need to commit and push this file?
If you're using Cocoapods, I actually find that the answer depends on a few things.
If you just want the project to be compilable and runable "out of the box", then go ahead and check everything in; xcworkspace and all pods.
If there is a pod that you need to modify for some reason and you want to include that change with your project, then check everything in. For instance, I've found bugs that haven't been fixed for one reason or another and it was easier to just fix them myself and check in the pod along with my project rather than wait for the updated pod or integrating the library manually (which is essentially the same result as checking the pod in anyways). Alternatively, fork the repo, push your changes to it, and point your pod to your fork.
If you have no issues with any of the pods and you've verified that everything works with the versions of the pods you've specified, then you don't have to check in the xcworkspace file or pods. Of course, you'll have to run pod install in this case.
There's no hard and fast rule on what to do here. Sometimes it's worth the extra overhead to just check everything in, and sometimes it's not necessary. It depends on what's most convenient for you.
In short yes it should be commited.
I have my xcworkspace file checked in to my repo. If you don't use a workspace it probably isn't needed but as I use Cocoapods this creates a xcworkspace with the original project and the pods project inside of it.
Use a workspace is the correct way on handling multiple project sets/dependencies.
If you have/or plan to have several projects in the workspace (for example sub projects of your project) then you should not add it to .gitignore.
Cocoa pods just adds its own project to the workspace if a workspace exists when you do a pod install.
In general it is safer to include the workspace file in the git commit, even if you exclude pods.
You will have to do a pod install anyway to compile your project so even if you commit a workspace file that already has the cocoa pod project added it wont cause any issues.