classes .m and .h not updated - iphone

kinda awkward asking this. But I cant seem to find the solution, because I dont know how/what to search in google. It goes something like this. In my project folder, whenever I click my Project.xcodeproj the latest code I have edited there was right or what I meant is when opened in XCODE it is updated.
Problem:
For example, when I try to unzip my latest project from the latest zipped project( for back-up purposes ) when I open the folder( back up ) then click for example View1Controller.m the codes in it arent updated the way they are in the XCODE though if I click the xcodeproj part. It is updated in the XCODE.
Hope someone could help me with this, and explain some good ways/solution for my prob. Thanks.

I assume that you are zipping old projects and saving them to avoid using git - I'm no git lover but for sure its a better solution.
The problem with trying to use Xcode to view old and new projects at the same time is (IMHO) is that Xcode seems to get confused about what file is in what project - if you have a new one and old one open.
open the old file in TextEdit, it should be exactly what you think it should be
in Xcode, have the current project open, look at some files. close the project, and open the older project. look at the files, they should be correct [if they are not, close and reopen Xcode between project openings, but I suspect this is not necessary]
if you really need to see the files from the old project while viewing the new ones, then in the Finder rename the file - put a "O" prefix on the file, then open that file (with the modified name) in Xcode
My experience is dated on this issue to older releases, but I do strongly recall having this kind of problem in the past.

Related

How to manually add SSZipArchive to my project

First off, I'm a Mac OSX newbie, both using and programming, but it's been thrust upon me. My project is moving along nicely, but I need to unzip a file, and it looks like SSZipArchive seems like the way to go. I want to manually add it to my project, so that it stays all together in my source code control system. Others, esp. the release engineer, shouldn't need to do anything, and we need to have all the source code local.
I've tried a million ways and back, only to keep getting the dreaded "No Such module" error. I've researched for a couple days now, and still no closer. So I'm starting from scratch in a new project to say what I'm doing and to plead for some help here. All this is being done on an El Capitan laptop, using Xcode 7.3.1, with Swift 2.2.
Create a Cocoa Application project, calling it 'ziptest', using Swift, nothing else checked. Build it just for fun.
Drag 'n' Drop the SSZipArchive folder found in the master.zip downloaded from the SSZipArchive GitHub site into my project. I'm not sure where it should go, or if it matters - top level, between ziptest project icon and the ziptest group or inside the ziptest group. But I'll put it inside the ziptest group. Now I'm faced with a new question - for the "Added folders", do I want to "Create groups" or "Create folder references". I do copy the items, because, as I said, I want to add them to SCCS later. I saw somewhere here on Stackexchange to make sure it is Group, so that's what I'll do. Build again and it still works.
I know I need a "bridging header" file, so I'll create it. I thought at some point, Xcode asked if I wanted to create it, but the above step doesn't do that. After much experimention, I found that if I d'n'd the SSZipArchive.m/.h files directly, it asks me. It doesn't put anything into it, but at least it creates it and updates the Build Settings. But I do this now manually by right clicking on the ziptest group folder, select New File... and create an empty Header File called "ziptest-Bridging-Header.h", following the pattern from the Xcode created one, being sure to check off the ziptest Target.
I add:
#import "SSZipArchive.h"
to that file. And building still works.
I added ziptest-Bridging-Header.h as the Objective-C Bridging Header in the Build Settings. And building still works.
Now comes the moment of truth. I add:
#import SSZipArchive
to AppDelegate.swift and I get the dreaded No such module 'SSZipArchive'
What am I doing wrong?
Edited to add: Oh, I also added libz.dylib to the Build Phases -> Link Binary With Libraries part. Doesn't help, of course, because we haven't even gotten to the link phase yet.

Xcode indexing frequently and searching in framework files/takes time when loading project

I am having a weird problem with Xcode where it keep indexing and takes long time to do that. Search functionality also does not work properly. It searches in all framework/library files instead of project files. I tried with my other project but that project has no problem. So I guess it is something wrong with my project...But I am not able to find out. Can anyone help?
Found out answer to my own question... I deleted workspace file in .xcodeproject package. Then When I opened the project in xcode, it still took time because it has whole "Application" folder under the project. I removed the reference to it and reopened it and now it works fine. It didn't affect the git repository for me.

Deleted a file manually: How can I fix Xcode project file?

I'm developing an iOS 4 with latest iOS SDK and XCode 4.2.
I don't know how, but I have found that one of my ViewController.xib has been moved to en.lproj folder.
I've moved this file out of this folder, and added it again to project.
But now, when I compile I get a waring saying that I en.lproj/ViewController.xib is missing from working copy.
How can I fix this?
you may be having a soft link of en.lproj/ViewController.xib in project group . It will be red in color after building . You just delete them from the group.
Select your ViewController.xib file in Xcode's list of files & groups along the left side of your project window and then open up file inspector and that's where you can change the path.
Here is how I do it:
I hope this helps you out!
This is not a direct answer to your question, but I'd still say this.
Use something like git or svn to avoid such mistakes. The new XCode in fact gives an option for git while creating a new project.
If you are already using Code Revision Control System, just look for the commit that did this change and revert it. (I am using git language here)

Organise my project folder

It's a terrible mess in my project folder (not in xcode, where all is clean, but on the desktop folder).
How can I organize this folder without killing all xcode references ? I just tried, but all the links broke.
Thanks,
What I'm used to do in this case is:
Organize everything in my finder folders, don't mind the red missing files in xcode. If you are using svn, make sure you use its commands to do this.
Then I go to each file in XCode marked red and redefine its Location using the right pane Utilities tab (xcode 4) or its file properties(cmd+i in xcode 3).
Clean and build to make sure everything is OK.
To avoid this, I got used to organize my project each time I create a new file/folder. I first create the folder physically and then add it to xcode, later I create the files.
I don't know a simpler way of doing this.
Hope it helps,
I've been there myself :) You do need to remove and add back in the files that need organizing , but it can be safely done. Here's what I'd normally do;
Remove the files / folders you need to organize from within your XCode project (this is safe, you can add them back, no worries) ONLY DELETE THE REFERENCES when asked. Do NOT Trash them.
Close XCode
In your desktop folder, now arrange and organize your files and folders as needed.
Open up your XCode again, and open your project. Now, re-add your now well-organized files and folders back into the XCode project. Copy them into to your folder if you happen to be adding anything from outside the desktop folder.
Now, your project will be well organized both in and outside.

Is there a way I can compare code in an old Xcode project with a new Xcode project?

I have a developer who has been working on an old Xcode project for me. Is there a simple way I can compare files in his new Xcode project to the ones in the new Xcode project to quickly see which changes he's done and how the old code has changed? He's be procrastinating and finally i have twisted his arm to send me the new Xcode project. He claims that the old code was rubbish, including the old coder too, so I'd like to see if he's actually done any changes to the old guy's project or is just plain and simple, 'a talker'.
Sure, use the "diff" command (from a terminal window).
If the two projects are in folders "old-project" and "new-project", respectively, you would do something like:
diff -r old-project new-project
The "-r" will recursively compare corresponding files in subdirectories.
ps. this should also be a wake-up call to you that's it's time to put your project into some kind of version control system (such as svn). If you had your project in source control, there would not be any question about exactly what had been changed, when, and by whom.
you can use FileMerge. it is under Developer/Applications/Utilities/FileMerge