Posts

Post not yet marked as solved
0 Replies
344 Views
I'm building my Apple Id sign in, since it is required now and the first time it launched the sign in, it showed the user's name and email and then a continue button. Now each time after it only shows a continue button with text. I can no longer take action to set a name or email address. This isn't very helpful during testing. How do I clear the stored data so that I get back to that original screen on the first run of Sign In with Apple Id?
Posted Last updated
.
Post not yet marked as solved
18 Replies
2.2k Views
Basically I have an array of jokers for a card game. The number of jokers in this array can be any number really. What I need to do is loop through every possible combination of those jokers being any of the other 52 cards. So something like this needs to happen:Jokers array (A, B, C)1-52 representing each of the 52 possible cards.Results for looping:A1, B1, C1A1, B1, C2...A1, B1, C52A1, B2, C1A1, B1, C2...A1, B2, C52...A1, B52, C52A2, B1, C1...A52, B52, C52So this scenario would be 140,608 possible combinations: 52 * 52 * 52, since there are 3 jokers.How would I write this in obj c?
Posted Last updated
.
Post not yet marked as solved
1 Replies
495 Views
Can anyone help me determine what to do next with the metadata.imageProvider? I'm trying to display a preview of my link but there is nothing anywhere on the web of how to do this in obj c.// vars LPMetadataProvider *metadataProvider = [LPMetadataProvider new]; [metadataProvider startFetchingMetadataForURL:[NSURL URLWithString:@"http://www.apple.com/ipad"] completionHandler:^(LPLinkMetadata *metadata, NSError *error){ // check if(!error){ NSLog(@"metadata: %@", metadata.title); NSLog(@"metadata: %@", metadata.imageProvider); NSLog(@"metadata: %@", metadata.iconProvider); // get ui dispatch_async(dispatch_get_main_queue(), ^{ // }); } }];
Posted Last updated
.
Post not yet marked as solved
9 Replies
2.2k Views
I have an array [3, 5, 6, 7, 11, 12] .I want to count, in obj c, the maximum number of consecutive numbers. In the case above it would be 3 becase of 5-7. The array is already sorted by integer values.
Posted Last updated
.
Post not yet marked as solved
0 Replies
470 Views
I have a simple Objective C function that I would like to convert to use metal instead, for better performance. I have scoured the internet but can't seem to find much other than swift examples. How can I convert this code to metal for a quick image blur?// Create our blurred image CIContext *context = [CIContext contextWithOptions:nil]; CIImage *inputImage = [CIImage imageWithCGImage:thisImage.CGImage]; // Setting up Gaussian Blur CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"]; [filter setValue:inputImage forKey:kCIInputImageKey]; [filter setValue:[NSNumber numberWithFloat:5.0f] forKey:@"inputRadius"]; CIImage *result = [filter valueForKey:kCIOutputImageKey]; CGImageRef cgImage = [context createCGImage:result fromRect:[inputImage extent]]; UIImage *retVal = [UIImage imageWithCGImage:cgImage]; if (cgImage) { CGImageRelease(cgImage); } return retVal;
Posted Last updated
.
Post not yet marked as solved
2 Replies
507 Views
I'm creating an app where a user will be swimming using the HKWorkoutSession where the activity type is declared at init. However, what if the user leaves the water and starts running. Is there a way to detect this transition?
Posted Last updated
.
Post not yet marked as solved
3 Replies
598 Views
I'm allowing my users to select multiple iCloud documents to compare side by side. I would like the user to select the file and it copy locally and then display it in the WKWebView. In the simulator it works perfectly. However, on the device it will not display the documents at all. Any ideas?-(void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray *)urls{ // check if(controller.documentPickerMode == UIDocumentPickerModeOpen){ // vars NSURL *url = [urls objectAtIndex:0]; BOOL isAccess = [url startAccessingSecurityScopedResource]; // check if(!isAccess){ // return return; } // vars NSString *fileName = [NSString stringWithFormat:@"%@.%@", [appDelegate.myGlobals getGuid], url.pathExtension]; NSString *path = [url path]; NSData *data = [[NSFileManager defaultManager] contentsAtPath:path]; NSString *documentsPath = [[self applicationDocumentsDirectory].path stringByAppendingPathComponent:fileName]; NSURL *fileURL = [NSURL fileURLWithPath:documentsPath]; // write [data writeToFile:documentsPath atomically:YES]; // set NSURL *url = [NSURL URLWithString:fileURL]; NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url]; [myWebView loadRequest:urlRequest]; // stop [url stopAccessingSecurityScopedResource]; } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
599 Views
I'm trying to present the AVRoutePickerView and respond to one of the external devices being selected and then present content to it. However, once it is selected and the picker view is dismissed there are no new screens to add content to.// create AVRoutePickerView *routePickerView = [[AVRoutePickerView alloc] initWithFrame:CGRectMake(80, 30, 40, 40)]; routePickerView.backgroundColor = [UIColor redColor]; routePickerView.delegate = self; [self.view addSubview:routePickerView];I'd like to simply be able to select an external device and create a new window to attach the screen to and then add a view to add some labels to so it presents on the external device. Help, please!
Posted Last updated
.
Post not yet marked as solved
1 Replies
952 Views
Why is it if I have a UITableView and I display cells that it fires the willDisplayCell for every cell that is in the table? One cell takes up about 40% of the display. So at most 4-5 cells should be prepared and fire the cellForRowAtIndexPath method along with the willDisplayCell method. It shouldn't fire all 15! It's killing the performance of my tableview.-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // vars SimpleTVCell *tempCell = (SimpleTVCell *)[tableView dequeueReusableCellWithIdentifier:simpleTVCellIdentifier]; NSLog(@"temp cell %@", tempCell); // return return tempCell; } -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ // vars SimpleTVCell *tempCell = (SimpleTVCell *)cell; NSLog(@"will display cell %d", indexPath.row); }
Posted Last updated
.