Figured it out. The login item quits too soon. It should wait for the open operation to be completed. Something like (not the best solution, for illustrative purpose only):
[workspace openApplicationAtURL: [NSURL fileURLWithPath: path] configuration: configuration completionHandler:^(NSRunningApplication* app, NSError* error) {
	if (error) {
		NSLog(@"Failed to run the app: %@", error.localizedDescription);
	}
	exit(0);
}];
[NSThread sleepForTimeInterval: 10];
Topic:
UI Frameworks
SubTopic:
AppKit
Tags: