The instructions in “HELP.md” seem to be out of date; the “objc” gem apparently no longer exists and I’m bewildered by the Xcode instructions, which seem to be for a long out-of-date version of Xcode. Does anyone have this working with Xcode 26?
I’m sorry you’re having difficulties. Unfortunately Objective-C does not currently have any maintainers.
Those setup instructions do look … daunting. And they haven’t been updated in 5 years.
On the bright side, the objc Ruby gem does look like it still exists: https://rubygems.org/gems/objc
Thanks. I haven’t been able to install the objc gem; this may be because Apple’s “gem” command is out of date or looks in the wrong place. I have been able to get clang to compile my solution without struggling with Xcode (there ought to be a course for Xcode), but how I get the test to run I don’t yet see. To be continued…
I have access to a Mac so I can test this setup tomorrow. It’s very possible the gem is out-of-date since it hasn’t been updated in almost ten years.
Thanks. I managed to get it going with Xcode, though I doubt that I did it the “right” way. I’m also pretty sure I found an error in the “bob” test script.
The test script, as written, reads:
- (void)testForcefulQuestions {
NSString *input = @"WHAT THE HELL WERE YOU THINKING?";
NSString *expected = @"Whoa, chill out!";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result);
}
Pretty sure it ought to read:
- (void)testForcefulQuestions {
NSString *input = @"WHAT THE HELL WERE YOU THINKING?";
NSString *expected = @"Calm down, I know what I'm doing!";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result);
}
Yeah, there’s an open PR for that at Fixed bob exercise's testForcefulQuestions test by capnslipp · Pull Request #296 · exercism/objective-c · GitHub. Since Objective-C hasn’t had maintainers for a while, its test suites might be out-of-date and need to be synced with the upstream canonical test data.
Worth a read if you haven’t yet read it: https://exercism.org/docs/community/being-a-good-community-member/suggesting-exercise-improvements#h-practice-exercises
(Updated 2026.10.31)
I think the test is just wrong, not out-of-date.
Anyhow, for anyone who wants to try this course, here’s what I think I have learned so far:
First, you need Xcode and a Mac; the harness that runs the tests is a proprietary Apple product, and there is (if the “AI” I queried is correct) no substitute for it.
The general procedure for running the exercises I have done so far is:
-
Create a project containing a dummy command line app in the exercise directory; you won’t actually run it, but you will need the project to provide a place for the test.
-
Create a “unit test,” that is, test of a part (unit) of a program using exactly the name in the exercises test script; in the “bob” exercise, this is called “BobTest”. (I am not certain that the name has to be the same, but it might.)
-
Remove the placeholder test script Xcode provides.
-
Into the unit test target, move the test script.
-
Into the main program, move the files you will be working on. Check the test target “target membership;” this will include the code you wrote into the test, though it will not show up under the test target in the project navigator.
-
Read the test script; it will tell you what classes and methods to implement.
-
Create, at least, dummy methods for the test; this will get you to the point of something which compiles, though all the tests will probably fail.
-
Select the test scheme under Product>Scheme.
-
Run the test (Product>Test or Command-U.) Xcode will attempt to compile and run your code.
-
Examine errors, correct errors, and keep going.
The tests come from the shared problem spec. Either Objective-C has a stale version of the test from there, or it is up to date with the problem spec and the tests are wrong across many tracks! Depending on which it is, the fix is very different. In the first case, the Objective C test could be refreshed with the latest data. In the latter case, we’d want to start a language-agnostic cross-track discussion about incorrect data in the problem spec so the fix can trickle down to all tracks!
I just resynced the Bob tests so you should be hopefully be good to go here.
To run the tests, I was able to use this from the exercise folder:
mkdir -p .build/Tests.xctest/Contents/MacOS
xcrun --sdk macosx clang -fobjc-arc -bundle \
-framework Foundation -framework XCTest \
-F "$(xcode-select -p)/Platforms/MacOSX.platform/Developer/Library/Frameworks" \
*.m -o .build/Tests.xctest/Contents/MacOS/Tests
xcrun xctest .build/Tests.xctest
We should add that command to the testing directions as another way to test besides or instead of the old objc gem.