Post

Replies

Boosts

Views

Activity

Reply to macos app non-store distribution question / hardened runtime
ah ha, interesting on my backwards interpretation of hardened runtime. thanks for that clue. from the above apple "embedding a helper tool" doc, i was able to get past the issues with the runtime entitlements (i think...), but then got stuck on a dlopen( ) (dynamic library open?) issue with the main Python library. it looks like some others have reported this issue as i was looking around online, but i havent found a solution that works for me yet. at least i made some progress.
Oct ’22
Reply to macos app non-store distribution question / hardened runtime
it seems that apple policy is to not allow what i asked for earlier (code signed only). you have to do the whole hardened runtime business for all sub-executables unless you want macOS to flag your app as potentially harmful fyi if anyone is looking for similar, i found this, seems fairly descriptive but non trivial as they say https://developer.apple.com/documentation/xcode/embedding-a-helper-tool-in-a-sandboxed-app?language=objc started going thru it the trick seems to be the step where they talk about adding a new copy files phase and 'check the "code sign on copy" button' but it looks like it will require some trial and error for my particular case
Oct ’22
Reply to applicationWillTerminate not being called
having same issue, need to do some cleanup when mac app is closed, saw this hint on a stack overflow post https://stackoverflow.com/questions/8193305/applicationwillterminate-not-called add this function to the mac app delegate, and then the applicationWillTerminate: method is called -(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication *) sender{ return YES; } i havent tested all cases e.g. user kills an app with kill -9 or something like that, i just checked the window close case at this point (you may need to set both of the aforementioned info plist values in the other chat responses here to NO. I have them set to NO. i did not go thru testing iterations with those plist values. one or both may not be needed.) see attached screenshot for plist settings i used. Update: If you use normal quit from Activity Monitor, this solution traps the exit. If you use force quit, it does not (which kind of makes sense). (That may be the kill -9). also, an app crash doesnt seem to trigger the WillTerminate test: // at end of did finish launching:        [self performSelector:@selector(forceCrash) withObject:nil afterDelay:10]; -(void)forceCrash {   int *x = NULL;   int y = *x; } so, at least normal app close is handled
Sep ’22
Reply to AVFoundation error -11829 "Cannot Open" (random-ish fail on same url)
for anyone interested in trying to trace weird AV errors, we ran across these methods on AVPlayerItem which seem like they may give more info AVPlayerItemAccessLog * accessLog = [_playerItem accessLog];          AVPlayerItemErrorLog * errorLog = [_playerItem errorLog];          NSString * errorString = [[NSString alloc] initWithData:[errorLog extendedLogData] encoding:[errorLog extendedLogDataStringEncoding]];         printf("video error string = %s\n", [errorString UTF8String]);
Sep ’22
Reply to Writing MP4 metadata with AVFoundation
the AVMetadataItem writing indeed seems fraught with peril. i tried a bunch of examples with basic stuff like title and description in the "common" metadata family, and none of them seem to write data to the file using AVAssetWriter for mp4 files. checked by mpls command line. does anyone know the difference between the .key and the .identifier ? i see examples with .key and examples with .identifier. why we should use one over the other = ?
Feb ’22
Reply to sometimes file stat fails for media files / iOS 14.2 and up
continued: this is the error we get fairly often (same file works other times). this is a file from the photos folder. Error Domain=NSCocoaErrorDomain Code=260 "The file “IMG_2685.mp4” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/var/mobile/Media/DCIM/102APPLE/IMG_2685.mp4, NSUnderlyingError=0x281af1cb0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
Nov ’21