Skip to content

Add object detection, tracking, mobile notifications, and search to any security camera.

clean

rorycleare2c05a1b78d2
diff --git a/clearcam/Email.m b/clearcam/Email.m
index 0becf35..baf709a 100644
--- a/clearcam/Email.m
+++ b/clearcam/Email.m
@@ -107,11 +107,7 @@
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
- if (error) {
- NSLog(@"Error: %@", error.localizedDescription);
- } else {
- NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- }
+ if (error) NSLog(@"Error: %@", error.localizedDescription);
}];
[task resume];
}
diff --git a/clearcam/FileServer.m b/clearcam/FileServer.m
index 9c640c3..b23e107 100644
--- a/clearcam/FileServer.m
+++ b/clearcam/FileServer.m
@@ -129,8 +129,6 @@
}
self.isServerRunning = YES;
- NSLog(@"HTTP Server started on port 80");
-
while (self.isServerRunning) {
int clientSocket = accept(self.serverSocket, NULL, NULL);
if (clientSocket != -1) {
@@ -162,7 +160,6 @@
close(self.serverSocket);
self.serverSocket = -1;
}
- NSLog(@"HTTP Server stopped");
}
- (void)observeValueForKeyPath:(NSString *)keyPath
@@ -467,7 +464,6 @@
NSString *startParam = nil;
NSString *endParam = nil;
- // ✅ Extract query params
NSRange queryRange = [filePath rangeOfString:@"?"];
if (queryRange.location != NSNotFound) {
NSString *queryString = [filePath substringFromIndex:queryRange.location + 1];
@@ -484,8 +480,6 @@
}
}
}
-
- // ✅ Validate params
if (!startParam || !endParam) {
NSString *errorResponse = @"HTTP/1.1 400 Bad Request\r\nContent-Type: application/json\r\n\r\n[{\"error\": \"Missing or invalid start/end parameter\"}]";
send(clientSocket, [errorResponse UTF8String], errorResponse.length, 0);
@@ -494,11 +488,8 @@
NSTimeInterval startTimeStamp = [startParam doubleValue];
NSTimeInterval endTimeStamp = [endParam doubleValue];
-
- // ✅ Convert timestamps to "seconds since midnight"
NSDate *startDate = [NSDate dateWithTimeIntervalSince1970:startTimeStamp];
NSDate *endDate = [NSDate dateWithTimeIntervalSince1970:endTimeStamp];
-
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd"];
@@ -517,7 +508,6 @@
NSTimeInterval relativeStart = [startDate timeIntervalSinceDate:midnight];
NSTimeInterval relativeEnd = [endDate timeIntervalSinceDate:midnight];
- // ✅ Fetch segments for the date
NSArray *segments = [self fetchAndProcessSegmentsFromCoreDataForDateParam:formattedStartDate start:0 context:self.context];
if (segments.count == 0) {
@@ -525,8 +515,6 @@
send(clientSocket, [errorResponse UTF8String], errorResponse.length, 0);
return;
}
-
- // ✅ Find the last segment that starts BEFORE `relativeStart`
NSInteger startIndex = -1;
for (NSInteger i = segments.count - 1; i >= 0; i--) {
NSTimeInterval segmentTimeStamp = [segments[i][@"timeStamp"] doubleValue];
@@ -536,10 +524,7 @@
break;
}
}
-
- if (startIndex == -1) startIndex = 0; // If none found, start from the first segment
-
- // ✅ Find the first segment that ENDS AFTER `relativeEnd`
+ if (startIndex == -1) startIndex = 0;
NSInteger endIndex = -1;
for (NSInteger i = startIndex; i < segments.count; i++) {
NSTimeInterval segmentStart = [segments[i][@"timeStamp"] doubleValue];
@@ -554,7 +539,6 @@
if (endIndex == -1) endIndex = segments.count - 1; // If none found, include everything
- // ✅ Collect segment file paths
NSMutableArray<NSString *> *segmentFilePaths = [NSMutableArray array];
for (NSInteger i = startIndex; i <= endIndex; i++) {
@@ -562,7 +546,7 @@
NSString *fullFilePath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject stringByAppendingPathComponent:segmentURL];
if (![[NSFileManager defaultManager] fileExistsAtPath:fullFilePath]) {
- NSLog(@"❌ Segment file not found: %@", segmentURL);
+ NSLog(@"Segment file not found: %@", segmentURL);
continue;
}
@@ -575,7 +559,6 @@
return;
}
- // ✅ Merge files synchronously
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
__block NSString *outputPath = nil;
@@ -595,25 +578,22 @@
return;
}
- // ✅ Open merged file
FILE *mergedFile = fopen([outputPath UTF8String], "rb");
if (!mergedFile) {
- NSLog(@"❌ Failed to open merged video file for sending: %s", strerror(errno));
+ NSLog(@"Failed to open merged video file for sending: %s", strerror(errno));
return;
}
if (clientSocket < 0) {
- NSLog(@"❌ Invalid socket: %d", clientSocket);
+ NSLog(@"Invalid socket: %d", clientSocket);
fclose(mergedFile);
return;
}
- // ✅ Get file size
NSFileManager *fileManager = [NSFileManager defaultManager];
NSDictionary *fileAttributes = [fileManager attributesOfItemAtPath:outputPath error:nil];
NSUInteger fileSize = [fileAttributes[NSFileSize] unsignedIntegerValue];
- // ✅ Send HTTP Headers
dprintf(clientSocket, "HTTP/1.1 200 OK\r\n");
dprintf(clientSocket, "Content-Type: video/mp4\r\n");
dprintf(clientSocket, "Content-Disposition: attachment; filename=\"%s-%s.mp4\"\r\n",
@@ -622,14 +602,12 @@
dprintf(clientSocket, "Content-Length: %lu\r\n", (unsigned long)fileSize);
dprintf(clientSocket, "Accept-Ranges: bytes\r\n");
dprintf(clientSocket, "\r\n");
-
- // ✅ Send File Data
char buffer[64 * 1024];
size_t bytesRead;
while ((bytesRead = fread(buffer, 1, sizeof(buffer), mergedFile)) > 0) {
ssize_t bytesSent = send(clientSocket, buffer, bytesRead, 0);
if (bytesSent < 0) {
- NSLog(@"❌ Error sending file data: %s", strerror(errno));
+ NSLog(@"Error sending file data: %s", strerror(errno));
break;
}
}
@@ -938,7 +916,7 @@
AVAsset *asset = [AVAsset assetWithURL:[NSURL fileURLWithPath:filePath]];
if (asset.tracks.count == 0) {
- NSLog(@"❌ Error: No tracks found in asset %@", filePath);
+ NSLog(@"Error: No tracks found in asset %@", filePath);
continue;
}
@@ -950,9 +928,7 @@
atTime:currentTime
error:&error];
- if (error) {
- NSLog(@"❌ Error inserting video track: %@", error.localizedDescription);
- }
+ if (error) NSLog(@"Error inserting video track: %@", error.localizedDescription);
currentTime = CMTimeAdd(currentTime, asset.duration);
}
@@ -969,13 +945,10 @@
[exportSession exportAsynchronouslyWithCompletionHandler:^{
if (exportSession.status == AVAssetExportSessionStatusCompleted) {
- if (![[NSFileManager defaultManager] fileExistsAtPath:outputPath]) {
- NSLog(@"❌ File not found in Documents: %@", outputPath);
- }
-
+ if (![[NSFileManager defaultManager] fileExistsAtPath:outputPath]) NSLog(@"File not found in Documents: %@", outputPath);
completion(outputPath, nil);
} else {
- NSLog(@"❌ Export failed: %@", exportSession.error.localizedDescription);
+ NSLog(@"Export failed: %@", exportSession.error.localizedDescription);
completion(nil, exportSession.error);
}
}];
@@ -1058,11 +1031,7 @@
// Save the context after deletion
NSError *saveError = nil;
- if (![context save:&saveError]) {
- NSLog(@"Failed to delete DayEntity and EventEntity objects: %@", saveError.localizedDescription);
- } else {
- NSLog(@"All DayEntity and EventEntity objects deleted successfully");
- }
+ if (![context save:&saveError]) NSLog(@"Failed to delete DayEntity and EventEntity objects: %@", saveError.localizedDescription);
}
@end
diff --git a/clearcam/PortScanner.h b/clearcam/PortScanner.h
index b1f864e..c80978e 100644
--- a/clearcam/PortScanner.h
+++ b/clearcam/PortScanner.h
@@ -2,7 +2,6 @@
@interface PortScanner : NSObject
-- (void)scanNetworkForPort:(int)port completion:(void (^)(NSArray<NSString *> *openPorts))completion;
- (NSString *)getDeviceIPAddress;
- (void)updateCachedOpenPortsForPort:(int)port;
diff --git a/clearcam/PortScanner.m b/clearcam/PortScanner.m
index 74fd9b7..519c09b 100644
--- a/clearcam/PortScanner.m
+++ b/clearcam/PortScanner.m
@@ -116,44 +116,6 @@
return NO; // Port is closed
}
-
-- (void)scanNetworkForPort:(int)port completion:(void (^)(NSArray<NSString *> *openPorts))completion {
- NSDictionary *ipInfo = [self getLocalIPInfo];
- if (!ipInfo) {
- NSLog(@"Failed to get local IP info.");
- if (completion) completion(@[]);
- return;
- }
-
- NSString *deviceIP = [self getDeviceIPAddress];
- NSMutableArray<NSString *> *foundIPs = [NSMutableArray array];
-
- if (deviceIP) {
- [foundIPs addObject:deviceIP];
- }
-
- NSArray<NSString *> *ipList = [self getIPRangeFromIP:ipInfo[@"ip"] subnetMask:ipInfo[@"subnet"]];
-
- dispatch_group_t scanGroup = dispatch_group_create();
-
- for (NSString *ip in ipList) {
- dispatch_group_enter(scanGroup);
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
- if ([self isPortOpen:ip port:port]) {
- @synchronized(self) {
- [foundIPs addObject:ip];
- }
- }
- dispatch_group_leave(scanGroup);
- });
- }
-
- dispatch_group_wait(scanGroup, DISPATCH_TIME_FOREVER);
- if (completion) {
- completion([foundIPs copy]);
- }
-}
-
- (void)throttledScanNetworkForPort:(int)port withBatchSize:(int)batchSize completion:(void (^)(NSArray<NSString *> *openPorts))completion {
NSDictionary *ipInfo = [self getLocalIPInfo];
if (!ipInfo) {
@@ -171,8 +133,6 @@
}
NSArray<NSString *> *ipList = [self getIPRangeFromIP:ipInfo[@"ip"] subnetMask:ipInfo[@"subnet"]];
- NSLog(@"Scanning %lu IPs for app instances on port %d...", (unsigned long)ipList.count, port);
-
dispatch_group_t scanGroup = dispatch_group_create();
dispatch_queue_t scanQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0);
diff --git a/clearcam/SceneDelegate.m b/clearcam/SceneDelegate.m
index 3f752a2..013c9ea 100644
--- a/clearcam/SceneDelegate.m
+++ b/clearcam/SceneDelegate.m
@@ -28,7 +28,6 @@
if (connectionOptions.URLContexts.count > 0) {
UIOpenURLContext *context = connectionOptions.URLContexts.anyObject;
NSURL *url = context.URL;
- NSLog(@"App launched with URL: %@", url);
[self handleURL:url];
}
}
@@ -37,38 +36,23 @@
// Handle the URL when the app is already running
UIOpenURLContext *context = URLContexts.anyObject;
NSURL *url = context.URL;
- NSLog(@"App opened URL: %@", url);
[self handleURL:url];
}
- (void)handleURL:(NSURL *)url {
// Handle security-scoped URL
BOOL isSecurityScoped = [url startAccessingSecurityScopedResource];
- if (isSecurityScoped) {
- NSLog(@"Started accessing security-scoped resource.");
- }
-
// Handle the .aes file
[self handleAESFile:url];
// Stop accessing security-scoped resource
- if (isSecurityScoped) {
- [url stopAccessingSecurityScopedResource];
- NSLog(@"Stopped accessing security-scoped resource.");
- }
+ if (isSecurityScoped) [url stopAccessingSecurityScopedResource];
}
- (void)handleAESFile:(NSURL *)aesFileURL {
NSFileManager *fileManager = [NSFileManager defaultManager];
-
- // Log the file path for debugging
- NSLog(@"Attempting to access file at path: %@", aesFileURL.path);
-
- // Check if the file is an iCloud file
BOOL isUbiquitous = [fileManager isUbiquitousItemAtURL:aesFileURL];
if (isUbiquitous) {
- NSLog(@"File is an iCloud file.");
-
// Check the download status
NSString *downloadStatus = nil;
NSError *downloadError = nil;
@@ -82,8 +66,6 @@
NSLog(@"iCloud download status: %@", downloadStatus);
if (![downloadStatus isEqualToString:NSURLUbiquitousItemDownloadingStatusCurrent]) {
- // File is not downloaded locally, initiate download
- NSLog(@"File is not downloaded locally. Starting download...");
NSError *downloadStartError = nil;
[fileManager startDownloadingUbiquitousItemAtURL:aesFileURL error:&downloadStartError];
if (downloadStartError) {
@@ -91,7 +73,6 @@
[self showErrorAlertWithMessage:[NSString stringWithFormat:@"Failed to start download: %@", downloadStartError.localizedDescription]];
return;
}
- NSLog(@"Started downloading iCloud file. Monitoring download progress...");
[self monitorICloudDownloadForURL:aesFileURL];
[self showDownloadAlert];
return;
@@ -120,24 +101,17 @@
[self showErrorAlertWithMessage:[NSString stringWithFormat:@"Failed to read the file: %@", readError.localizedDescription]];
return;
}
- NSLog(@"Read .aes file successfully. Size: %lu bytes", (unsigned long)encryptedData.length);
-
- // Attempt to decrypt the data using stored keys
NSArray<NSString *> *storedKeys = [[SecretManager sharedManager] getAllDecryptionKeys];
__block NSData *decryptedData = nil; // Add __block specifier
__block NSString *successfulKey = nil; // Add __block specifier
- // Try each stored key
- NSLog(@"rory stored keys: %lu",(unsigned long)storedKeys.count);
for (NSString *key in storedKeys) {
decryptedData = [[SecretManager sharedManager] decryptData:encryptedData withKey:key];
if (decryptedData) {
- NSLog(@"rory has key");
successfulKey = key;
break;
}
}
- NSLog(@"rory key not found");
// If no stored key worked, prompt the user for a key
if (!decryptedData) {
@@ -160,7 +134,6 @@
// Helper method to handle decrypted data
- (void)handleDecryptedData:(NSData *)decryptedData fromURL:(NSURL *)aesFileURL {
NSFileManager *fileManager = [NSFileManager defaultManager];
- NSLog(@"Decrypted data successfully. Size: %lu bytes", (unsigned long)decryptedData.length);
// Remove only the .aes extension
NSString *fileName = [aesFileURL lastPathComponent];
@@ -177,20 +150,12 @@
[self showErrorAlertWithMessage:[NSString stringWithFormat:@"Failed to save the decrypted file: %@", writeError.localizedDescription]];
return;
}
-
- NSLog(@"Decrypted and saved .jpg file: %@", jpgFileURL);
-
- // Open the .jpg file in the system's photo viewer
[self openImageInPhotoViewer:jpgFileURL];
-
- // Delete the .aes file after successful decryption and saving
NSError *deleteError = nil;
[fileManager removeItemAtURL:aesFileURL error:&deleteError];
if (deleteError) {
NSLog(@"Failed to delete .aes file: %@", deleteError.localizedDescription);
[self showErrorAlertWithMessage:[NSString stringWithFormat:@"Failed to delete the original file: %@", deleteError.localizedDescription]];
- } else {
- NSLog(@"Successfully deleted .aes file: %@", aesFileURL.path);
}
}
@@ -324,8 +289,6 @@
NSMetadataQuery *query = notification.object;
[query enumerateResultsUsingBlock:^(NSMetadataItem *result, NSUInteger idx, BOOL *stop) {
NSString *downloadStatus = [result valueForAttribute:NSMetadataUbiquitousItemDownloadingStatusKey];
- NSLog(@"Download status finished: %@", downloadStatus);
-
if ([downloadStatus isEqualToString:NSURLUbiquitousItemDownloadingStatusCurrent]) {
// File is downloaded, stop the query and handle the file
[query stopQuery];
@@ -358,8 +321,6 @@
}
- (void)documentInteractionControllerDidEndPreview:(UIDocumentInteractionController *)controller {
- // This method is called when the user is done viewing the image
- NSLog(@"User is done viewing the image.");
self.docController = nil; // Clear the controller
}
diff --git a/clearcam/SceneState.m b/clearcam/SceneState.m
index 9e2d8ec..e653da5 100644
--- a/clearcam/SceneState.m
+++ b/clearcam/SceneState.m
@@ -91,7 +91,6 @@
if (![imageData writeToFile:filePath atomically:YES]) {
NSLog(@"Failed to save image at path: %@", filePath);
} else {
- NSLog(@"Image saved at path: %@", filePath);
//thumbnail
UIGraphicsBeginImageContextWithOptions(CGSizeMake(uiImage.size.width / 2, uiImage.size.height / 2), YES, 1.0);
[uiImage drawInRect:CGRectMake(0, 0, uiImage.size.width / 2, uiImage.size.height / 2)];
@@ -133,10 +132,7 @@
NSLog(@"NOT sending an email");
}
}
- } else {
- NSLog(@"Failed to create CGImage from CIImage");
}
-
[self.backgroundContext performBlockAndWait:^{
NSManagedObject *newEvent = [NSEntityDescription insertNewObjectForEntityForName:@"EventEntity"
inManagedObjectContext:self.backgroundContext];
diff --git a/clearcam/SecretManager.m b/clearcam/SecretManager.m
index 10eba43..22f1cd3 100644
--- a/clearcam/SecretManager.m
+++ b/clearcam/SecretManager.m
@@ -88,8 +88,6 @@ static NSString *const kServiceIdentifier = @"com.yourapp.aeskeys"; // Replace w
}
return NO;
}
-
- NSLog(@"Successfully saved encryption key.");
return YES;
}
@@ -157,8 +155,6 @@ static NSString *const kServiceIdentifier = @"com.yourapp.aeskeys"; // Replace w
}
return NO;
}
-
- NSLog(@"Successfully saved decryption key with identifier: %@", identifier);
return YES;
}
@@ -216,8 +212,6 @@ static NSString *const kServiceIdentifier = @"com.yourapp.aeskeys"; // Replace w
}
return NO;
}
-
- NSLog(@"Successfully deleted key from Keychain with identifier: %@", identifier);
return YES;
}
@@ -238,8 +232,6 @@ static NSString *const kServiceIdentifier = @"com.yourapp.aeskeys"; // Replace w
}
return NO;
}
-
- NSLog(@"Successfully deleted all keys from Keychain.");
return YES;
}
diff --git a/clearcam/SettingsViewController.m b/clearcam/SettingsViewController.m
index 6a02a4c..d9c7698 100644
--- a/clearcam/SettingsViewController.m
+++ b/clearcam/SettingsViewController.m
@@ -156,13 +156,9 @@
- (void)streamViaWiFiSwitchToggled:(UISwitch *)sender {
self.streamViaWiFiEnabled = sender.on;
-
- // Save the toggle state to NSUserDefaults
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:self.streamViaWiFiEnabled forKey:@"stream_via_wifi_enabled"];
[defaults synchronize];
-
- NSLog(@"Stream via Wi-Fi: %@", self.streamViaWiFiEnabled ? @"Enabled" : @"Disabled");
}
#pragma mark - Subscription Status
@@ -170,11 +166,6 @@
- (void)checkSubscriptionStatus {
[[StoreManager sharedInstance] verifySubscriptionWithCompletion:^(BOOL isActive, NSDate *expiryDate) {
dispatch_async(dispatch_get_main_queue(), ^{
- if (isActive) {
- NSLog(@"Subscription is active. Expiry date: %@", expiryDate);
- } else {
- NSLog(@"No active subscription found.");
- }
[self.tableView reloadData]; // Refresh the UI based on the subscription status
});
}];
@@ -183,7 +174,6 @@
- (void)subscriptionStatusDidChange:(NSNotification *)notification {
// Called when the subscription status changes (e.g., after a successful purchase)
dispatch_async(dispatch_get_main_queue(), ^{
- NSLog(@"Subscription status changed. Refreshing UI.");
[self.tableView reloadData]; // Refresh the UI to reflect the new subscription status
});
}
@@ -418,7 +408,6 @@
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- NSLog(@"Tapped section %ld, row %ld", (long)indexPath.section, (long)indexPath.row);
BOOL isPremiumOrUsingOwnServer = [[NSUserDefaults standardUserDefaults] boolForKey:@"isSubscribed"] || self.useOwnEmailServerEnabled;
if (indexPath.section == 0) {
@@ -514,8 +503,6 @@
[defaults synchronize];
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationAutomatic];
-
- NSLog(@"Use own email server: %@", self.useOwnEmailServerEnabled ? @"Enabled" : @"Disabled");
}
- (void)showEmailServerAddressInputDialog {
@@ -642,19 +629,12 @@
}
- (void)savePasswordToSecretsManager:(NSString *)password {
- if (!password) {
- NSLog(@"Error: Password cannot be nil.");
- return;
- }
+ if (!password) return;
NSError *error = nil;
BOOL success = [[SecretManager sharedManager] saveEncryptionKey:password error:&error];
- if (!success) {
- NSLog(@"Failed to save password to Keychain: %@", error.localizedDescription);
- } else {
- NSLog(@"Password successfully saved to Keychain.");
- }
+ if (!success) NSLog(@"Failed to save password to Keychain: %@", error.localizedDescription);
}
- (NSString *)retrievePasswordFromSecretsManager {
@@ -713,7 +693,6 @@
[[NSUserDefaults standardUserDefaults] synchronize];
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationAutomatic];
}
- NSLog(@"Send Email Alerts: %@", self.sendEmailAlertsEnabled ? @"Enabled" : @"Disabled");
}
- (void)showEmailInputDialogWithCompletion:(void (^)(BOOL success))completion {
@@ -836,7 +815,6 @@
}
- (void)showEmailInputDialog {
- NSLog(@"Entering showEmailInputDialog");
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Enter Email Address"
message:@"Please enter a valid email address."
preferredStyle:UIAlertControllerStyleAlert];
@@ -851,13 +829,11 @@
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
NSString *email = alert.textFields.firstObject.text;
- NSLog(@"User entered email: %@", email);
if ([self isValidEmail:email]) {
[[NSUserDefaults standardUserDefaults] setObject:email forKey:@"user_email"];
[[NSUserDefaults standardUserDefaults] synchronize];
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
- NSLog(@"Table view reloaded with new email");
});
} else {
[self showInvalidEmailAlert];
@@ -867,14 +843,12 @@
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * _Nonnull action) {
- NSLog(@"User canceled email input dialog");
}];
[alert addAction:saveAction];
[alert addAction:cancelAction];
dispatch_async(dispatch_get_main_queue(), ^{
- NSLog(@"Presenting email input dialog");
[self presentViewController:alert animated:YES completion:^{
NSLog(@"Email input dialog presentation completed");
}];
@@ -884,7 +858,6 @@
#pragma mark - Resolution Picker
- (void)showResolutionPicker {
- NSLog(@"Entering showResolutionPicker");
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Select Resolution"
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
@@ -895,7 +868,6 @@
UIAlertAction *action = [UIAlertAction actionWithTitle:resolution
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
- NSLog(@"User selected resolution: %@", resolution);
self.selectedResolution = resolution;
SettingsManager *settingsManager = [SettingsManager sharedManager];
if ([resolution isEqualToString:@"720p"]) {
@@ -903,11 +875,8 @@
} else if ([resolution isEqualToString:@"1080p"]) {
[settingsManager updateResolutionWithWidth:@"1920" height:@"1080" textSize:@"3" preset:@"AVCaptureSessionPreset1920x1080"];
}
- NSLog(@"Updated SettingsManager: width=%@, height=%@, textSize=%@, preset=%@",
- settingsManager.width, settingsManager.height, settingsManager.text_size, settingsManager.preset);
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
- NSLog(@"Table view reloaded for resolution change");
});
}];
[alert addAction:action];
@@ -916,12 +885,10 @@
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * _Nonnull action) {
- NSLog(@"User canceled resolution picker");
}];
[alert addAction:cancelAction];
dispatch_async(dispatch_get_main_queue(), ^{
- NSLog(@"Presenting resolution picker");
[self presentViewController:alert animated:YES completion:^{
NSLog(@"Resolution picker presentation completed");
}];
@@ -942,7 +909,6 @@
handler:^(UIAlertAction * _Nonnull action) {
self.selectedPresetKey = presetKey;
[settingsManager updateYoloIndexesKey:presetKey];
- NSLog(@"Selected YOLO indexes key: %@", self.selectedPresetKey);
[self.tableView reloadData];
}];
[alert addAction:action];
diff --git a/clearcam/ViewController.m b/clearcam/ViewController.m
index 046dbd1..657d33c 100644
--- a/clearcam/ViewController.m
+++ b/clearcam/ViewController.m
@@ -688,9 +688,6 @@ NSMutableDictionary *classColorMap;
@try {
if ((double)[[[[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:nil] objectForKey:NSFileSystemFreeSize] unsignedLongLongValue] / (1024.0 * 1024.0) < MIN_FREE_SPACE_MB) {
- NSLog(@"deleting stuff");
- NSLog(@"NOT ENOUGH SPACE!");
-
// Fetch all DayEntities, sorted by date
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"DayEntity"];
fetchRequest.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES]];