On Oct 19, 2012, at 9:13 AM, Jens Alfke < email@hidden> wrote: On Oct 19, 2012, at 8:54 AM, Russell Finn < email@hidden> wrote: Now, if I modify the text of the message in the library source file, then click the "build and run" button, Xcode correctly rebuilds the library, but *fails* to relink the application, so when the application runs, the unmodified message text is displayed.
I have projects with these kinds of dependencies, and have not seen this problem. It sounds like Xcode doesn’t realize that the static library it’s linking into the app is the product of the library target.
It's heartening (if a bit baffling to me) that not everyone using static libraries is hitting this, but yes, this is a known bug in Xcode.
The bug isn't specifically due to static libraries (you can probably contrive a situation where it would happen for dynamic libraries), but it is more serious for more static libraries since of course it's critical that static libraries get relinked because that's how your changes make it into your app. For dynamic libraries (which aren't available for iOS developers, but are for OS X developers), a large set of possible changes (though obviously not all of them) don't need to be detected at the time the app is relinked because they won't actually result in a changed app binary; instead the changes get picked up dynamically at run time when the dylib is loaded.
The best workaround would be to add a shell script build phase to your app target to check whether the static library's modification date is newer than that for the app's binary, and if so to remove the app's binary to force it to be relinked.
-- Michael Rawdon email@hidden Xcode Developer Apple Inc., Cupertino CA
|