Strange application behavior when creating a project with the latest version of xcode / OSX

I have an OSX application written in Objective-C / Cocoa using xcode. The application is completely finished, tested and sold in the App Store.

I have not worked on this application for some time and recently, I rebuilt it using xcode 4.3.3 on my OSX 10.7.4, and I noticed that although it builds just fine, there are some very strange visual glitches when starting the application which has never been seen before and sometimes, I get EXC_BAD_ACCESS when I close the application. All this seems to be related to the PDFKit map used. I can’t debug these problems because the glitches are just visual (I can’t check the code) and the EXC_BAD_ACCESS exception comes from internal objects that are not related to my code.

The code itself has not changed, I tried the previous revisions of the code, and now they all exhibit the same strange behavior. I tried to run the old binary that I have (compiled a couple of months ago) and it works fine. Then I tried to create it with previous versions of xcode, up to 4.2.1 (which I know was fine when I sent the application to the application store), and problems still occur.

Then I suspected that this might be something special for my environment, so I built the project on another machine, also using xcode 4.3.2 and OSX 10.7.4. The same results, problems still exist.

So, now I suspect that it has something to do with the OSX 10.7.4 update, since this is the last thing that has changed between now and when I was able to create a good build of the application. I am rather puzzled by what to do next, and how to determine the cause of this problem. I have an old binary that is working fine, and I have a recently compiled binary of the same version of code that has problems.

Is there any useful information I can get from the difference of these binaries? What can I do to determine the cause of these problems? What can I try next?

Thanks!

NOTE (update): I have stated this above, but I want to make sure that it is clear. This is a Cocoa Mac OSX application, not iOS.

+4
source share
4 answers

I will answer my question (since none of the above answers answered it), so someone with a similar problem may have a hint. I could not understand why this was happening, but I am sure that this is not a problem with my code, but rather a failure on the Apple side. And there is a workaround.

First, I compiled the Apple PDF Annotation Editor sample on my Lion 10.7.4, and although the functionality is clearly different from my project, it also found similar errors with the PDFView display that my project makes when compiled with 10.7. 4

Then I set about creating a fresh clean system on a new hard drive. Intalled Snow Leopard and updated to 10.6.8 and ONLY installed xcode. Compiled my project (the source code always remains exactly the same) and everything works fine. No problems were detected in the compiled project.

Updated my OSX to Lion 10.7.4 and xcode 4.3.3, same source code. The problem occurs after compiling it. I am sure that if I tried 10.7.3 first, I would not see this problem, because I remember that it starts only with 10.7.4, but Apple does not provide a reasonable way to upgrade to 10.7.3 first or down to it after 10.7.4 (shame on them, not very friendly for developers!).

So, the problem appears in 10.7.4.

Then I installed the preliminary version 10.7.5. It was the only thing that was changed, the same source, the same xcode. To my surprise, the compiled code works flawlessly, and the problems with 10.7.4 have now disappeared!

So, my decision is to wait until 10.7.5 is released before continuing with the project. I hope Apple does not introduce it into the future with Mountain Lion. I do not think that I will try to debug it further or send a ticket to Apple, and this will be a difficult case to explain.

Thanks for answers.

0
source

just reset your sim, then try.

Hope you check the ARC info.

go to your project Settings of a given set of settings β†’ Search paths β†’ Always search for user paths. Yes.

And check all class variables different from each other.

Xcode β†’ settings β†’ Checking the documentation of the installed Library core (or) install it like this Xcode β†’ preferences β†’ Components check the installed component or not

check these things out in your project.

+1
source

Are you sure your customers do not have the same problem? Since you tested the application on another machine, you probably do not have the installed libraries installed (if you did not install from scratch but used some kind of migration tool?), So this is probably not a problem.

The most logical explanation for me would be that your clients also have this problem, but they have not yet reported it. In this case, you probably have a memory problem, and there are ways to attack this.

In any case, eliminate all the options that you can eliminate in order to simplify this problem. Deconstruct the application until the problem arises or restores the application in another project until the problem arises again.

It sounds nasty, but you get there, after all, with patience and perseverance :)

+1
source

First of all, you need to check and check the build log for warnings about suspicious compilers.

For EXC_BAD_ACCESS, Xcode analysis will provide useful information.

You can try the SDK 10.6 or 10.5 (manual installation required). Or limit the deployment target to 10.5 or 10.6.

+1
source

All Articles