Posts

Post not yet marked as solved
6 Replies
Well I don't know, as always I might be missing something of importance; but I sort of think this is precisely what link listi is for, isn't it?Anyway with the build-rule-and-special-source it works so far completely reliably. Just is a bit at the hackish side to my liking 🙂
Post not yet marked as solved
6 Replies
Have you tried that and it worked for you? In which Xcode?When I tried that, the link still occurred before the script.In another project for testing purposes I have removed the link-with phase altogether and it still linked. As always I can be wrong, but it seems to me that Xcode does not really interprets this phase as a real build phase; seems to me it just consults its contents to determine which libraries to add, but links automatically at the end of the compile phase, completely regardless of the placement (or even existence) of the link-with phase :/
Post not yet marked as solved
5 Replies
> you want to use some notification of charge to launch/activate your app?Essentially, yes. More precisely, I need the app to be launched/activated somehow when charging begins; I do not really care whether the mechanism used for that is a notification or anything else.> Do you want to launch the app or only to activate from background?Well as “launch/activate” sort of suggest, I would need it to be activated if it happens to be suspended (or runs, which it very probably would not, see below) at bacground; launched if it does not run at all.> As far as I understand, the first is not possibleActually, a local notification (alerting the user who would tap the alert to launch the app) would be quite an acceptable solution — provided that notification could come exactly at (or very shortly after, let's say up to a second or two at very worst) the moment when the device starts charging.Is that possible? As always, I can be missing something of importance, but I don't know such a local notification can be requested. Is there a way to do that? All I know are time- and location-based local notifications, none of which helps here the slightest bit.> For the second, you could detect that the iPhone has been plugged / unpluggedAbsolutely, provided my application actually runs at background, which is generally — again, far as I understand — not possible to achieve.Again do please correct me if I am wrong, but far as I know, Apple does not allow applications to run at background, unless they play a (silent, in this case) audio, which is trick dirty enough for my client to frown upon, not speaking of the Store, which well might reject such a thing. There's also BGTaskScheduler now, but it won't make sure my app gets a few ticks of CPU at least each second, which is roughly what I would need; the new API, far as I understand the thing, might well leave the app dormant for minutes (or hours or days) 😟If there's any other possibility to make my app really run at bacground (well, aside of VoIP which is not a solution for roughly same reasons as the audio-play hack) — or, even better, be reliably resumed at background each second or so —, I never heard of the thing, and would be grateful if you point it to me.Thanks and all the best,OC
Post not yet marked as solved
5 Replies
Well thanks, but it's a bit more convoluted than that.He obviously does not want to switch the auto-lock completely off; that would clash seriously with the normal usage, when the iPhone is not charging (or he would have to remember to switch is always back on whenever he takes the iPhone from the dock, which is self-evidently absurd).The good news is that this is actually not needed at all! Once my application is active, it can both monitor the charging status (through the batteryState property) and, if the iPhone is being charged, it can easily keep the screen unlocked through idleTimerDisabled.The bad news is that to be able to do this, the app needs to be active. That's why I need a way to automatically launch/activate the application when the device is put into the charger — that's one thing whole solution I can't see :/(The other one is to make the app automatically launched/activated if the charging is in process, another app is active, and the idle timer strikes in: normally iPhone would switch off the display in this case, I need it again to activate my app.)Unless I am missing something of importance, that's all I need; all the other requirements I do know how to implement easily.
Post marked as solved
5 Replies
Same here: worked for me quite nicely in 11 up to, I believe, .1; far as I recall correctly from .2 up there seems to be no way to make the thing work again: my langspec shows in Editor/Syntax Coloring list all right, but can't be selected, and does not work 😟I'd be really very grateful if anyone can explain how to add a new langspec into Xcode 11.3 (and up) reliably.(Let me also link a loosely related question, how to make Xcode to add a file of some type into compiled sources, instead of into bundle resources: How Xcode decides which build phase to add a file into?)
Post not yet marked as solved
3 Replies
We just have bumped into the very same problem (submodules not cloned automatically) with Xcode 11.1 (11A1027).The only work-around we eventually found was to go Terminal and use an explicitgit submodule update --init --recursiveIs it possible such a howler still was not fixed in Xcode, not even after three years? Or do we do some mistake at our side, for this should work all right and does for others? Thanks!
Post not yet marked as solved
5 Replies
Anyway... that said, do you think it might help to write (and use) our own NSRunningApplication wrapper, which would simply super (or perhaps rather forward using embedding instead of subclassing) all the messages inside of a @synchronized(self) harness? I have considered trying that myself originally, but having read that NSRunningApplication is thread safe in the docs, I have decided it would be a waste of time. Was I wrong and should I try that anyway?
Post not yet marked as solved
5 Replies
First and important thing — as can be seen in the crashlogs (and as I did not stress out here, sorry for that), it does happen to crash in the main thread 😟Aside of that (and unimportant) — myself, I read in there something quite different, namely, something like “use anywhere safely, just don't be surprised if the values change somewhat wildly” (which won't affect our usage). Especially I can't read in there anything about a danger of a crash. Might you have a different documentation? What I see in there is> NSRunningApplication is thread safe, in that its properties are returned atomically. However, it is still subject to the main run loop policy described above. If you access an instance of NSRunningApplication from a background thread, be aware that its time-varying properties may change from under you as the main run loop runs (or not).
Post not yet marked as solved
4 Replies
Thanks! Alas, at least in Xcode 10.1 (10B61) which I have at the moment at hand, it does not seem to help, or I do something wrong. I have tried even a rule to compile *.groovy files by clang (would not work build-time of course, just to test), and still all groovy files are automatically added to the Copy Bundle Resource phase 😟
Post not yet marked as solved
4 Replies
Bumping up. Nobody knows? Still would appreciate a solution...
Post marked as solved
8 Replies
I don't know how Apple does it, but seems to me quite probable that the underlying support is the very NSAppleEventManager. The 10.13 news then would be just that the NSApplication init-time checks whether there's a CFBundleURLTypes set, if so, adds its own URL event handler to NSAppleEventManager, and upon getting the event sends the openURLs delegate message. Wouldn't it be the easiest and simplest solution?Anyway, meantime, my client tested in 10.12 and told me it works, so it seems the right answer indeed.Thanks!
Post marked as solved
8 Replies
Meantime, seems I've succeeded to find the answer myself. Looks like one has to go down AppleEvents; it seems the code to observe for the URL received looks like this:[NSAppleEventManager.sharedAppleEventManager setEventHandler:self andSelector:@selector(handleEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL];and the URL then can be obtained from the event like this:[event paramDescriptorForKeyword:keyDirectObject].stringValueWe'll see soon as I am able to test in 10.12...
Post marked as solved
8 Replies
Well, you open in Safari or Mail or essentially wherever (e.g., from another application through the aforementioned NSWorkspace APIs) an URL, say, „ocsoftware://show.logs“, and my application — if installed, of course — gets activated and shows logs. (The actual usage somewhat differs, would be a bit too complex to explain here and is completely irrelevant to the problem; but this is the principle.)
Post marked as solved
8 Replies
Perhaps I just don't properly understand the darned Swift thing, but far as I can say, this is not what I need.I do not need to open a URL from my application; I need my application to be able to process a URL with a custom scheme, opened from elsewhere (e.g., Safari, Mail, etc.)