kotlin-multiplatform
tag name: kotlin-multiplatform
tags question: http://stackoverflow.com/q/75753778
type: Tag
tags question: http://stackoverflow.com/q/77053720
tags question: http://stackoverflow.com/q/77799533
tags question: http://stackoverflow.com/q/78448106
tags question: http://stackoverflow.com/q/78706424
tags question: http://stackoverflow.com/q/79010527
tags question: http://stackoverflow.com/q/79177378

http://stackoverflow.com/q/75847398
has body: I don't know why I'm getting this error in objective c while integrating CashFree Payment service. I'm trying to integrate cashfree payment gateway service in my iOS through Objective-C but don't know where I'm getting this error ViewController.h: @interface ViewController : UIViewController <CFResponseDelegate> ViewController.m: @interface ViewController() <CFResponseDelegate> -(void) cashFreePayment; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; [self cashFreePayment]; } -(void) cashFreePayment { @try { CFSessionBuilder* sessionBuilder = [[CFSessionBuilder alloc]init]; sessionBuilder = [sessionBuilder setEnvironment:CFENVIRONMENTSANDBOX]; sessionBuilder = [sessionBuilder setPaymentSessionId:@""]; sessionBuilder = [sessionBuilder setOrderID:@""]; sessionBuilder = [sessionBuilder buildAndReturnError:nil]; CFPaymentComponentBuilder *paymentComponent = [[CFPaymentComponentBuilder alloc]init]; paymentComponent = [paymentComponent enableComponents:@"order-details"]; paymentComponent = [paymentComponent enableComponents:@"card"]; paymentComponent = [paymentComponent enableComponents:@"upi"]; paymentComponent = [paymentComponent enableComponents:@"wallet"]; paymentComponent = [paymentComponent enableComponents:@"netbanking"]; paymentComponent = [paymentComponent enableComponents:@"emi"]; paymentComponent = [paymentComponent enableComponents:@"paylater"]; paymentComponent = [paymentComponent buildAndReturnError:nil]; CFThemeBuilder *theme = [[CFThemeBuilder alloc]init]; theme = [theme setPrimaryFont:@"Futura"]; theme = [theme setSecondaryFont:@"Menlo"]; theme = [theme setButtonTextColor:@"#FFFFFF"]; theme = [theme setButtonBackgroundColor:@"#FF0000"]; theme = [theme setNavigationBarTextColor: @"#FFFFFF"]; theme = [theme setNavigationBarBackgroundColor:@"#C3C3C3"]; theme = [theme buildAndReturnError:nil]; CFWebCheckoutPaymentBuilder *payout = [[CFWebCheckoutPaymentBuilder alloc]init]; payout = [payout setSession:sessionBuilder]; payout = [pa…
type: Question
has comment: http://stackoverflow.com/comment/133787553
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/75858090
has comment: http://stackoverflow.com/comment/133795635
tagged with: ios
score: 0
linked to: http://stackoverflow.com/q/17802662
answer count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/133788085
has comment: http://stackoverflow.com/comment/133787903
has title: I'm continuously getting this error, Don't know why? <-[__NSCFConstantString count]: unrecognized selector sent to instance>
has comment: http://stackoverflow.com/comment/133788160

http://stackoverflow.com/q/75720394
has body: We have a reader app similar to apple books. We are facing following accessibility issue on mac catalyst version of the app: When the content on the page is read out by voice over and we turn the page using keyboard arrow keys, even though the page gets turned and the focus also goes to the next page, the voice over continues to read the previous page. Can you please suggest what needs to be done and how it is fixed in apple books mac app. I tried following things but none of them worked: Post UIAccessibilityAnnouncementNotification when page is turned. This didn’t work and the announcement does not interrupts it, it just continues to read the previous page. Though the announcement string gets appended in the end and VO speaks when it is done with reading. (we don't have UIAccessibilitySpeechAttributeQueueAnnouncement overridden, i even tried to set it to false explicitly as well) Post UIAccessibilityLayoutChangedNotification or UIAccessibilityLayoutChangedNotification or UIAccessibilityLayoutChangedNotification when page is turned. I know that apple books also has similar issue till macOS Monterey but it is fixed in macOS Ventura but for us this issue is still in macOS ventura.
has title: Voice over continues to read previous page even when page is turned
type: Question
type: UnansweredQuestion
tagged with: macos
tagged with: ios
tagged with: mac-catalyst
tagged with: objective-c
has answer: http://stackoverflow.com/a/75729278
has comment: http://stackoverflow.com/comment/133595090
answer count: 1
score: 0

http://stackoverflow.com/comment/133524921
has text: Either that or adding an wrapper for the initialisation part, if it not possible to convert the AppDelegate to objc itself. Anyway, the most of the services and types are plain swift and won't be accessible through objc. For these adapters would have to be implemented. The reason is that the SDK uses a lot of async code (promises etc.) which rely on generic types. Generic types are not supported by objc in that way. Additional not all native swift types are available via in objc.
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/75685150

http://stackoverflow.com/comment/133794472
score: 0
type: QuestionComment
has text: Kotlin `sealed interface UIState<out T> { object Loading : UIState<Nothing> data class Data<T>(val value: T) : UIState<T> data class Error(val throwable: Throwable) : UIState<Nothing> } ` Generated xcframework `public protocol UIState { } public class UIStateLoading : KotlinBase, UIState { } public class UIStateData<T> : KotlinBase, UIState where T : AnyObject { open var value: T? { get } } public class UIStateError : KotlinBase, UIState { open var throwable: KotlinThrowable { get } } `
type: Comment
comment on: http://stackoverflow.com/q/75753778

http://stackoverflow.com/comment/133794477
has text: As the kswift developer said from this medium https://medium.com/icerock/how-to-implement-swift-friendly-api-with-kotlin-multiplatform-mobile-e68521a63b6d. From the Swift side Kotlin’s sealed interface looks like a set of classes with a common protocol. Of course, in this case, one cannot hope to check the completeness of the switch implementation, since it is not an enum.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/75753778

nskeyedunarchiver
tag name: nskeyedunarchiver
tags question: http://stackoverflow.com/q/75714226
type: Tag

react-native
type: Tag
tags question: http://stackoverflow.com/q/75823143
tag name: react-native
tags question: http://stackoverflow.com/q/75685030
tags question: http://stackoverflow.com/q/76001227
tags question: http://stackoverflow.com/q/76330995
tags question: http://stackoverflow.com/q/76223560
tags question: http://stackoverflow.com/q/76480080
tags question: http://stackoverflow.com/q/76420865
tags question: http://stackoverflow.com/q/76648688
tags question: http://stackoverflow.com/q/76595578
tags question: http://stackoverflow.com/q/76860334
tags question: http://stackoverflow.com/q/76822622
tags question: http://stackoverflow.com/q/76849065
tags question: http://stackoverflow.com/q/76919529
tags question: http://stackoverflow.com/q/76997256
tags question: http://stackoverflow.com/q/77221275
tags question: http://stackoverflow.com/q/77207126
tags question: http://stackoverflow.com/q/77259548
tags question: http://stackoverflow.com/q/77364438
tags question: http://stackoverflow.com/q/77281077
tags question: http://stackoverflow.com/q/77579967
tags question: http://stackoverflow.com/q/77518834
tags question: http://stackoverflow.com/q/77760644
tags question: http://stackoverflow.com/q/77703429
tags question: http://stackoverflow.com/q/78008072
tags question: http://stackoverflow.com/q/78032397
tags question: http://stackoverflow.com/q/78169320
tags question: http://stackoverflow.com/q/78158611
tags question: http://stackoverflow.com/q/78153217
tags question: http://stackoverflow.com/q/78373566
tags question: http://stackoverflow.com/q/78435889
tags question: http://stackoverflow.com/q/78350245
tags question: http://stackoverflow.com/q/78543725
tags question: http://stackoverflow.com/q/78502092
tags question: http://stackoverflow.com/q/78672092
tags question: http://stackoverflow.com/q/78650783
tags question: http://stackoverflow.com/q/79044693
tags question: http://stackoverflow.com/q/79046682
tags question: http://stackoverflow.com/q/79143366
tags question: http://stackoverflow.com/q/79228371
tags question: http://stackoverflow.com/q/79090801
tags question: http://stackoverflow.com/q/79351022
tags question: http://stackoverflow.com/q/79524757

http://stackoverflow.com/q/75784604
tagged with: objective-c
has comment: http://stackoverflow.com/comment/133704357
tagged with: automatic-ref-counting
type: Question
has comment: http://stackoverflow.com/comment/133689993
has comment: http://stackoverflow.com/comment/133704292
tagged with: xcode
has comment: http://stackoverflow.com/comment/133704347
has comment: http://stackoverflow.com/comment/133704369
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/133707864
has comment: http://stackoverflow.com/comment/133703894
score: 0
has comment: http://stackoverflow.com/comment/133700593
has comment: http://stackoverflow.com/comment/133689848
has title: How to get list of ARC conversion errors
has comment: http://stackoverflow.com/comment/133700588
answer count: 0
has body: I am dusting off a very old app and trying to get it cleaned up so I can re-submit it to the App Store. It was written in Objective-C using manual reference counting. I tried using the automatic ARC conversion in Xcode (14.2). It displays a message: Cannot Convert to Objective-C ARC and Xcode found 22 issues that prevent conversion from proceeding. Fix all ARC readiness issues and try again. (I'm down to 22 after a couple of hours of work.) However, the error messages show up in the issue navigator until I click on one to try to resolve it, and then they all disappear. Is there a way to view all the errors, including copying them to a text editor? A related question: It looks like a good number of @selector declarations now throw errors in the ARC conversion because they are declaring selectors in a class defined in another file. (They appear to be listed as errors in the ARC conversion preview, but only warnings if I build the project, which is odd.) What is the Objective-C syntax for defining a selector in another class? In swift it's just ClassName.selector, but what is it in Objective-C? I've tried searching the docs and googling it, but haven't found the answer yet.
has comment: http://stackoverflow.com/comment/133703981
has comment: http://stackoverflow.com/comment/133700624

ios
type: Tag
tags question: http://stackoverflow.com/q/75714226
tags question: http://stackoverflow.com/q/75705049
tags question: http://stackoverflow.com/q/75720394
tags question: http://stackoverflow.com/q/75849831
tags question: http://stackoverflow.com/q/75735604
tags question: http://stackoverflow.com/q/75847398
tags question: http://stackoverflow.com/q/75738756
tags question: http://stackoverflow.com/q/75685030
tags question: http://stackoverflow.com/q/75729144
tags question: http://stackoverflow.com/q/75813181
tags question: http://stackoverflow.com/q/75717269
tags question: http://stackoverflow.com/q/75787854
tags question: http://stackoverflow.com/q/75706059
tag name: ios
tags question: http://stackoverflow.com/q/76011701
tags question: http://stackoverflow.com/q/75949482
tags question: http://stackoverflow.com/q/75884104
tags question: http://stackoverflow.com/q/76022262
tags question: http://stackoverflow.com/q/75950246
tags question: http://stackoverflow.com/q/75946121
tags question: http://stackoverflow.com/q/76016717
tags question: http://stackoverflow.com/q/76002388
tags question: http://stackoverflow.com/q/75905667
tags question: http://stackoverflow.com/q/76001227
tags question: http://stackoverflow.com/q/75981242
tags question: http://stackoverflow.com/q/75986813
tags question: http://stackoverflow.com/q/75903232
tags question: http://stackoverflow.com/q/75864711
tags question: http://stackoverflow.com/q/76026075
tags question: http://stackoverflow.com/q/75863219
tags question: http://stackoverflow.com/q/75962915
tags question: http://stackoverflow.com/q/75943541
tags question: http://stackoverflow.com/q/75991674
tags question: http://stackoverflow.com/q/76123444
tags question: http://stackoverflow.com/q/76199112
tags question: http://stackoverflow.com/q/76160415
tags question: http://stackoverflow.com/q/76186465
tags question: http://stackoverflow.com/q/76149831
tags question: http://stackoverflow.com/q/76046184
tags question: http://stackoverflow.com/q/76197050
tags question: http://stackoverflow.com/q/76111768
tags question: http://stackoverflow.com/q/76081876
tags question: http://stackoverflow.com/q/76135581
tags question: http://stackoverflow.com/q/76080307
tags question: http://stackoverflow.com/q/76156263
tags question: http://stackoverflow.com/q/76077379
tags question: http://stackoverflow.com/q/76171892
tags question: http://stackoverflow.com/q/76151348
tags question: http://stackoverflow.com/q/76043479
tags question: http://stackoverflow.com/q/76215695
tags question: http://stackoverflow.com/q/76373287
tags question: http://stackoverflow.com/q/76334354
tags question: http://stackoverflow.com/q/76241132
tags question: http://stackoverflow.com/q/76225320
tags question: http://stackoverflow.com/q/76320148
tags question: http://stackoverflow.com/q/76245513
tags question: http://stackoverflow.com/q/76259633
tags question: http://stackoverflow.com/q/76208755
tags question: http://stackoverflow.com/q/76292989
tags question: http://stackoverflow.com/q/76262477
tags question: http://stackoverflow.com/q/76286739
tags question: http://stackoverflow.com/q/76369635
tags question: http://stackoverflow.com/q/76305070
tags question: http://stackoverflow.com/q/76381280
tags question: http://stackoverflow.com/q/76480080
tags question: http://stackoverflow.com/q/76429102
tags question: http://stackoverflow.com/q/76528271
tags question: http://stackoverflow.com/q/76536415
tags question: http://stackoverflow.com/q/76461631
tags question: http://stackoverflow.com/q/76401182
tags question: http://stackoverflow.com/q/76403207
tags question: http://stackoverflow.com/q/76420865
tags question: http://stackoverflow.com/q/76455043
tags question: http://stackoverflow.com/q/76604747
tags question: http://stackoverflow.com/q/76648688
tags question: http://stackoverflow.com/q/76686566
tags question: http://stackoverflow.com/q/76571909
tags question: http://stackoverflow.com/q/76565935
tags question: http://stackoverflow.com/q/76559806

http://stackoverflow.com/a/75825303
has body: Check this out as well. My WSDL-generated code is generating a read-write var (String) for description. And, of course, this conflicts with the (NSObject-provided?) "description" that is a get-only property for any object (and which seems to return the class name. So in the debugger, if I do this I see that things are ambiguous: (lldb) po self.description error: expression failed to parse: __ObjC.MFBWebServiceSvc_SimpleMakeModel:19:14: note: found this candidate open var description: String! { get set } ^ ObjectiveC.NSObject:105:14: note: found this candidate open var description: String { get } ^ error: <EXPR>:8:1: error: ambiguous use of 'description' self.description ^ __ObjC.MFBWebServiceSvc_SimpleMakeModel:23:14: note: found this candidate open var description: String! { get set } ^ ObjectiveC.NSObject:109:14: note: found this candidate open var description: String { get } Note that the NSObject runtime-getter is not implicitly unwrapped, but the read/write property is. So if I now type "po self.description!", it seems to explicitly return the correct underlying description read/write property. I'm not entirely sure why that happens - I thought "description!" meant "I know description is non-nil, so unwrap it", I didn't think it was also a means of disambiguation. Am I relying here on an artifact that could change, or is this deliberate in swift?
score: 0
answers question: http://stackoverflow.com/q/75728509
type: Answer

http://stackoverflow.com/comment/133523260
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/75686023
has text: What have you tried already?

http://stackoverflow.com/q/75728509
type: Question
has comment: http://stackoverflow.com/comment/133602339
score: 0
tagged with: swift
tagged with: bridging-header
has comment: http://stackoverflow.com/comment/133592227
has title: Use NS_SWIFT_NAME away from the file where a property is declared?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/133611659
has answer: http://stackoverflow.com/a/75755910
answer count: 2
has answer: http://stackoverflow.com/a/75825303
tagged with: objective-c
has comment: http://stackoverflow.com/comment/133609047
has body: I have an objective-c iOS codebase that uses a set of files generated (please don't laugh) by a tool from a SOAP WSDL file. One of the objects in the WSDL includes a property "Description". The tool dutifully - and correctly - translates this into an Objective-C object with a "Description" property. All has worked just fine for 15 years or so. I'm in the process of converting my app to Swift because I can read the writing on the wall (despite Apple's protestations to the contrary). And the fact that swift can interact with Objective-C is a key reason that this is possible! But alas...when accessing Objective-C code from Swift, the default is to convert the casing of the property from upper-case to camel case, so "Description" becomes "description", and conflicts with the Swift "description" property on such objective-c objects. (Does XCode raise a compile-time error on this? Of course not, but that's a separate digression). As a result, my code that references the "description" property gets the name of the class rather than the human-readable value in the "Description" (capital-D) property. Apple recognizes this issue and provides the "NS_SWIFT_NAME" macro to specify a name to be used from Swift, and that could easily solve the problem, except that this is in code that's generated by a 3rd party tool, so it has no idea when/where to add the "NS_SWIFT_NAME" macro. For now, I've got an insane hack on this: I've created an objective-c method visible to Swift that takes the object in question and returns the value of the "Description" field (capital-D), and that works, but (a) man that's an ugly hack, and (b) if my goal is to translate everything except the tool-generated-code to Swift, then...well, tough luck. Any thoughts for solutions here? I can't seem to apply the "NS_SWIFT_NAME" macro in an extension or otherwise in a separate file...

http://stackoverflow.com/comment/133611659
score: 0
has text: I'm confused how I would do that? From Objc its easy, but if I do the category extension in swift, how would I access the original property? That's more or less what I'm currently doing, but it means additional pieces of objc I need to hang onto.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/75728509

http://stackoverflow.com/a/75755910
has body: I also thought about using an Objective-C category to extend the WDSL-generated class to provide another property for accessing the Description. It's still messy, but I think it is cleaner than passing an object to a top-level function. Here's how I mocked it up. First, here's the WSDL-generated class which you cannot change. It has a Description property: // WDSLClass.h - auto-generated #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN @interface WSDLClass: NSObject // the `Description` property that you want to access @property (strong, readonly) NSString *Description; // lots of other stuff @end NS_ASSUME_NONNULL_END // WDSLClass.m - autogenerated #import "WSDLClass.h" @implementation WSDLClass - (NSString *)Description { return @"This is the Description!"; } // lots of other stuff @end To provide access to the Description property under another name I created an Objective-C extension on WSDLClass: // WSDLClass+Extensions.h #import "WSDLClass.h" NS_ASSUME_NONNULL_BEGIN @interface WSDLClass (Extensions) // This is an alias for the `Description` property @property (strong, readonly) NSString *getDescription; @end NS_ASSUME_NONNULL_END // WSDLClass+Extensions.m #import "WSDLClass+Extensions.h" @implementation WSDLClass (Extensions) - (NSString *)getDescription { return self.Description; } The bridging header needs to import WDSLClass+Extensions.h to gain access to this. I can then do this in Swift: let wsdlObject = WSDLClass() print(wsdlObject.getDescription) I.e. I can use the getDescription property (from Swift or Objective-C) to access the Objective-C Description property. Of course, you would need to rename WSDLClass to whatever class name you need and maybe getDescription isn't the best name for the alias. If there are mutiple objects with a Description property then you would need to create an extension for each of them (best combined into a single file for simplicity). Granted you still need to keep a bit more Objective-C in your project, but it's a l…
type: Answer
answers question: http://stackoverflow.com/q/75728509
has comment: http://stackoverflow.com/comment/133658461
score: 0

http://stackoverflow.com/a/75729278
has body: Post the UIAccessibilityScreenChangedNotification notification, and pass along the your new view that should be focussed-on by the accessibility system. See documentation here. It states Post this notification using the UIAccessibilityPostNotification function. Optionally, include a parameter that contains the accessibility element for VoiceOver to move to after processing the notification. You can use this function like so: UIAccessibility.post(notification: .screenChanged, argument: viewToBeFocussed) where viewToBeFocussed is the view that contains the text to be read by the accessibility system.
type: Answer
answers question: http://stackoverflow.com/q/75720394
score: 0

http://stackoverflow.com/q/75714226
tagged with: afnetworking
tagged with: ios
downvote count: 1
tagged with: objective-c
upvote count: 1
has body: I'm using an old version of AFNetworking in an app, it works fine except I'm getting on deprecation warning from Xcode from this line in an initWithCoder method: self.queryStringSerializationStyle = (AFHTTPRequestQueryStringSerializationStyle)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))] unsignedIntegerValue]; The specific warning is: *** -[NSKeyedUnarchiver decodeObjectForKey:]: value for key (queryStringSerializationStyle) is not an object. This will become an error in the future. From what I can tell with the code (ObjectiveC isn't a big strength of mine) it's because of @selector(queryStringSerializationStyle) which looks to be an attempt to convert the "getter" selector for querySerializationStyle to an NSString. But I don't understand why that's wrong, in fact it works for the line before: self.mutableHTTPRequestHeaders = [[decoder decodeObjectOfClass:[NSDictionary class] forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))] mutableCopy]; How should I be fixing this?
answer count: 1
score: 0
tagged with: nskeyedunarchiver
has title: How do I properly use a getter as a selector in Objective-C? Getting deprecation warnings in modern Xcode
tagged with: nscoder
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/75714509
type: UnansweredQuestion

http://stackoverflow.com/q/75761402
has comment: http://stackoverflow.com/comment/133649435
has body: I have a question concerning sorting of a multidimensional array. The array holds n elements, each element has three objects, an NSString, an NSNumber, and another NSString. The two objects, the NSNumber and the second string need to stay with the first string in an array but I need to alphabetize the array by the first string. I previously used the following code to alphabetize a single element array: theSortedFilenames = [NSArray arrayWithArray:[filenamesArray sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]]; However, a version of that code modified to alphabetize the bigger multidimensional array by the first object’s name does not work: theSortedFilenames = [NSArray arrayWithArray:[elementsArray[0] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]]; I also tried: NSComparisonResult alphaSort(NSString *string1, NSString *string2, void *context) { return [string1 caseInsensitiveCompare:string2]; } // sort things NSArray *sortedArray; sortedArray = [elementsArray[0] sortedArrayUsingFunction:alphaSort context:NULL]; Which didn’t work and also a variant given in an answer to a previous question here on stack overflow: static NSInteger order (id a, id b, void* context) { NSString* catA = [a firstObject]; NSString* catB = [b firstObject]; return [catA caseInsensitiveCompare:catB]; } sortedArray = [theArrayToSort sortedArrayUsingFunction:order context:self]; Which also did not work. Can anyone suggest a way to alphabetize the array of three object elements by the first element while maintaining the relationship between all three objects?
score: 0
has comment: http://stackoverflow.com/comment/133654587
has comment: http://stackoverflow.com/comment/133648889
type: Question
has comment: http://stackoverflow.com/comment/133654798
tagged with: sorting
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/133647117
answer count: 0
has comment: http://stackoverflow.com/comment/133680298
tagged with: multidimensional-array
tagged with: objective-c
tagged with: cocoa
has title: Why am I unable to alphabetically sort a multidimensional array in objective-c?

http://stackoverflow.com/q/75717269
has title: Slow load time with UITextView as compared to UITextField
tagged with: uitextview
has comment: http://stackoverflow.com/comment/133587324
favorite count: 0
has comment: http://stackoverflow.com/comment/133586345
tagged with: swift
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/75726811
has comment: http://stackoverflow.com/comment/133585627
accepted answer: http://stackoverflow.com/a/75726811
has comment: http://stackoverflow.com/comment/133586146
downvote count: 2
tagged with: ios
has body: I am working on a project that creates a form dynamically based on an XML file. Everything works fine, except that if a form has too many textViews, it loads very slowly. Analyzing the app performance through xcode Time profiler, I came to know that whenever a textView is initailized it consumes a lot of CPU. To make this easier to understand, I created a sample project that recreates this issue. The sample project just adds about 1000 UITextViews when a ViewController is loaded. I checked the performance of this code using Xcode Profiler. I was able to figure out that if UITextView is replaced by UITextField, the performance increases dramatically. The demo project would show a slight improvement since the view is limited with just textviews or textfields. But in my actual app, I see an improvement of 4 seconds minimum when I try to load a heavy XML. Sample Project: https://github.com/amrit42087/TextView_Performance Here is the screenshot of the Xcode Profiler with UITextView: Here is the screenshot of the Xcode Profiler with UITextField: UITextField reduces the load time to 960 ms from 1.49 seconds which is in case of UITextView. My actual project notices quite a lot of improvement since that is a heavy application. Question: If anyone could suggest a solution to improve the performance while using a UITextView, that would be greatly appreciated. Using UITextField is not an option since I need multiline text.
has comment: http://stackoverflow.com/comment/133589368
upvote count: 2
score: 0
has comment: http://stackoverflow.com/comment/133585597
has comment: http://stackoverflow.com/comment/133573223
has comment: http://stackoverflow.com/comment/133586486
tagged with: objective-c
has comment: http://stackoverflow.com/comment/133583764
type: Question
tagged with: xcode
answer count: 1

iphone
tags question: http://stackoverflow.com/q/75679687
tag name: iphone
type: Tag
tags question: http://stackoverflow.com/q/76111768
tags question: http://stackoverflow.com/q/76403207
tags question: http://stackoverflow.com/q/76455043
tags question: http://stackoverflow.com/q/76480080
tags question: http://stackoverflow.com/q/77228239
tags question: http://stackoverflow.com/q/79029952
tags question: http://stackoverflow.com/q/79050151
tags question: http://stackoverflow.com/q/78957932
tags question: http://stackoverflow.com/q/79155986

drag-and-drop
type: Tag
tags question: http://stackoverflow.com/q/75725732
tag name: drag-and-drop
tags question: http://stackoverflow.com/q/76149338
tags question: http://stackoverflow.com/q/77256493
tags question: http://stackoverflow.com/q/78076129

http://stackoverflow.com/q/75753778
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/133794453
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/133812350
has comment: http://stackoverflow.com/comment/133794477
has comment: http://stackoverflow.com/comment/133634412
tagged with: objective-c
downvote count: 0
has title: KMM Library - How to implement Kotlin sealed class/interface into Swift switch
answer count: 0
tagged with: kotlin-multiplatform
tagged with: kotlin
has body: So I'm trying out KMM Library (not App) that will be imported into .xcframework/.framework for Xcode project and .aar for Android project. I wanted to implement UIState (Loading, Success, and Error) so I create a sealed class sealed class UIState<out T> { object Loading : UIState<Nothing>() data class Success<T>(val data: T) : UIState<T>() data class Error(val message: String) : UIState<Nothing>() } Then make an API call using Coroutine suspend fun getDotaHeroesWithSealedClass(): UIState<List<DotaHero>> = when (httpClient.get("https://api.opendota.com/api/heroes").status.value) { in 200..299 -> { UIState.Success(httpClient.get("https://api.opendota.com/api/heroes").body()) } else -> { UIState.Error("An error has occured") } } After that, I run ./gradlew assembleXCFramework then link the .xcframework into my Xcode project. But the function detected as UIState< NSArray>. getDotaHeroesWithSealedClass function in Swift How can I make the function return UIState so I can make a switch case like this switch uiState { case .loading: case .success(let data): case .error(let errorMessage): }
type: Question
upvote count: 1
tagged with: swift
has comment: http://stackoverflow.com/comment/133794472

http://stackoverflow.com/comment/133512509
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/75679687
type: Comment
has text: Thanks for the response. I did try that and I still observed the same behavior.

http://stackoverflow.com/q/75837044
upvote count: 1
has comment: http://stackoverflow.com/comment/133797419
favorite count: 0
tagged with: swift
has comment: http://stackoverflow.com/comment/133781938
type: UnansweredQuestion
score: 1
downvote count: 0
tagged with: swift-package
has body: I have a class hierarchy like this: MySwiftSubViewController -> ViewController -> UIViewController. Here is the code: #import <UIKit/UIKit.h> @class SwiftClassFromPackage; @interface ViewController : UIViewController @property (nonatomic, strong) SwiftClassFromPackage* _Nullable someSwiftObjectFromPackage; @end This class is using a type from an SwiftPackage for a property. Inside the Objective-C class it seems to be fine: #import "ViewController.h" @import MyPackage; @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; _someSwiftObjectFromPackage = [[SwiftClassFromPackage alloc] init]; } @end But in the Swift subclass it got an compile error when I use this property like this: import UIKit import MyPackage class MySwiftSubViewController: ViewController { override func viewDidLoad() { super.viewDidLoad() print("\(self.someSwiftObjectFromPackage.text)") // Value of type 'MySwiftSubViewController' has no member 'someSwiftObjectFromPackage' } } When I use this SwiftClassFromPackage class outside the package then it is working but not when it is coming from an package. Any suggestions why this is not working?
answer count: 0
has title: Property from Objective-C class is not visible in Swift subclass when that property is from Swift Package
tagged with: objective-c
type: Question

http://stackoverflow.com/q/75739414
downvote count: 0
has body: I have an Xcode project that is a mix of Objective-C(++), C++, and Swift. Some of the Objective-C++ serves as a bridge between Swift and C++. Say I have an Objective-C class with a public property whose type is a C++ class that I want to use from other parts of the Objective-C code. This will cause a compiler error if the header is imported in the Swift bridging header. Is there a way to hide part of the header of this Objective-C class from Swift? EDIT: here's a sample header file to illustrate what I mean. #import &lt;Foundation/Foundation.h&gt; class MyCppType; @interface SwiftCancelationToken : NSObject //I need to expose this so Obj-C can interact with it @property MyCppType *cppProperty; -(void)doSomethingWithCppObject; @end
favorite count: 0
has title: How can I hide part of an Objective-C class's interface from Swift?
upvote count: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/133623847
tagged with: objective-c
has comment: http://stackoverflow.com/comment/133613391
tagged with: objective-c++
has comment: http://stackoverflow.com/comment/133610895
answer count: 1
has comment: http://stackoverflow.com/comment/133610664
has answer: http://stackoverflow.com/a/75747914
accepted answer: http://stackoverflow.com/a/75747914
linked to: http://stackoverflow.com/q/32827389
tagged with: c++
type: Question
tagged with: swift
score: 2

http://stackoverflow.com/q/75679687
has title: Objective c iPhone microphone self adjusts after loud noise
type: Question
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/133512509
tagged with: iphone
has body: I'm using AVAudioRecorder and calling averagePowerForChannel. When I start the app, the ambient noise, produces and a decibel value of, for example, -50. However, if the iPhone is exposed to sustained loud noise that value looks to automatically adjust. So, for example, if I blow into the microphone, then let it return to ambient noise level, the decibel value is now, for example, -90. This does not happen on my iPhone 8. However, this is occurring on my iPhone 12 Pro Max. Is there a way that this can be disabled?
has comment: http://stackoverflow.com/comment/133512488
tagged with: microphone
answer count: 0
score: 0
tagged with: objective-c
tagged with: avaudiorecorder

http://stackoverflow.com/comment/133586345
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/75717269
type: Comment
has text: @DonMag Thanks for the suggestion but that doesn't work for our solution. It's a well established product that can not be asked to change the complete approach how a UI is rendered but yes minor tweaks are most welcome.

http://stackoverflow.com/q/75706059
score: 0
answer count: 0
linked to: http://stackoverflow.com/q/4960197
has comment: http://stackoverflow.com/comment/133555940
has title: How to apply gaussian noise to an existing image in iOS?
tagged with: ios
tagged with: gaussian
type: Question
has comment: http://stackoverflow.com/comment/133556655
has body: The only relevant thread I could found is this: Gaussian Noise using Core Graphics only? Which has a solution of creating complete noise using: CGImageRef CGGenerateNoiseImage(CGSize size, CGFloat factor) CF_RETURNS_RETAINED { NSUInteger bits = fabs(size.width) * fabs(size.height); char *rgba = (char *)malloc(bits); srand(124); for(int i = 0; i < bits; ++i) rgba[i] = (rand() % 256) * factor; CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray(); CGContextRef bitmapContext = CGBitmapContextCreate(rgba, fabs(size.width), fabs(size.height), 8, fabs(size.width), colorSpace, kCGImageAlphaNone); CGImageRef image = CGBitmapContextCreateImage(bitmapContext); CFRelease(bitmapContext); CGColorSpaceRelease(colorSpace); free(rgba); return image; } Or another answer that takes a noise image and combine it with an image // draw background CGContextFillRect(context, ...) // blend noise on top CGContextSetBlendMode(context, kCGBlendModeOverlay); CGImageRef cgImage = [UIImage imageNamed:@"noise"].CGImage; CGContextDrawImage(context, rect, cgImage); CGContextSetBlendMode(context, kCGBlendModeNormal); But I couldn't quite figure out how to take an existing normal image and apply gaussian noise to it (with varying amount). Much like Photoshop noise filter.
tagged with: core-graphics
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/comment/133623847
comment on: http://stackoverflow.com/q/75739414
has text: @Rob `NS_SWIFT_UNAVAILABLE` may work for hiding properties and methods, but I have to expose my C++ object as a property on the wrapper object, which means either forward-declaring its type or importing its header, both of which cause a compiler error. See the edit to the question.
type: QuestionComment
score: 0
type: Comment

kotlin
tags question: http://stackoverflow.com/q/75753778
type: Tag
tag name: kotlin
tags question: http://stackoverflow.com/q/77053720
tags question: http://stackoverflow.com/q/78448106
tags question: http://stackoverflow.com/q/78706424
tags question: http://stackoverflow.com/q/79010527
tags question: http://stackoverflow.com/q/79103337

http://stackoverflow.com/comment/133703981
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/75784604
has text: Is the selector declared in the header file of the class it belongs to and is this header file imported in the file with the error?

http://stackoverflow.com/comment/133704369
type: QuestionComment
type: Comment
has text: Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/252641/discussion-between-duncan-c-and-willeke).
comment on: http://stackoverflow.com/q/75784604
score: 0

http://stackoverflow.com/comment/133794453
type: Comment
comment on: http://stackoverflow.com/q/75753778
has text: I've tried to use KSwift multiple times for my KMM Library but the generated xcframework still not generating the enum for Swift. It's still detected as empty protocol and the other UIState inside it detected as split class implementing the protocol. If you want to try it out for yourself, here's the link to the repository https://github.com/Fostahh/MySharedKMMLibrary . Thank you for the advice though! @PhilDukhov
score: 0
type: QuestionComment

http://stackoverflow.com/comment/133647117
has text: Could you provide some sample of the input data to be sorted?
type: Comment
comment on: http://stackoverflow.com/q/75761402
score: 0
type: QuestionComment

multidimensional-array
tags question: http://stackoverflow.com/q/75761402
tag name: multidimensional-array
type: Tag

http://stackoverflow.com/a/75801743
answers question: http://stackoverflow.com/q/75798736
score: 1
has comment: http://stackoverflow.com/comment/133721023
has comment: http://stackoverflow.com/comment/133731764
has comment: http://stackoverflow.com/comment/133720808
has body: From apple sample code that you provide: The CVDisplayLink callback, displayLinkCallback, never executes on the main thread. So you need to add autoreleasepool to your callback function: static CVReturn displayLinkCallback( CVDisplayLinkRef displayLink, const CVTimeStamp* now, const CVTimeStamp* outputTime, CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* displayLinkContext) { @autoreleasepool { [(MainView*)displayLinkContext renderOneFrame]; } return kCVReturnSuccess; } It looks like ARC is disabled in your project. To explicitly enable ARC add the -fobjc-arc flag to your compile command. clang -fobjc-arc -framework Cocoa -framework QuartzCore -framework Metal -o out/example main.m
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/139618060
type: Answer
downvote count: 0
upvote count: 1
accepted answer of: http://stackoverflow.com/q/75798736

http://stackoverflow.com/q/75685030
type: AnsweredQuestion
score: 0
tagged with: tapkey
has body: I get this error message when trying to use the Tapkey Mobile SDK for iOS in a Objective C AppDelegate: No visible @interface for 'TKMServiceFactoryBuilder' declares the selector 'build' This is the code I use to initialize the ServiceFactory: TKMServiceFactoryBuilder *builder = [[TKMServiceFactoryBuilder alloc] init]; self.tapkeyServiceFactory = [builder build]; Here is the error message as screenshot: Am I missing some imports? The code above with the config has a valid build method. I can also use the setConfig to use the config above. Or am I just not using the library correctly in Objetcive C? The project is React Native. The SDK is working with Android using the React Native Bridge and I want to add it to iOS to. The SDK is prepared for iOS but unfortunately the AppDelegate is in objetcive c and not swift. There is no documentation on how to use it with that.
tagged with: objective-c
tagged with: react-native
answer count: 1
type: Question
has answer: http://stackoverflow.com/a/75685150
accepted answer: http://stackoverflow.com/a/75685150
has title: Tapkey Mobile SDK missing build when using Objective C for iOS
tagged with: ios

http://stackoverflow.com/q/75686023
has body: NSArray *arrTemp = @[ @{@"Appearance" : @"Copper", @"Bitterness" : @(50), @"Style" : @"India Pale Ale (IPA)"}, @{@"Appearance" : @"Jet Black", @"Bitterness" : @(35), @"Style" : @"Stout"}, @{@"Appearance" : @"Copper", @"Bitterness" : @(25), @"Style" : @"English Brown Ale"}, @{@"Appearance" : @"Deep Gold", @"Bitterness" : @(25), @"Style" : @"Bock"} ]; From the above structure, how can we get the array of "Appearance" values. Please help.
has title: How to get array of values from array of dictionary?
answer count: 1
favorite count: 0
score: -2
type: Question
has comment: http://stackoverflow.com/comment/133523260
has comment: http://stackoverflow.com/comment/133535369
has comment: http://stackoverflow.com/comment/133523557
accepted answer: http://stackoverflow.com/a/75686926
upvote count: 0
has answer: http://stackoverflow.com/a/75686926
downvote count: 2
type: AnsweredQuestion
tagged with: objective-c

http://stackoverflow.com/a/75726811
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/75717269
has comment: http://stackoverflow.com/comment/133590230
downvote count: 0
upvote count: 1
has body: Since we have no idea what else you might be doing... One thing to try is to use a UIView subclass that contains a label and a text view. Only show the text view after tapping on the label. Try replacing your SecondViewController with this: class SecondViewController: UIViewController { let scrollView = UIScrollView() let stackView = UIStackView() var myData: [String] = [] let spinner = UIActivityIndicatorView() override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .yellow scrollView.backgroundColor = UIColor(white: 0.95, alpha: 1.0) scrollView.keyboardDismissMode = .onDrag stackView.axis = .vertical stackView.spacing = 20 stackView.translatesAutoresizingMaskIntoConstraints = false scrollView.addSubview(stackView) scrollView.translatesAutoresizingMaskIntoConstraints = false view.addSubview(scrollView) let g = view.safeAreaLayoutGuide let cg = scrollView.contentLayoutGuide let fg = scrollView.frameLayoutGuide NSLayoutConstraint.activate([ scrollView.topAnchor.constraint(equalTo: g.topAnchor, constant: 20.0), scrollView.leadingAnchor.constraint(equalTo: g.leadingAnchor, constant: 20.0), scrollView.trailingAnchor.constraint(equalTo: g.trailingAnchor, constant: -20.0), scrollView.bottomAnchor.constraint(equalTo: g.bottomAnchor, constant: -20.0), stackView.topAnchor.constraint(equalTo: cg.topAnchor, constant: 8.0), stackView.leadingAnchor.constraint(equalTo: cg.leadingAnchor, constant: 8.0), stackView.trailingAnchor.constraint(equalTo: cg.trailingAnchor, constant: 0.0), stackView.bottomAnchor.constraint(equalTo: cg.bottomAnchor, constant: -8.0), stackView.widthAnchor.constraint(equalTo: fg.widthAnchor, constant: -16.0), ]) spinner.style = .large spinner.translatesAutoresizingMaskIntoConstraints = false view.addSubview(spinner) spinner.hidesWhenStopped = true spinner.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true spinner.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true spinner.startAnimating() myData = (1...10…
score: 1
accepted answer of: http://stackoverflow.com/q/75717269
has comment: http://stackoverflow.com/comment/133647078
has comment: http://stackoverflow.com/comment/133610700

objective-c
tags question: http://stackoverflow.com/q/75729144
tags question: http://stackoverflow.com/q/75728509
type: Tag
tags question: http://stackoverflow.com/q/75837044
tags question: http://stackoverflow.com/q/75813181
tags question: http://stackoverflow.com/q/75787854
tags question: http://stackoverflow.com/q/75706059
tags question: http://stackoverflow.com/q/75725732
tags question: http://stackoverflow.com/q/75720394
tags question: http://stackoverflow.com/q/75849831
tags question: http://stackoverflow.com/q/75823143
tags question: http://stackoverflow.com/q/75686023
tags question: http://stackoverflow.com/q/75736685
tags question: http://stackoverflow.com/q/75679687
tags question: http://stackoverflow.com/q/75753778
tags question: http://stackoverflow.com/q/75714226
tags question: http://stackoverflow.com/q/75705049
tags question: http://stackoverflow.com/q/75734132
tags question: http://stackoverflow.com/q/75738756
tags question: http://stackoverflow.com/q/75782846
tag name: objective-c
tags question: http://stackoverflow.com/q/75798736
tags question: http://stackoverflow.com/q/75739414
tags question: http://stackoverflow.com/q/75784604
tags question: http://stackoverflow.com/q/75735604
tags question: http://stackoverflow.com/q/75717269
tags question: http://stackoverflow.com/q/75761402
tags question: http://stackoverflow.com/q/75847398
tags question: http://stackoverflow.com/q/75725844
tags question: http://stackoverflow.com/q/75685030
tags question: http://stackoverflow.com/q/75727849
tags question: http://stackoverflow.com/q/75903232
tags question: http://stackoverflow.com/q/76026075
tags question: http://stackoverflow.com/q/75962915
tags question: http://stackoverflow.com/q/75857765
tags question: http://stackoverflow.com/q/75943541
tags question: http://stackoverflow.com/q/75940769
tags question: http://stackoverflow.com/q/75856290
tags question: http://stackoverflow.com/q/76011701
tags question: http://stackoverflow.com/q/75949482
tags question: http://stackoverflow.com/q/75884104
tags question: http://stackoverflow.com/q/75981242
tags question: http://stackoverflow.com/q/75989522
tags question: http://stackoverflow.com/q/75857334
tags question: http://stackoverflow.com/q/76022262
tags question: http://stackoverflow.com/q/75987263
tags question: http://stackoverflow.com/q/75950246
tags question: http://stackoverflow.com/q/75985811
tags question: http://stackoverflow.com/q/75946121
tags question: http://stackoverflow.com/q/75864711
tags question: http://stackoverflow.com/q/76016717
tags question: http://stackoverflow.com/q/76009123
tags question: http://stackoverflow.com/q/75863219
tags question: http://stackoverflow.com/q/76022077
tags question: http://stackoverflow.com/q/76002388
tags question: http://stackoverflow.com/q/75905667
tags question: http://stackoverflow.com/q/76001227
tags question: http://stackoverflow.com/q/75991674
tags question: http://stackoverflow.com/q/75976964
tags question: http://stackoverflow.com/q/75986813
tags question: http://stackoverflow.com/q/76123444
tags question: http://stackoverflow.com/q/76189088
tags question: http://stackoverflow.com/q/76140890
tags question: http://stackoverflow.com/q/76156263
tags question: http://stackoverflow.com/q/76147011
tags question: http://stackoverflow.com/q/76092456
tags question: http://stackoverflow.com/q/76038481
tags question: http://stackoverflow.com/q/76199112
tags question: http://stackoverflow.com/q/76140643
tags question: http://stackoverflow.com/q/76035273
tags question: http://stackoverflow.com/q/76160415
tags question: http://stackoverflow.com/q/76180099
tags question: http://stackoverflow.com/q/76073275
tags question: http://stackoverflow.com/q/76185744
tags question: http://stackoverflow.com/q/76043479
tags question: http://stackoverflow.com/q/76199576
tags question: http://stackoverflow.com/q/76149338
tags question: http://stackoverflow.com/q/76111768
tags question: http://stackoverflow.com/q/76186465
tags question: http://stackoverflow.com/q/76027766

http://stackoverflow.com/a/75813329
accepted answer of: http://stackoverflow.com/q/75813181
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/75813181
type: Answer
has body: Your approach here is wrong. You don't constantly poll CLLocationManager on a thread. You start CLLocationManager one time, and let it run for as long as you want the information. The app will receive periodic updates. There is no need for a thread of any kind, and definitely not a polling loop. For obtaining permissions, and other required setup, see Configuring your app to use location services. For more details on reading location information in the background, see Handling location updates in the background. Your app does not continually poll for information in the background. The OS will deliver events when they are available, potentially launching your app if needed. While no threads or queues are required for your current problem, it's worth noting that DISPATCH_QUEUE_PRIORITY_BACKGROUND is a very low-priority queue that often does not run at all when the app is in the background. (I'd never really thought about how counter-intuitive that name is.) Even in cases where this code should run while the app is in the background, you wouldn't want to use that priority. As a rule, if you find yourself using sleepForTimeInterval:, you're probably doing something wrong. It's sometimes the correct tool, but it's extremely rare, particularly if you're a beginner.
score: 0

swift
tags question: http://stackoverflow.com/q/75717269
tag name: swift
tags question: http://stackoverflow.com/q/75727849
tags question: http://stackoverflow.com/q/75728509
tags question: http://stackoverflow.com/q/75837044
tags question: http://stackoverflow.com/q/75787854
tags question: http://stackoverflow.com/q/75736685
tags question: http://stackoverflow.com/q/75735604
tags question: http://stackoverflow.com/q/75753778
type: Tag
tags question: http://stackoverflow.com/q/75738756
tags question: http://stackoverflow.com/q/75782846
tags question: http://stackoverflow.com/q/75739414
tags question: http://stackoverflow.com/q/75903232
tags question: http://stackoverflow.com/q/75989522
tags question: http://stackoverflow.com/q/75905667
tags question: http://stackoverflow.com/q/75884104
tags question: http://stackoverflow.com/q/76001227
tags question: http://stackoverflow.com/q/75987263
tags question: http://stackoverflow.com/q/76171892
tags question: http://stackoverflow.com/q/76151348
tags question: http://stackoverflow.com/q/76189088
tags question: http://stackoverflow.com/q/76147011
tags question: http://stackoverflow.com/q/76199112
tags question: http://stackoverflow.com/q/76160415
tags question: http://stackoverflow.com/q/76043479
tags question: http://stackoverflow.com/q/76180648
tags question: http://stackoverflow.com/q/76183122
tags question: http://stackoverflow.com/q/76368198
tags question: http://stackoverflow.com/q/76208755
tags question: http://stackoverflow.com/q/76297115
tags question: http://stackoverflow.com/q/76286739
tags question: http://stackoverflow.com/q/76276000
tags question: http://stackoverflow.com/q/76201998
tags question: http://stackoverflow.com/q/76334354
tags question: http://stackoverflow.com/q/76246627
tags question: http://stackoverflow.com/q/76312639
tags question: http://stackoverflow.com/q/76372609
tags question: http://stackoverflow.com/q/76225320
tags question: http://stackoverflow.com/q/76320148
tags question: http://stackoverflow.com/q/76324356
tags question: http://stackoverflow.com/q/76296059
tags question: http://stackoverflow.com/q/76223560
tags question: http://stackoverflow.com/q/76378869
tags question: http://stackoverflow.com/q/76512900
tags question: http://stackoverflow.com/q/76435609
tags question: http://stackoverflow.com/q/76381280
tags question: http://stackoverflow.com/q/76520858
tags question: http://stackoverflow.com/q/76475957
tags question: http://stackoverflow.com/q/76420865
tags question: http://stackoverflow.com/q/76649829
tags question: http://stackoverflow.com/q/76648688
tags question: http://stackoverflow.com/q/76686566
tags question: http://stackoverflow.com/q/76626212
tags question: http://stackoverflow.com/q/76559806
tags question: http://stackoverflow.com/q/76707092
tags question: http://stackoverflow.com/q/76696283
tags question: http://stackoverflow.com/q/76670798
tags question: http://stackoverflow.com/q/76677790
tags question: http://stackoverflow.com/q/76710556
tags question: http://stackoverflow.com/q/76849065
tags question: http://stackoverflow.com/q/76815699
tags question: http://stackoverflow.com/q/76757060
tags question: http://stackoverflow.com/q/76757144
tags question: http://stackoverflow.com/q/76827926
tags question: http://stackoverflow.com/q/76719292
tags question: http://stackoverflow.com/q/76816843
tags question: http://stackoverflow.com/q/76748378
tags question: http://stackoverflow.com/q/76793320
tags question: http://stackoverflow.com/q/76857514
tags question: http://stackoverflow.com/q/76851823
tags question: http://stackoverflow.com/q/76822622
tags question: http://stackoverflow.com/q/77058213
tags question: http://stackoverflow.com/q/76932655
tags question: http://stackoverflow.com/q/76904340
tags question: http://stackoverflow.com/q/77053720
tags question: http://stackoverflow.com/q/76970382
tags question: http://stackoverflow.com/q/77037290
tags question: http://stackoverflow.com/q/77111849
tags question: http://stackoverflow.com/q/77097789

http://stackoverflow.com/comment/133684697
type: Comment
has text: @TheNextman thanks for the suggestion! I'll look into it. So far the `LocateMe.swift` file is not prompting me for permissions access either, but I'll try to adapt my CLLocation code to see if it does. If I can get it working I'll gladly accept this as a solution!
score: 0
comment on: http://stackoverflow.com/q/75782846
type: QuestionComment

http://stackoverflow.com/comment/133649435
type: Comment
score: 0
comment on: http://stackoverflow.com/q/75761402
has text: The second `sortedArrayUsingFunction` should work. How did it not work?
type: QuestionComment

http://stackoverflow.com/a/75788872
type: Answer
score: 0
has body: There is no direct way to detect if the user has cleared all the notifications. But u can try a workaround as follows. Following function give the count of the delivered notifications. func hasUserClearedNotifications() { UNUserNotificationCenter.current().getDeliveredNotifications { (notifications) in let deliveredCount = notifications.count } } U have to keep checking that count periodically inside ur application. If that count goes to zero or the count drops suddenly then there is a high chance that user have cleared the notifications. (Please note that this is a workaround. Not a best practise)
answers question: http://stackoverflow.com/q/75787854

http://stackoverflow.com/comment/133787903
type: QuestionComment
has text: Not getting the error through these exception breakpoints.
type: Comment
comment on: http://stackoverflow.com/q/75847398
score: 0

http://stackoverflow.com/comment/133634412
comment on: http://stackoverflow.com/q/75753778
has text: KMM generates ObjC headers, there's no ObjC enum analog that can hold data. But you can generate swift code for your sealed classes using [KSwift](https://github.com/icerockdev/moko-kswift)
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/comment/133707864
comment on: http://stackoverflow.com/q/75784604
has text: I tried to convert an old project to ARC and don't have issues with disappearing errors or selectors. It's easier to do the ARC and new deployment target steps one by one. Switch "show live issues" off when fixing the ARC errors. Post a [mre] if you want help with the selectors.
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/a/75685150
upvote count: 1
has comment: http://stackoverflow.com/comment/133521308
downvote count: 0
has body: The Tapkey Mobile SDK for iOS does not support objc: https://developers.tapkey.io/mobile/ios/getting_started/#requirements
answers question: http://stackoverflow.com/q/75685030
has comment: http://stackoverflow.com/comment/133524921
accepted answer of: http://stackoverflow.com/q/75685030
score: 1
type: AcceptedAnswer
type: Answer

xcode
tags question: http://stackoverflow.com/q/75736685
tag name: xcode
type: Tag
tags question: http://stackoverflow.com/q/75784604
tags question: http://stackoverflow.com/q/75717269
tags question: http://stackoverflow.com/q/75940769
tags question: http://stackoverflow.com/q/75884104
tags question: http://stackoverflow.com/q/75903232
tags question: http://stackoverflow.com/q/76026075
tags question: http://stackoverflow.com/q/76009123
tags question: http://stackoverflow.com/q/76080307
tags question: http://stackoverflow.com/q/76092456
tags question: http://stackoverflow.com/q/76215695
tags question: http://stackoverflow.com/q/76297115
tags question: http://stackoverflow.com/q/76276000
tags question: http://stackoverflow.com/q/76321041
tags question: http://stackoverflow.com/q/76334354
tags question: http://stackoverflow.com/q/76349932
tags question: http://stackoverflow.com/q/76208755
tags question: http://stackoverflow.com/q/76528271
tags question: http://stackoverflow.com/q/76428958
tags question: http://stackoverflow.com/q/76455043
tags question: http://stackoverflow.com/q/76555630
tags question: http://stackoverflow.com/q/76621276
tags question: http://stackoverflow.com/q/76560981
tags question: http://stackoverflow.com/q/76668394
tags question: http://stackoverflow.com/q/76822622
tags question: http://stackoverflow.com/q/76878213
tags question: http://stackoverflow.com/q/77064360
tags question: http://stackoverflow.com/q/77351837
tags question: http://stackoverflow.com/q/77381636
tags question: http://stackoverflow.com/q/77410043
tags question: http://stackoverflow.com/q/77479986
tags question: http://stackoverflow.com/q/77425911
tags question: http://stackoverflow.com/q/77573776
tags question: http://stackoverflow.com/q/77554378
tags question: http://stackoverflow.com/q/77518826
tags question: http://stackoverflow.com/q/77509555
tags question: http://stackoverflow.com/q/77760644
tags question: http://stackoverflow.com/q/77683794
tags question: http://stackoverflow.com/q/77649167
tags question: http://stackoverflow.com/q/77599602
tags question: http://stackoverflow.com/q/77668346
tags question: http://stackoverflow.com/q/77617207
tags question: http://stackoverflow.com/q/77798833
tags question: http://stackoverflow.com/q/77907322
tags question: http://stackoverflow.com/q/77941248
tags question: http://stackoverflow.com/q/77869520
tags question: http://stackoverflow.com/q/77983169
tags question: http://stackoverflow.com/q/78136069
tags question: http://stackoverflow.com/q/78112507
tags question: http://stackoverflow.com/q/77981579
tags question: http://stackoverflow.com/q/78046487
tags question: http://stackoverflow.com/q/78282782
tags question: http://stackoverflow.com/q/78293837
tags question: http://stackoverflow.com/q/78290156
tags question: http://stackoverflow.com/q/78295722
tags question: http://stackoverflow.com/q/78169320
tags question: http://stackoverflow.com/q/78277788
tags question: http://stackoverflow.com/q/78207140
tags question: http://stackoverflow.com/q/78260865
tags question: http://stackoverflow.com/q/78259397
tags question: http://stackoverflow.com/q/78167503
tags question: http://stackoverflow.com/q/78324556
tags question: http://stackoverflow.com/q/78328208
tags question: http://stackoverflow.com/q/78313766
tags question: http://stackoverflow.com/q/78586930
tags question: http://stackoverflow.com/q/78559718
tags question: http://stackoverflow.com/q/78585460
tags question: http://stackoverflow.com/q/78633210
tags question: http://stackoverflow.com/q/78672092
tags question: http://stackoverflow.com/q/78705702
tags question: http://stackoverflow.com/q/78607713
tags question: http://stackoverflow.com/q/78638545
tags question: http://stackoverflow.com/q/78644961
tags question: http://stackoverflow.com/q/78618633
tags question: http://stackoverflow.com/q/78723321
tags question: http://stackoverflow.com/q/78656106
tags question: http://stackoverflow.com/q/78825520
tags question: http://stackoverflow.com/q/78835604

http://stackoverflow.com/comment/133527237
has text: I have tried this. but I am getting only one value but we need array of values like : Copper,Jet Black, Copper,Deep Gold
comment on: http://stackoverflow.com/a/75686926
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/75798736
tagged with: metal
type: AnsweredQuestion
tagged with: objective-c
has title: CAMetalLayer leaks memory during resize
type: Question
upvote count: 1
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/75801743
favorite count: 0
has body: I am creating a window on macOS whose entire content is a subclass of CAMetalLayer. I re-render at the display’s refresh rate using a CVDisplayLink; the window is constantly being re-rendered, even at idle. Each time I resize the window, memory usage increases by hundreds of megabytes per second. While the window is not being resized, memory usage increases by maybe 0.3 MB/s (a small memory leak because I haven’t included an @autoreleasepool anywhere – this is ok for demo purposes). This makes me think that new framebuffers are being allocated during resize, but are never freed. I’ve investigated using Instruments.app, and all this memory is being allocated in CAMetalLayer’s nextDrawable method. Here is the code most significant to the question: // ... - (void)setFrameSize:(NSSize)size { [super setFrameSize:size]; metalLayer.drawableSize = size; } // ... - (void)renderOneFrame { id<CAMetalDrawable> drawable = [metalLayer nextDrawable]; id<MTLCommandBuffer> commandBuffer = [commandQueue commandBuffer]; MTLRenderPassDescriptor* passDesc = [[MTLRenderPassDescriptor alloc] init]; passDesc.colorAttachments[0].texture = drawable.texture; passDesc.colorAttachments[0].loadAction = MTLLoadActionClear; passDesc.colorAttachments[0].storeAction = MTLStoreActionStore; id<MTLRenderCommandEncoder> commandEncoder = [commandBuffer renderCommandEncoderWithDescriptor:passDesc]; [commandEncoder setRenderPipelineState:renderPipeline]; [commandEncoder endEncoding]; [commandBuffer presentDrawable:drawable]; [commandBuffer commit]; } // ... This really is a minimal working example – I’m not even rendering anything! Note how I ask Metal to resize the frame buffer simply by modifying CAMetalLayer’s drawableSize property. I checked the docs both for that and for nextDrawable, but I didn’t see anything that would be relevant to this. Apple’s example code for CAMetalLayer resizes the layer in the same way I do, and I couldn’t see it doing anything else that might affect this (though clearly I’m…
score: 1
tagged with: cametallayer
has answer: http://stackoverflow.com/a/75801743

http://stackoverflow.com/comment/133647078
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/75726811
has text: @AmritSidhu - glad it helped... I suspect (based on your other comments) there are a number of things you're doing that could be done much quicker.

http://stackoverflow.com/a/76394327
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/75705049
answers question: http://stackoverflow.com/q/75705049
score: 0
has body: Just posting the solution which I decided to go ahead with and which solved the problem for us. I decided to listen for the AudioSession interruption which are triggered by the system based on what's happening with the device: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleInterruption:) name:AVAudioSessionInterruptionNotification object:[AVAudioSession sharedInstance]]; Following piece of code is specific to Twilio which solved the current call going blank while a new incoming call is ringing: - (void)handleInterruption:(NSNotification *)notification { if ([notification.name isEqualToString:AVAudioSessionInterruptionNotification]) { if ([[notification.userInfo valueForKey:AVAudioSessionInterruptionTypeKey] isEqualToNumber:[NSNumber numberWithInt:AVAudioSessionInterruptionTypeBegan]]) { self.audioDevice.block(); } }

http://stackoverflow.com/comment/133704357
type: QuestionComment
type: Comment
has text: I'm thinking Apple has not put much effort into maintaining the ARC converter and it's gotten buggy. I haven't tried to use it myself in a lot of years.
score: 0
comment on: http://stackoverflow.com/q/75784604

http://stackoverflow.com/q/75849831
has body: Going to ask this question because I cannot find a sufficient answer. I have an application that needs to play some audio. It needs to pause the current media player (Spotify, Apple Music, etc), and when my audio is done playing it needs to release and notify such that the previously playing media resumes. This works properly when the screen is on, and my app is active on the screen, aka my application is running in the foreground. However, this does not work properly when my application is in the background (eg the screen is locked, or another app is present on the screen). Here is the setup that works when my app is on screen in the foreground. Initial setup -(void) viewDidLoad { [super viewDidLoad]; // deactivate session BOOL success = [[AVAudioSession sharedInstance] setActive:NO error: nil]; if (!success) { NSLog(@"deactivationError"); } // set audio session category AVAudioSessionCategoryPlayAndRecord success = [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil]; if (!success) { NSLog(@"setCategoryError"); } // set audio session mode to default success = [[AVAudioSession sharedInstance] setMode:AVAudioSessionModeDefault error:nil]; if (!success) { NSLog(@"setModeError"); } // activate audio session success = [[AVAudioSession sharedInstance] setActive:YES error: nil]; if (!success) { NSLog(@"activationError"); } The code below is called when I want to pause the background audio player (Spotify, Apple Music, etc.): -(void) pauseBackgroundAudio { // activate a non-mixable session // set audio session category AVAudioSessionCategoryPlayAndRecord BOOL success; AVAudioSessionCategoryOptions AVAudioSessionCategoryOptionsNone = 0; success = [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionsNone error:nil]; if (!success) { NSLog(@"setCategoryError"); } // set audio session mode default success = [[AVAudioS…
upvote count: 1
score: 1
tagged with: audio
tagged with: ios
type: Question
has title: Resume media player (Spotify, Apple Music, etc) while my ios app is in background
tagged with: objective-c
type: UnansweredQuestion
downvote count: 0
favorite count: 0
answer count: 0

http://stackoverflow.com/comment/133544785
has text: If you test that code with your sample, you exactly get `@[@"Copper", @"Jet Black", @"Copper", @"Deep Gold"]`, which is the expected result.
comment on: http://stackoverflow.com/a/75686926
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/133556655
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/75706059
type: Comment
has text: @RobNapier Normal just means any image. Like a photograph for example. I took a brief look at the filter api but it doesn’t look like there is Gaussian noise?

http://stackoverflow.com/comment/133606080
has text: Yeah, for other reasons. It's on the to-do list.
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/75736685

http://stackoverflow.com/a/75686926
upvote count: 3
accepted answer of: http://stackoverflow.com/q/75686023
answers question: http://stackoverflow.com/q/75686023
has comment: http://stackoverflow.com/comment/133527237
has comment: http://stackoverflow.com/comment/133544785
has body: Key Value Coding is your friend. See the paragraph Getting Attribute Values Using Keys NSArray *appearances = [arrTemp valueForKey:@"Appearance"]; valueForKey called on an array of dictionaries returns an array of all values for the specific key.
score: 3
downvote count: 0
type: AcceptedAnswer
type: Answer

scene
tags question: http://stackoverflow.com/q/75729144
type: Tag
tag name: scene

http://stackoverflow.com/comment/133610895
type: Comment
comment on: http://stackoverflow.com/q/75739414
score: 1
has text: `NS_SWIFT_UNAVAILABLE`? https://developer.apple.com/documentation/swift/making-objective-c-apis-unavailable-in-swift
type: QuestionComment

http://stackoverflow.com/a/75747176
answers question: http://stackoverflow.com/q/75738756
upvote count: 2
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/133624820
has comment: http://stackoverflow.com/comment/133776677
has body: Protocol extensions are a Swift-only feature, meaning everything you declare in a protocol extension won't be visible/callable from Objective-C code. As others have said, if you want to provide a custom isEqual, then the only viable approach is to subclass NSObject. However in that case you run into the generics problem you described. However, not all is lost, you could push the generic constraint to the initializer, with a class crafted like this: @objc class Bridge: NSObject { private let _isEqual: (Any?) -&gt; Bool init&lt;T: Equatable&gt;(_ data: T) { _isEqual = { object in guard let other = object as? Bridge, let otherData = other._data as? T else { return false } return data == otherData } } override func isEqual(to object: Any?) -&gt; Bool { _isEqual(object) } } Pushing the generic constraint to the initializer allows Objective-C to consume the class, however, as you might've already noticed, this increases the amount of boilerplate code you need to write in the class definition. Basically, every method you want to support will need to be backed up by a closure created in the initializer
has comment: http://stackoverflow.com/comment/133753407

http://stackoverflow.com/comment/133703894
score: 0
has text: I have "show live issues" unchecked and the ARC errors don't disappear.
type: Comment
comment on: http://stackoverflow.com/q/75784604
type: QuestionComment

http://stackoverflow.com/comment/133523557
has text: I just tried with my project details with same structure and separate class which I should not post it here
type: Comment
comment on: http://stackoverflow.com/q/75686023
score: 0
type: QuestionComment

http://stackoverflow.com/comment/133593432
comment on: http://stackoverflow.com/q/75729144
type: QuestionComment
has text: FYI - Any examples you might find in Swift show the same information that applies to Objective-C. It's all the same UIKit APIs, just in a different programming language.
score: 1
type: Comment

http://stackoverflow.com/comment/133590230
comment on: http://stackoverflow.com/a/75726811
type: AnswerComment
has text: DonMag, Thank you taking time to help me out. This seems to be helpful. I checked the performance using Profiler. The performance is drastically reduced if I replace the UILabel in your code with just UItextView. This makes clear that UITextView does take little longer as compared to other UI elements to be rendered. Your suggested code is definitely a starting point for me and would help me improve the performance. I am gonna accept this answer. But I would also like to give some credit to @Evgeny Karkan, whose clarifications did make sense to me why a UITextView would render slowly.
score: 0
type: Comment

metal
type: Tag
tag name: metal
tags question: http://stackoverflow.com/q/75798736
tags question: http://stackoverflow.com/q/76176009
tags question: http://stackoverflow.com/q/76696283
tags question: http://stackoverflow.com/q/76553856
tags question: http://stackoverflow.com/q/76694493
tags question: http://stackoverflow.com/q/76989609
tags question: http://stackoverflow.com/q/77734537
tags question: http://stackoverflow.com/q/77762066
tags question: http://stackoverflow.com/q/77789337
tags question: http://stackoverflow.com/q/78173482
tags question: http://stackoverflow.com/q/78618633
tags question: http://stackoverflow.com/q/79220145
tags question: http://stackoverflow.com/q/79149592

http://stackoverflow.com/q/75782846
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/133685578
tagged with: macos
linked to: http://stackoverflow.com/q/42634584
has body: MacOS 13.2.1, Xcode 14.2 I'm struggling to get CLLocation to work on Ventura from a command line executable. It works fine from a GUI app. I have the same experience with Swift and Objective C (using the app template works but command line tool doesn't); I'm using ObjC for the example below. I found some example code online that I've put into two Xcode projects at https://github.com/n8henrie/test-location. location-objc-app was created with the Xcode -> new project -> macos -> app template (using storyboard and objective c) location-objc was created with the Xcode -> new project -> macos -> Command Line Tool template (objective c) When I run it in Xcode, location-objc does not prompt for any permissions, and can't retrieve the location: 2023-03-18 09:30:50.109158-0600 location-objc[92344:8383074] authorization status: 0 2023-03-18 09:30:52.121832-0600 location-objc[92344:8383074] status: 1 2023-03-18 09:30:52.121868-0600 location-objc[92344:8383074] 0.000000.0.000000 Program ended with exit code: 0 location-objc-app does give me a popup for permissions and successfully prints the location: 2023-03-18 09:30:56.815837-0600 location-objc-app[92346:8383607] authorization status: 0 2023-03-18 09:30:56.823216-0600 location-objc-app[92346:8383607] status: 0 2023-03-18 09:30:56.823263-0600 location-objc-app[92346:8383607] 12.REDACTED.-34.REDACTED I've ensured that the resulting location-objc binary has the Info.plist information embedded: $ otool -P location-objc location-objc: (__TEXT,__info_plist) section <?xml version="1.0" encoding="UTF-8"?> BuildMachineOSBuild 22D68 CFBundleExecutable location-objc CFBundleIdentifier com.n8henrie.location-objc CFBundleInfoDictionaryVersion 6.0 CFBundleName location-objc CFBundleShortVersionString 1.0 CFBundleSupportedPlatforms MacOSX CFBundleVersion 1 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild 14C18 DTPlatformName macosx DTPlatformVersion 13.1 DTSDKBuild 22C55 DTSDKName macosx13.1 DTXcode 1420 DTXcodeBuild 14C18 LSMi…
has comment: http://stackoverflow.com/comment/133700806
has comment: http://stackoverflow.com/comment/133687210
tagged with: command-line-interface
upvote count: 2
has comment: http://stackoverflow.com/comment/133682433
has comment: http://stackoverflow.com/comment/133682416
has comment: http://stackoverflow.com/comment/133731295
tagged with: objective-c
has title: CLLocation doesn't work from CLI app on MacOS Ventura
has comment: http://stackoverflow.com/comment/133722762
tagged with: core-location
favorite count: 0
score: 2
has comment: http://stackoverflow.com/comment/133684697
type: Question
tagged with: swift
downvote count: 0
linked to: http://stackoverflow.com/q/69232295

http://stackoverflow.com/comment/133595314
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/75725844
has text: The exception is on `[txtCode setStringValue:@""];`, registering undo is using the old selected range.
score: 0

http://stackoverflow.com/comment/133795635
type: Comment
comment on: http://stackoverflow.com/q/75847398
has text: I’d advise against `NSException` catching because these are bugs that should be resolved during development, not simply caught and logged at runtime. If your program catches these, we can’t use the exception breakpoint and/or look at the stack trace. Bottom line, as Larme said, some method was provided a string rather than an array, but why should we be guessing. And exception breakpoint and associated stack track would tell you precisely where the problem was. Don’t using exception handling, or if you do, look at `callStackSymbols`.
type: QuestionComment
score: 0

bridging-header
type: Tag
tags question: http://stackoverflow.com/q/75727849
tags question: http://stackoverflow.com/q/75728509
tag name: bridging-header
tags question: http://stackoverflow.com/q/75905667
tags question: http://stackoverflow.com/q/76473669
tags question: http://stackoverflow.com/q/77085172
tags question: http://stackoverflow.com/q/77670057
tags question: http://stackoverflow.com/q/78109418
tags question: http://stackoverflow.com/q/78167503
tags question: http://stackoverflow.com/q/78333515
tags question: http://stackoverflow.com/q/78756425
tags question: http://stackoverflow.com/q/79456745

http://stackoverflow.com/comment/133607433
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/75736685
score: 0
has text: Even if calling `CGRectMake` from Swift is permitted, it'd seem better and more modern to use the Swift `CGRect()` initializer. `CGRectMake` only exists because structs in C and Obj-C don't have intializers; in Swift, they do, so it makes sense to use the one provided.

http://stackoverflow.com/comment/133788160
has text: From what I see: `[paymentComponent enableComponents:@"order-details"];` seems wrong. Instead, you should do: `paymentComponent enableComponents:@[@"order-details", @"netbanking", @"upi"...]];` as I read `componentS` with an "s" (plural), and see the method https://github.com/cashfree/core-ios-sdk/blob/6ea73372d0ae25bd2ec9f5aef951ea7d906ff329/CashfreePGUISDK.xcframework/ios-arm64_x86_64-simulator/CashfreePGUISDK.framework/Headers/CashfreePGUISDK-Swift.h#L301 `- (CFPaymentComponentBuilder * _Nonnull)enableComponents:(NSArray<NSString *> * _Nonnull)components` Don't you have a warning in code?
type: Comment
comment on: http://stackoverflow.com/q/75847398
type: QuestionComment
score: 2

http://stackoverflow.com/comment/133600007
type: QuestionComment
comment on: http://stackoverflow.com/q/75725732
type: Comment
has text: I think that you're right - when dropping into Finder it's the view that gets highlighted. So, in this case, it would be the contentView of the NSWindow (i.e. the border is drawn around the content excluding the titlebar and toolbar, rather than around the entire window itself). Thank you for clarifying my thinking - and in doing so helping understand the answer for myself. I think that this question should be closed as badly worded. Thank you for your help.
score: 0

http://stackoverflow.com/q/75734132
favorite count: 0
has answer: http://stackoverflow.com/a/75736392
type: AnsweredQuestion
tagged with: nswindow
has body: I want to write a command-line tool which will display window in certain situations (but not always). Now I'm trying to create a simple application which just displays a window. I need it to behave like any other window (but without main menu). I need icon to appear in the Dock. Right now I've come with some code that follows below. But this code creates a window that behave strange. I commented out level = 1 line. With this line this windows appears on top of other windows. Without this line this window appears below other windows and I can't bring it to the top. Also it does not set cursor properly, e.g. I can move cursor from textbox to this app and the cursor keeps text appearance even when hovering over title or other parts of this window. I feel like I missing some important part of the puzzle. #import <AppKit/AppKit.h> @interface ApplicationDelegate : NSObject <NSApplicationDelegate> @end int main(int argc, const char * argv[]) { NSApplication *application = [NSApplication sharedApplication]; ApplicationDelegate *applicationDelegate = [[ApplicationDelegate alloc] init]; application.delegate = applicationDelegate; [application run]; return 0; } @implementation ApplicationDelegate { NSWindow *window; } - (void)applicationDidFinishLaunching:(NSNotification *)notification { window = [ [NSWindow alloc] initWithContentRect:NSMakeRect(100, 100, 600, 400) styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskMiniaturizable backing:NSBackingStoreBuffered defer:NO ]; window.title = @"My Title"; // window.level = 1; [window makeKeyAndOrderFront:nil]; } @end
tagged with: objective-c
has title: Create NSWindow from the command line tool
accepted answer: http://stackoverflow.com/a/75736392
tagged with: cocoa
type: Question
upvote count: 1
downvote count: 0
answer count: 1
score: 1

c++
tags question: http://stackoverflow.com/q/75739414
type: Tag
tag name: c++
tags question: http://stackoverflow.com/q/75864711
tags question: http://stackoverflow.com/q/76092456
tags question: http://stackoverflow.com/q/76349932
tags question: http://stackoverflow.com/q/76486081
tags question: http://stackoverflow.com/q/76553856
tags question: http://stackoverflow.com/q/76923569
tags question: http://stackoverflow.com/q/76989609
tags question: http://stackoverflow.com/q/77199317
tags question: http://stackoverflow.com/q/77790334
tags question: http://stackoverflow.com/q/77789337
tags question: http://stackoverflow.com/q/78106703
tags question: http://stackoverflow.com/q/78129689
tags question: http://stackoverflow.com/q/78492779
tags question: http://stackoverflow.com/q/78566066
tags question: http://stackoverflow.com/q/78656106
tags question: http://stackoverflow.com/q/78705702
tags question: http://stackoverflow.com/q/79007340
tags question: http://stackoverflow.com/q/79109731
tags question: http://stackoverflow.com/q/79355825
tags question: http://stackoverflow.com/q/79321725
tags question: http://stackoverflow.com/q/79289144

http://stackoverflow.com/q/75823143
tagged with: javascript
tagged with: objective-c
downvote count: 0
answer count: 0
tagged with: react-native-firebase
tagged with: react-native
type: Question
upvote count: 1
tagged with: firebase-cloud-messaging
type: UnansweredQuestion
has title: RNFIREBASE MESSENGER push notification not working on iOS
score: 1
has body: I m working on push notification RN firebase, I have followed the rnfirebase documentation, I get the remote message in console.log but not displaying the notifcation on the xcode simulator. Below are the relevant files screenshots and code filename : notificationservices where i have added the respective react-native-firebase code snippets import messaging from "@react-native-firebase/messaging"; import PushNotification from "react-native-push-notification"; import {PushNotificationIOS} from "@react-native-community/push-notification-ios"; import {Platform} from "react-native"; const getFcmToken = async () => { const fcmToken = await messaging() .registerDeviceForRemoteMessages() .then(() => messaging().getToken()); console.log("fcmToken ==>", fcmToken); if (fcmToken) { console.log("Your Firebase Token is:", fcmToken); } else { console.log("Failed", "No token received"); } }; export const requestUserPermission = async () => { const authStatus = await messaging().requestPermission(); const enabled = authStatus === messaging.AuthorizationStatus.AUTHORIZED || authStatus === messaging.AuthorizationStatus.PROVISIONAL; if (enabled) { getFcmToken(); console.log("Authorization status:", authStatus); } }; export const notficationListener = async () => { messaging().onNotificationOpenedApp(remoteMessage => { console.log( "Notification caused app to open from background state:", remoteMessage.notification, ); }); messaging() .getInitialNotification() .then(remoteMessage => { if (remoteMessage) { console.log( "Notification caused app to open from quit state:", remoteMessage.notification, ); } }); messaging().onMessage(async remotemessage => { console.log("remote message11", JSON.stringify(remotemessage)); }); messaging().onNotificationOpenedApp(remotemessage => { console.log("remote message11", JSON.stringify(remotemessage)); PushNotificationIOS.addNotificationRequest({ id: remotemessage.messageId, title: remotemessage.notification.title, body: remotemessage.notification.body,…
favorite count: 0

http://stackoverflow.com/comment/133658461
score: 0
has text: Indeed that's precisely what I had done, but it feels like a hack because it prevents a full swift migration. But it absolutely works fine. I was just hoping there was some way I could tell the compiler to use the original property name without modifying the autogenerated code. Thanks!!
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/75755910

http://stackoverflow.com/comment/133605961
type: Comment
comment on: http://stackoverflow.com/q/75736685
score: 0
has text: Something must have changed. I just realized that `CGRectMake` is listed in the Swift documentation (https://developer.apple.com/documentation/coregraphics/1455245-cgrectmake) and I can use it in a Swift project with Xcode 14. I would have sworn it didn't exist in earlier versions of Swift. Sounds like you need to update your build server with Xcode 14.
type: QuestionComment

http://stackoverflow.com/comment/133610664
comment on: http://stackoverflow.com/q/75739414
has text: Maybe, but from my own (limited) working with Objective-C and Objective-C++ and Swift: **no**. (But as said, "maybe", I may be wrong.)
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/q/75735604
answer count: 0
upvote count: 2
tagged with: bluetooth
tagged with: swift
downvote count: 1
score: 1
favorite count: 0
tagged with: ios
has body: I need to identify some hardware keyboards connected via bluetooth to my app. I have it connected via bluetooth and I can access to it via GCKeyboard.coalesced; I know that it comes from class GCKeyboard that implements GCDevice and I cannot get an unique identifier of the device currently connected: I only can get the vendorName and product category that only returns "Keyboard". I also tried to get the bluetooth device but that keyboard is not BLE and neither is MFi compliant. Is there a turnaround that I could do?
type: Question
tagged with: objective-c
type: UnansweredQuestion
tagged with: keyboard-wedge
has title: Is there a way to get an identifier from a physical keyboard?

http://stackoverflow.com/comment/133595868
comment on: http://stackoverflow.com/q/75725732
type: Comment
has text: That's exactly the point isn't it? It's at the bottom of the pile - so the only solution I can think of (and I'm trying to see if there's a better way) is to create a new view which sits on top of all the others, and is just the border. But… Apple has clearly solved this problem already (Finder etc) so is there a standard way of achieving this end that I'm missing?
score: 0
type: QuestionComment

http://stackoverflow.com/q/75725844
has comment: http://stackoverflow.com/comment/133628532
has comment: http://stackoverflow.com/comment/133590003
tagged with: macos
has comment: http://stackoverflow.com/comment/133601087
type: Question
has comment: http://stackoverflow.com/comment/133595314
tagged with: objective-c
type: UnansweredQuestion
has body: I have a textfield for which i'd like to clear the input if the word 'ERROR' has been put in there. I have made my ViewController the delegate and have setup the following method. - (void)controlTextDidBeginEditing:(NSNotification *)obj { if ([[txtCode stringValue] isEqual:@"ERROR"]) { [txtCode setStringValue:@""]; } } Every time the first character is pressed in that text field, regardless of what's in it (ie even if it doesn't have the word 'ERROR' in it), the app crashes with: [General] -[__NSCFString replaceCharactersInRange:withString:]: Range or index out of bounds I have narrowed it down to the if statement, or really this line: [[txtCode stringValue] isEqual:@"ERROR"] is what's causing the crash, but I can't understand why?
score: 0
answer count: 0
has title: Range or index out of bounds crash when i'm a delegate for my NSTextField
has comment: http://stackoverflow.com/comment/133589375

http://stackoverflow.com/q/75736685
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/133608579
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/133605606
has comment: http://stackoverflow.com/comment/133605856
tagged with: cgrectmake
tagged with: uikit
has comment: http://stackoverflow.com/comment/133605961
has comment: http://stackoverflow.com/comment/133606080
tagged with: objective-c
has title: Objective-C initializers used by Swift (or not)
answer count: 0
tagged with: xcode
has comment: http://stackoverflow.com/comment/133605668
score: 0
has comment: http://stackoverflow.com/comment/133607433
has body: In an app that was originally created in Objective-C but now with a lot of Swift code, initializing a CGRect, for example, using CGRectMake compiles just fine on a developer's Mac using Xcode, but produces an error 'CGRectMake' has been explicitly marked unavailable here on the build server. If I Command-Click on the function, I'm directed to the Objective_C header, where, given that message, I should see something like NS_SWIFT_UNAVAILABLE, but I don't. What would cause this different behavior on dev computers and the build server? More specifically, what can we do on the dev computer to generate the same errors the build server is generating? We're using Xcode 14 with Swift 5.

http://stackoverflow.com/a/75736392
accepted answer of: http://stackoverflow.com/q/75734132
answers question: http://stackoverflow.com/q/75734132
type: AcceptedAnswer
type: Answer
upvote count: 1
downvote count: 0
score: 1
has body: Apparently I needed the following line in main function: application.activationPolicy = NSApplicationActivationPolicyRegular; With this line I'm getting Dock icon and proper behaviour for the window.

http://stackoverflow.com/comment/133722762
type: Comment
has text: @n8henrie If adding a runloop doesn't seem to change anything, then why did you [post an answer](https://stackoverflow.com/a/75795467/20287183) stating that adding `RunLoop.main.run()` allowed you to get the location permission?
score: 0
comment on: http://stackoverflow.com/q/75782846
type: QuestionComment

http://stackoverflow.com/comment/133689993
type: Comment
has text: Is Show live Issues switched on? What is reventing you from copying the isssues? Doesn't select all, Copy work? Have you tried Oen Build Log in the context menu?
score: 0
comment on: http://stackoverflow.com/q/75784604
type: QuestionComment

http://stackoverflow.com/q/75725732
has comment: http://stackoverflow.com/comment/133600007
answer count: 0
has comment: http://stackoverflow.com/comment/133595868
has comment: http://stackoverflow.com/comment/133596497
tagged with: objective-c
score: 0
has body: I'm trying to add a border to an NSWindow for a drag operation (in the same way that dragging into a Finder window puts a blue border around it). The problem I'm experiencing is that the border is drawn underneath all of the subviews in the window. Note, in the interests of simplicity I've left out the code in MyWindowController, which calls draggingEntered, draggingExited and performDragOperation. I've also removed the code that removes the border - if the code as it stands is run then the window will always have a yellow border under the subviews because the problem that I need to solve is the layering rather than anything else. @implementation MyWindowView - (void)drawRect:(NSRect)dirtyRect { [NSColor.yellowColor set]; // just for debug purposes because I don't use yellow for any other reason NSBezierPath *path = [NSBezierPath bezierPathWithRect:self.bounds]; path.lineWidth = 10.0; [path stroke]; } @end How do I need to implement this so that the border is drawn on top of the subviews?
has title: How can I add a border to NSWindow for a drag operation?
type: Question
has comment: http://stackoverflow.com/comment/133591970
tagged with: drag-and-drop
tagged with: nswindow
type: UnansweredQuestion

http://stackoverflow.com/comment/133605606
has text: I just checked, and the build server uses Xcode13. Maybe that's the difference.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/75736685
type: Comment

nswindow
type: Tag
tags question: http://stackoverflow.com/q/75734132
tag name: nswindow
tags question: http://stackoverflow.com/q/75725732
tags question: http://stackoverflow.com/q/76860334
tags question: http://stackoverflow.com/q/77083967
tags question: http://stackoverflow.com/q/77894366
tags question: http://stackoverflow.com/q/78014996

http://stackoverflow.com/q/75813181
tagged with: unity-game-engine
tagged with: ios
type: AnsweredQuestion
tagged with: objective-c
has body: I have few knowledge of Objective-C and Swift but after spending several hours to write a native plugin to collect compass data using a background thread in iOS, below there is the plugin so far // MyPlugin.m extern "C" { #import <CoreLocation/CoreLocation.h> #import "MyPlugin.h" @implementation MyPlugin NSThread *_magneticHeadThread; BOOL _shouldStop; NSMutableArray *readings; - (void)startBackgroundThread { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ // Put your code here that should run in the background when the app enters background. NSLog(@"Background thread started!"); readings = [NSMutableArray array]; _magneticHeadThread = [[NSThread alloc] initWithTarget:self selector:@selector(retrieveMagneticHeadPosition) object:nil]; [_magneticHeadThread start]; }); } - (void)applicationDidEnterBackground:(NSNotification *)notification { _shouldStop = NO; [self startBackgroundThread]; } - (void)applicationWillEnterForeground:(NSNotification *)notification { _shouldStop = YES; [_magneticHeadThread cancel]; NSLog(@"Magnetic head position: %lu", [readings count]); } + (instancetype)sharedInstance { static MyPlugin *sharedInstance = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedInstance = [[MyPlugin alloc] init]; }); return sharedInstance; } - (void)retrieveMagneticHeadPosition { CLLocationManager *locationManager = [[CLLocationManager alloc] init]; locationManager.headingFilter = kCLHeadingFilterNone; [locationManager startUpdatingHeading]; int c = 0; while (!_shouldStop) { NSLog(@"Magnetic head position: %i", c); c++; [readings addObject:@(locationManager.heading.magneticHeading)]; [NSThread sleepForTimeInterval:0.1]; } [locationManager stopUpdatingHeading]; } @end void UnityMyPlugin_StartBackgroundThread() { [[NSNotificationCenter defaultCenter] addObserver:[MyPlugin sharedInstance] selector:@selector(applicationDidEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil]; [[NSNotifi…
has answer: http://stackoverflow.com/a/75813329
accepted answer: http://stackoverflow.com/a/75813329
has title: How to collect compass data, in iOS, when a Unity Application is in background?
answer count: 1
score: 0
type: Question

http://stackoverflow.com/comment/133628532
type: Comment
has text: Undo is registered after `[txtCode setStringValue:@""]` with the selected range before `[txtCode setStringValue:@""]`. Post a [mre] without `[txtCode setStringValue:@""]` please.
type: QuestionComment
comment on: http://stackoverflow.com/q/75725844
score: 0

sorting
tag name: sorting
type: Tag
tags question: http://stackoverflow.com/q/75761402

http://stackoverflow.com/comment/133654798
score: 1
type: QuestionComment
has text: Your last attempt should work: `NSMutableArray *arrayToSort = [[NSMutableArray alloc] init]; for (NSInteger i = 5; i > 0; i--) [arrayToSort addObject:@[[NSString stringWithFormat:@"String1-%d", i], @(i), [NSString stringWithFormat:@"String2-%d", i]]];} NSArray *sorted = [arrayToSort sortedArrayUsingComparator:^NSComparisonResult(NSArray * _Nonnull obj1, NSArray * _Nonnull obj2) { return [[obj1 firstObject] caseInsensitiveCompare:[obj2 firstObject]]; }]; NSLog(@"Sorted: %@", sorted); NSArray *sorted2 = [arrayToSort sortedArrayUsingFunction:order context:NULL]; NSLog(@"Sorted2: %@", sorted2);`
comment on: http://stackoverflow.com/q/75761402
type: Comment

http://stackoverflow.com/q/75705049
accepted answer: http://stackoverflow.com/a/76394327
score: 0
has title: How to reject incoming call programatically
has comment: http://stackoverflow.com/comment/133555460
has comment: http://stackoverflow.com/comment/133560279
type: Question
tagged with: callkit
has answer: http://stackoverflow.com/a/76394327
tagged with: ios
type: AnsweredQuestion
tagged with: voip
answer count: 1
tagged with: objective-c
has body: I'm having a VoIP app in which calling works normally. However, when we have an active VoIP call and the user receives a normal PSTN call, the active VoIP call goes blank - no audio is audible on either side. To resolve this issue, we decided to end the new incoming call programmatically and I'm successfully able to detect an incoming PSTN call. But when I try to end the call, I get error saying: EndCallAction transaction request failed: The operation couldn’t be completed. (com.apple.CallKit.error.requesttransaction error 4.) Error code 4 refers to CXErrorCodeRequestTransactionErrorUnknownCallUUID. Below is my code: // called during initialization self.callObserver = [[CXCallObserver alloc] init]; [self.callObserver setDelegate:self queue:dispatch_get_main_queue()]; - (void)callObserver:(nonnull CXCallObserver *)callObserver callChanged:(nonnull CXCall *)call { // isCallInProgress static variable tracks if a VoIP call is active and I verified its value - works as expected if(isCallInProgress) { if(!call.isOutgoing && !call.hasConnected && !call.hasEnded) { NSLog(@"*** New incoming call detected while a call is in progress - so reject it"); dispatch_async(dispatch_get_main_queue(), ^{ CXEndCallAction *endCallAction = [[CXEndCallAction alloc] initWithCallUUID:call.UUID]; CXTransaction *transaction = [[CXTransaction alloc] initWithAction:endCallAction]; CXCallController *controller = [[CXCallController alloc] init]; [controller requestTransaction:transaction completion:^(NSError *error) { if (error) { NSLog(@"*** EndCallAction transaction request failed: %@", [error localizedDescription]); } else { NSLog(@"*** EndCallAction transaction request successful"); } }]; }); } } } What can I try next?

http://stackoverflow.com/comment/133610700
has text: Hey @DonMag, I just replaced my UITextView with your MyTextView. I was amazed to see the performance improved by 50%. A form that took 8 seconds to render was loaded in just 3.69 seconds after the update. Thank you for the support!
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/75726811
score: 0

http://stackoverflow.com/comment/133753407
has text: Unfortunately, I can't get this to work as `other._data` isn't available because `_data` isn't in the bridge. I can add `_data: Any?` as a property in the bridge class, but I can't treat the objects I need abstractly as I can with the protocol. I'll update the question to provide even more context.
comment on: http://stackoverflow.com/a/75747176
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/133682416
comment on: http://stackoverflow.com/q/75782846
has text: It's likely you need to setup and run a runloop to get callbacks from the location framework. This is done for you in a GUI app but not CLI. See [here](https://stackoverflow.com/questions/42634584/corebluetooth-on-mac-command-line-application/42635036#42635036)
type: QuestionComment
score: 2
type: Comment

http://stackoverflow.com/a/75729263
score: 4
has body: The image you reference in the documentation is two scenes. On an iPad, when using split screen multitasking, you are creating additional scenes. Think of the old, pre-scene, iOS app structure as always having just a single scene. Now, apps can have multiple scenes to support iPad multitasking. Or if you use Mac Catalyst, your app can have multiple scenes when running on a Mac. Whether your app currently has one scene or several, each scene may have one or more windows (though it's most common to have just one). The windows of a scene will be one on top of the other and will fill the full frame of its associated scene. In short, use scenes to support multitasking on the iPad. Just stick to one window per scene to host the scene's root view controller and any further view controllers you display. Don't worry about adding additional windows to a scene unless you come across a clear reason to do so.
upvote count: 4
downvote count: 0
accepted answer of: http://stackoverflow.com/q/75729144
answers question: http://stackoverflow.com/q/75729144
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/75738756
has title: Override Objc NSObject conformance within Swift protocol
answer count: 2
has answer: http://stackoverflow.com/a/75740243
type: Question
upvote count: 1
tagged with: swift
type: UnansweredQuestion
score: 1
favorite count: 0
tagged with: ios
has answer: http://stackoverflow.com/a/75747176
has body: I'm exposing my Swift structs as wrapped classes so I don't pollute my Swift API by converting structs to @objc classes. Since I can't use generics in @objc classes, I'm trying to eliminate some boilerplate code within a protocol to provide features like equality as shown below. However, the function in the protocol extension is not getting called. Can you think of other tricks to accomplish what I'm trying to do? It'd be nice to get rid of the initializer to and move it to a default implementation of the extension too, but I couldn't figure that out either. public protocol InitializableConverter: NSObject { associatedtype SwiftStructType: Equatable var _data: SwiftStructType { get set } init(_ data: SwiftStructType) } extension InitializableConverter { /// Returns object equality if underlying structs are equal func isEqual(_ object: Any?) -> Bool { if let other = object as? Self { return self._data == other._data } return false } } @objc public class UserSettingsObjc: NSObject, InitializableConverter { public var _data: UserSettings required public init(_ data: UserSettings) { _data = data } @objc public var locale: String { _data.locale } } public struct UserSettings: Equatable { public private(set) var locale: String public init(locale: String) { self.locale = locale } } UPDATE: Here are additional methods for context on how it's used: // Original swift method that uses Result<> syntax func call(username: String?, password: String?, completion: @escaping (Result<UserSettings, MyError>) -> Void) { completion(.success(UserSettings(locale: "hello world"))) } // Objc method using non-Result<> syntax (@objc commented out because of playground) @objc func wrappedCall(username: String?, password: String?, completion: @escaping (UserSettingsObjc?, MyErrorObjc?) -> Void) { call(username: username, password: password) { result in callCompletion(completion, with: result) } } // Converting result to non-result via InitializableConverter protocol func callCompletion<T, TOrig…
tagged with: objective-c
downvote count: 0

uitextview
type: Tag
tag name: uitextview
tags question: http://stackoverflow.com/q/75717269
tags question: http://stackoverflow.com/q/78914923
tags question: http://stackoverflow.com/q/79379840

http://stackoverflow.com/comment/133587324
score: 0
type: QuestionComment
type: Comment
has text: @DonMag Thanks for the suggestion again. The form that loads in 15 seconds in iOS only takes about a second in android. This is what is not letting us change the approach. Since, android is working fine, we cannot afford to remake both ios and android just because of an issue in one platform. I can still try the next suggestion for replacing it with labels.
comment on: http://stackoverflow.com/q/75717269

http://stackoverflow.com/comment/133700624
type: QuestionComment
comment on: http://stackoverflow.com/q/75784604
score: 0
has text: @Willeke, what do you mean "is the selector visible"? Visible where? The compiler can't find the selector, so it just flags it as being unknown selectors. In Swift, there is a straightforward syntax for qualifying a selector by the class it belongs to, but I am not aware of a way to do that in Objective-C. (My Objective-C has gotten very rusty.)
type: Comment

http://stackoverflow.com/comment/133596497
score: 1
type: Comment
comment on: http://stackoverflow.com/q/75725732
has text: Is the `MyWindowView` the content view? Do you want to add a border to a view (code) or a window (title of the question)? How do I get a drop target indication on a Finder window?
type: QuestionComment

http://stackoverflow.com/comment/133689848
comment on: http://stackoverflow.com/q/75784604
type: Comment
has text: Is the selector visible? Is the selector in the header of the class and is the header included?
score: 0
type: QuestionComment

gaussian
type: Tag
tag name: gaussian
tags question: http://stackoverflow.com/q/75706059

http://stackoverflow.com/q/75729144
has body: According to Apple's official documentation: A scene is represented by a UIScene object. Apple defines this as: "An object that represents one instance of your app’s user interface" source: https://developer.apple.com/documentation/uikit/uiscene A window is represented by a UIWindow object. Apple defines this as: "The backdrop for your app’s user interface and the object that dispatches events to your views." source: https://developer.apple.com/documentation/uikit/uiwindow So then in this image, is this best represented as one scene containing two windows or two separate scenes? image source: https://developer.apple.com/documentation/uikit/app_and_environment/scenes To my understanding, this is the high-level structure of an iOS application: UIApplication -> UIScene -> UIWindow -> UIView What is the purpose of being able to have both multiple scenes per application and multiple windows per scene? And the differences / distinct usages of the two. Thanks. The Apple documentation is thorough, but I find its definitions and usages of technical terms to be inconsistent. It also doesn't help that there is no clear example code, especially for Objective-C. The Apple documentation archives have a lot of Objective-C introductory material to learn the language, but not actual iOS development using UIKit. I also haven't been able to find a definitive answer from the web either. Any insight is appreciated.
tagged with: window
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/133593432
accepted answer: http://stackoverflow.com/a/75729263
favorite count: 0
has title: What is the difference between a scene and a window in iOS app development?
type: AnsweredQuestion
upvote count: 4
tagged with: uiscene
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/75729263
score: 4
tagged with: scene
tagged with: ios

mac-catalyst
tag name: mac-catalyst
tags question: http://stackoverflow.com/q/75720394
type: Tag
tags question: http://stackoverflow.com/q/76513922
tags question: http://stackoverflow.com/q/76677790
tags question: http://stackoverflow.com/q/77573776
tags question: http://stackoverflow.com/q/78254730
tags question: http://stackoverflow.com/q/78932369
tags question: http://stackoverflow.com/q/79379840

macos
type: Tag
tags question: http://stackoverflow.com/q/75782846
tags question: http://stackoverflow.com/q/75725844
tag name: macos
tags question: http://stackoverflow.com/q/75720394
tags question: http://stackoverflow.com/q/75989522
tags question: http://stackoverflow.com/q/76027766
tags question: http://stackoverflow.com/q/76145278
tags question: http://stackoverflow.com/q/76166846
tags question: http://stackoverflow.com/q/76193081
tags question: http://stackoverflow.com/q/76145816
tags question: http://stackoverflow.com/q/76140643
tags question: http://stackoverflow.com/q/76149338
tags question: http://stackoverflow.com/q/76287510
tags question: http://stackoverflow.com/q/76285850
tags question: http://stackoverflow.com/q/76246627
tags question: http://stackoverflow.com/q/76443344
tags question: http://stackoverflow.com/q/76512900
tags question: http://stackoverflow.com/q/76378869
tags question: http://stackoverflow.com/q/76451404
tags question: http://stackoverflow.com/q/76621276
tags question: http://stackoverflow.com/q/76623872
tags question: http://stackoverflow.com/q/76748425
tags question: http://stackoverflow.com/q/76748378
tags question: http://stackoverflow.com/q/76773759
tags question: http://stackoverflow.com/q/76816843
tags question: http://stackoverflow.com/q/76893657
tags question: http://stackoverflow.com/q/77088641
tags question: http://stackoverflow.com/q/77062432
tags question: http://stackoverflow.com/q/77199867
tags question: http://stackoverflow.com/q/77410043
tags question: http://stackoverflow.com/q/77319718
tags question: http://stackoverflow.com/q/77418597
tags question: http://stackoverflow.com/q/77573776
tags question: http://stackoverflow.com/q/77709334
tags question: http://stackoverflow.com/q/77689811
tags question: http://stackoverflow.com/q/77637622
tags question: http://stackoverflow.com/q/77709979
tags question: http://stackoverflow.com/q/77683794
tags question: http://stackoverflow.com/q/77790334
tags question: http://stackoverflow.com/q/77916083
tags question: http://stackoverflow.com/q/77950769
tags question: http://stackoverflow.com/q/77976279
tags question: http://stackoverflow.com/q/78046487
tags question: http://stackoverflow.com/q/78063975
tags question: http://stackoverflow.com/q/78011219
tags question: http://stackoverflow.com/q/78076129
tags question: http://stackoverflow.com/q/77983169
tags question: http://stackoverflow.com/q/78106703
tags question: http://stackoverflow.com/q/78014996
tags question: http://stackoverflow.com/q/78010035
tags question: http://stackoverflow.com/q/78069138
tags question: http://stackoverflow.com/q/78269843
tags question: http://stackoverflow.com/q/78290156
tags question: http://stackoverflow.com/q/78172699
tags question: http://stackoverflow.com/q/78254753
tags question: http://stackoverflow.com/q/78295722
tags question: http://stackoverflow.com/q/78417644
tags question: http://stackoverflow.com/q/78426105
tags question: http://stackoverflow.com/q/78360107
tags question: http://stackoverflow.com/q/78353070
tags question: http://stackoverflow.com/q/78516082
tags question: http://stackoverflow.com/q/78492779
tags question: http://stackoverflow.com/q/78586575
tags question: http://stackoverflow.com/q/78566066
tags question: http://stackoverflow.com/q/78478022
tags question: http://stackoverflow.com/q/78467796
tags question: http://stackoverflow.com/q/78499204
tags question: http://stackoverflow.com/q/78537820
tags question: http://stackoverflow.com/q/78715945
tags question: http://stackoverflow.com/q/78607713
tags question: http://stackoverflow.com/q/78648329
tags question: http://stackoverflow.com/q/78692256
tags question: http://stackoverflow.com/q/78602533
tags question: http://stackoverflow.com/q/78932369
tags question: http://stackoverflow.com/q/78983850
tags question: http://stackoverflow.com/q/78939676
tags question: http://stackoverflow.com/q/79002502
tags question: http://stackoverflow.com/q/78967569
tags question: http://stackoverflow.com/q/79050151

http://stackoverflow.com/comment/133812350
has text: KSwift can't convert your class to swift enum, it generates class with `Ks` suffix, e.g. `UIStateKs`, and you can convert `UIState` to `UIStateKs` and back using code generated by KSwift.
type: Comment
comment on: http://stackoverflow.com/q/75753778
score: 0
type: QuestionComment

http://stackoverflow.com/comment/133787553
type: QuestionComment
has text: Try adding an exception breakpoint, that should hopefully tell you where the error occurs: https://stackoverflow.com/questions/17802662/
type: Comment
comment on: http://stackoverflow.com/q/75847398
score: 1

http://stackoverflow.com/comment/133680298
type: QuestionComment
has text: Well, I finally got it to work! I really didn't understand how sortedArrayUsingFunction:order worked. Thank you Larme for insisting it would. I spent a lot more time studying how it does work and came up with an approach that works. I'm very grateful to Larme for causing me to try that approach again. Thanks to all for helping with this, it turned out more difficult than I originally thought but now it works perfectly. Sorry about the formatting of the question and response, the web site seems not to be cooperating as it should. Thanks again.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/75761402

http://stackoverflow.com/q/75787854
type: Question
upvote count: 1
tagged with: swift
downvote count: 0
type: UnansweredQuestion
score: 1
favorite count: 0
has title: How to detect/identify when the User clears all the push notifications from the NotificationCenter tray in iOS
tagged with: ios
has comment: http://stackoverflow.com/comment/133690672
has body: We can detect/identify if the User clears each push notification explicitly at func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -&gt; Void) but is there any way that When the User clears all the push notifications at once from the notification center tray. Any help from anyone is very much appreciated. I have tried setting up the UNNotitificationCategory for each push notifications but still no luck in getting this callback at func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -&gt; Void) for clearing all the push notifications at once.
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/75788872
tagged with: apple-push-notifications

http://stackoverflow.com/comment/133602339
type: Comment
comment on: http://stackoverflow.com/q/75728509
type: QuestionComment
has text: might need to, but I'd have to add it conditionally since a lot of the code is already translated to swift, so I'd have to change the casing on all for that. It's old code, so I'd like to avoid touching it...
score: 0

http://stackoverflow.com/comment/133654587
score: 2
type: Comment
comment on: http://stackoverflow.com/q/75761402
has text: Edit your question with input value and desired output, it should be clearer.
type: QuestionComment

unity-game-engine
type: Tag
tags question: http://stackoverflow.com/q/75813181
tag name: unity-game-engine

http://stackoverflow.com/a/75740243
downvote count: 0
has body: You cannot override a method in an extension. If you want to change the default implementation of isEqual, you'll have to subclass NSObject. (If the compiler doesn't force you to include the word override, you're not overriding.) I doubt what you're trying to do is possible in an ObjC bridge, but it definitely cannot be done with an extension.
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/75738756

http://stackoverflow.com/comment/133583764
score: 0
has text: Lots of ways to do something incorrectly and cause problems. If I try to load 1000 4K images, it will take a long time (and problem cause a memory crash). The simple answer is: *"I shouldn't do that."* -- If you are seeing a **4 seconds minimum** difference, then: *"You shouldn't do that."* Evaluate what it is that you're doing and ***why*** you're taking the wrong approach.
type: QuestionComment
comment on: http://stackoverflow.com/q/75717269
type: Comment

http://stackoverflow.com/comment/133700806
score: 0
comment on: http://stackoverflow.com/q/75782846
type: Comment
type: QuestionComment
has text: @TheNextman no dice, adding a runloop doesn't seem to change anything.

http://stackoverflow.com/comment/133573223
comment on: http://stackoverflow.com/q/75717269
has text: Show relevant code in your question. FYI - I have a screen with 8 UITextView instances and that view controller loads instantly. It's certainly not taking .68 seconds per text view to initialize.
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/comment/133590003
type: Comment
comment on: http://stackoverflow.com/q/75725844
score: 0
type: QuestionComment
has text: Nothing in there linking directly to my code... the only thing i have found is that remarking that if statement disabled this problem.

http://stackoverflow.com/comment/133585627
has text: @DonMag I donot have an option to avoid creating multiple textviews. I have explained the scenario as a comment to below answer.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/75717269
type: Comment

http://stackoverflow.com/comment/133521308
comment on: http://stackoverflow.com/a/75685150
score: 0
has text: So I would need to convert my Objective C AppDelegate to one written in swift?
type: AnswerComment
type: Comment

swift-package
type: Tag
tags question: http://stackoverflow.com/q/75837044
tag name: swift-package

http://stackoverflow.com/comment/133589375
type: Comment
type: QuestionComment
has text: When the app crashes, the stack trace should show you the exact line causing the crash.
comment on: http://stackoverflow.com/q/75725844
score: 1

cocoa
tags question: http://stackoverflow.com/q/75761402
type: Tag
tags question: http://stackoverflow.com/q/75734132
tag name: cocoa
tags question: http://stackoverflow.com/q/76073275
tags question: http://stackoverflow.com/q/76287510
tags question: http://stackoverflow.com/q/76285850
tags question: http://stackoverflow.com/q/76443344
tags question: http://stackoverflow.com/q/76546729
tags question: http://stackoverflow.com/q/76860334
tags question: http://stackoverflow.com/q/76748378
tags question: http://stackoverflow.com/q/76748425
tags question: http://stackoverflow.com/q/77045441
tags question: http://stackoverflow.com/q/76893657
tags question: http://stackoverflow.com/q/76953584
tags question: http://stackoverflow.com/q/77095168
tags question: http://stackoverflow.com/q/77062432
tags question: http://stackoverflow.com/q/77319718
tags question: http://stackoverflow.com/q/77256493
tags question: http://stackoverflow.com/q/77556761
tags question: http://stackoverflow.com/q/77688658
tags question: http://stackoverflow.com/q/77705575
tags question: http://stackoverflow.com/q/77644430
tags question: http://stackoverflow.com/q/77637622
tags question: http://stackoverflow.com/q/77916083
tags question: http://stackoverflow.com/q/77894366
tags question: http://stackoverflow.com/q/78099020
tags question: http://stackoverflow.com/q/78063975
tags question: http://stackoverflow.com/q/78136069
tags question: http://stackoverflow.com/q/78010035
tags question: http://stackoverflow.com/q/78104447
tags question: http://stackoverflow.com/q/78091416
tags question: http://stackoverflow.com/q/78241949
tags question: http://stackoverflow.com/q/78254753
tags question: http://stackoverflow.com/q/78353070
tags question: http://stackoverflow.com/q/78417644
tags question: http://stackoverflow.com/q/78516082
tags question: http://stackoverflow.com/q/78556827
tags question: http://stackoverflow.com/q/78681400
tags question: http://stackoverflow.com/q/79050151
tags question: http://stackoverflow.com/q/79002502
tags question: http://stackoverflow.com/q/78983850
tags question: http://stackoverflow.com/q/79217908
tags question: http://stackoverflow.com/q/79118618
tags question: http://stackoverflow.com/q/79100189
tags question: http://stackoverflow.com/q/79189823
tags question: http://stackoverflow.com/q/79213356
tags question: http://stackoverflow.com/q/79228264
tags question: http://stackoverflow.com/q/79269479
tags question: http://stackoverflow.com/q/79286630
tags question: http://stackoverflow.com/q/79270160
tags question: http://stackoverflow.com/q/79327312
tags question: http://stackoverflow.com/q/79412250
tags question: http://stackoverflow.com/q/79305765
tags question: http://stackoverflow.com/q/79334360
tags question: http://stackoverflow.com/q/79457893

keyboard-wedge
tags question: http://stackoverflow.com/q/75735604
type: Tag
tag name: keyboard-wedge

http://stackoverflow.com/comment/133592227
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/75728509
has text: I guess the code generator cannot be configured to emit `NS_SWIFT_NAME`s?
score: 0

http://stackoverflow.com/a/75858090
type: Answer
answers question: http://stackoverflow.com/q/75847398
has body: The runtime error is saying this: I tried to call the method/getter count on an object I supposed had it, but in fact it's a NSString object (__NSCFConstantString being an internal class of Apple for NSString for optimization purposes). And since it doesn't have that method, it will throw a unrecognized selector exception. count being a common method, we could guess, since NSArray has it, that you put a NSString instead of a NSArray somewhere. It could also be a NSString instead of a NSDictionary. Now, let's try your code: You are ignoring compiler warning! Why? If you don't ignore them, you'll see them on: paymentComponent = [paymentComponent enableComponents:@"order-details"]; The warning says: Incompatible pointer types sending 'NSString *' to parameter of type 'NSArray<NSString *> * _Nonnull' If we see the method, it's as said by the warning: - (CFPaymentComponentBuilder * _Nonnull)enableComponents:(NSArray<NSString *> * _Nonnull)components SWIFT_WARN_UNUSED_RESULT; So instead of paymentComponent = [paymentComponent enableComponents:@"order-details"]; paymentComponent = [paymentComponent enableComponents:@"card"]; paymentComponent = [paymentComponent enableComponents:@"upi"]; paymentComponent = [paymentComponent enableComponents:@"wallet"]; paymentComponent = [paymentComponent enableComponents:@"netbanking"]; paymentComponent = [paymentComponent enableComponents:@"emi"]; paymentComponent = [paymentComponent enableComponents:@"paylater"]; Do: let components = @[@"order-details", @"card", @"upi", @"wallet", @"netbanking", @"emi", @"paylater"]; paymentComponent = [paymentComponent enableComponents:components];
score: 0

http://stackoverflow.com/q/75727849
score: 0
answer count: 0
has title: Provide an Objective-C compatibility to non-compliant Swift types
has body: I am trying to understand what would be a good pattern for providing an Objective-C compatibility to non-compliant Swift types. Consider the following example: class Model { var b: Bool? // Optional Bool cannot be marked as @objc var i: Int? // Optional Int cannot be marked as @objc var e: MyEnum // Swift enums, except for Integer type, cannot be marked as @objc } My current naive implementation is: extension Model { @objc func setB(_ value: Bool) { b = value } @objc func unsetB() { b = nil } @objc var isB: NSNumber? { guard let b = b else {return nil }; return NSNumber(value: b) } } That works, but with many properties, this is very tedious to define, and even worse on usage from Objective-C (while in Swift all properties can be provided on init, in Objective-C they would have to be set / unset one by one). So are there any better patterns to provide an Objective-C compatibility to the properties of non-compliant Swift types? Any tips are welcome. Thanks.
tagged with: swift
tagged with: bridging-header
has comment: http://stackoverflow.com/comment/133607042
type: Question
has comment: http://stackoverflow.com/comment/133591392
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/comment/133613391
score: 0
type: Comment
type: QuestionComment
has text: Try this https://stackoverflow.com/a/33215044/1934750
comment on: http://stackoverflow.com/q/75739414

http://stackoverflow.com/comment/133609047
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/75728509
has text: It's only one of the objects with property `Description`. Add category with normal name and use it swift.

http://stackoverflow.com/comment/133535369
comment on: http://stackoverflow.com/q/75686023
score: 0
has text: A simple for loop should do the trick. It's basic algorithm (and quite base to learn). It doesn't work with your code? What code?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/133591970
type: Comment
has text: Where is the `MyWindowView` view in the view hierarchy?
type: QuestionComment
comment on: http://stackoverflow.com/q/75725732
score: 1

http://stackoverflow.com/comment/133797419
score: 0
type: QuestionComment
has text: Thank you for your response. These things seems to be fine. My Objective-C class is visible to the Swift class and vice versa. Also the class from the Swift Package is visible to both. What is causing problems is the inheritance from Objective-C to Swift. The sub class in Swift will not get functions or properties from the Objective-C class when it is using the class from the Swift Package as type.
type: Comment
comment on: http://stackoverflow.com/q/75837044

http://stackoverflow.com/comment/133700588
comment on: http://stackoverflow.com/q/75784604
has text: For the ARC conversion feature, the list of errors is very squirrely. It shows the errors specific to ARC conversion for a few seconds; sometimes it clears the first batch and shows another batch, and then all the conversion errors go away and it reverts to showing normal build warnings. It's maddening, and all but impossible to use.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/133605668
score: 1
type: Comment
has text: Are you saying that you are using `CGRectMake` in Swift code? `CGRectMake` should only be used in Objective-C code, not Swift code. Use `CGRect(x:y:width:height:)` in Swift.
comment on: http://stackoverflow.com/q/75736685
type: QuestionComment

http://stackoverflow.com/comment/133704292
type: Comment
has text: @willeke, there are a bunch of selectors with the same problem. I just checked one of them, and sure enough it is declared in the header of the class that defines it and the .m file that references it imports that header.
comment on: http://stackoverflow.com/q/75784604
score: 0
type: QuestionComment

http://stackoverflow.com/comment/133586146
type: Comment
score: 0
comment on: http://stackoverflow.com/q/75717269
has text: @AmritSidhu - there are big differences between *what I **want** to do* -- *what I **CAN** do* -- *what I **shouldn't** do* -- *what I **CANNOT** do* . Your comment of "an xml might have 20 pages in a form and each page might be having 100 textview to enter data" could be interpreted as **shouldn't** do. I'd recommend re-thinking your approach. Or, since you also say *"also makes use of javascript"* you **could** format it as html and use a `WKWebView`
type: QuestionComment

automatic-ref-counting
tag name: automatic-ref-counting
tags question: http://stackoverflow.com/q/75784604
type: Tag
tags question: http://stackoverflow.com/q/77199317
tags question: http://stackoverflow.com/q/77629081
tags question: http://stackoverflow.com/q/78360107
tags question: http://stackoverflow.com/q/78633101
tags question: http://stackoverflow.com/q/78983850
tags question: http://stackoverflow.com/q/79151429
tags question: http://stackoverflow.com/q/79336530

javascript
type: Tag
tag name: javascript
tags question: http://stackoverflow.com/q/75823143
tags question: http://stackoverflow.com/q/75856290
tags question: http://stackoverflow.com/q/75857334
tags question: http://stackoverflow.com/q/76623872
tags question: http://stackoverflow.com/q/78435889
tags question: http://stackoverflow.com/q/78633210
tags question: http://stackoverflow.com/q/79044693
tags question: http://stackoverflow.com/q/79069233

react-native-firebase
tags question: http://stackoverflow.com/q/75823143
type: Tag
tag name: react-native-firebase

apple-push-notifications
tags question: http://stackoverflow.com/q/75787854
tag name: apple-push-notifications
type: Tag
tags question: http://stackoverflow.com/q/76748378
tags question: http://stackoverflow.com/q/78582894
tags question: http://stackoverflow.com/q/78637226

http://stackoverflow.com/comment/133700593
type: QuestionComment
score: 0
type: Comment
has text: I do in fact have "show live issues" checked.
comment on: http://stackoverflow.com/q/75784604

http://stackoverflow.com/comment/133720808
type: AnswerComment
type: Comment
has text: This doesn’t fix the memory leak; even with this change the application leaks hundreds of megabytes a second during resizing.
comment on: http://stackoverflow.com/a/75801743
score: 0

http://stackoverflow.com/comment/133682433
type: Comment
comment on: http://stackoverflow.com/q/75782846
has text: And the comments on that question/answer link a [specific solution](https://gist.github.com/cmittendorf/2c6eefc6dd128b323428) for your problem.
score: 0
type: QuestionComment

callkit
type: Tag
tags question: http://stackoverflow.com/q/75705049
tag name: callkit
tags question: http://stackoverflow.com/q/75991674
tags question: http://stackoverflow.com/q/77207126
tags question: http://stackoverflow.com/q/78505503

http://stackoverflow.com/comment/133624820
score: 0
comment on: http://stackoverflow.com/a/75747176
type: Comment
has text: This is really good (in a "oh good grief this is horrible" kind of way). I kept mulling around how to pull this off, and this catches the type-erasure trick well with minimal complications.
type: AnswerComment

http://stackoverflow.com/comment/133607042
has text: @HangarRash that has another limitation: they would have to provide _all the parameters_ (since default arguments are not translated from swift to objc). I.e. if I have `init(b: Bool? = true)` it becomes `initWithB:` on objc and they have to provide a value for `b` - not quite convenient either. I guess I will have to have something like a builder pattern interface...
comment on: http://stackoverflow.com/q/75727849
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/133731295
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/75782846
has text: @TheNextman thank you! I wrote "location" when I meant "calendar," which is what that question was about; I have since corrected the mistake. I still have not gotten this to work for location with CLI tool (but it works for both camera and calendar access).

http://stackoverflow.com/comment/133555460
type: Comment
has text: I would expect this to be impossible by design. Apple very rarely allows apps to mess with calls they don't directly control. I'd dig into why your VoIP call doesn't behave correctly when a PSTN call comes in and try to fix that instead. Make sure you're properly responding to audio interruptions: https://developer.apple.com/documentation/callkit/#3730350
score: 0
comment on: http://stackoverflow.com/q/75705049
type: QuestionComment

uiscene
tag name: uiscene
tags question: http://stackoverflow.com/q/75729144
type: Tag

http://stackoverflow.com/comment/133690672
comment on: http://stackoverflow.com/q/75787854
score: 0
type: QuestionComment
has text: No, there is no visibility of the state of notifications that the user doesn't actually interact with
type: Comment

http://stackoverflow.com/a/75747914
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/75739414
type: Answer
answers question: http://stackoverflow.com/q/75739414
score: 2
has body: Long story short - this is a mistake in the class API design. If you want to have a header compatible with Objective-C/Swift, it cannot expose any C++ stuff, such as C++ classes, templates, keywords, etc... There is only Swift - Objective-C interoperability (and sometimes C), but not Swift - Objective-C++ interoperability (there is however Swift - C++ interop project ongoing). On the other hand, you can technically put pre-processor, which may omit any C++ parts from the header, when the compiler-frontend is in another language mode with use of __cpluplus guards: #import &lt;Foundation/Foundation.h&gt; #ifdef __cplusplus class MyCppType; #endif @interface SwiftCancelationToken : NSObject #ifdef __cplusplus @property MyCppType *cppProperty; #endif -(void)doSomethingWithCppObject; @end
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/133601087
comment on: http://stackoverflow.com/q/75725844
type: QuestionComment
has text: I'm sorry can you explain what you mean? I don't understand. Also if i comment just that line out, i still have the problem. The problem only goes away if i comment the if statement out.
type: Comment
score: 0

http://stackoverflow.com/comment/133687210
score: 1
type: Comment
has text: @TheNextman https://github.com/fulldecent/corelocationcli/issues/48#issuecomment-1474512866
comment on: http://stackoverflow.com/q/75782846
type: QuestionComment

objective-c++
tags question: http://stackoverflow.com/q/75739414
type: Tag
tag name: objective-c++
tags question: http://stackoverflow.com/q/76001227
tags question: http://stackoverflow.com/q/75864711
tags question: http://stackoverflow.com/q/76092456
tags question: http://stackoverflow.com/q/77629081
tags question: http://stackoverflow.com/q/78282782
tags question: http://stackoverflow.com/q/78733543
tags question: http://stackoverflow.com/q/79023642
tags question: http://stackoverflow.com/q/79233081
tags question: http://stackoverflow.com/q/79118618
tags question: http://stackoverflow.com/q/79321725
tags question: http://stackoverflow.com/q/79466619

cametallayer
type: Tag
tag name: cametallayer
tags question: http://stackoverflow.com/q/75798736

http://stackoverflow.com/comment/133555940
type: QuestionComment
has text: What is a "normal" image in this context? Typically you'd do this with CIImage. https://developer.apple.com/documentation/coreimage/processing_an_image_using_built-in_filters For a specific example that includes a noise filter, see https://developer.apple.com/documentation/coreimage/simulating_scratchy_analog_film
comment on: http://stackoverflow.com/q/75706059
type: Comment
score: 0

avaudiorecorder
tags question: http://stackoverflow.com/q/75679687
tag name: avaudiorecorder
type: Tag

http://stackoverflow.com/comment/133512488
score: 0
type: QuestionComment
type: Comment
has text: Maybe set it to measurement mode? https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/1616608-measurement
comment on: http://stackoverflow.com/q/75679687

window
tag name: window
tags question: http://stackoverflow.com/q/75729144
type: Tag

http://stackoverflow.com/comment/133560279
has text: Yes, it is not your app's job to decide if an incoming call should be rejected. The user should see a screen that asks them what to do. If they reject the call, ios will handle it. If they choose to end your call and accept the incoming call then ios will send the appropriate event to your app. Is your app using CallKit correctly so that iOS is aware that a VoIP call is in progress?
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/75705049
type: Comment

core-graphics
type: Tag
tags question: http://stackoverflow.com/q/75706059
tag name: core-graphics
tags question: http://stackoverflow.com/q/76193081
tags question: http://stackoverflow.com/q/76568196
tags question: http://stackoverflow.com/q/77915637
tags question: http://stackoverflow.com/q/78014194
tags question: http://stackoverflow.com/q/78824958
tags question: http://stackoverflow.com/q/78822765
tags question: http://stackoverflow.com/q/78825520
tags question: http://stackoverflow.com/q/79135637

tapkey
tags question: http://stackoverflow.com/q/75685030
tag name: tapkey
type: Tag

uikit
type: Tag
tag name: uikit
tags question: http://stackoverflow.com/q/75736685
tags question: http://stackoverflow.com/q/76002388
tags question: http://stackoverflow.com/q/76149831
tags question: http://stackoverflow.com/q/76197050
tags question: http://stackoverflow.com/q/76199112
tags question: http://stackoverflow.com/q/76536415
tags question: http://stackoverflow.com/q/76901088
tags question: http://stackoverflow.com/q/77420684
tags question: http://stackoverflow.com/q/77703429
tags question: http://stackoverflow.com/q/77614453
tags question: http://stackoverflow.com/q/77600151
tags question: http://stackoverflow.com/q/77974177
tags question: http://stackoverflow.com/q/78091125
tags question: http://stackoverflow.com/q/78081552
tags question: http://stackoverflow.com/q/78383595
tags question: http://stackoverflow.com/q/78412848
tags question: http://stackoverflow.com/q/78585460
tags question: http://stackoverflow.com/q/78763503
tags question: http://stackoverflow.com/q/78932369
tags question: http://stackoverflow.com/q/79042128
tags question: http://stackoverflow.com/q/79144762
tags question: http://stackoverflow.com/q/79376958
tags question: http://stackoverflow.com/q/79379840
tags question: http://stackoverflow.com/q/79519362

http://stackoverflow.com/comment/133608579
type: Comment
comment on: http://stackoverflow.com/q/75736685
score: 0
type: QuestionComment
has text: Agreed - so how can we get warnings to that effect? Possible?

afnetworking
type: Tag
tag name: afnetworking
tags question: http://stackoverflow.com/q/75714226
tags question: http://stackoverflow.com/q/75986813

firebase-cloud-messaging
tags question: http://stackoverflow.com/q/75823143
type: Tag
tag name: firebase-cloud-messaging

http://stackoverflow.com/comment/133704347
has text: I managed to slog through all the conversion warnings by quickly taking a screen-shot while they were on screen and then fixing them one by one. (For the selector errors I used `NSSelectorFromString:` to get around them.) Now that I have finished the ARC conversion, I just tried, and I am able to go back to `@selector()` syntax and it works. The ARC converter seems to not have been able to find the functions in their owning classes but the normal compiler on an ARC project does.
comment on: http://stackoverflow.com/q/75784604
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/133788085
type: QuestionComment
score: 1
type: Comment
comment on: http://stackoverflow.com/q/75847398
has text: Do you have the stacktrace? From what I guess, at some point, your are using setting a `NSString` where it should be an `NSArray` (or any other class with a `count` method/getter). I don't use CashFree, but check the code, if it uses a value in a plist, it could be there, or also if there a "cloud" values, there too.

core-location
type: Tag
tag name: core-location
tags question: http://stackoverflow.com/q/75782846
tags question: http://stackoverflow.com/q/76615959

http://stackoverflow.com/comment/133591392
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/75727849
score: 0
has text: What about adding an `init` that takes an `NSNumber` parameter for each optional `Bool` or `Int`?

cgrectmake
tag name: cgrectmake
type: Tag
tags question: http://stackoverflow.com/q/75736685

http://stackoverflow.com/comment/133589368
type: QuestionComment
comment on: http://stackoverflow.com/q/75717269
has text: @AmritSidhu - ***15 seconds in iOS** only takes about a second in android*??? Gotta wonder what else you are doing that is taking up so much time. Maybe use a table view and split your "20 pages" into 20 rows... or, "20 pages" into 20 sections and split "page" elements into rows.
type: Comment
score: 0

http://stackoverflow.com/comment/133776677
score: 0
has text: @Shawn the missing `_data` property is just a typo, somehow it got lost when I posted the answer. What are the problems you have with the new code you added to the question?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/75747176

voip
tags question: http://stackoverflow.com/q/75705049
tag name: voip
type: Tag

http://stackoverflow.com/comment/133781938
type: QuestionComment
comment on: http://stackoverflow.com/q/75837044
score: 0
has text: Interface of Objective-C class that needs to be visible by swift must be imported in the bridging header file in your project. On the other direction, Swift class are automatically converted to Objective-C interface in the Project-Swift.h file which must be included in Objective-C or prefix header.
type: Comment

command-line-interface
type: Tag
tags question: http://stackoverflow.com/q/75782846
tag name: command-line-interface
tags question: http://stackoverflow.com/q/77683794

http://stackoverflow.com/comment/133721023
comment on: http://stackoverflow.com/a/75801743
type: AnswerComment
has text: @LunaRazzaghipour If you invoke clang from the command line, it does default to ARC being disabled and you must manually add the -fobjc-arc argument.
score: 1
type: Comment

http://stackoverflow.com/comment/133648889
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/75761402
type: Comment
has text: int i; NSString *arg1 = [NSString stringWithString:@"String1"]; NSNumber *arg2 = [NSNumber numberWithInt:1]; NSString *arg3 = [NSString stringWithString:@"String2"]; NSArray *arrayElement = [NSArray arrayWithObjects:arg1, arg2, arg3, nil]; NSArray *arrayToSort = [NSArray arrayWithObject:arrayElement]; for (i = 0; i < 99; i++) { [arrayToSort addObject:arrayElement]; } // arrayToSort now has 101 arrayElements in it // I want arrayToSort to be sorted alphabetically on the characters in arg1

http://stackoverflow.com/comment/133731764
type: AnswerComment
comment on: http://stackoverflow.com/a/75801743
score: 1
type: Comment
has text: I added some `(__bridge)` casts and recompiled with the flag, and that solved it. Thank you so much!

http://stackoverflow.com/a/75714509
score: 0
answers question: http://stackoverflow.com/q/75714226
type: Answer
has body: The problem here isn't related to the selector. It's the serialized value. It's likely that the encoder used -encodeInteger:forKey:, so the actual thing encoded is an integer, not an NSNumber. When you then decode it as an NSNumber (an object), it's complaining that the types mismatch. Make sure that your encoding and decoding logic match.

http://stackoverflow.com/comment/133586486
comment on: http://stackoverflow.com/q/75717269
score: 0
type: QuestionComment
type: Comment
has text: @AmritSidhu - well, if you cannot change the approach, you're kind of out-of-luck. Another suggestion would be to use labels, and only display a `UITextVIew` when editing... but that would be changing "the complete approach." So... it sounds like you need to add some sort of animated progress view to let the user know your code is formatting the UI.

microphone
type: Tag
tags question: http://stackoverflow.com/q/75679687
tag name: microphone

http://stackoverflow.com/comment/133595090
type: QuestionComment
has text: Please provide enough code so others can better understand or reproduce the problem.
comment on: http://stackoverflow.com/q/75720394
type: Comment
score: 0

http://stackoverflow.com/comment/133605856
type: QuestionComment
comment on: http://stackoverflow.com/q/75736685
score: 0
type: Comment
has text: Yes, I know that. It was not I, but another dev who was using it, not that it matters. Yes, it's Swift code. The point is, using the Obj-C initializer does NOT produce an error except on the build server. Was it excluded in Xcode13 but not excluded in Xcode14 for some reason? What other explanation could there be? Why are we not getting that error message in Xcode14?

http://stackoverflow.com/comment/133585597
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/75717269
type: Comment
has text: @HangarRash I have attached a demo project that recreates this issue. And the time profiler shows isn't per UITextView. It's the time takes to load 1000 UITextViews.

http://stackoverflow.com/comment/139618060
comment on: http://stackoverflow.com/a/75801743
has text: I noticed this in a Swift project as well! Had to wrap the DisplayLink callback code in autorelease (inside the callback), and it was fixed. Didn't know have to do it from Swift too! -- edit typos
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/133685578
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/75782846
has text: Maybe take a look at [this project](https://github.com/fulldecent/corelocationcli) also
type: Comment

nscoder
tag name: nscoder
tags question: http://stackoverflow.com/q/75714226
type: Tag

bluetooth
tags question: http://stackoverflow.com/q/75735604
tag name: bluetooth
type: Tag
tags question: http://stackoverflow.com/q/75989522
tags question: http://stackoverflow.com/q/76461631
tags question: http://stackoverflow.com/q/76577713
tags question: http://stackoverflow.com/q/78502092
tags question: http://stackoverflow.com/q/79317378

audio
tags question: http://stackoverflow.com/q/75849831
type: Tag
tag name: audio
tags question: http://stackoverflow.com/q/78303864
tags question: http://stackoverflow.com/q/78733543

avkit
tags question: http://stackoverflow.com/q/75863219
type: Tag
tag name: avkit

http://stackoverflow.com/a/76001255
has comment: http://stackoverflow.com/comment/134052588
downvote count: 0
has comment: http://stackoverflow.com/comment/134059831
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/134050629
type: Answer
has body: You need to import AVFoundation into your Swift file that uses AVCapturePhotoCaptureDelegate, not your ObjC++. In MyCamera.swift you want import AVFoundation. Looking at your repo, you created a prefix header, but didn't configure the project to use it. // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. The build setting you want is in the general pane: It's called GCC_PREFIX_HEADER.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/76001227
answers question: http://stackoverflow.com/q/76001227
score: 1
has comment: http://stackoverflow.com/comment/134044011

http://stackoverflow.com/comment/134029644
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/75989522
has text: Do you want to know if Bluetooth is switched on in the system prefs?

http://stackoverflow.com/q/76026075
has comment: http://stackoverflow.com/comment/134283756
tagged with: xcode
favorite count: 0
has comment: http://stackoverflow.com/comment/134274262
tagged with: flutter
has title: Can't compile due to no such module '__ObjC'
answer count: 2
score: 5
tagged with: ios-simulator
has comment: http://stackoverflow.com/comment/134268522
has body: I'm trying to build for iOS in flutter. However, the compilation could not be completed because the module __ObjC was not found. Launching lib/main.dart on iPhone 13 Pro Max in debug mode... main.dart:1 Xcode build done. 42.7s Failed to build iOS app Swift Compiler Error (Xcode): Using bridging headers with module interfaces is unsupported Uncategorized (Xcode): Command SwiftDriver emitted errors but did not return a nonzero exit code to indicate failure Error (Xcode): no such module '__ObjC' /Users/myname/Library/Developer/Xcode/DerivedData/Runner-gnvomxdvkbnvhiftqgeatxtbshib/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/arm64/Runner.private.swiftinterface:11:18 Error (Xcode): failed to verify module interface of 'Runner' due to the errors above; the textual interface may be broken by project issues or a compiler bug /Users/myname/Library/Developer/Xcode/DerivedData/Runner-gnvomxdvkbnvhiftqgeatxtbshib/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/arm64/Runner.private.swiftinterface:0:0 Error (Xcode): no such module '__ObjC' /Users/myname/Library/Developer/Xcode/DerivedData/Runner-gnvomxdvkbnvhiftqgeatxtbshib/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/arm64/Runner.swiftinterface:11:18 Error (Xcode): failed to verify module interface of 'Runner' due to the errors above; the textual interface may be broken by project issues or a compiler bug /Users/myname/Library/Developer/Xcode/DerivedData/Runner-gnvomxdvkbnvhiftqgeatxtbshib/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/arm64/Runner.swiftinterface:0:0 Could not build the application for the simulator. Error launching application on iPhone 13 Pro Max. Exited What is __ObjC? This happens after upgrading Xcode version to 14.3. How can this be fixed? Please someone answer. [✓] Flutter (Channel stable, 3.7.6, on macOS 13.3.1 22E261 darwin-arm…
upvote count: 5
tagged with: ios
type: Question
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134202930
has answer: http://stackoverflow.com/a/76389997
has answer: http://stackoverflow.com/a/78063804
downvote count: 0

http://stackoverflow.com/a/75989339
answers question: http://stackoverflow.com/q/75987263
has body: In Objective-C, any object reference can be nil, and any call to an object initializer must cope with the possibility that nil might be returned. In Swift, therefore, every Objective-C object would theoretically need to be an Optional — and in Swift 1 this was indeed the case: They were all implicitly unwrapped Optionals. Later, though, every single Objective-C object reference in Swift was hand-tweaked to be either a normal Optional or an ordinary non-Optional, depending on whether it could truly ever by nil or not. Well, the object that you get when you call dispatch_group_create() therefore can theoretically be nil, in fact it never will be. The creators of the Swift-style DispatchQueue code knew this, and so the DispatchGroup initializer is not nullable.
score: 2
has comment: http://stackoverflow.com/comment/134024382
downvote count: 0
has comment: http://stackoverflow.com/comment/134025352
has comment: http://stackoverflow.com/comment/134028477
has comment: http://stackoverflow.com/comment/134025316
type: AcceptedAnswer
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/134023831
accepted answer of: http://stackoverflow.com/q/75987263

http://stackoverflow.com/comment/133860231
has text: Ii'm wondering if you need to draw in main thread: `dispatch_async(dispatch_get_main_queue(), ^{ [self doitnowpdf]; });`?
comment on: http://stackoverflow.com/q/75857765
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/a/77291613
has comment: http://stackoverflow.com/comment/140032801
upvote count: 41
score: 41
answers question: http://stackoverflow.com/q/75943541
downvote count: 0
has comment: http://stackoverflow.com/comment/136347366
type: Answer
has comment: http://stackoverflow.com/comment/138227888
has body: I have faced the same issue and below fix worked for me. I am able to build and run the project successfully by disabling Strict Prototypes in your Pods Project Settings. Pods =&gt; Build settings =&gt; Strict Prototypes =&gt; set to NO

http://stackoverflow.com/comment/134836456
score: 0
type: AnswerComment
type: Comment
has text: @user129393192 It does indirectly since it is a non-prototype format and the compiler can't know the types passed until it finds a function definition. But this was never really a "feature", just a language flaw.
comment on: http://stackoverflow.com/a/76371638

http://stackoverflow.com/comment/134125318
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/76038505
has text: under what heading in xcode? Where do i find this?

http://stackoverflow.com/a/75944602
downvote count: 0
accepted answer of: http://stackoverflow.com/q/75857765
answers question: http://stackoverflow.com/q/75857765
has comment: http://stackoverflow.com/comment/134088649
score: 1
type: AcceptedAnswer
type: Answer
has body: It sounds like the issue you are facing is related to an asynch programming one. The getDataInBackgroundWithBlock method that downloads the PDF is asynch, meaning that it runs in background and is not blocking the main thread. This is okay as it prevents the freezing effect in the app, however, this means that the code that renders the PDF is executed prior the PDF itself is ready, which could be the issue here. The 5-secs is a workaround but the condition of download in 5 secs is not a warranty that this is enough to have it downloaded always as depends on the network conditions. I would recommend a completion block that is executed when the PDF is ready. You can do the next: - (void)sermonTime { if (theImageView.hidden == NO) { theImageView.hidden = YES; } if ([self.entry[@"SermonPresIncluded"] isEqualToString:@"NO"]) { //there are some instances where there is no PDF to download, following method just displays black screen [self blankTime]; } else { NSLog(@"SermonTime"); PFFileObject *thumbnail = self.entry[@"SermonPDF"]; NSString *tempDir = NSTemporaryDirectory(); NSString *pdfPath = [[tempDir stringByAppendingPathComponent:[self.entry valueForKey:@"DateOfService"]] stringByAppendingString:@".pdf"]; [thumbnail getDataInBackgroundWithBlock:^(NSData *imageData, NSError *error) { if (error) { NSLog(@"Error downloading PDF: %@", error); [self blankTime]; } else { [imageData writeToFile:pdfPath atomically:YES]; NSURL *pdfURL = [NSURL fileURLWithPath:pdfPath]; [self drawPDFWithURL:pdfURL completion:^{ self.view.backgroundColor = [UIColor blackColor]; }]; } }]; } } and drawPDFWithURL is like this - (void)drawPDFWithURL:(NSURL *)url completion:(void (^)(void))completionBlock { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ CGPDFDocumentRef pdfDocument = CGPDFDocumentCreateWithURL((__bridge CFURLRef)url); size_t pageCount = CGPDFDocumentGetNumberOfPages(pdfDocument); if (pageCount == 0) { NSLog(@"Error: PDF has no pages"); return; } // D…
has comment: http://stackoverflow.com/comment/133998141
upvote count: 1

http://stackoverflow.com/a/75858271
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/75857334
score: 1
downvote count: 0
has body: In general if you want to dereference a pointer like args[3] in Frida you can simply execute readPointer() from Frida NativePointer API: args[3].readPointer() Unfortunately you are trying to hook the parameter response which is an Out parameter for the URL. That means it will contain the result after the method has been executed. Thus accessing it in onEnter will not work. You have to do it in onLeave: Interceptor.attach(ObjC.classes[className][`+ ${methodName}`].implementation, { onEnter: function (args) { this.savedArg = args[3]; // save argument for onLeave }, onLeave: function (retval) { const responsePtr = prt(this.savedArg).readPointer(); // ptr just to make sure const response = new ObjC.Object(responsePtr); console.log('URL', response.URL()); } }) Not sure if this code will work, just give it a try...

http://stackoverflow.com/comment/133945801
type: QuestionComment
type: Comment
has text: It register the message to its database, so you'd need to ask the database the last event registered. I don't know if Firebase provides a method to do so...
score: 0
comment on: http://stackoverflow.com/q/75940769

http://stackoverflow.com/q/75940769
tagged with: xcode
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/133945801
has body: This is a very simple issue I'm having, but I can't find anything about how to log an event like this in my debug console. This is what I am trying to po: I've tried accessing the logEvent message and selectedValueenter image description here anyway I could think to and nothing seems to be working.
tagged with: objective-c
tagged with: firebase
answer count: 0
has comment: http://stackoverflow.com/comment/133947620
tagged with: debugging
score: 0
has title: Attempting to po a firebase log event on my Xcode debug console
tagged with: console
type: Question

http://stackoverflow.com/q/76016717
has body: Cannot attach a pdf file and open it in gmail app. The gmail app is opening, but the attached file is missing. The code used is: NSString *pdfPath = [[NSBundle mainBundle] pathForResource:@"MyFile" ofType:@"pdf"]; NSData *pdfData = [NSData dataWithContentsOfFile:pdfPath]; NSString *pdfBase64 = [pdfData base64EncodedStringWithOptions:0]; NSString *gmailScheme = [NSString stringWithFormat:@"googlegmail:///co?to=&subject=&body=&attachment=%@", pdfBase64]; NSURL *gmailURL = [NSURL URLWithString:gmailScheme]; if ([[UIApplication sharedApplication] canOpenURL:gmailURL]) { [[UIApplication sharedApplication] openURL:gmailURL options:@{} completionHandler:nil]; }
answer count: 0
has title: Can't attach a pdf file in gmail using Objective C
score: 0
has comment: http://stackoverflow.com/comment/134070877
type: Question
tagged with: gmail
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134111160
has comment: http://stackoverflow.com/comment/134119893
tagged with: ios
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134072092

http://stackoverflow.com/comment/134202807
has text: Can you clarify where you added this? Thx
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/75917950

http://stackoverflow.com/q/75949482
has answer: http://stackoverflow.com/a/75949640
accepted answer: http://stackoverflow.com/a/75949640
has comment: http://stackoverflow.com/comment/133958656
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/133958856
tagged with: ios
has body: I encountered a weird thing. The colour of my custom image was changed in the running app! The original colour of the alert bell image is red as shown. However, when the app runs, the colour of that bell changes to blue! The code to add the image is as follows: UIImage *alertImage = [UIImage imageNamed:@"alert_bell"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:alertImage]; [imageView setBackgroundColor:[UIColor redColor]]; UIGestureRecognizer *tapGR = [[UIGestureRecognizer alloc] initWithTarget:self action:@selector(disruptionsAlertAction:)]; [self.view addGestureRecognizer:tapGR]; cell.accessoryView = imageView; // cell is a TableViewCell I have idea what changed the colour if the bell and how to fix. I would very much appreciate it if anyone can please explain this and let me know how I can fix it. Heaps of thanks!
type: Question
answer count: 1
tagged with: objective-c
has title: Why was the colour of image changed in iOS app?
score: 0

http://stackoverflow.com/q/75989522
accepted answer: http://stackoverflow.com/a/75995700
score: -2
has title: macOS check is Bluetooth is supported programmatically
has comment: http://stackoverflow.com/comment/134026736
has comment: http://stackoverflow.com/comment/134024811
tagged with: bluetooth
type: Question
tagged with: swift
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/134024278
tagged with: macos
has comment: http://stackoverflow.com/comment/134033847
favorite count: 0
has answer: http://stackoverflow.com/a/75995700
downvote count: 3
has comment: http://stackoverflow.com/comment/134025599
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/134025290
has comment: http://stackoverflow.com/comment/134029644
tagged with: objective-c
has body: I need to determine if the bluetooth is supported on macOS in Objective-C or Swift ? Thanks

http://stackoverflow.com/a/75997487
has body: It may well be that the object is released, when the completion handler is invoked. To know for sure, more code snippets would be needed. You should either check for self being nil at the beginning of the completion handler. Or you should ensure, that the reference to the instance is strongly held, so it does not get released until the completion handler is called. One pattern to ensure, that a reference is weak until the completion handler starts and then is held on strongly while it executes is this: __weak typeof(self) weakSelf = self; [someObj someCall:^{ __strong typeof(self) strongSelf = weakSelf; if (strongSelf == nil) return; ... }]; Hope this helps.
has comment: http://stackoverflow.com/comment/134044027
answers question: http://stackoverflow.com/q/75986813
score: 0
type: Answer

http://stackoverflow.com/comment/134026736
score: 1
type: Comment
has text: What specific programmatic thing "like LInux" do you mean? What C code would you write on Linux that would do what you mean? (Bluetooth is a broad topic that includes several somewhat unrelated protocols. BLE is not the same as BT Audio is not the same as a BT network adapter. Perhaps `system_profiler SPBluetoothDataType` is what you're looking for?
type: QuestionComment
comment on: http://stackoverflow.com/q/75989522

http://stackoverflow.com/a/76011793
score: 1
has comment: http://stackoverflow.com/comment/134065394
has comment: http://stackoverflow.com/comment/134064043
downvote count: 0
type: AcceptedAnswer
type: Answer
has body: The value you provide for the title in the initialiser is copied to the alert's title. Changing the value in the provided variable won't change the title. You can set a new value to alert.title directly. UIAlertController *alert = [UIAlertController alertControllerWithTitle:Value message:nil preferredStyle:UIAlertControllerStyleAlert]; // Alert = 1 UIViewController *topController = [UIApplication sharedApplication].keyWindow.rootViewController; [topController presentViewController:alert animated:YES completion:nil]; alert.title = @"2";
accepted answer of: http://stackoverflow.com/q/76011701
upvote count: 1
has comment: http://stackoverflow.com/comment/134061813
answers question: http://stackoverflow.com/q/76011701

http://stackoverflow.com/a/76371565
type: Answer
downvote count: 4
upvote count: 3
answers question: http://stackoverflow.com/q/75943541
has body: add (void) in every function this error occur on
score: -1

http://stackoverflow.com/a/76371638
has body: What it says - functions of the form void func () rather than void func (void) have been flagged as obsolescent by the C standard since the year 1990. So you should (for now) never write functions with an empty parenthesis in C. Unlike C++ where the two forms are equivalent. In the upcoming C23 standard this will no longer be an issue since the old "K&R style" functions are finally removed from the C language and void func () will get treated as if you typed void func (void).
type: Answer
answers question: http://stackoverflow.com/q/75943541
upvote count: 8
has comment: http://stackoverflow.com/comment/134834959
has comment: http://stackoverflow.com/comment/134850568
has comment: http://stackoverflow.com/comment/134859458
score: 8
has comment: http://stackoverflow.com/comment/134864139
downvote count: 0
has comment: http://stackoverflow.com/comment/134850752
has comment: http://stackoverflow.com/comment/134850981
has comment: http://stackoverflow.com/comment/134850704
has comment: http://stackoverflow.com/comment/134864266
has comment: http://stackoverflow.com/comment/134850697
has comment: http://stackoverflow.com/comment/134864255
has comment: http://stackoverflow.com/comment/134850564
has comment: http://stackoverflow.com/comment/134848907
has comment: http://stackoverflow.com/comment/134850652
has comment: http://stackoverflow.com/comment/134836456

http://stackoverflow.com/comment/134859458
comment on: http://stackoverflow.com/a/76371638
score: 0
has text: Understood. So it's just the idea of uniformity that is now being upheld. So back to the original `int main() {}`, it seems like that's been saying that it takes no parameters in C17 (definition-attached), so it is strange to me that the compiler (clang) would yell at me for it.
type: AnswerComment
type: Comment

vimage
tags question: http://stackoverflow.com/q/76022262
tag name: vimage
type: Tag
tags question: http://stackoverflow.com/q/79518919

http://stackoverflow.com/q/75962915
linked to: http://stackoverflow.com/q/41243007
has comment: http://stackoverflow.com/comment/133995440
downvote count: 1
type: Question
upvote count: 1
has title: how to downcase rootviewcontroller from appdelegate to define NSPersistentContainer in Objective C
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134012180
favorite count: 0
has comment: http://stackoverflow.com/comment/134008184
tagged with: ios
has comment: http://stackoverflow.com/comment/133995431
tagged with: core-data
has comment: http://stackoverflow.com/comment/134027760
score: 0
has comment: http://stackoverflow.com/comment/134043526
has body: I'm trying to follow the steps Setting Up a Core Data Stack documentation for setting up Core Data using Objective-C but it appears to only show Swift implementation. The main view controller I have is of class TodoListTableViewController, which is embedded in a navigation controller like so: Application Entry Point->UINavigationController->TodoListTableViewController I tried defining my -[UIApplicationDelegate application:didFinishLaunchingWithOptions:] like so: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. if (self.persistentContainer == nil) { [NSException raise:@"did not initialize persistent container in app delegate" format:@"no init"]; } UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; TodoListTableViewController *todoListVC = [mainStoryboard instantiateViewControllerWithIdentifier:@"TodoListTableViewController"]; todoListVC.persistentContainer = self.persistentContainer; UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:todoListVC]; self.window.rootViewController = navController; return YES; } but I'm getting a missing container exception since I added a check for the existence of persistentContainer in TodoListTableViewController class like so: - (void)viewDidLoad { [super viewDidLoad]; if (self.persistentContainer == nil) { [NSException raise:@"missing container" format:@"missing container"]; } } EDIT: below is the boilerplate Ccore Data related code in my AppDelegate class for adding both the persistent container and context generated by Xcode when opting in for Core Data, that I'm using: @synthesize persistentContainer = _persistentContainer; - (NSPersistentContainer *)persistentContainer { // The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. @sync…
answer count: 0
has comment: http://stackoverflow.com/comment/133980909
has comment: http://stackoverflow.com/comment/133981687
has comment: http://stackoverflow.com/comment/134011273

http://stackoverflow.com/a/75869473
has body: The property is not required to be an Objective-C property, but you anyway need an Objective-C class to conform to the YMAInterstitialAdDelegate protocol which the YMAInterstitialAd object apparently requires in order to initialize itself. Provided you compile the code with Objective-C++ syntax flag, you can just do the initialisation as follows: class YandexIosInterstitialAd : public InterstitialAd { public: YandexIosInterstitialAd(): delegate{ [TDWAdDelegate new] }, interstitialAd{ [[YMAInterstitialAd alloc] initWithAdUnitID:&lt;your unique AdUnitId&gt;] } { interstitialAd.delegate = delegate; [interstitialAd load]; } private: id&lt;YMAInterstitialAdDelegate&gt; delegate; YMAInterstitialAd *interstitialAd; }; Be advised, that ARC knows how and when to release the Cocoa objects, even if they are C++ class members, so you don't commonly need to do it manually. TDWAdDelegate in this case is just another Objective-C class which implements the YMAInterstitialAd protocol and looks something like that: @interface TDWAdDelegate : NSObject &lt;YMAInterstitialAdDelegate&gt; - (void)interstitialAdDidLoad:(YMAInterstitialAd *)interstitialAd; - (void)interstitialAdDidClick:(nonnull YMAInterstitialAd *)interstitialAd; /* ...other methods which your implementation requires... */ @end @implementation TDWAdDelegate - (void)interstitialAdDidLoad:(YMAInterstitialAd *)interstitialAd { // your implementation goes here } - (void)interstitialAdDidClick:(nonnull YMAInterstitialAd *)interstitialAd { // another method implementation } /* ...other methods which your implementation requires... */ @end
upvote count: 1
has comment: http://stackoverflow.com/comment/133827349
answers question: http://stackoverflow.com/q/75864711
has comment: http://stackoverflow.com/comment/133825987
downvote count: 0
accepted answer of: http://stackoverflow.com/q/75864711
score: 1
type: AcceptedAnswer
type: Answer

avplayerviewcontroller
tags question: http://stackoverflow.com/q/75985811
tag name: avplayerviewcontroller
type: Tag
tags question: http://stackoverflow.com/q/76555630

http://stackoverflow.com/comment/134073010
type: QuestionComment
comment on: http://stackoverflow.com/q/76002388
has text: I can't reproduce this. In my own app, if I pass an array with a file NSURL for a local video (a .mov file originally selected from the photo library) and the same string shown in your question, then when the activity view appears, selecting Messages results in the New Message screen appearing and the message contains the text followed by the video. Selecting Mail also shows a new email screen with the text and the video both in place in the message body. I tested this with an Objective-C app on a real iPhone 13 Pro running iOS 16.4.1.
type: Comment
score: 0

http://stackoverflow.com/q/75985811
tagged with: objective-c
tagged with: avplayer
has title: ios 16 lockscreen playbutton is disabled but working fine with ios15 (iphone11)
type: Question
has comment: http://stackoverflow.com/comment/134031889
type: UnansweredQuestion
tagged with: ios16
tagged with: lockscreen
answer count: 0
has body: I have used avplayer and avplayerViewController to play a video from url. I can control lockscreen play/pause button through avaudiosession as below-- [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&amp;sessionError]; [[AVAudioSession sharedInstance] setActive:YES error:nil]; [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; Its working fine with iphone having ios 15, can control play/pause from lockscreen. But in ios 16 iphone , the play/pause button is disabled. Can anyone please help me why its not working with ios 16.
tagged with: avplayerviewcontroller
score: 0
has comment: http://stackoverflow.com/comment/134034196

http://stackoverflow.com/comment/134074438
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76002388
has text: I essentially used your code. I just created the `NSURL` from my own file path to a .mov file stored within the app's sandbox. The key difference seems to be iOS 15.6.1 vs 16.4.1. I can't imagine the mp4 vs mov makes any difference.

http://stackoverflow.com/comment/134025599
score: 0
comment on: http://stackoverflow.com/q/75989522
type: QuestionComment
type: Comment
has text: It's possible or not to detect is the the bluetooth adapter is active or inactive like Linux ?

http://stackoverflow.com/comment/133817829
comment on: http://stackoverflow.com/q/75864711
type: Comment
score: 0
has text: @where do I define `@property` then?
type: QuestionComment

http://stackoverflow.com/q/75857765
answer count: 1
tagged with: http://stackoverflow.com/tag/pdf
favorite count: 0
type: AnsweredQuestion
tagged with: objective-c
downvote count: 0
tagged with: parse-platform
has title: Downloaded PDF Not Accessible
upvote count: 2
tagged with: pfquery
tagged with: tvos
has answer: http://stackoverflow.com/a/75944602
accepted answer: http://stackoverflow.com/a/75944602
score: 2
has comment: http://stackoverflow.com/comment/133860231
type: Question
has body: My tvOS app is set up with the main capability being drawing PDFs of music sheets that are already embedded into the app itself. There are multiple options here, as it can possibly only display certain verses of the song. The code I use for this is: - (void)drawDocument:(CGPDFDocumentRef)pdfDocument { NSLog(@"draw document"); // Get the total number of pages for the whole PDF document int totalPages= (int)CGPDFDocumentGetNumberOfPages(pdfDocument); if ([[self.arrayOfVerses firstObject] isEqualToString:@"allverses"]) { //This is if all verses have been picked and it will do the entire PDF NSLog(@"draw document all verses %d", totalPages); self.pages = totalPages; self.subtractingPages = totalPages - 1; NSMutableArray *pageImages = [[NSMutableArray alloc] init]; // Iterate through the pages and add each page image to an array for (int i = 1; i <= totalPages; i++) { // Get the first page of the PDF document CGPDFPageRef page = CGPDFDocumentGetPage(pdfDocument, i); CGRect pageRect = CGPDFPageGetBoxRect(page, kCGPDFMediaBox); // Begin the image context with the page size // Also get the grapgics context that we will draw to UIGraphicsBeginImageContext(pageRect.size); CGContextRef context = UIGraphicsGetCurrentContext(); // Rotate the page, so it displays correctly CGContextTranslateCTM(context, 0.0, pageRect.size.height); CGContextScaleCTM(context, 1.0, -1.0); CGContextConcatCTM(context, CGPDFPageGetDrawingTransform(page, kCGPDFMediaBox, pageRect, 0, true)); // Draw to the graphics context CGContextDrawPDFPage(context, page); // Get an image of the graphics context UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); [pageImages addObject:image]; } // Set the image of the PDF to the current view [self addImagesToScrollView:pageImages]; } else { //Only a certain number of verses self.pages = [self.arrayOfVerses count]; self.subtractingPages = self.pages - 1; NSLog (@"total pages %ld", (long)self.pages); NSMutableArray *pageImages = [[…

firebase
tags question: http://stackoverflow.com/q/75940769
type: Tag
tag name: firebase
tags question: http://stackoverflow.com/q/76512900
tags question: http://stackoverflow.com/q/78192465
tags question: http://stackoverflow.com/q/78293837
tags question: http://stackoverflow.com/q/79017759
tags question: http://stackoverflow.com/q/78976697
tags question: http://stackoverflow.com/q/79100926
tags question: http://stackoverflow.com/q/79463591

http://stackoverflow.com/q/75987263
type: Question
tagged with: swift
downvote count: 0
has body: I noticed a disparity between the Swift API for dispatch groups and the Objective-C API. The init() for DispatchGroup() returns a non optional value. But the Objective-C dispatch_group_create() mentions a possibility for a NULL return: Return Value The newly created group, or NULL on failure. What might cause the Objective-C function to fail? What behind the scenes issues could cause the creation of the group to not be possible? Why is the Swift version not optional but the Objective-C version is? If creation could fail for any reason why would those same reasons not apply to Swift?
has comment: http://stackoverflow.com/comment/134020737
has answer: http://stackoverflow.com/a/75989339
has title: Why can Objective-C dispatch_group_create() return NULL but not Swift DispatchGroup()?
upvote count: 2
type: AnsweredQuestion
tagged with: null
answer count: 1
tagged with: objective-c
favorite count: 0
accepted answer: http://stackoverflow.com/a/75989339
tagged with: dispatchgroup
score: 2

http://stackoverflow.com/comment/134027917
type: Comment
has text: `applicationWillTerminate` is rarely called. Even when it is called, the app will be terminated long before the code in the `dispatch_after` blocks is ever called. Try without the use of `dispatch_after`.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/75991674

opencv
tag name: opencv
type: Tag
tags question: http://stackoverflow.com/q/75946121
tags question: http://stackoverflow.com/q/78566066

http://stackoverflow.com/tag/c
type: Tag
tags question: http://stackoverflow.com/q/75943541
tag name: c
tags question: http://stackoverflow.com/q/76059936
tags question: http://stackoverflow.com/q/76027766
tags question: http://stackoverflow.com/q/76246627
tags question: http://stackoverflow.com/q/76210219
tags question: http://stackoverflow.com/q/76579270
tags question: http://stackoverflow.com/q/76694493
tags question: http://stackoverflow.com/q/77649167
tags question: http://stackoverflow.com/q/77981579
tags question: http://stackoverflow.com/q/78172699
tags question: http://stackoverflow.com/q/78744919
tags question: http://stackoverflow.com/q/78940966

http://stackoverflow.com/comment/134025352
score: 1
type: Comment
comment on: http://stackoverflow.com/a/75989339
has text: Also, there's no need to guess. libdispatch is open source: https://github.com/apple/swift-corelibs-libdispatch/blob/469c8ecfa0011f5da23acacf8658b6a60a899a78/src/semaphore.c#L29-L49
type: AnswerComment

http://stackoverflow.com/comment/134034196
type: Comment
score: 0
type: QuestionComment
has text: The os version is 16.3.1 (Iphone 11 pro)
comment on: http://stackoverflow.com/q/75985811

http://stackoverflow.com/q/76009123
has comment: http://stackoverflow.com/comment/134057665
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134064571
has title: How to add Objective-c library manually to Xcode project
answer count: 0
tagged with: xcode
score: 0
has comment: http://stackoverflow.com/comment/134215583
has body: I would like to add the Objective-c version of the PINRemoteImage library to my project manually. Based on their Github docs, I should: Download the latest tag and drag the Pod/Classes folder into your Xcode project. You must also manually link against PINCache. So I downloaded the latest version from the given link, extracted it and got the following files in the folder Then copied the Classes folder into the Xcode project (checked the copy if needed option). And when I run the app, I get the following error: I understand it doesn't find the required file from the package, but can't figure out the issue. I also tried the same with the whole Source folder, but didn't work. What am I doing wrong?
type: Question
type: UnansweredQuestion

http://stackoverflow.com/q/76002388
tagged with: ios
tagged with: uiactivityviewcontroller
tagged with: imessage
has comment: http://stackoverflow.com/comment/134074668
has comment: http://stackoverflow.com/comment/134074438
tagged with: objective-c
has body: Is it possible to share NSURL and NString at the same time using the UIActivityViewController? I know it's possible using the MFMessageComposeViewController but wanted to use the native UI sheet so the user can select a different app if they wanted. In this example, the filePath variable is a path to a video file saved on the device. NSMutableArray *items = [NSMutableArray new]; [items addObject:[NSURL fileURLWithPath:filePath]]; UIViewController *rootViewController = UnityGetGLViewController(); UIActivityViewController *activity = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil]; [rootViewController presentViewController:activity animated:YES completion:nil]; Updating the items with an additional string value will result in only the video being shared. NSMutableArray *items = [NSMutableArray new]; [items addObject:[NSURL fileURLWithPath:filePath]]; [items addObject:[NSString stringWithUTF8String:"Check out this video!"]]; UIViewController *rootViewController = UnityGetGLViewController(); UIActivityViewController *activity = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil]; [rootViewController presentViewController:activity animated:YES completion:nil]; The "Check out this video!" text is never included in the iMessage app. Is this something that is possible? If not It would be nice to see some official Apple documentation about this. Also, this would be quite surprising considering iMessage is a built-in app, you would imagine it would have this capability.
answer count: 0
has title: Unable to Share NSURL and NSString simultaneously to iMessage app
score: 0
type: Question
has comment: http://stackoverflow.com/comment/134073010
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134074429
has comment: http://stackoverflow.com/comment/134074683
tagged with: uikit

http://stackoverflow.com/q/75884104
answer count: 0
tagged with: ios
has body: I am currently developing a framework in Swift and in order to use NSClassFromString to perform reflection, the class I'm looking for needs to be loaded. In Objective-C, I could add -ObjC to the other linker flags in build settings to load the classes at build time and use NSClassFromString, but is there an equivalent for Swift? Although adding -ObjC works, I'm wondering if there's a different value for loading Swift classes.
type: Question
has title: Is there an equivalent to -ObjC in Xcode build settings for Swift?
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/133851377
tagged with: xcode
has comment: http://stackoverflow.com/comment/133901838
has comment: http://stackoverflow.com/comment/133851429
score: 0
tagged with: swift

http://stackoverflow.com/comment/133970793
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/75943541
type: Comment
has text: Maybe you need update `cocoapods` itself?

http://stackoverflow.com/q/75986813
tagged with: segmentation-fault
has body: My app crashes at line 4 in URLSession:dataTask:didReceiveResponse:completionHandler of AFURLSessionManager.m，it seems like the self object is released, the Func is where we add the callback: - (void) Func:(AFHTTPSessionManager *)sessionManager { @weakify(self); [sessionManager setDataTaskDidReceiveResponseBlock:^NSURLSessionResponseDisposition(NSURLSession * _Nonnull session, NSURLSessionDataTask * _Nonnull dataTask, NSURLResponse * _Nonnull response) { @strongify(self); if (!self) { return NSURLSessionResponseCancel; } ...... } ...... } - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveResponse:(NSURLResponse *)response completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler { 1 NSURLSessionResponseDisposition disposition = NSURLSessionResponseAllow; 2 3 if (self.dataTaskDidReceiveResponse) { 4 disposition = self.dataTaskDidReceiveResponse(session, dataTask, response);(line 1115 of original m file) 5 } 6 7 } crash stack: Exception Type: SIGSEGV Exception Codes: SEGV_ACCERR at 0x58fe10485d20 Thread 13 Crashed: 0 libobjc.A.dylib 0x000000019d5f9c20 objc_msgSend 1 APPInfo 0x0000000105204e0c -[AFURLSessionManager URLSession:dataTask:didReceiveResponse:completionHandler:] at AFURLSessionManager.m:1115:28 2 CFNetwork 0x00000001a54c9934 CFURLConnectionCreateWithProperties 3 Foundation 0x19e75f2f0 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ 4 Foundation 0x19e7334a0 -[NSBlockOperation main] 5 Foundation 0x19e733430 __NSOPERATION_IS_INVOKING_MAIN__ 6 Foundation 0x19e6f47d8 -[NSOperation start] 7 Foundation 0x19e6f450c __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ 8 Foundation 0x19e6f9c20 __NSOQSchedule_f 9 libdispatch.dylib 0x1ab8c1114 _dispatch_block_async_invoke2 10 libdispatch.dylib 0x1ab8b1fdc _dispatch_client_callout 11 libdispatch.dylib 0x1ab8b546c _dispatch_continuation_pop 12 libdispatch.dylib 0x1ab8b4ad4 _dispatch_async_redirect_invoke 13 libdispatch.dylib 0x1ab8c3a6c _dispatch_root_q…
type: UnansweredQuestion
answer count: 1
tagged with: afnetworking
tagged with: ios
has title: Why AFNetWork crashes in URLSession:dataTask:didReceiveResponse:completionHandler
tagged with: objective-c
type: Question
has answer: http://stackoverflow.com/a/75997487
score: 0

http://stackoverflow.com/q/75976964
tagged with: objective-c
has title: Inconsistent behavior in viewDidAppear Objective C
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/75976990
tagged with: crash
has comment: http://stackoverflow.com/comment/134008462
tagged with: viewdidappear
favorite count: 0
has body: [ViewController] Calling -viewDidAppear: directly on a view controller is not supported, and may result in out-of-order callbacks and other inconsistent behavior. Use the -beginAppearanceTransition:animated: and -endAppearanceTransition APIs on UIViewController to manually drive appearance callbacks instead. Make a symbolic breakpoint at UIViewControllerAlertForAppearanceCallbackMisuse to catch this in the debugger May i know the exact reason causing this issue. Thanks in advance
upvote count: 2
tagged with: uiviewcontroller
score: 1
answer count: 2
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/75979068

http://stackoverflow.com/comment/140032801
type: Comment
has text: Works, thank you. However, every time I run `ionic cap sync` it reverts to `Yes`. Not sure if there's a way to configure it, for now I just reset it each sync.
score: 0
comment on: http://stackoverflow.com/a/77291613
type: AnswerComment

http://stackoverflow.com/q/75950246
has body: Suddenly in-app purchases of already productive IAPs are failing in the production with the error code: NSUnderlyingError=0x283b42e20 {Error Domain=ASDServerErrorDomain Code=3504 "找不到此项目。" UserInfo={NSLocalizedDescription=找不到此项目。}}} Environment: Production OS Version： iOS 15.6.1 What does Code 3504 represent? Where can I find documentation related to error codes? I confirm that there have been no prohibited sales areas for the product. This issue was not found in the sandbox environment.
tagged with: ios
tagged with: objective-c
has title: Transaction fails with ASDServerErrorDomain Code=3504 in production
upvote count: 3
tagged with: in-app-purchase
type: Question
downvote count: 0
score: 3
type: UnansweredQuestion
answer count: 0
favorite count: 0

http://stackoverflow.com/comment/134008462
has text: You can only call `viewDidAppear:` in the override of the method itself to call its super: `[super viewDidAppear:animated];`, if you called yourself `viewDidAppear:` elsewhere, you'll get that message. It's hard to tell without code.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/75976964

http://stackoverflow.com/a/75948092
has body: "But when I run cv::Imread();, cv::Mat tiffImage image is saved as nil." allocator = nil opencv read image fail with tiffImage is nil. opencv save image will definitely fail. You need to determine whether the image path and opencv are readable. NSString* readFilePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"read.png"]; UIImage* image = [[UIImage alloc] initWithContentsOfFile:readFilePath]; NSLog(@"image:%@", image); cv::String readpath_str = [readFilePath cStringUsingEncoding:NSUTF8StringEncoding]; cv::Mat image_mat = cv::imread(readpath_str); NSString* saveFilePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"write.png"]; cv::String writepath_str = [saveFilePath cStringUsingEncoding:NSUTF8StringEncoding]; bool res = cv::imwrite(writepath_str, image_mat); NSLog(@"cm write:%d", res);
has comment: http://stackoverflow.com/comment/133967630
score: 0
answers question: http://stackoverflow.com/q/75946121
type: Answer

http://stackoverflow.com/comment/134472697
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/75905667
has text: Were you able to solve your issue? I have been stuck on this for a few weeks myself.

http://stackoverflow.com/q/75903232
has body: Xcode Screenshot: Project Details: The project is an Objective-C project originally created in 2012. Roughly 33% of the code base is now in Swift. Project has Cocoapod dependencies. Project compiles with no issues on Xcode 14.2 Xcode 14.3 Issue: On Xcode 14.3 project does not build and the errors thrown are in Xcode generated files ProjectName.private.swiftinterface and ProjectName.swiftinterface Xcode says 'no such module __ObjC' failed to verify module interface 'ProjectName' due to errors above; the textual interface may be broken by project issues or a compiler bug See attached screenshot for full a visual. What we've tried: pod install --repo-update full project clean, delete Derived Data folder, clean again, try to build again. Question: Does the community think this is an Xcode issue? Or is there something wrong in our Build Settings/Info.plist file? Has anyone encountered this before? Any help would be highly appreciated!
upvote count: 17
downvote count: 4
type: Question
tagged with: swift
has answer: http://stackoverflow.com/a/75917950
type: UnansweredQuestion
has title: Xcode 14.3 "no such module '__ObjC'"
tagged with: ios
answer count: 3
linked to: http://stackoverflow.com/q/75574268
has answer: http://stackoverflow.com/a/76265637
tagged with: objective-c
score: 13
tagged with: xcode
favorite count: 0
has answer: http://stackoverflow.com/a/76038505

console
tag name: console
type: Tag
tags question: http://stackoverflow.com/q/75940769

http://stackoverflow.com/q/75943541
linked to: http://stackoverflow.com/q/76063843
has comment: http://stackoverflow.com/comment/133970793
has answer: http://stackoverflow.com/a/76371565
downvote count: 0
has comment: http://stackoverflow.com/comment/133950162
has comment: http://stackoverflow.com/comment/133948906
answer count: 5
has answer: http://stackoverflow.com/a/77291613
has comment: http://stackoverflow.com/comment/133949147
tagged with: ios
score: 40
type: Question
has comment: http://stackoverflow.com/comment/133948828
tagged with: objective-c
has answer: http://stackoverflow.com/a/76174256
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/75189250
has body: I am using Firebase Analytics on my pod file of an iOS project. I get the following errors when I run the app. A function declaration without a prototype is deprecated in all versions of C it's shown on the following code (on the Firebase library): GDTCORNetworkType GDTCORNetworkTypeMessage() {. &lt;----error here #if !TARGET_OS_WATCH SCNetworkReachabilityFlags reachabilityFlags = [GDTCORReachability currentFlags]; if ((reachabilityFlags &amp; kSCNetworkReachabilityFlagsReachable) == kSCNetworkReachabilityFlagsReachable) { if (GDTCORReachabilityFlagsContainWWAN(reachabilityFlags)) { return GDTCORNetworkTypeMobile; } else { return GDTCORNetworkTypeWIFI; } } #endif return GDTCORNetworkTypeUNKNOWN; } I tried doing a pod update but I'm still unable to fix the problem. For reference, I have this particular issue besides that I'm on Xcode and not on RN.
upvote count: 40
favorite count: 0
has answer: http://stackoverflow.com/a/76371638
has answer: http://stackoverflow.com/a/76051703
has title: A function declaration without a prototype is deprecated in all versions of C
tagged with: http://stackoverflow.com/tag/c

http://stackoverflow.com/q/76022262
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
has body: I am trying to resize a pixel buffer with the kCVPixelFormatType_420YpCbCr8BiPlanarFullRange (420f) pixel format to another size with preserving aspect ratio and adding black bars (if needed). I am using the vImageScale_Planar8 and vImageRotate90_Planar8 functions from the Accelerate framework to scale and rotate the Y plane, and the vImageScale_CbCr8 and vImageRotate90_Planar16U functions to scale and rotate the CbCr plane. Here is the code: + (CVPixelBufferRef)resizeProportionallyBuffer:(CVPixelBufferRef)srcPixelBuffer withOrientation:(CGImagePropertyOrientation)orientation toSize:(CGSize)dstSize { OSType pixelFormat = CVPixelBufferGetPixelFormatType(srcPixelBuffer); CVPixelBufferLockFlags srcFlags = kCVPixelBufferLock_ReadOnly; CVPixelBufferLockBaseAddress(srcPixelBuffer, srcFlags); void *srcLuminanceData = CVPixelBufferGetBaseAddressOfPlane(srcPixelBuffer, 0); size_t srcLuminanceWidth = CVPixelBufferGetWidthOfPlane(srcPixelBuffer, 0);//750 size_t srcLuminanceHeight = CVPixelBufferGetHeightOfPlane(srcPixelBuffer, 0);//1334 size_t srcLuminanceBytesPerRow = CVPixelBufferGetBytesPerRowOfPlane(srcPixelBuffer, 0);//768 void *srcCbCrData = CVPixelBufferGetBaseAddressOfPlane(srcPixelBuffer, 1); int srcCbCrWidth = (int)CVPixelBufferGetWidthOfPlane(srcPixelBuffer, 1);//375 int srcCbCrHeight = (int)CVPixelBufferGetHeightOfPlane(srcPixelBuffer, 1);//667 size_t srcCbCrBytesPerRow = CVPixelBufferGetBytesPerRowOfPlane(srcPixelBuffer, 1);//768 vImage_Buffer srcLuminanceBuffer = { .data = srcLuminanceData, .width = srcLuminanceWidth, .height = srcLuminanceHeight, .rowBytes = srcLuminanceBytesPerRow }; vImage_Buffer srcCbCrBuffer = { .data = srcCbCrData, .width = srcCbCrWidth, .height = srcCbCrHeight, .rowBytes = srcCbCrBytesPerRow }; size_t srcWidth = srcLuminanceWidth; size_t srcHeight = srcLuminanceHeight; int dstWidth = (int)dstSize.width; int dstHeight = (int)dstSize.height; uint8_t rotationConstant = 0; size_t scaledWidth = srcLuminanceWidth; size_t scaledHeight = srcLumina…
tagged with: image-processing
has answer: http://stackoverflow.com/a/76080334
score: 0
tagged with: accelerate-framework
tagged with: vimage
has title: How to resize CVPixelBufferRef 420f with preserving aspect ratio?
tagged with: ios
type: Question

http://stackoverflow.com/comment/134052588
type: Comment
has text: Here is a sample repo, please check https://github.com/CodingWithNobody/Deleteme. Please note it is using react native's new architecture. React native's new architecture internally uses C++ and the docs tells us to use objective-c++ and just using objective-c won't work for the new architecture
score: 0
comment on: http://stackoverflow.com/a/76001255
type: AnswerComment

http://stackoverflow.com/q/75905667
tagged with: objective-c
downvote count: 0
answer count: 0
score: 1
tagged with: mastercard
type: Question
upvote count: 1
tagged with: swift
has comment: http://stackoverflow.com/comment/134472697
has body: I am attempting to run the MasterPass sandbox sample app in Xcode 13.3 provided by the MasterPass docs, however the error: using bridging headers with module interfaces is unsupported error in my logs keeps persisting. I am attempting to do this because I would prefer to tinker with it first before integrating it with my project I am using Xcode 13.3, macOS Monterrey mac mini 2018 32GB. I have gone through quite a number of similar questions here on stackoverflow on the same issue, but the solutions thereof have been unsuccessful on my project at this time, hence the need to ask a separate question, with particularity on using the MasterPass iOS SDK First, I got the following error message during compilation on the MerchantServices and MCCMerchant frameworks building for ios simulator, but the linked and embedded framework 'mcc merchant.framework' was built for ios + ios simulator I resolved that by going to my Build Settings on the specified target and setting the value on Validate Workspace to YES I attempted to build the project and this second error popped up module compiled with swift 5.0 cannot be imported by the swift 5.6 compiler This I resolved by setting the Build Settings > Build Options > Build Libraries for Distribution option to Yes Next build attempt resulted in the following error messages, but this time, it was in the crash logs remark: incremental compilation has been disabled: it is not compatible with whole module optimization error: using bridging headers with module interfaces is unsupported I then resolved the remark by setting the Build Settings > Swift Compiler > Compilation Mode option to Incremental leaving error: using bridging headers with module interfaces is unsupported unresolved I took the following steps to try to resolve the issue 4.a - Created a modulemap file to expose the Objective-C headers to my Swift project, BridgingMerchantModule.modulemap 4.b - the following code was in the provided MerchantCheckoutApp-Bridging-Header.h fi…
type: UnansweredQuestion
has title: "error: using bridging headers with module interfaces is unsupported" when attempting to run the sample MerchantCheckoutApp from MasterPass docs
favorite count: 0
tagged with: ios
tagged with: bridging-header
has comment: http://stackoverflow.com/comment/134484774

http://stackoverflow.com/q/75981242
has body: I am developing new version for Mapp Intelligence library (https://github.com/mapp-digital/MappIntelligence-iOS-v5) and I had to rename few classes at the latest version to avoid collision with some other library when they are added together. After that when I run pod lib lint command if gives me errors for every renamed class that can not find the relative path for it. Encountered an unknown error (No such file or directory @ realpath_rec - /Users/***/Desktop/novagrana/MappIntelligence-iOS-v5/MappIntelligence/UserMatching/DeviceID/APXIdentifier.h) during validation. and APXIdentifier.h is an old name not renamed one. I have tried to remove derived data few time and I also tried to remove completely cocoa pods and install them again, also pod cache clean --all command does not help. It must be some caching problem, but I do not know what I need to clean or remove.
tagged with: objective-c
type: Question
score: 1
favorite count: 0
tagged with: cocoapods
downvote count: 1
has title: pod lib lint error for objective C library
type: UnansweredQuestion
answer count: 0
tagged with: ios
upvote count: 2
tagged with: sdk

http://stackoverflow.com/comment/134070877
has text: Do you know for sure that the Gmail app supports the `attachment` query parameter? Do you know for sure the value is a plain base64 encoding of the data? How big is the PDF? With the resulting base64 encoding, the final URL could be far too long to be valid.
type: QuestionComment
comment on: http://stackoverflow.com/q/76016717
score: 1
type: Comment

http://stackoverflow.com/comment/133851429
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/75884104
has text: Also swift have own reflection: https://developer.apple.com/documentation/swift/debugging-and-reflection
type: Comment

http://stackoverflow.com/q/76001227
type: AnsweredQuestion
has title: No type or protocol named 'AVCapturePhotoCaptureDelegate' error
answer count: 2
tagged with: swift
accepted answer: http://stackoverflow.com/a/76001255
has answer: http://stackoverflow.com/a/76004133
has body: I am trying to use Swift class in objective-c code. I already went through this and I can't convert my .mm file to .m file as I am using react native's new architecture which requires .mm file I am trying this out for react native's new architecture which requires .mm file. Check here to learn more My header file RTNMyCamera.h #import <React/RCTViewComponentView.h> #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface RTNMyCamera : RCTViewComponentView @end NS_ASSUME_NONNULL_END My objective-c++ file RTNMyCamera.mm #import "RTNMyCamera.h" #import <react/renderer/components/RTNMyCameraSpecs/ComponentDescriptors.h> #import <react/renderer/components/RTNMyCameraSpecs/EventEmitters.h> #import <react/renderer/components/RTNMyCameraSpecs/Props.h> #import <react/renderer/components/RTNMyCameraSpecs/RCTComponentViewHelpers.h> #import "myapp-Swift.h" #import "RCTFabric/React-RCTFabric-umbrella.h" using namespace facebook::react; @interface RTNMyCamera () <RCTRTNMyCameraViewProtocol> @end @implementation RTNMyCamera { UIView *_view; MyCamera *myCamera; } + (ComponentDescriptorProvider)componentDescriptorProvider { return concreteComponentDescriptorProvider<RTNMyCameraComponentDescriptor>(); } - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { static const auto defaultProps = std::make_shared<const RTNMyCameraProps>(); _props = defaultProps; _view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)]; myCamera = [[MyCamera alloc] initWithFrame:_view.bounds]; [_view addSubview: myCamera]; self.contentView = _view; } return self; } @end Class<RCTComponentViewProtocol> RTNMyCameraCls(void) { return RTNMyCamera.class; } My swift file MyCamera @objcMembers class MyCamera: UIView,AVCapturePhotoCaptureDelegate,AVCaptureVideoDataOutputSampleBufferDelegate { //all of my business logic to capture photo } Entire swift code here I get getting error saying No type or pro…
possible better answer: http://stackoverflow.com/a/76004133
linked to: http://stackoverflow.com/q/44561770
tagged with: ios
type: Question
tagged with: objective-c
has answer: http://stackoverflow.com/a/76001255
tagged with: react-native
tagged with: objective-c++
score: 0

http://stackoverflow.com/q/76011701
answer count: 1
has body: When I put an NSString value in obj c alert, and I updated the string, it doesn’t seem to change the value in the alert but when I print it, it prints the changed value NSString *Value = @"1"; // Alert = 1 NSlog(Value); // 1 UIAlertController *alert = [UIAlertController alertControllerWithTitle:Value message:nil preferredStyle:UIAlertControllerStyleAlert]; // Alert = 1 UIViewController *topController = [UIApplication sharedApplication].keyWindow.rootViewController; [topController presentViewController:alert animated:YES completion:nil]; Value = @"2"; // Alert is still = 1 NSlog(Value); // 2
tagged with: ios
type: AnsweredQuestion
has title: Update String in objective C alert
tagged with: objective-c
has answer: http://stackoverflow.com/a/76011793
score: 0
accepted answer: http://stackoverflow.com/a/76011793
type: Question

http://stackoverflow.com/comment/133902844
type: QuestionComment
score: 0
has text: Sorry I had a mistake. There is no mistake in this code snippet. Now it's working properly. Thank you everyone who reached on this question.
type: Comment
comment on: http://stackoverflow.com/q/75863219

http://stackoverflow.com/comment/134850564
type: Comment
comment on: http://stackoverflow.com/a/76371638
score: 0
has text: @user129393192 No it (non-prototype format functions) has always been flagged as an obsolescent feature since 1989. Compilers have supported it as required by the standard, but it could have gotten removed at any moment. It finally did with C23, but they chose to synchronize the behavior with C++ so now we can finally type `int main()` without worrying about the feature getting deprecated. Some compilers like clang 16 chose to warn if you compile in strict mode `-std=c17 -pedantic`, but that can be solved by compiling in strict C23 mode `-std=c2x -pedantic`.
type: AnswerComment

http://stackoverflow.com/comment/134024278
has text: What macOS hardware doesn't support Bluetooth? Are you thinking about environments where Bluetooth is disabled by policy? What situation do you have in mind here?
type: QuestionComment
comment on: http://stackoverflow.com/q/75989522
score: 3
type: Comment

http://stackoverflow.com/comment/133827349
type: AnswerComment
score: 1
type: Comment
has text: @AlexeyStarinsky frankly i don't know which exact methods you need here. As far as I can see from [the documentation](https://yandex.ru/dev/mobile-ads/doc/ios/ref/Protocols/YMAInterstitialAdDelegate.html) most of the methods are optional, so it's probably up to you to decide which one needs customisation. I added a sample code for such a class which should give you a general idea of the approach
comment on: http://stackoverflow.com/a/75869473

http://stackoverflow.com/a/75917950
answers question: http://stackoverflow.com/q/75903232
upvote count: 0
has body: I experience the same. I guess it's an Xcode issue, since it works with the prior version. In the meantime I use @_implementationOnly import to get rid of it.
type: Answer
score: -1
downvote count: 1
has comment: http://stackoverflow.com/comment/134202807

http://stackoverflow.com/comment/134819774
has text: It worked but what about when this app goes to distribution? :) will it matter?
type: AnswerComment
comment on: http://stackoverflow.com/a/76038505
type: Comment
score: 0

http://stackoverflow.com/comment/134033847
score: 0
comment on: http://stackoverflow.com/q/75989522
type: QuestionComment
has text: @Rob Napier what does `system_profiler SPBluetoothDataType` return if no bluetooth card is available
type: Comment

http://stackoverflow.com/comment/135909499
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76174256
score: 0
has text: This worked for me. Thank you for sharing. this is basically # set CODE_SIGNING_ALLOWED = NO for com.apple.product-type.bundle # set CLANG_WARN_STRICT_PROTOTYPES = NO for GoogleDataTransport

http://stackoverflow.com/comment/138227888
type: Comment
has text: This also works for me with Xcode 14
comment on: http://stackoverflow.com/a/77291613
score: 0
type: AnswerComment

http://stackoverflow.com/a/76051703
type: Answer
score: 18
upvote count: 19
downvote count: 1
answers question: http://stackoverflow.com/q/75943541
has body: I had the same problem with Firebase Analytics and followed advice in the comments from @HangarRash. Put void in the empty parentheses on the error line. There is a 'fix' button which does it for you if you click on the little red x. It asked me to unlock but that worked OK and could save and build. There were about half a dozen of these to fix, then it builds.

http://stackoverflow.com/comment/134064043
score: 0
comment on: http://stackoverflow.com/a/76011793
has text: No. It is a separate line after you create `alert`. You simply need to assign a new value to the `title` property.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/133825061
comment on: http://stackoverflow.com/q/75864711
score: 0
type: QuestionComment
has text: As long as you develop an iOS application, which anyway requires Cocoa Touch framework, you are required to have an Objective-C compatible compiler. Why can't you just use an Objective-C class here?
type: Comment

crash
tag name: crash
type: Tag
tags question: http://stackoverflow.com/q/75976964
tags question: http://stackoverflow.com/q/76649829
tags question: http://stackoverflow.com/q/76953246
tags question: http://stackoverflow.com/q/77477713
tags question: http://stackoverflow.com/q/79092218
tags question: http://stackoverflow.com/q/79394234

tvos
tag name: tvos
type: Tag
tags question: http://stackoverflow.com/q/75857765
tags question: http://stackoverflow.com/q/76038481
tags question: http://stackoverflow.com/q/76649829
tags question: http://stackoverflow.com/q/76804325
tags question: http://stackoverflow.com/q/77952697

http://stackoverflow.com/comment/134023831
has text: Then why does the documentation say *'NULL on failure'* if it will never ever fail?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/75989339

http://stackoverflow.com/comment/133947620
comment on: http://stackoverflow.com/q/75940769
type: Comment
score: 0
has text: Welcome to SO. First, please do not include links in questions; if the link breaks future readers will have no idea what's your asking about. Ether embed the image in the question or include it textually. Secondly, the console fully supports print commands `print("some log message")` in Swift or `NSLog( @"Here is a test message: '%@'", message );` in ObjC
type: QuestionComment

imessage
type: Tag
tags question: http://stackoverflow.com/q/76002388
tag name: imessage

http://stackoverflow.com/comment/134850697
score: 0
type: AnswerComment
type: Comment
has text: @user129393192 Between C89 to current C17, there's (C17 6.7.6.3 §14) _"An identifier list declares only the identifiers of the parameters of the function. An empty list in a function declarator that is part of a definition of that function specifies that the function has no parameters. The empty list in a function declarator that is not part of a definition of that function specifies that no information about the number or types of the parameters is supplied."_
comment on: http://stackoverflow.com/a/76371638

http://stackoverflow.com/a/76038505
score: 6
has comment: http://stackoverflow.com/comment/134696615
has body: Posting as answer per a commenter suggestion: In the case of this project what solved the issue was setting the "Build Libraries for Distribution" flag to "No". The errors went away, and the project now compiles in Xcode 14.3.
has comment: http://stackoverflow.com/comment/134643613
type: Answer
has comment: http://stackoverflow.com/comment/134688981
has comment: http://stackoverflow.com/comment/134819774
has comment: http://stackoverflow.com/comment/134202816
downvote count: 0
answers question: http://stackoverflow.com/q/75903232
has comment: http://stackoverflow.com/comment/134125318
upvote count: 6
has comment: http://stackoverflow.com/comment/134135169

null
type: Tag
tag name: null
tags question: http://stackoverflow.com/q/75987263
tags question: http://stackoverflow.com/q/79376363

http://stackoverflow.com/comment/134202816
comment on: http://stackoverflow.com/a/76038505
has text: This solution doesn't seem to be universal. I need to be able to Archive my project which I can't seem to do with this setting unchecked. I can build it though...
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/134008184
comment on: http://stackoverflow.com/q/75962915
score: 0
type: QuestionComment
type: Comment
has text: @reactor i can't spot anything that can cause the exception thrown the code you provided. Especially since you have `self.persistentContainer == nil` check in the `AppDelegate` class. You either should have the `AppDelegate` class released for whatever reason (provided you controller doesn't retain the pointer to the persistent container) OR which is more likely - you have another instance of `TodoListTableViewController` allocated somewhere, which doesn't have `persistentContainer` set up. E.g. the storyboard may instantiate a `TodoListTableViewController` as part of the designed hierarchy

http://stackoverflow.com/comment/134072092
type: QuestionComment
has text: Also, why specifically target the gmail app? Why not share the file using UIActivityViewController and let the user choose what they want to do with the file?
type: Comment
comment on: http://stackoverflow.com/q/76016717
score: 0

http://stackoverflow.com/comment/133998141
comment on: http://stackoverflow.com/a/75944602
has text: I've tried this out, and as I didn't have a property for the image view, I tried it out using the existing image view, but it refused to draw anything when I ran it.
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/a/76080334
answers question: http://stackoverflow.com/q/76022262
score: 0
type: Answer
has body: Images in both coregraphics and corevideo can have an orientation tag. This means that the image may be rotated or flipped in the storage container relative to how it is supposed to be drawn. VImage however doesn’t have any such concept. As far as it is concerned, pixels is pixels. Where things go wrong is when the logical height and width don’t match the physical height and width. VImage is concerned only with the physical height and width, whereas these other APIs will likely feed you the logical height and width, as it would appear on screen so you can position it correctly. (They regard the storage format as an Implementation detail, while VImage does not.) When the rotation is left or right, I would suggest trying swapping the height and width when populating the vImage_Buffer structure so that it matches the storage orientation. If the stripe is really tiny for a resampling filter, like 1-3 pixels wide, then I’d probably also look at whether I’d correctly described the size of the image. Resampling filters will look at at least the 6 nearest src pixels to the center of the new pixel. If some of those are garbage, particularly off the right or bottom of the image, then you get garbage in / garbage out. Vimage is very careful not to touch nonexistent or logically nonexistent pixels, but if the data is incorrectly described in the vimage_buffer struct then it may be licensed to use that data and then you’ll get stripes at edges and/or a crash. Note that vimage scale is not appropriate for tiled images. It will need to see the surrounding area outside the tile to work correctly, which is likely absent. This will cause stitching edges visible in the result at tile boundaries. To solve this problem, you’d need to fall back on the lower level shear routines. Alas vImage doesn’t provide a way to know how many extra scanlines / columns will be needed, so this is hard for downsampling.

http://stackoverflow.com/q/75864711
score: 0
has title: What is the right syntax for adding Objective C @property into C++ class?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/133817829
accepted answer: http://stackoverflow.com/a/75869473
answer count: 1
has comment: http://stackoverflow.com/comment/133825650
tagged with: ios
has comment: http://stackoverflow.com/comment/133817820
has comment: http://stackoverflow.com/comment/133825061
type: Question
has body: In my C++ project I have a base class for interstitial ad: class InterstitialAd { public: virtual void initialize(std::string unit_id) = 0; virtual void load() = 0; virtual void show() = 0; virtual void uninitialize() = 0; }; and need to implement it of iOS with Yandex Mobile Ads. According to their docs I need to add a @property and initialize it in my initialize method like this: class YandexIosInterstitialAd : public InterstitialAd { public: void initialize(std::string unit_id) override { //access interstitialAd here and add a code like this: self.interstitialAd = [[YMAInterstitialAd alloc] initWithAdUnitID:&lt;your unique AdUnitId&gt;]; self.interstitialAd.delegate = self; [self.interstitialAd load]; } private: //Need to declare this property @property (nonatomic, strong) YMAInterstitialAd *interstitialAd; } what is the right syntax for that? Ideally that @property should be declared inside my YandexIosInterstitialAd class, but not globally.
has answer: http://stackoverflow.com/a/75869473
tagged with: objective-c
tagged with: c++
tagged with: objective-c++
has comment: http://stackoverflow.com/comment/133817850

http://stackoverflow.com/comment/134057665
comment on: http://stackoverflow.com/q/76009123
score: 0
type: QuestionComment
type: Comment
has text: In your case it might help to change the include to #import "PINRemoteImage.h". Or you can add the path to the header to the HEADER SEARCH PATH setting in your Xcode project.

http://stackoverflow.com/comment/134044011
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/76001255
has text: I have done that. I have to keep my post short and readable so I have not included my entire swift code. Check here if you like to see my entire swift code https://gist.github.com/CodingWithNobody/8fb37230a34db2127442dd703506912e

http://stackoverflow.com/a/76004133
type: Answer
has comment: http://stackoverflow.com/comment/134049698
upvote count: 0
score: -1
has body: I think you need to make sure the class implementing AVCapturePhotoCaptureDelegate extends NSObject.
downvote count: 1
answers question: http://stackoverflow.com/q/76001227

ios-simulator
tags question: http://stackoverflow.com/q/76026075
type: Tag
tag name: ios-simulator
tags question: http://stackoverflow.com/q/78293837
tags question: http://stackoverflow.com/q/78207140

http://stackoverflow.com/comment/136347366
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77291613
has text: This is correct answer as with Xcode 15. Thanks!
score: 5

http://stackoverflow.com/comment/134064571
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76009123
has text: @jackdaimond tried that too, unfortunately in this case it just simply missing the .h file.

http://stackoverflow.com/comment/134074668
has text: @HangarRash That was it, updated my phone to iOS 16.4.1, and now it works. I guess on 15.6.1 there was a bug with the `UIActivityViewController`. You can write an answer with this information and I can mark it as resolved. Or I can, either way works for me(If we consider this resolved, still technically a problem for users under 16). But thanks though.
comment on: http://stackoverflow.com/q/76002388
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/133950162
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/75943541
has text: Same as https://stackoverflow.com/questions/75189250/warning-a-function-declaration-without-a-prototype-is-deprecated-in-all-version
type: Comment

frida
tag name: frida
type: Tag
tags question: http://stackoverflow.com/q/75856290
tags question: http://stackoverflow.com/q/75857334
tags question: http://stackoverflow.com/q/78011219

accelerate-framework
type: Tag
tag name: accelerate-framework
tags question: http://stackoverflow.com/q/76022262
tags question: http://stackoverflow.com/q/77542065
tags question: http://stackoverflow.com/q/78939676

uiviewcontroller
tags question: http://stackoverflow.com/q/75976964
type: Tag
tag name: uiviewcontroller
tags question: http://stackoverflow.com/q/76901088
tags question: http://stackoverflow.com/q/78501315
tags question: http://stackoverflow.com/q/79505321

http://stackoverflow.com/comment/134024382
has text: I think that's what I just explained. _Any_ Objective-C initializer can return NULL on failure. That doesn't mean it _will_ and it isn't the (very old) documentation's job to worry about that distinction. All Objective-C code checks to see whether it got `nil`.
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/75989339

http://stackoverflow.com/q/75857334
tagged with: javascript
answer count: 1
tagged with: objective-c
has body: This is my index.js const className = 'NSURLConnection' const methodName = 'sendSynchronousRequest:returningResponse:error:' Interceptor.attach(ObjC.classes[className][`+ ${methodName}`].implementation, { onEnter: function (args) { const response = new ObjC.Object(args[3]) console.log('URL', response.URL()) } }) args[3] should be a NSURLResponse. If I understood correctly, based on what is written inside the official documentation, response arg should be a pointer to a pointer. When I try to log response url, everything breaks. How can I access the object like I would do with a normal pointer?
score: 0
has title: How can I read ObjC pointer to pointer (**) using Fida Javascript APIs?
type: Question
tagged with: frida
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/75858271

parse-platform
tags question: http://stackoverflow.com/q/75857765
tag name: parse-platform
type: Tag
tags question: http://stackoverflow.com/q/78846475
tags question: http://stackoverflow.com/q/79033269

http://stackoverflow.com/a/76389997
has body: Following this topic https://github.com/rafaelsetragni/awesome_notifications/issues/773 I have avoided this issue by comeback to version 0.6.21 of awesome_notifications
downvote count: 0
answers question: http://stackoverflow.com/q/76026075
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/133948906
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/75943541
has text: @HangarRash I have tried unlocking the files and adding them but still no luck

http://stackoverflow.com/comment/134011273
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/75962915
has text: @TheDreamsWind chatgpt had advised that the above is the way I should use the view controller added with storyboard. apparently, there's another version of instantiateViewControllerWithIdentifier which includes a `creator` argument, which is a block with access to an `NSCoder`. however, that doesn't work either

http://stackoverflow.com/comment/134074429
comment on: http://stackoverflow.com/q/76002388
type: Comment
score: 0
has text: @HangarRash Interesting, I tested it on a real iPhone 12 iOS 15.6.1 using an mp4 file downloaded into the app data. There are several differences in our test cases, I could try using the same conditions as you. Also, it would be great if you could post a snippet of the code so we could compare that as well, thanks.
type: QuestionComment

http://stackoverflow.com/comment/134012180
type: QuestionComment
score: 0
has text: @reactor with help of debugger you can just check whether the controller instance where the exception gets thrown and the controller you create in the `-[UIApplicationDelegate application:didFinishLaunchingWithOptions:]` have the same addresses. If the addresses are the same, keep digging into the property of the controller (when it changes and to what values), if addresses are different, find out where the redundant controller come from.
type: Comment
comment on: http://stackoverflow.com/q/75962915

http://stackoverflow.com/comment/133817850
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/75864711
score: 2
has text: in an objective c class, though from a quick scan of their documentation I don't think you need a property at all, just a member variable. Though when you come to do `self.interstitialAd.delegate = self` you'll probably need an objective-c class

http://stackoverflow.com/a/75995700
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/75989522
has body: Bluetooth is always supported. But I believe the thing you're looking for is the IOBluetoothHostController: import IOBluetooth let controller = IOBluetoothHostController.default()! print(controller.powerState) While .default() returns an implicitly unwrapped optional (because it lacks optionality annotations), I don't believe it's possible for it to actually return nil. There is always a Bluetooth module. You probably want to read Bluetooth on OS X, though I don't believe it's fully up-to-date (it references some non-existent classes, though it's possible some of those classes are merely private).
accepted answer of: http://stackoverflow.com/q/75989522

core-data
tag name: core-data
tags question: http://stackoverflow.com/q/75962915
type: Tag
tags question: http://stackoverflow.com/q/76186465
tags question: http://stackoverflow.com/q/77655283
tags question: http://stackoverflow.com/q/78324556
tags question: http://stackoverflow.com/q/78457453
tags question: http://stackoverflow.com/q/78681400
tags question: http://stackoverflow.com/q/78869590
tags question: http://stackoverflow.com/q/78937053
tags question: http://stackoverflow.com/q/79158106
tags question: http://stackoverflow.com/q/79527661
tags question: http://stackoverflow.com/q/79542554

http://stackoverflow.com/comment/134215583
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76009123
has text: It says: ‘You must also manually link against PINCache’, and the error looks suspiciously similar to the one you’d get if you didn’t link. Does the library show up in the target settings?

http://stackoverflow.com/comment/134864139
type: AnswerComment
has text: @user129393192 Yeah it was a strange call they made. Tbh the latest builds of gcc and clang are so experiemental and out of the loop with bugs and lacking in standard compliance that they can't really be trusted for production purposes. I used to find like at most one bug per year in these compilers, nowadays it's more like one bug per month and that's just my personal findings. And since they are open source, bugs won't get fixed - the maintainers are super busy inventing useless extensions that nobody will use or asked for. It's pretty sad, at least gcc used to be great.
comment on: http://stackoverflow.com/a/76371638
type: Comment
score: 0

sdk
type: Tag
tags question: http://stackoverflow.com/q/75981242
tag name: sdk
tags question: http://stackoverflow.com/q/77838327
tags question: http://stackoverflow.com/q/79023265
tags question: http://stackoverflow.com/q/79195432

http://stackoverflow.com/comment/134029689
type: QuestionComment
type: Comment
has text: @HangarRash "I have tried it, but it still won't reject the call
score: 0
comment on: http://stackoverflow.com/q/75991674

http://stackoverflow.com/comment/134864255
has text: Weird. I'm still not quite sure I fully get it. So the declarator without an item list, even attached to a definition, is not considered a prototype in C17? Specifically referring to what you said: (C17 6.7.6.3 §14) "An empty list in a function declarator that is part of a definition of that function specifies that the function has no parameters." Is it because the function [body](https://en.wikipedia.org/wiki/Function_prototype#:~:text=In%20computer%20programming%2C%20a%20function,but%20omits%20the%20function%20body.) is omitted that they did not interpret the dec.+def. to be a prototype?
comment on: http://stackoverflow.com/a/76371638
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/133958893
score: 1
has text: Thank you, @Chintu. Thanks for your comment. I did as you said. It worked on my iPhone, but it still didn't work on the iPhone 14 Pro simulator. Strange thing! Fogmeister above provided an alternative solution which did work on both the real phone and the simulator.
comment on: http://stackoverflow.com/a/75949640
type: AnswerComment
type: Comment

image-processing
type: Tag
tags question: http://stackoverflow.com/q/76022262
tag name: image-processing

http://stackoverflow.com/comment/133995440
has text: @TheDreamsWind I'll update the code for the persistentContainer property since the implementation is long
type: QuestionComment
comment on: http://stackoverflow.com/q/75962915
type: Comment
score: 0

http://stackoverflow.com/comment/134044027
score: 0
comment on: http://stackoverflow.com/a/75997487
has text: we did add that code: @weakify(self); [sessionManager setDataTaskDidReceiveResponseBlock:^NSURLSessionResponseDisposition(NSURLSession * _Nonnull session, NSURLSessionDataTask * _Nonnull dataTask, NSURLResponse * _Nonnull response) { @strongify(self); if (!self) { return NSURLSessionResponseCancel; }
type: AnswerComment
type: Comment

http://stackoverflow.com/tag/pdf
type: Tag
tag name: pdf
tags question: http://stackoverflow.com/q/75857765
tags question: http://stackoverflow.com/q/76199576
tags question: http://stackoverflow.com/q/76189088
tags question: http://stackoverflow.com/q/76180648
tags question: http://stackoverflow.com/q/78799874

http://stackoverflow.com/comment/134484774
type: Comment
score: 0
comment on: http://stackoverflow.com/q/75905667
type: QuestionComment
has text: Not yet. I have deferred implementing the Payment System for now until I can figure it out

http://stackoverflow.com/comment/134643613
has text: Thanks man!, its been a week, i have been checking the issue. finally it got resolved. but i wonder why the Build Libraries for Distribution effect __objC module?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76038505

mastercard
type: Tag
tags question: http://stackoverflow.com/q/75905667
tag name: mastercard

http://stackoverflow.com/comment/133817820
type: Comment
score: 3
has text: you can't do that, you can mix obejctive-c and c++ in a single file but c++ classes can't have objective-c properties
type: QuestionComment
comment on: http://stackoverflow.com/q/75864711

avplayer
tag name: avplayer
tags question: http://stackoverflow.com/q/75985811
type: Tag
tags question: http://stackoverflow.com/q/76555630
tags question: http://stackoverflow.com/q/77381636
tags question: http://stackoverflow.com/q/78283285

http://stackoverflow.com/q/76022077
type: Question
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134186766
has title: Load New View Controller Instead of Presenting Temporary
has answer: http://stackoverflow.com/a/76086260
answer count: 1
tagged with: objective-c
has body: I have the below code which I wanted to use to load a new view controller after the user enters the app via a login form. The problem with this implementation is that when I load the new view, it's own navigation bar doesn't appear on the screen, I think because i the purpose of this function is temporary presentation, when the user can switch back to the previous view. My question is how could I load the other view to display its on navigation bar and don't let the user to go back to the previous view (login area)? UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; UINavigationController *homeViewNavigationController = [storyboard instantiateViewControllerWithIdentifier:@"Tab"]; [homeViewNavigationController setModalPresentationStyle:UIModalPresentationFullScreen]; [self presentViewController:homeViewNavigationController animated:animated completion:nil];
score: 0

http://stackoverflow.com/comment/134850704
has text: @user129393192 But in C23 draft N3096 6.7.6.3 §13 _"For a function declarator without a parameter type list: the effect is as if it were declared with a parameter type list consisting of the keyword `void`. A function declarator provides a prototype for the function."_
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76371638
score: 0

http://stackoverflow.com/a/78063804
answers question: http://stackoverflow.com/q/76026075
type: Answer
has body: Following the discussion on this github issue, I managed to solve the issue without downgrading the version of awesome_nofitications. It seems that changing the following settings in Xcode will solve the problem: In Runner Target: Build libraries for distribution =&gt; NO Only safe API extensions =&gt; NO iOS Deployment Target =&gt; 11 or greater In all other Targets: Build libraries for distribution =&gt; NO Only safe API extensions =&gt; YES iOS Deployment Target =&gt; 11 or greater
score: 0

http://stackoverflow.com/comment/134059831
has text: Thank you I have to set precompile prefix header to yes and in prefix header => PrefixHeader.pch
comment on: http://stackoverflow.com/a/76001255
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/75863219
type: Question
upvote count: 1
has title: Implement picture in picture mode (PIP) for video calls using Objective - C
type: UnansweredQuestion
has body: I have tried with below mentioned code snippet. This code will execute when clicking on minimise button that I have created. But picture in picture mode is not working. Is there any errors in this code? AVPictureInPictureVideoCallViewController *hello= [[AVPictureInPictureVideoCallViewController alloc] init]; hello.preferredContentSize = CGSizeMake(300, 400); [hello.view addSubview:self.view]; AVPictureInPictureControllerContentSource *contentSource = [[AVPictureInPictureControllerContentSource alloc] initWithActiveVideoCallSourceView:self.view contentViewController:hello]; self.pictureInPictureController = [[AVPictureInPictureController alloc] initWithContentSource:contentSource]; self.pictureInPictureController.delegate = self; self.pictureInPictureController.canStartPictureInPictureAutomaticallyFromInline = YES; [self.pictureInPictureController startPictureInPicture]; This self.pictureInPictureController is AVPictureInPictureController. I need a proper answer for implement picture in picture mode for video call view.
has comment: http://stackoverflow.com/comment/134603894
score: 1
tagged with: avkit
favorite count: 0
has comment: http://stackoverflow.com/comment/133902844
tagged with: ios
tagged with: objective-c
downvote count: 0
answer count: 0

http://stackoverflow.com/comment/134020737
comment on: http://stackoverflow.com/q/75987263
type: QuestionComment
score: 1
type: Comment
has text: Does seem odd. One would think that Swift's `DispatchGroup` is just a wrapper around Objective-C's `dispatch_group_t`.

http://stackoverflow.com/q/75856290
score: 0
type: Question
answer count: 1
tagged with: frida
type: UnansweredQuestion
has title: How can I read a NSDictionary using Frida Javascript APIs?
tagged with: javascript
has body: This is my index.js const className = 'NSURLConnection' const methodName = 'sendSynchronousRequest:returningResponse:error:' Interceptor.attach(ObjC.classes[className][`+ ${methodName}`].implementation, { onEnter: function (args) { const request = new ObjC.Object(args[2]) console.log('HTTPHeaders', request.allHTTPHeaderFields) } }) request should be a NSURLRequest. Whenever I try to log the HTTP headers, this is what I get: HTTPHeaders function () { return retType.fromNative.call(this, objc_msgSend(this, sel)); } request.allHTTPHeaderFields should be a NSDictionary. My goal is to save each key/value pair inside a javascript object, like this: obj: { key1: value1, key2: value2 } How can I achieve this result?
has answer: http://stackoverflow.com/a/75856749
tagged with: objective-c

http://stackoverflow.com/a/75976990
score: 0
answers question: http://stackoverflow.com/q/75976964
type: Answer
has body: It seems, from the error message, that you are calling viewDidAppear:. Never do that (except to call super from within your implementation). It is an event method to be called by the runtime, not by you. That is what the error message is telling you. If for some reason you don't know how to find your code where you are making this mistake, the error method also tells you how to set a breakpoint to find it when it happens.

gmail
type: Tag
tags question: http://stackoverflow.com/q/76016717
tag name: gmail

http://stackoverflow.com/comment/134049698
score: 0
has text: Same issue..........
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76004133

http://stackoverflow.com/comment/134074683
score: 0
type: QuestionComment
has text: I'd rather not post an answer since all we know at this point is that it didn't work under iOS 15.6.1 and it works with 16.4.1. I have no way to check if it worked on any other versions before 15.6.1 or any other 16.x versions.
comment on: http://stackoverflow.com/q/76002388
type: Comment

http://stackoverflow.com/comment/134111160
type: Comment
has text: The PDF file size is around 13KB. This file is supposed to be sent out via mail only. If the user haven't logged into the default mail app, I have a check if user uses gmail app, and if yes, I want to perform the above action. The mail is composed in gmail app without the file attached.
comment on: http://stackoverflow.com/q/76016717
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134850981
has text: @user129393192 Yes, a function declarator needed named parameters (or `void`) to have prototype format. This was deprecated in C89 too, I just quoted the current active ISO 9899:2018 ("C17") standard for convenience. In my old copy of C89, then 6.9.5 _"The use of function definitions with separate parameter identifier and declaration lists (not prototype-format parameter type and identifier declarators) is an obsolescent feature._ I think even the esteemed Dennis Ritchie commented about this at some point with regret and in favour of enforcing prototypes.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76371638
score: 0

http://stackoverflow.com/comment/134274262
type: QuestionComment
type: Comment
has text: Thanks for your reply. I did the same for now. Couldn't get it working on Xcode 14.3, sadly.
comment on: http://stackoverflow.com/q/76026075
score: 0

lockscreen
type: Tag
tags question: http://stackoverflow.com/q/75985811
tag name: lockscreen

http://stackoverflow.com/comment/133981687
has text: How is your `persistentContainer` property defined in the application delegate class?
type: Comment
comment on: http://stackoverflow.com/q/75962915
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134186766
type: QuestionComment
has text: Your approach is backwards. Pretend for a moment that your app doesn't need a login screen. Setup your app to initially show the app's main view controller as the root view controller. Now you can deal with the login. If, upon startup, you determine that a login is needed, present the login screen from the main root view. When the login is complete and the login view controller is dismissed, the main view becomes visible again without any need to for any weird changes.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76022077

http://stackoverflow.com/q/75946121
score: 0
has title: Mat nil when reading and writing images with openCV in ios
type: Question
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/75948092
answer count: 2
tagged with: opencv
has answer: http://stackoverflow.com/a/75968883
tagged with: ios
has body: Read Image (tiff) files in IOS (objectiv-C). Save data as NSString* and cast as cv::String. So far, the string I want is stored in a variable. NSString* strTiff = call.arguments[@"Tiff"]; NSString* png = call.arguments[@"Path"]; cv::String test1 = [strTiff cStringUsingEncoding:NSUTF8StringEncoding];; cv::String test2 = [png cStringUsingEncoding:NSUTF8StringEncoding];; cv::Mat tiffImage = cv::imread(test1); bool res = cv::imwrite(test2, tiffImage); But when I run cv::Imread();, cv::Mat tiffImage image is saved as nil. Looking at the official documentation, there seems to be no problem with how to use it, but why is nil returned? tiffImage Data (cv::Mat) tiffImage = { flags = 1124007936 dims = 0 rows = 0 cols = 0 data = 0x0000000000000000 datastart = 0x0000000000000000 dataend = 0x0000000000000000 datalimit = 0x0000000000000000 allocator = nil u = nil size = { p = 0x000000016cf41098 } step = { p = 0x000000016cf410e0 buf = ([0] = 0, [1] = 0) } }
tagged with: objective-c

http://stackoverflow.com/comment/134061813
has text: literally `alert.title=@"Some new title";`
score: 0
comment on: http://stackoverflow.com/a/76011793
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/133851377
type: Comment
comment on: http://stackoverflow.com/q/75884104
has text: `NSClassFromString` is loading ObjC classes, isn't it? Doesn't matter how you describe their interfaces with Objc of Swift. But Swift was designed to get rid from `-ObjC` flag. Could you describe more yours case when you have issues without `-ObjC` flag?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/133949147
type: QuestionComment
comment on: http://stackoverflow.com/q/75943541
type: Comment
score: 0
has text: I am not sure why you are getting this error but a prototype of your function is simply `GDTCORNetworkType GDTCORNetworkTypeMessage();`. It is used to split interface and implementation. Try adding this line to the top of your file. But I doubt this would be the only function in the source that has no prototype defined.

http://stackoverflow.com/comment/134603894
type: QuestionComment
comment on: http://stackoverflow.com/q/75863219
score: 1
type: Comment
has text: Can you elaborate on how you got it working? What's `self` in your context above?

http://stackoverflow.com/comment/134688981
score: 0
has text: Have you found any solution for Archiving with this error and XC 14.3 ? The solution works for development, this is not a normal behaviour for production build :/
type: AnswerComment
comment on: http://stackoverflow.com/a/76038505
type: Comment

http://stackoverflow.com/comment/133958856
comment on: http://stackoverflow.com/q/75949482
type: QuestionComment
score: 1
type: Comment
has text: @Fogmeister Thank you for your comment. I did as you said. And it worked!

http://stackoverflow.com/comment/134850652
type: AnswerComment
comment on: http://stackoverflow.com/a/76371638
type: Comment
score: 0
has text: I see. So you’re saying that the feature of “unknown amount of arguments” got deprecated in 1989 … and now in C23 we finally have it mean “void” … but I didn’t quite catch if compilers in meantime support which version. I think I’m missing a key thing here of when using it in prototype vs the definition itself.

http://stackoverflow.com/a/75856749
downvote count: 0
type: Answer
has body: For simple key-value dictionaries you can easily convert everything to a Java JSON structure by looping through all keys and their values: const className = 'NSURLConnection' const methodName = 'sendSynchronousRequest:returningResponse:error:' Interceptor.attach(ObjC.classes[className][`+ ${methodName}`].implementation, { onEnter: function (args) { const request = new ObjC.Object(args[2]) let json = convertNsDictionaryToJson(request.allHTTPHeaderFields); console.log('HTTPHeaders', JSON.stringify(json)); } }) function convertNsDictionaryToJson(nsDict) { let jsDict = {}; let keys = nsDict.allKeys(); let keyCount = keys.count(); for (var i = 0; i &lt; keyCount; i++) { let key = keys.objectAtIndex_(i); let value = new ObjC.Object(nsDict.objectForKey_(key)); jsDict[key] = String(value); // convert everything to a JavaScript String representation } return jsDict; } Note that the code converts every value to it's String representation. Depending on what is stored inside the NSDictionary this may be necessary or not. The posted code converts everything to String to make sure no ObjC specific types remain as these types can not be serialized if you plan to serialize the JSON structure to a String and print it or use Frida's send() method.
answers question: http://stackoverflow.com/q/75856290
upvote count: 1
score: 1

http://stackoverflow.com/a/75949640
score: 1
answers question: http://stackoverflow.com/q/75949482
type: AcceptedAnswer
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/75949482
has body: I think you need to set the rendering mode of the image view as "UIImageRenderingModeAlwaysOriginal" UIImage *myIcon = [[UIImage imageNamed:@"alert_bell"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; UIImageView *myImageView = [[UIImageView alloc] initWithImage:myIcon]; This could solve your issue.
has comment: http://stackoverflow.com/comment/133958893
downvote count: 0

http://stackoverflow.com/comment/134864266
type: AnswerComment
comment on: http://stackoverflow.com/a/76371638
type: Comment
has text: It seems to me that if you have the definition, and from the definition, you know it takes no parameters, that would suffice as a prototype, but perhaps they didn't see it that way, because the function body was attached, so it wasn't a "true" prototype?
score: 0

http://stackoverflow.com/comment/134031889
type: QuestionComment
score: 0
has text: The issue with AVPlayer was fixed in iOS 16.1. Can you mention the OS version
type: Comment
comment on: http://stackoverflow.com/q/75985811

http://stackoverflow.com/q/75991674
has comment: http://stackoverflow.com/comment/134029689
answer count: 0
tagged with: callkit
tagged with: ios
has comment: http://stackoverflow.com/comment/134027917
type: Question
tagged with: objective-c
type: UnansweredQuestion
has body: I want to send a call rejection notification through CallKit when the app is closed. The following code works properly when executed by a button, but when placed in the applicationWillTerminate method, it executes successfully but cannot reject the call. I would like to know what could be the reason for this. - (void)applicationWillTerminate:(UIApplication *)application { [self endCall]; } - (void)endCall { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ self.callController = [[CXCallController alloc] init]; if (self.callController.callObserver.calls.count > 0) { CXCall *call = self.callController.callObserver.calls.lastObject; if (call.hasConnected == NO) { // 拒绝通话 CXEndCallAction *endAction = [[CXEndCallAction alloc] initWithCallUUID:[[SIMProviderManager sharedInstance] currentCallUUID]]; CXTransaction *transaction = [[CXTransaction alloc] initWithAction:endAction]; [self.callController requestTransaction:transaction completion:^(NSError * _Nullable error) { if (error) { NSLog(@"End call request transaction failed: %@", [error localizedDescription]); } else { NSLog(@"End call request transaction success"); } }]; } } }); }
has title: How to automatically reject incoming calls when the app is terminated using CallKit in iOS
score: 0

http://stackoverflow.com/comment/133958656
type: Comment
comment on: http://stackoverflow.com/q/75949482
has text: In the asset catalog under the “rendering mode” for that image. Which option is selected! If it is selected as “template” then only the transparency of the image is used. The colour comes from the code. Change it to “original”
score: 3
type: QuestionComment

http://stackoverflow.com/comment/134119893
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76016717
has text: A 13kB attachment becomes roughly 18kB as a base64 encoded string. So you are trying to create a URL with over 18,000 characters. I just did a test on an iPhone 13 Pro running iOS 16.4.1 and it had no trouble with such a URL. I was able to decode a 16kB attachment just fine. So that's not the issue. Again, does the gmail app support the `attachment` query parameter? If so, what format does it expect?
type: Comment

http://stackoverflow.com/comment/134088649
score: 0
comment on: http://stackoverflow.com/a/75944602
has text: I have also tried to download the pdf early, maybe 40 minutes or more before it is needed, but have the same results when it is time to draw it
type: AnswerComment
type: Comment

http://stackoverflow.com/a/75968883
score: 0
answers question: http://stackoverflow.com/q/75946121
type: Answer
has body: Solved cv::Mat tiffImage = cv::imread(test1); change cv::Mat tiffImage; UIImageToMat(image, tiffImage, true);

http://stackoverflow.com/a/76174256
has comment: http://stackoverflow.com/comment/135909499
answers question: http://stackoverflow.com/q/75943541
downvote count: 0
score: 22
type: Answer
upvote count: 22
has body: TLDR Apply the following in your Podfile (post_install) post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) installer.pods_project.targets.each do |target| # Make it build with Xcode 14 if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle" target.build_configurations.each do |config| config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' end end # Make it work with GoogleDataTransport if target.name.start_with? "GoogleDataTransport" target.build_configurations.each do |config| config.build_settings['CLANG_WARN_STRICT_PROTOTYPES'] = 'NO' end end end end Details First of all, credit to this post in Github. At the same time, GDT has released the fix too.

http://stackoverflow.com/a/75979068
answers question: http://stackoverflow.com/q/75976964
score: 0
has body: You can't call the viewDidAppear: method by yourself. Instead put whatever code you have inside viewDidAppear: and relocate to a new method which you define yourself. Then you can call that method just as you are calling viewDidAppear: now :)
type: Answer

http://stackoverflow.com/comment/133995431
type: QuestionComment
comment on: http://stackoverflow.com/q/75962915
score: 0
type: Comment
has text: @HangarRash thanks. I didn't, even after adding the check, I'm getting the same error. I'll update the code to include the nil check

http://stackoverflow.com/comment/134025290
score: 1
comment on: http://stackoverflow.com/q/75989522
has text: You need to test what? If there's a hardware problem, there definitely isn't a simple API call that will tell you the hardware is broken. (In that case, Bluetooth is "supported," so to your question, the correct response would be true, even though it doesn't work.) Do you have broken hardware that you're trying to help users diagnose? That's likely a very complex project.
type: Comment
type: QuestionComment

in-app-purchase
tags question: http://stackoverflow.com/q/75950246
type: Tag
tag name: in-app-purchase
tags question: http://stackoverflow.com/q/76841203
tags question: http://stackoverflow.com/q/78733946
tags question: http://stackoverflow.com/q/79072182

http://stackoverflow.com/comment/134065394
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/76011793
has text: If you want it to change over time, you need to set the title over time; each time `loader` changes you need to assign the new value to `title`.

http://stackoverflow.com/comment/134696615
has text: I don't know if this might help, but if you're using cocoapods an archiving issue we encountered was solved by changing source="$(readlink "${source}")" in the Pods-[ProjectName]-frameworks file to source="$(readlink -f "$source")". Article: https://stackoverflow.com/questions/75574268/missing-file-libarclite-iphoneos-a-xcode-14-3
type: AnswerComment
comment on: http://stackoverflow.com/a/76038505
type: Comment
score: 0

http://stackoverflow.com/comment/133948828
type: QuestionComment
comment on: http://stackoverflow.com/q/75943541
type: Comment
score: 9
has text: Put `void` in the empty parentheses on the error line.

debugging
tags question: http://stackoverflow.com/q/75940769
type: Tag
tag name: debugging
tags question: http://stackoverflow.com/q/79455766

viewdidappear
type: Tag
tags question: http://stackoverflow.com/q/75976964
tag name: viewdidappear

http://stackoverflow.com/comment/134025316
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/75989339
has text: As an example, ObjC considers the possibility that memory may be exhausted and the required data structures cannot be initialized. In practice, it's basically impossible to actually deal with memory exhaustion in ObjC, and no one really does, but it is considered a legitimate non-fatal failure. Swift does not consider memory exhaustion to be a recoverable error.

http://stackoverflow.com/comment/133825650
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/75864711
has text: @TheDreamsWind It is a cross-platform app in QT that compiles for Android and Windows as well, so it has C++ class `InterstitialAd` base class that is implemented in different ways on different OSes.

http://stackoverflow.com/comment/134024811
type: QuestionComment
comment on: http://stackoverflow.com/q/75989522
has text: I don't know if it's possible, I think yes (a hardware problem, ...), I need to test it.
type: Comment
score: 0

http://stackoverflow.com/comment/133967630
has text: `readFilePath` and `image` are not `nil`. But still the error exists. The error is `error: (-215:Assertion failed) !_img.empty() in function 'imwrite'`.
comment on: http://stackoverflow.com/a/75948092
score: 0
type: AnswerComment
type: Comment

segmentation-fault
type: Tag
tag name: segmentation-fault
tags question: http://stackoverflow.com/q/75986813

http://stackoverflow.com/comment/134027760
score: 0
type: QuestionComment
type: Comment
has text: @TheDreamsWind yes! I'm seeing that the addresses are different. I even tried to override `initWithCoder` and am seeing this being called twice for the same view controller. How would I make sure that it's only called once for the view controller I added using storyboard?
comment on: http://stackoverflow.com/q/75962915

http://stackoverflow.com/comment/134848907
has text: So the common convention `int main()` has always been invalid? I received a compile error with strict compile flags on, and that was a first for me.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/76371638
type: Comment

uiactivityviewcontroller
type: Tag
tag name: uiactivityviewcontroller
tags question: http://stackoverflow.com/q/76002388

http://stackoverflow.com/comment/134135169
has text: Click on your project file in Xcode, then in the Targets select the Project, then Build Settings tab, and search Build Libraries for Distribution. That sets it globally. You can also do it individually for a Pod in the Pods, Build Settings.
type: AnswerComment
comment on: http://stackoverflow.com/a/76038505
type: Comment
score: 1

http://stackoverflow.com/comment/134202930
has text: Did you find any solution? I am experiencing the same issue here after upgrading xcode to 14.3.
type: QuestionComment
comment on: http://stackoverflow.com/q/76026075
score: 1
type: Comment

http://stackoverflow.com/comment/134283756
has text: Did you remove the old one? Same error code?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76026075
type: Comment

dispatchgroup
tag name: dispatchgroup
type: Tag
tags question: http://stackoverflow.com/q/75987263

http://stackoverflow.com/comment/134850752
has text: So if I'm understanding right, between C89 to C17, a "declarator" with no definition was not a prototype per se, but just some information to let the compiler know that symbol exists ... and now they are saying that the declarator does give a prototype for the function that must be later followed. Seems like if it were in C17 though, it weren't deprecated since C89, unless I'm missing something.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/76371638
type: Comment

http://stackoverflow.com/comment/134268522
type: Comment
comment on: http://stackoverflow.com/q/76026075
score: 0
type: QuestionComment
has text: I solved by downgrading Xcode to 14.2

http://stackoverflow.com/comment/134050629
comment on: http://stackoverflow.com/a/76001255
has text: Your sample code doesn't reproduce this problem. It compiles file if EventEmitter references are commented out. I recommend building a tiny RN app that just imports this one thing, and build up from there until you reproduce the problem. Nothing you've described here seems to involve the C++, so it's unclear why that's your focus. Is there a C++ error you're not telling us about?
type: AnswerComment
type: Comment
score: 0

pfquery
type: Tag
tag name: pfquery
tags question: http://stackoverflow.com/q/75857765

http://stackoverflow.com/comment/134043526
type: Comment
has text: I found a solution here: https://stackoverflow.com/questions/41243007/how-to-include-nspersistentcontainer-in-appdelegate where instead of passing the persistent container from the appdelegate, I would define it in the view controller like so `self.persistentContainer = ((AppDelegate *)[UIApplication sharedApplication].delegate).persistentContainer;`. I'm not super happy about this solution but it's the only one I found that works. if there's a better solution, I'm game.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/75962915

http://stackoverflow.com/a/76265637
type: Answer
has body: Linking as static frameworks by adding use_frameworks! :linkage => :static to your Podfile. Flipper does not work when use_frameworks is enabled, and you should remove it from Podfile. Adding the -no-verify-emitted-module-interface flag to failing targets to avoid verification failure. You can add the following post install hook to your Podfile to automatically add this flag. In my case my Pods were AEP so I used "AEP". post_install do |installer| installer.pods_project.targets.each do |t| if t.name.start_with?("AEP") t.build_configurations.each do |bc| bc.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -no-verify-emitted-module-interface' end end end end https://github.com/adobe/aepsdk-rulesengine-ios/issues/68#issuecomment-1548199715
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/75903232
score: 1

http://stackoverflow.com/comment/134028477
comment on: http://stackoverflow.com/a/75989339
score: 0
type: AnswerComment
has text: @RobNapier Based on the linked source, they seem to access members of the object pointer without checking if it is `NULL`. So if it fails undefined behavior will have been invoked anyway.
type: Comment

cocoapods
type: Tag
tag name: cocoapods
tags question: http://stackoverflow.com/q/75981242
tags question: http://stackoverflow.com/q/76793320
tags question: http://stackoverflow.com/q/77167307
tags question: http://stackoverflow.com/q/77272011
tags question: http://stackoverflow.com/q/77270424
tags question: http://stackoverflow.com/q/77256529
tags question: http://stackoverflow.com/q/77518826
tags question: http://stackoverflow.com/q/77599602
tags question: http://stackoverflow.com/q/77869520
tags question: http://stackoverflow.com/q/78032810
tags question: http://stackoverflow.com/q/78757491
tags question: http://stackoverflow.com/q/78976697
tags question: http://stackoverflow.com/q/78988312
tags question: http://stackoverflow.com/q/79009379

flutter
type: Tag
tag name: flutter
tags question: http://stackoverflow.com/q/76026075
tags question: http://stackoverflow.com/q/76171892
tags question: http://stackoverflow.com/q/76262477
tags question: http://stackoverflow.com/q/76604747
tags question: http://stackoverflow.com/q/77058213
tags question: http://stackoverflow.com/q/77479986
tags question: http://stackoverflow.com/q/77647922
tags question: http://stackoverflow.com/q/78499204
tags question: http://stackoverflow.com/q/78723321
tags question: http://stackoverflow.com/q/78761078
tags question: http://stackoverflow.com/q/79017759
tags question: http://stackoverflow.com/q/79093041

http://stackoverflow.com/a/76086260
has body: Ok one possible solution can be hide the navigation controller before pushing new views into the view hierarchy. [homeViewNavigationController setNavigationBarHidden:YES animated:YES]; Reference: https://developer.apple.com/documentation/uikit/uinavigationcontroller/1621885-setnavigationbarhidden?language=objc
type: Answer
answers question: http://stackoverflow.com/q/76022077
upvote count: 1
downvote count: 0
score: 1

http://stackoverflow.com/comment/133825987
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/75869473
score: 0
has text: I need to add `@implementation YMAInterstitialAdDelegate` with `interstitialAdDidLoad` and `interstitialAdDidFailToLoad` methods, right?

http://stackoverflow.com/comment/134834959
type: AnswerComment
comment on: http://stackoverflow.com/a/76371638
type: Comment
score: 0
has text: I thought that empty parantheses means a function that takes an unspecified number of arguments?

http://stackoverflow.com/comment/134850568
has text: @user129393192 It confused me too, see https://stackoverflow.com/questions/76063843/regarding-mainstream-compilers-and-int-main-in-c23
type: AnswerComment
comment on: http://stackoverflow.com/a/76371638
type: Comment
score: 0

http://stackoverflow.com/comment/133901838
type: QuestionComment
has text: @Cy-4AH I'm sorry for being late. If there is a `module B` in `module A`, I am attempting to perform reflection. Therefore, in `module A`, I am trying to retrieve a class without importing the `module B`, using `NSClassFromString` to check if the class exists and then obtain it. However, if the class is not already loaded because I did not use the `-ObjC` or `-all_load` flags, `NSClassFromString` will return nil. Therefore, I am wondering if there is a flag in Swift that can load classes beforehand similar to the `-ObjC` flag.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/75884104

ios16
tags question: http://stackoverflow.com/q/75985811
tag name: ios16
type: Tag
tags question: http://stackoverflow.com/q/77064360

http://stackoverflow.com/comment/133980909
type: QuestionComment
comment on: http://stackoverflow.com/q/75962915
score: 0
type: Comment
has text: Have you checked whether your app delegate's `persistentContainer` is non-nil at the time you call the line `todoListVC.persistentContainer = self.persistentContainer;`? Have you verified that that line is being called before `viewDidLoad`?

http://stackoverflow.com/comment/134334161
comment on: http://stackoverflow.com/q/76111768
score: 0
type: QuestionComment
type: Comment
has text: @Paulw11 That worked perfectly thank you. Do you know if there's any built in way to exclude reserved addresses from being returned in this?

http://stackoverflow.com/q/76140890
upvote count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/76141412
favorite count: 0
type: Question
linked to: http://stackoverflow.com/q/76140643
has comment: http://stackoverflow.com/comment/134278290
score: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/76141412
type: AnsweredQuestion
tagged with: objective-c
has title: memory leak from NSString→const char* conversion in Objective C
has body: In another question I asked as an aside, for confirmation that my use of NSString→const char* in the code below is correct. I was asked to remove this as two questions were being asked in a single post. The code that I have below works, but I can see that memory consumption grows monotonically, so I am concerned about a memory leak. Attempting to free the strings results in "pointer being freed was not allocated"; no experience in Objective C, but this segfault seems like the correct behaviour, so where is the leak? #include <Cocoa/Cocoa.h> #include <CoreGraphics/CGWindow.h> struct details { int wid; int pid; const char* name; const char* window; }; int activeWindow(struct details *d) { if (d == NULL) { return 0; } NSArray *windows = (NSArray *)CGWindowListCopyWindowInfo(kCGWindowListExcludeDesktopElements|kCGWindowListOptionOnScreenOnly,kCGNullWindowID); for(NSDictionary *window in windows){ int WindowLayer = [[window objectForKey:(NSString *)kCGWindowLayer] intValue]; if (WindowLayer == 0) { d->wid = [[window objectForKey:(NSString *)kCGWindowNumber] intValue]; d->pid = [[window objectForKey:(NSString *)kCGWindowOwnerPID] intValue]; d->name = [[window objectForKey:(NSString *)kCGWindowOwnerName] UTF8String]; d->window = [[window objectForKey:(NSString *)kCGWindowName] UTF8String]; return 1; } } return 0; }
linked to: http://stackoverflow.com/q/70050353

http://stackoverflow.com/q/76183122
downvote count: 0
tagged with: signal-processing
type: UnansweredQuestion
has body: I'm adding some new features to the audio player in my app KeyStage. One of the features that I wanna add is the transpose functionality. I found a real-time pitch shifter unit in AVAudioEngine, but it outputs the signals with approximately 0.1-second latency, which renders it useless. I don't know anything about digital signal processing (I hope to learn it at some point when I have time). Still, after some web search, I discovered that all the real-time pitch-shifting algorithms produce a similar amount of latency, so real-time pitch-shifting is out of the table for me. Therefore I need to change the pitch of the whole audio file or the buffer in non-real time in Swift or Objective-C. So I need a function that takes an AVAudioFile (or an AVAudioPCMBuffer) and a pitch shift amount in cents and outputs the pitch-shifted AVAudioFile (or AVAudioPCMBuffer), possibly through a completion handler or a message to delegate. I searched online for such a project or library but couldn't find any. I wish I could write such a function independently, but as I said, I don't know any DSP. I'd appreciate it if anyone can help me with this. Can third-party libraries do this in objective c (or Swift)? Or, if this is a simple algorithm, can someone guide me on how I can achieve this? I even tried using chatGPT, but the codes it generates have tons of errors. Here is what chatGPT provided me: import Foundation import Accelerate func pitchShiftUsingFFT(audioFile: AVAudioFile, semitones: Float) -> AVAudioPCMBuffer? { // Load input audio file guard let inputFormat = AVAudioFormat(commonFormat: .pcmFormatFloat32, sampleRate: audioFile.fileFormat.sampleRate, channels: 1, interleaved: false), let inputFile = try? AVAudioFile(forReading: audioFile.url, commonFormat: .pcmFormatFloat32, interleaved: false) else { print("Failed to load input audio file") return nil } // Calculate pitch shift factor and ratio let pitchShiftFactor = pow(2.0, semitones/12.0) let pitchShiftRatio = Float(inputFormat.…
has title: Non-realtime pitch shift function for swift or objective c
upvote count: 2
tagged with: objective-c
tagged with: pitch-shifting
answer count: 0
has comment: http://stackoverflow.com/comment/136038367
favorite count: 0
score: 2
type: Question
tagged with: swift

http://stackoverflow.com/q/76171892
tagged with: objective-c
has title: +[GMSx_GMPCClientVectorTileExtensionsRoot indoorBuildingMetadata]: unrecognized selector sent to class
favorite count: 0
has answer: http://stackoverflow.com/a/76172053
score: 0
has body: I have google maps pod installed in my app and using third party SDK which is internally using google maps. Whenever i am trying to enter to load Maps screen, it immediately crashing with below exception. Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[GMSx_GMPCClientVectorTileExtensionsRoot indoorBuildingMetadata]: unrecognized selector sent to class 0x100c90448' When I remove that custom SDK and loading maps, it is successfully loading without crash. Dont know what is the exact issue here. Suggestions would be helpful to solve this issue.
type: UnansweredQuestion
tagged with: swift
tagged with: flutter
tagged with: ios
downvote count: 1
type: Question
upvote count: 1
answer count: 1

http://stackoverflow.com/q/76145278
tagged with: macos
favorite count: 0
has body: I am learning to write EndpointSecurity Client for macOS. The client is running and observes all the notifications from all the paths from "/" (root), as it runs as root. I have muted all the system-paths. What I need is to observe path for /Users/anoopvaidya for any file changes. But this never happens, what am I missing? What I learn is if there are several notifications it may get skipped in the Queue. So is there a way to mute-all but targeted ones? Any leads/guidance is much appreciated. Here is the full code: static void handleEvent(es_client_t *client, const es_message_t *msg) { char const *filePath = msg->process->executable->path.data; NSString *filePathString = [[NSString alloc] initWithFormat:@"%s", filePath]; // TODO: need to check the user who logged in, is this possible? NSString *path = [NSString stringWithFormat:@"/Users/%@/Documents", @"anoopvaidya"]; os_log(OS_LOG_DEFAULT, "filePathString = %@, path = %@", filePathString, path); // check if the events are from path if ([filePathString hasPrefix:path]) { os_log(OS_LOG_DEFAULT, "Compare - filePathString = %@, path = %@", filePathString, path); os_log(OS_LOG_DEFAULT, "proceeding..."); } else { return; } switch (msg->event_type) { case ES_EVENT_TYPE_NOTIFY_EXEC: os_log(OS_LOG_DEFAULT, "%{public}s (pid: %d) | EXEC: New image: %{public}s", msg->process->executable->path.data, audit_token_to_pid(msg->process->audit_token), msg->event.exec.target->executable->path.data); break; case ES_EVENT_TYPE_NOTIFY_FORK: os_log(OS_LOG_DEFAULT, "%{public}s (pid: %d) | FORK: Child pid: %d", msg->process->executable->path.data, audit_token_to_pid(msg->process->audit_token), audit_token_to_pid(msg->event.fork.child->audit_token)); break; case ES_EVENT_TYPE_NOTIFY_EXIT: os_log(OS_LOG_DEFAULT, "%{public}s (pid: %d) | EXIT: status: %d", msg->process->executable->path.data, audit_token_to_pid(msg->process->audit_token), msg->event.exit.stat); break; case ES_EVENT_TYPE_NOTIFY_OPEN: os_log(OS_LOG_DEFAULT, "Open event"); break; …
tagged with: objective-c
has answer: http://stackoverflow.com/a/76902389
has title: MacOS EndpointSecurity, how to observe a specific path
tagged with: endpointsecurity
tagged with: endpoint
type: Question
upvote count: 1
downvote count: 0
answer count: 1
type: UnansweredQuestion
score: 1

http://stackoverflow.com/q/76059936
has title: Get NSHomeDirectory() in pure C
downvote count: 1
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/134141484
answer count: 1
tagged with: http://stackoverflow.com/tag/c
has body: I am trying to get the NSHomeDirectory() in pure C #include &lt;CoreFoundation/CFBundle.h&gt; #include &lt;CoreFoundation/CoreFoundation.h&gt; void testFunc() { printf(NSHomeDirectory()); }
favorite count: 0
score: 0
type: AnsweredQuestion
tagged with: nsstring
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134159638
linked to: http://stackoverflow.com/q/38945963
has answer: http://stackoverflow.com/a/76060045
has comment: http://stackoverflow.com/comment/134150135
accepted answer: http://stackoverflow.com/a/76060045
tagged with: nshomedirectory

http://stackoverflow.com/comment/134184804
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76080736
has text: A view's frame in `viewDidLoad` should never be relied on. Always use constraints to deal with view size adjustments caused by any number of reasons.

http://stackoverflow.com/a/76185909
type: Answer
upvote count: 1
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/76185744
has body: Your decodeObjectOfClasses:forKey: is being called with key1 However, it's the key in the dictionary that is being archived, not the key for the root object which is why it doesn't work. You can try this: NSDictionary *unarchivedDict = [unarchiver decodeObjectOfClasses:[NSSet setWithObjects:[NSDictionary class], [NSString class], [NSNumber class], nil] forKey:NSKeyedArchiveRootObjectKey]; if (!unarchivedDict) { NSLog(@"Error decoding object: %@", [unarchiver error]); return 1; } [unarchiver finishDecoding]; I change forKey:@"key1" to forKey:NSKeyedArchiveRootObjectKey By doing this, the unarchiver will decode the root object of the archive. You should get this key1 = value1; key2 = 42;
answers question: http://stackoverflow.com/q/76185744
type: AcceptedAnswer

http://stackoverflow.com/comment/134310889
comment on: http://stackoverflow.com/q/76149338
type: Comment
has text: I believe this is the case, as each item in my outline view is a unique object.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134296471
comment on: http://stackoverflow.com/q/76151348
score: 0
has text: Your question prompted me add swizzling methods that take Objc-C blocks to SwizzleHelper, and I found it necessary to add `@convention(block)` in the signature for Swift-side methods that I'm swizzling. So in your case maybe `func swizzledPullTypes(fromServer completionBlock: @escaping @convention(block) (Any) -> Void, error errorBlock: @escaping MKNKErrorBlock)`. I don't know but I suspect that `MKNKErrorBlock` is already `@convention(block)`. I've also realized I should add support for swizzling class methods, which you are doing. I've only needed it for instance methods.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/134196832
type: Comment
has text: Also, it's certainly not the case that "most C++ programmers write their programs on Windows..." C++ is used on a large variety of platforms, from embedded systems to supercomputers.
comment on: http://stackoverflow.com/a/76092478
score: 0
type: AnswerComment

http://stackoverflow.com/q/76199112
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/134377348
answer count: 1
linked to: http://stackoverflow.com/q/24670269
has body: I am trying to animate and resize a CAGradientLayer using a pan and tap gesture but it's lagging. I am animating other things along with this gradientLayer but speed of animation of gradientLayer slower than that of other UI animation. I have created a sample UIViewController in which I have a rectangle inside which I have my gradient layer. You can simply drag the rectangle to resize it or you can tap on it. You can see the timing difference in animation of rectangle's grey border and gradient layer. ViewController class ViewController: UIViewController { var rectangle: UIView! var gradientLayer: CAGradientLayer? var widthConstraint:NSLayoutConstraint! var shouldExpand = false override func viewDidLoad() { super.viewDidLoad() rectangle = UIView() view.addSubview(rectangle) rectangle.translatesAutoresizingMaskIntoConstraints = false rectangle.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: view.frame.width * 0.05).isActive = true rectangle.heightAnchor.constraint(equalToConstant: 200).isActive = true widthConstraint = rectangle.widthAnchor.constraint(equalToConstant: 100) widthConstraint.isActive = true rectangle.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true rectangle.layer.cornerRadius = 15 rectangle.layer.borderWidth = 5 rectangle.layer.borderColor = UIColor.lightGray.cgColor setUpGesture() setUpGradient() } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) if let layer = gradientLayer { layer.frame = rectangle.bounds } } func setUpGesture() { let panGesture = UIPanGestureRecognizer(target: self, action: #selector(handlePanGesture)) rectangle.addGestureRecognizer(panGesture) let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleTapGesture)) rectangle.addGestureRecognizer(tapGesture) } func setUpGradient() { gradientLayer = CAGradientLayer() gradientLayer!.frame = rectangle.bounds gradientLayer!.startPoint = .init(x: -1, y: 0) gradientLayer!.endPoint = .init(x: 1, y: 0) grad…
tagged with: uikit
tagged with: ios
tagged with: swiftui
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/76200243
tagged with: objective-c
has title: Animate and resize a linear gradient (CAGradientLayer) using drag and pan gesture
score: 0
accepted answer: http://stackoverflow.com/a/76200243

http://stackoverflow.com/q/76092456
has comment: http://stackoverflow.com/comment/134197112
tagged with: c++
has comment: http://stackoverflow.com/comment/134263262
duplicate of: http://stackoverflow.com/q/75516453
has comment: http://stackoverflow.com/comment/134224950
has comment: http://stackoverflow.com/comment/134196678
has title: Using C++ in Objective-C
has comment: http://stackoverflow.com/comment/134218752
has comment: http://stackoverflow.com/comment/134216676
has body: I'm trying to use C++ with Objective-C. My tasks force me to use C++ only for crossplatform core. Goal is to reuse core on different platforms and rewrite only graphics interface. I know Objective-C pretty well, and also some C++. However, when I try to use them together, get a ton of errors. For example: CppFile.cpp #include "ObjCFile.h" int main() { ObjCFile *objCFile; } ObjCFile.h #import <UIKit/UIKit.h> @interface ObjCFile : UIViewController - (void)showInterface; ... With the two files above, I get errors about things that seems completely unrelated, such as undefined NSString and so on. I've tried to look for answers to this problem on Google, and here on StackOverflow and found one approach, but it's not very clear because same C++ class in this case uses 2 type of methods : 1.Implemented outside 2.Implemented inside. And inside methods will call outside methods (C++ class from internal logic must call it’s own methods that implements different logic). There’s no responsibility division (SOLID). You may check this approach link How to call functions in c++ and objective-c to each other
score: 1
upvote count: 2
has comment: http://stackoverflow.com/comment/134224931
has comment: http://stackoverflow.com/comment/134215739
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/134196596
has comment: http://stackoverflow.com/comment/134195882
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134198511
has answer: http://stackoverflow.com/a/76092478
tagged with: objective-c++
tagged with: xcode
favorite count: 0
linked to: http://stackoverflow.com/q/75516453

http://stackoverflow.com/q/76029695
tagged with: github-actions
type: Question
has comment: http://stackoverflow.com/comment/134094212
linked to: http://stackoverflow.com/q/75192071
linked to: http://stackoverflow.com/q/75531993
type: AnsweredQuestion
score: 0
has title: SonarQube Github Action for Objective-C
tagged with: objective-c
has answer: http://stackoverflow.com/a/76039404
accepted answer: http://stackoverflow.com/a/76039404
answer count: 1
has body: I am trying to setup SonarQube for a project hosted on Github. The settings offered in the SonarQube UI are good, despite the fact that the project uses the Objective-C programming language. The Github Action I am using is jobs: sonarcloud: name: SonarCloud runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} and it fails with ERROR: Error during SonarScanner execution java.lang.UnsupportedOperationException: The only way to get an accurate analysis of C/C++/Objective-C files is by using the SonarSource build-wrapper and setting the property "sonar.cfamily.build-wrapper-output" or by using Clang Compilation Database and setting the property "sonar.cfamily.compile-commands". None of these two options were specified. Is there some Github Action that will run the SonarSource build-wrapper, or what would be the best next step?
tagged with: sonarqube

http://stackoverflow.com/comment/134087134
has text: You might be looking for [libffi](https://sourceware.org/libffi/).
type: QuestionComment
score: 1
type: Comment
comment on: http://stackoverflow.com/q/76027766

http://stackoverflow.com/comment/134307498
score: 0
has text: It occurs to me that I haven't asked an obvious question, what manner of "not working" are you seeing? Does it compile and run, but your swizzled method isn't called? Does it crash?
type: Comment
comment on: http://stackoverflow.com/q/76151348
type: QuestionComment

http://stackoverflow.com/q/76193081
tagged with: core-graphics
tagged with: objective-c
linked to: http://stackoverflow.com/q/11505255
has title: Querying whether a mac is in the locked state using Objective-C
type: Question
answer count: 1
score: 0
accepted answer: http://stackoverflow.com/a/76241560
tagged with: macos
has body: I would like to be able detect whether a mac is in the locked or asleep state via Objective-C. This question from 2012 provides half of the answer using the kCGSessionOnConsoleKey key into the dictionary provided by CGSessionCopyCurrentDictionary(). CFDictionaryRef session = CGSessionCopyCurrentDictionary(); if (session != NULL) { d-&gt;locked = ![[(id)session objectForKey:(NSString *)kCGSessionOnConsoleKey] boolValue]; // d's locked field name is not yet correct. CFRelease(session); } The obvious next step of using a CGSSessionScreenIsLocked key fails because it is not part of the dictionary's entries; TBH it's unclear how the linked answer worked given this, but I've seen many variations on the theme, so I guess it must have at some point. Was CGSSessionScreenIsLocked deprecated or does it live somewhere else? Is there an alternative approach to achieve this?
has answer: http://stackoverflow.com/a/76241560
type: AnsweredQuestion

http://stackoverflow.com/comment/134122154
has text: @willeke self AppDelegate * 0x6000004d4f60 0x00006000004d4f60 Edit:i use XIP, not NSViewController.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76035273
type: Comment

http://stackoverflow.com/q/76080307
tagged with: layoutmargins
tagged with: xcode
has body: I am simply trying to create a colored border along the margins of two subviews, one of which is defined in ViewController and the other in a UIView subclass. Both are subviews of the root view. I would like to make the blue border from the second subview (created in UIView subclass) match the red border from the first subview (created in ViewController). ViewController (root view) - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; // add border subview (red) UILayoutGuide *margins = self.view.layoutMarginsGuide; self.view.translatesAutoresizingMaskIntoConstraints = NO; UIView *l3 = [[UIView alloc] init]; [self.view addSubview:l3]; l3.layer.borderWidth = (CGFloat)1.0; l3.layer.borderColor = UIColor.systemRedColor.CGColor; l3.translatesAutoresizingMaskIntoConstraints = NO; [l3.trailingAnchor constraintEqualToAnchor:margins.trailingAnchor].active = YES; [l3.leadingAnchor constraintEqualToAnchor:margins.leadingAnchor].active = YES; [l3.topAnchor constraintEqualToAnchor:margins.topAnchor].active = YES; [l3.bottomAnchor constraintEqualToAnchor:margins.bottomAnchor].active = YES; // add border subview from LibraryView class (blue) LibraryView *library = [[LibraryView alloc] initWithFrame:self.view.frame]; [self.view addSubview:library]; } LibraryView (subview, UIView subclass) @implementation LibraryView // LibraryView inherits from UIView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self != nil) { // add margins of this LibraryView object UILayoutGuide *margins = self.layoutMarginsGuide; self.layer.borderWidth = (CGFloat)1.0; self.layer.borderColor = UIColor.systemBlueColor.CGColor; self.translatesAutoresizingMaskIntoConstraints = NO; [self.trailingAnchor constraintEqualToAnchor:margins.trailingAnchor].active = YES; [self.leadingAnchor constraintEqualToAnchor:margins.leadingAnchor].active = YES; [self.topAnchor constraintEqualToAnchor:margins.topAnchor].active = YES; [self.bottomAnchor con…
tagged with: uiview
has answer: http://stackoverflow.com/a/76080736
score: 0
accepted answer: http://stackoverflow.com/a/76080736
type: Question
answer count: 1
tagged with: ios
type: AnsweredQuestion
tagged with: objective-c
has title: Why are the margins of the root view and a subview with the same frame different?

http://stackoverflow.com/comment/134304136
comment on: http://stackoverflow.com/q/76149831
type: QuestionComment
score: 0
type: Comment
has text: Well... if you're on a 2x screen-scale device, you're generating a `16,000 x 1,000` pixel image... on a 3x device, a `24,000 x 1,500` pixel image. Those are pretty big, and likely why you get nothing when trying to use `UIGraphicsImageRenderer`.

http://stackoverflow.com/comment/134106877
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76038481
type: Comment
has text: I suggest using NSURLSession to download the remote PDF first, save it locally, then use your code with a local URL.

http://stackoverflow.com/a/76164006
type: Answer
has comment: http://stackoverflow.com/comment/134318394
has comment: http://stackoverflow.com/comment/134319686
answers question: http://stackoverflow.com/q/76156263
score: 0
has body: You have multiple problems. Lots of deprecated stuff to remove : <preference name="WKWebViewOnly" value="true" /> <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" /> You don't need to set any of this anymore with cordova-ios 6.2.0 as it all defaults to WKWebViewEngine. Also everything with feature is also deprecated.

http://stackoverflow.com/q/76180099
has comment: http://stackoverflow.com/comment/134347288
tagged with: nsstring
answer count: 2
tagged with: objective-c
has answer: http://stackoverflow.com/a/76180608
upvote count: 1
has comment: http://stackoverflow.com/comment/134354762
has body: Why i dont get NaN as result? 0 is wrong. Maybe compiler settings? CGFloat fValue = [@"NaN" floatValue]; // fValue is 0 double ddd = [@"NaN" doubleValue]; // also 0` Edit: Strange, in swift this works and returns nan: let fValue = Float ("NaN") let ddd = Double ("NaN")
type: Question
tagged with: cgfloat
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/76180529
has comment: http://stackoverflow.com/comment/134346912
score: 1
downvote count: 0
favorite count: 0
has title: Why NSString floatvalue return 0 for "NaN"?

http://stackoverflow.com/comment/134109694
comment on: http://stackoverflow.com/q/76035273
has text: Did you change anything? You should use `NSTableViewSelectionDidChangeNotification` instead of `@"NSTableViewSelectionDidChangeNotification"` but it should work. What is the class of `self`?
score: 0
type: QuestionComment
type: Comment

signal-processing
tags question: http://stackoverflow.com/q/76183122
type: Tag
tag name: signal-processing

http://stackoverflow.com/q/76104158
has comment: http://stackoverflow.com/comment/134225448
type: UnansweredQuestion
tagged with: microsoft-teams
has title: Objective C: Sharing pdf files to Microsoft teams fails when using iPad
has answer: http://stackoverflow.com/a/76110827
tagged with: objective-c
type: Question
has body: The code i use to present the action to the user after the share button is tapped, is as follows: UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil]; if ( [activityVC respondsToSelector:@selector(popoverPresentationController)] ) { // iOS8 [activityVC.popoverPresentationController setPermittedArrowDirections:UIPopoverArrowDirectionRight]; activityVC.popoverPresentationController.sourceView = [self.myUiBarButtonItem valueForKey:@"view"]; } [self presentViewController:activityVC animated:TRUE completion:nil]; Sharing files has worked in the past but now has stopped working on iPad when sending pdf content to Microsoft Teams. I get the expected behaviour on iPhone though. Both devices have IOS version of 16.4.1 The file size is the same on both devices so it is very mysterious why this only fails on one of the devices. I know that the popover presentation controller must not be nil on iPad's and i have verified that not to be the case. I tried adding a completion handler to my UIActivityViewController but this returned no errors. tl;dr: Works on iPhone, not iPad file size is same I don't get errors returned from the activity controller I get error above when sending pdf to Microsoft Teams I tried putting a pdf file into the bundle because i thought it might have something to do with memory(Busted). I tried saving the file when didFinishNavigation gets called and then loading it when the share button is tapped because i thought it might have something to do with completion and or asynchronous issues(Busted). I tried setting the modal presentation style and setting the preferred content size(Was not the issue). I tried sending my url as data instead. I tried using a UIDocumentInteractionController instead, same error.
answer count: 1
has comment: http://stackoverflow.com/comment/134217106
score: 0

http://stackoverflow.com/a/76193965
downvote count: 1
upvote count: 1
score: 0
has body: You can try cpdf -remove-annotations in.pdf -o out.pdf. This does remove all annotations, but if you only have link annotations, that would be ok.
answers question: http://stackoverflow.com/q/76189088
type: Answer

http://stackoverflow.com/q/76046184
accepted answer: http://stackoverflow.com/a/76046344
tagged with: indexoutofboundsexception
has body: I have a textfield that accepts numbers and I am trying to replace the 8th character in the string with a &quot;.&quot; if(self.txtQty.text.length &gt;= 8){ NSRange range = NSMakeRange(8,1); self.txtQty.text = [self.txtQty.text stringByReplacingCharactersInRange:range withString:@&quot;.&quot;]; } -Example- 1234567.90 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString replaceCharactersInRange:withString:]: Range or index out of bounds' *** First throw call stack: I keep receiving this error.
tagged with: ios
type: Question
tagged with: invalidargumentexception
answer count: 1
tagged with: objective-c
has title: ReplacingCharactersInRange out of bounds error
score: 0
has answer: http://stackoverflow.com/a/76046344
type: AnsweredQuestion

http://stackoverflow.com/comment/134294891
comment on: http://stackoverflow.com/q/76149338
score: 0
type: QuestionComment
type: Comment
has text: It is cell based.

http://stackoverflow.com/q/76027766
has comment: http://stackoverflow.com/comment/134089799
has comment: http://stackoverflow.com/comment/139351680
type: UnansweredQuestion
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/134087134
answer count: 0
tagged with: http://stackoverflow.com/tag/c
tagged with: objective-c-runtime
has comment: http://stackoverflow.com/comment/134181586
tagged with: macos
upvote count: 2
has title: Mac native function (ObjC / LibC) to call function with arguments
tagged with: vba
has comment: http://stackoverflow.com/comment/139341039
has comment: http://stackoverflow.com/comment/134087255
linked to: http://stackoverflow.com/q/34885868
has body: I maintain a 'modern' VBA library on github stdVBA. The library provides a high level wrapper on top of many low level functions in Windows OS. Mac compatibility is desired and the main obstruction is entry to the ObjC API. We can get classes using objc_lookUpClass and get pointers to methods with class_getMethodImplementation: Private Declare Function objc_lookUpClass Lib "/usr/lib/libobjc.A.dylib" (ByVal sClassName As String) As LongPtr Private Declare Function class_getMethodImplementation Lib "/usr/lib/libobjc.A.dylib" (ByVal klass as LongPtr, ByVal sClassName As String) As LongPtr Sub main() Dim lKlass as LongPtr: lKlass = objc_lookUpClass("NSRegularExpression") Dim lMethod as LongPtr: lMethod = class_getMethodImplementation(lKlass, "regularExpressionWithPattern") Dim lRegex as LongPtr: lRegex = SOMEHOW_CALL_METHOD(lKlass, "options", 0, "error", AddressOf MyFunction) End Sub However we have no method of calling the method pointer we obtain? Unfortunately VBA doesn't supply a method to do so... On windows OS we use DispCallFunc. See example. Is there an alternative to DispCallFunc defined in libobjc, libc or any other library we have access to natively on Mac?
type: Question
has comment: http://stackoverflow.com/comment/134087160
tagged with: objective-c
favorite count: 0

layoutmargins
tags question: http://stackoverflow.com/q/76080307
tag name: layoutmargins
type: Tag

http://stackoverflow.com/comment/134345682
has text: What is a valid text representation of NaN? Swift know it, C# know it too.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/76180529
type: AnswerComment

http://stackoverflow.com/q/76081876
type: Question
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136632858
downvote count: 0
has title: WKWebView requestMediaPlaybackState(WithCompletionHandler) returns WKMediaPlaybackStatePlaying when video is not playing?
has body: After navigating to a webpage using a WKWebView I'm polling every second to find out if there is any video media on the page and if it is playing. For many sites requestMediaPlaybackState (WithCompletionHandler) returns WKMediaPlaybackStatePlaying before the user has pressed Play on the video. if (@available(iOS 15.0, *)) { [website requestMediaPlaybackStateWithCompletionHandler:^(WKMediaPlaybackState result) { if (result == WKMediaPlaybackStatePlaying) { ...
answer count: 0
tagged with: ios
upvote count: 2
tagged with: objective-c
tagged with: wkwebview
favorite count: 0
score: 2

http://stackoverflow.com/q/76135581
type: AnsweredQuestion
has body: What's the meaning of the nil in else part? + (NSString *)createFile:(NSData *)data suffix:(NSString *)suffix { NSString *tmpPath = [self temporaryFilePath:suffix]; if ([[NSFileManager defaultManager] createFileAtPath:tmpPath contents:data attributes:nil]) { return tmpPath; } else { nil; } return tmpPath; }
accepted answer: http://stackoverflow.com/a/76135974
downvote count: 0
score: 1
tagged with: ios
type: Question
upvote count: 1
answer count: 1
tagged with: objective-c
has title: The meaning of the conditional nil
favorite count: 0
has answer: http://stackoverflow.com/a/76135974

http://stackoverflow.com/q/76035273
answer count: 0
has body: I used an Objective-C method to get the managedObjects on Xcode 9.2. Today I have a new iMac with Xcode 14.3 and the method is not called. -(void)awakeFromNib { _center = [NSNotificationCenter defaultCenter]; [_center addObserver:self selector:@selector(selectionDidchange:) name:@"NSTableViewSelectionDidChangeNotification" object:nil]; NSLog(@"arraController %@",_vrController); // o.k NSLog(@"tableView %@",_vrTableView); // o.k NSLog(@"center %@",_center); // o.k } -(void)selectionDidchange:(NSNotification *)notification { if((_vrController != nil) && (_vrTableView != nil)) { selected = [_vrController selectedObjects]; arranged = [_vrController arrangedObjects]; _currentObject = [selected objectAtIndex:0]; if(_currentObject != nil) { NSData * data; NSError * error; _vrRoot = [NSMutableDictionary new]; data =[NSKeyedArchiver archivedDataWithRootObject:_vrRoot requiringSecureCoding:YES error:&error]; [_currentObject setValue:data forKey:@"kVrRoot"]; } } In the Developer Documentation I read: NSTableView (macOS 10.0+). I assume the doc is not up to date. I expect the newest documentation (if there is one).
has comment: http://stackoverflow.com/comment/134122154
tagged with: nsviewcontroller
tagged with: objective-c
tagged with: nstableview
has comment: http://stackoverflow.com/comment/134109694
has comment: http://stackoverflow.com/comment/134103098
score: 0
has title: NStableView does not react to notification @"NSTableViewSelectionDidChangeNotification" call on Ventura
type: Question
type: UnansweredQuestion

gpu
type: Tag
tag name: gpu
tags question: http://stackoverflow.com/q/76077379
tags question: http://stackoverflow.com/q/77762066

http://stackoverflow.com/comment/134142084
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/76060045
has text: @Mohab Whoops I mean try `puts(NSHomeDirectory().UTF8String)` from Objective-C

http://stackoverflow.com/q/76189088
tagged with: swift
tagged with: http://stackoverflow.com/tag/pdf
answer count: 2
downvote count: 1
type: Question
has title: Remove hyperlink in PDFTron Objective C
upvote count: 1
has body: How to remove entire hyperlink in pdf file.If anybody knows please answer this question. Library used in PDFTron and ObjectiveC language. Thanks in advance
tagged with: pdftron
has answer: http://stackoverflow.com/a/76204570
tagged with: objective-c
has answer: http://stackoverflow.com/a/76193965
favorite count: 0
score: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/137297628
comment on: http://stackoverflow.com/a/76141553
score: 0
type: AnswerComment
type: Comment
has text: I would rather see this as a beautiful example of being multilingual than "cobbled together". Nicely done, @RobertKniazidis, much appreciated

http://stackoverflow.com/comment/134364437
score: 0
comment on: http://stackoverflow.com/a/76184877
has text: Thanks, that's very helpful. For other who may be interested, the details are explained in the WWDC19 [talk](https://developer.apple.com/videos/play/wwdc2019/701/) at 16:25 an onwards (transcript: "... CGWindowListCopyWindowInfo never triggers an authorization prompt, instead it filters the set of metadata that it returns to the caller.")
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134373091
has text: If you are using a storyboard, why have this code at all? Just let the storyboard do its thing.
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76197050

http://stackoverflow.com/comment/134316749
score: 0
type: QuestionComment
type: Comment
has text: @Eric I have added the config.xml file.
comment on: http://stackoverflow.com/q/76156263

completionhandler
tags question: http://stackoverflow.com/q/76038481
type: Tag
tag name: completionhandler

http://stackoverflow.com/comment/134197112
comment on: http://stackoverflow.com/q/76092456
score: 0
type: QuestionComment
has text: Твой английский лучше моего русского. (Your English is better than my Russian.)
type: Comment

http://stackoverflow.com/comment/134215739
comment on: http://stackoverflow.com/q/76092456
score: 0
type: QuestionComment
type: Comment
has text: @MarekR I need to use pure C++ for multiplatform core

http://stackoverflow.com/comment/134224950
comment on: http://stackoverflow.com/q/76092456
has text: @TheDreamsWind you’re right about my question. I’ve already fixed it
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/134141837
has text: @Mohab If you `NSLog(NSHomeDirectory())` in Objective-C what do you get?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76060045
score: 1

nsviewcontroller
type: Tag
tags question: http://stackoverflow.com/q/76035273
tag name: nsviewcontroller

cgfloat
type: Tag
tag name: cgfloat
tags question: http://stackoverflow.com/q/76180099

http://stackoverflow.com/comment/134378617
has text: @Larme : It's PDFTron not a pspdfkit
type: Comment
comment on: http://stackoverflow.com/q/76199576
score: 0
type: QuestionComment

http://stackoverflow.com/a/76141412
accepted answer of: http://stackoverflow.com/q/76140890
type: AcceptedAnswer
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/76140890
score: 1
has comment: http://stackoverflow.com/comment/134282176
has body: Under the hood, NSStrings have three main possible representations: A "typical" NSString with UTF-16 backing An NSString with ASCII backing A tagged pointer string with encoded backing The specifics of these representations isn't terribly important here, except that when you ask for the -UTF8String representation of one, it may need to perform some sort of conversion to get you UTF-8 data. In the case of (2), because ASCII is a strict subset of UTF-8, the string is allowed to hand you a pointer to its already-existing underlying storage; but in (1) and (3), the string must allocate space for UTF-8 data, because it doesn't yet exist. Because the pointer returned to you from -UTF8String is a regular old C pointer, there isn't any lifetime information/management associated with it: the NSString can't know when you're "done" using it in order to free the memory. Because the string may also hand you a pointer to its direct underlying storage (and can't communicate to you via this API whether or not you are allowed to free the result or not), NSString has to hand you a pointer which you are never responsible for freeing. So there's a bit of a conundrum here: NSString may need to allocate memory to store UTF-8 data NSString must hand you a pointer to that data, which you are not responsible for freeing NSString can't know when you might be done using the pointer, so it can't free it prematurely NSString shouldn't just leak the memory The way this is handled is by allocating a block of memory which is then -autoreleased. You can read more about autorelease pools in the old "Advanced Memory Management Programming Guide" (or a briefer explanation in another answer of mine), but the gist: An object which is autoreleased is placed in an "autorelease pool" for later When the pool is "drained", all contained objects are released, and their memory is freed Unless you create an autorelease pool yourself, or are in a context which has created a local autorelease pool, there is a glo…
downvote count: 0

http://stackoverflow.com/q/76073275
favorite count: 0
score: 0
type: Question
tagged with: objective-c
type: UnansweredQuestion
tagged with: cocoa
has title: Cocoa methods are not called at all when using "do not embed" for library
has body: I have spent an awful amount of time on that problem (I am not very good at Objective-C I must admit) without success so I need your expertise. I am developing several plugins, which are just shared libraries in this case. One of them declares Cocoa classes for the others to use and I manage to have it loading first. For the other plugin, I chose to "do not embed" the library but to make it "required" in linking (in Xcode). The problem: In the other plugin, I try to use a class, let's call it myArray. I can get the objc_class for it (with objc_getClass), I can also get the library's path with class_getImageName, so everything tells me that the library is loaded and active. However, when I use any method like [myArray doSomethingWith:...]; no method is ever called and all calls return 0. No error. No exception. I don't get how that can happen. Can someone help me, please ? And thanks in advance.
answer count: 0
has comment: http://stackoverflow.com/comment/134163800
has comment: http://stackoverflow.com/comment/134164022
downvote count: 1
has comment: http://stackoverflow.com/comment/134163713
upvote count: 1

http://stackoverflow.com/comment/134296177
type: AnswerComment
type: Comment
has text: No offense, for the sake of interacting with the Network framework, I think you’re just digging a deeper hole introducing operation queues…
score: 0
comment on: http://stackoverflow.com/a/76146727

indexoutofboundsexception
tags question: http://stackoverflow.com/q/76046184
tag name: indexoutofboundsexception
type: Tag

http://stackoverflow.com/comment/134197182
type: Comment
comment on: http://stackoverflow.com/a/76092478
has text: @Caleb the point to use C++ is crossplatform core that can be reused. Of course you can say that use of Kotlin or C# would be better, but my tasks force me to use C++
score: 0
type: AnswerComment

http://stackoverflow.com/comment/134103098
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/76035273
has text: When you see `NSTableView (macOS 10.0+)`, that means that the `NSTableView` class can be used starting with macOS 10.0 and later. That is up-to-date.

http://stackoverflow.com/q/76151348
has title: Method Swizzling does not work when methods have parameters
tagged with: ios
type: Question
has comment: http://stackoverflow.com/comment/134296471
has body: I have been doing method swizzling (Objective-C to Swift) for my unit tests and they're perfectly working, except when the time came I need to swizzle methods with parameters. Old method to be swizzled: @interface FNServerApiRequests : NSObject + (void) pullTypesFromServer:(void (^)(id responseJson))completionBlock error:(MKNKErrorBlock)errorBlock; @end Then my new Swift function: extension FNServerApiRequests { @objc class func swizzledPullTypes(fromServer completionBlock: @escaping (Any) -> Void, error errorBlock: @escaping MKNKErrorBlock) { print("swizzledPullTypes") let dic = FNTestUtils.getJsonDictionaryFile("pull-types.json") completionBlock(dic!) } } Then finally: func setupSwizzling() { let originalMethod = class_getClassMethod(FNServerApiRequests.self, #selector(FNServerApiRequests.pullTypes(fromServer:error:))) let swizzledMethod = class_getClassMethod(FNServerApiRequests.self, #selector(FNServerApiRequests.swizzledPullTypes(fromServer:error:))) method_exchangeImplementations(originalMethod!, swizzledMethod!) } I matched exactly how the two methods are declared in Swift (e.g. parameter names, placeholders, etc...)
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134306991
has comment: http://stackoverflow.com/comment/134295842
has comment: http://stackoverflow.com/comment/134307498
has comment: http://stackoverflow.com/comment/134310820
score: 0
answer count: 0
tagged with: swift
has comment: http://stackoverflow.com/comment/134295971
has comment: http://stackoverflow.com/comment/134307036
has comment: http://stackoverflow.com/comment/134306842
has comment: http://stackoverflow.com/comment/134307065
has comment: http://stackoverflow.com/comment/134311181
has comment: http://stackoverflow.com/comment/134307385

http://stackoverflow.com/comment/134277298
score: 0
has text: Can you give an example where AppleScript returns a name and Objective-C doesn't?
type: QuestionComment
comment on: http://stackoverflow.com/q/76140643
type: Comment

http://stackoverflow.com/a/76146727
has comment: http://stackoverflow.com/comment/134288377
has comment: http://stackoverflow.com/comment/134296177
has comment: http://stackoverflow.com/comment/134289278
has comment: http://stackoverflow.com/comment/134288288
has body: You are mixing different concepts here. Dispatch Queue is essentially a thread pool, the API of GCD doesn't give contract in regards to which thread it runs its tasks with (with exception to the "main" queue which runs in the "main" thread only), so each separate task of a GCD queue can potentially be executed in a new thread. On the other hand the run loops of Cocoa frameworks are bound to specific thread only (conventionally each thread has only one run loop it was created with). Long story short: you cannot "connect" a run loop to a dispatch queue, because queues operate in different threads (even if the queues are serial), while a run loop needs a specific thread to work in.
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/76145816
answers question: http://stackoverflow.com/q/76145816
has comment: http://stackoverflow.com/comment/134289577

http://stackoverflow.com/comment/134198511
comment on: http://stackoverflow.com/q/76092456
score: 0
type: QuestionComment
type: Comment
has text: Just rename source file so it has `.mm` extension and you are done.

http://stackoverflow.com/a/76141553
has comment: http://stackoverflow.com/comment/134293403
has comment: http://stackoverflow.com/comment/137297628
answers question: http://stackoverflow.com/q/76140643
type: Answer
has body: tell application "System Events" set frontProcess to 1st process whose frontmost is true set activePID to unix id of frontProcess set bundleID to bundle identifier of frontProcess set activeName to name of frontProcess end tell tell application id bundleID try set appName to name set windowID to id of front window set windowName to name of front window on error set windowID to my getFrontWindowID(appName) try tell application "System Events" to tell frontProcess to tell window 1 to set windowName to value of attribute "AXTitle" on error set windowName to "" end try end try end tell return {pid:activePID, processName:activeName, appName:appName, windowID:windowID, windowName:windowName} --> {pid:9893, processName:"Avidemux2.7", appName:"Avidemux_2.7.8", windowID:5969, windowName:"Avidemux"} on getFrontWindowID(appName) set JS to "ObjC.import('CoreGraphics'); Ref.prototype.$ = function() { return ObjC.deepUnwrap(ObjC.castRefToObject(this)); } Application.prototype.getWindowList = function() { let pids = Application('com.apple.systemevents') .processes.whose({ 'bundleIdentifier': this.id() }).unixId(); return $.CGWindowListCopyWindowInfo( $.kCGWindowListExcludeDesktopElements, $.kCGNullWindowID).$() .filter(x => pids.indexOf(x.kCGWindowOwnerPID) + 1 && x.kCGWindowLayer == 0 && x.kCGWindowStoreType == 1 && x.kCGWindowAlpha == 1 ).map(x => [x.kCGWindowNumber]); } Application('" & appName & "').getWindowList();" return (word 1 of (do shell script "osascript -l JavaScript -e " & quoted form of JS)) as integer end getFrontWindowID
has comment: http://stackoverflow.com/comment/134285245
downvote count: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/134301944
score: 0

http://stackoverflow.com/comment/134300274
comment on: http://stackoverflow.com/q/76149831
type: Comment
score: 0
has text: Hard to say what you might do to optimize it without seeing example code of what you're doing. But... have you set `shouldRasterize` to true for your shadows?
type: QuestionComment

http://stackoverflow.com/comment/134290235
has text: With functions that are not `init` I would have a swift-only `func getC(range:) -> C`, and a `@objc(getC) func _getC(min:max:) -> C`. Not optimal, the underscore is widely used in this context.
comment on: http://stackoverflow.com/q/76147011
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134285245
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/76141553
has text: I think this falls into the realms of cobbled together. Not to diminish the effort, I would rather do an FFI call to the Objective C from Go and if the name is not present, then shell out of `osascript`. This would be a less than or equal to single shell-out rather than less than or equal to two for each query.

nsstring
tags question: http://stackoverflow.com/q/76059936
tag name: nsstring
tags question: http://stackoverflow.com/q/76180099
type: Tag
tags question: http://stackoverflow.com/q/78290156

http://stackoverflow.com/q/76140643
has answer: http://stackoverflow.com/a/76141553
tagged with: macos
has comment: http://stackoverflow.com/comment/134285712
has body: I am writing an application that needs to periodically obtain the PID, process name, window ID and window name of the active window. The program is written in Go, but the issues relate to any FFI into the Mac ecosystem. I have two approaches, via AppleScript and via Objective C. Both give a 75% solution; either missing the window ID or the window name. I would like to find a single unified solution that gives all four attributes rather than having to cobble together one that depends on both of the approaches that I have. AppleScript approach; does not provide WindowNumber for most cases. global activeApp, activePID, activeName, windowName set windowName to "" tell application "System Events" set activeApp to first application process whose frontmost is true set activePID to unix id of activeApp set activeName to name of activeApp tell process activeName try tell (1st window whose value of attribute "AXMain" is true) set windowName to value of attribute "AXTitle" end tell end try end tell end tell return ("{\"pid\":" & activePID & ",\"name\":\"" & activeName & "\",\"window\":\"" & windowName & "\"}" as text) Objective C approach; does not provide WindowName for most cases. #include <Cocoa/Cocoa.h> #include <CoreGraphics/CGWindow.h> struct details { int wid; int pid; const char* name; const char* window; }; int activeWindow(struct details *d) { if (d == NULL) { return 0; } NSArray *windows = (NSArray *)CGWindowListCopyWindowInfo(kCGWindowListExcludeDesktopElements|kCGWindowListOptionOnScreenOnly,kCGNullWindowID); for(NSDictionary *window in windows){ int WindowLayer = [[window objectForKey:(NSString *)kCGWindowLayer] intValue]; if (WindowLayer == 0) { d->wid = [[window objectForKey:(NSString *)kCGWindowNumber] intValue]; d->pid = [[window objectForKey:(NSString *)kCGWindowOwnerPID] intValue]; d->name = [[window objectForKey:(NSString *)kCGWindowOwnerName] UTF8String]; d->window = [[window objectForKey:(NSString *)kCGWindowName] UTF8String]; return 1; } } return 0; }
favorite count: 0
tagged with: applescript
type: Question
has comment: http://stackoverflow.com/comment/134278321
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134277298
has comment: http://stackoverflow.com/comment/134293441
linked to: http://stackoverflow.com/q/6178860
score: 0
has answer: http://stackoverflow.com/a/76184877
has comment: http://stackoverflow.com/comment/134285715
downvote count: 2
possible better answer: http://stackoverflow.com/a/76141553
type: AnsweredQuestion
upvote count: 2
answer count: 2
has title: unified approach to getting PID, window ID, process name and window name from active window on mac
accepted answer: http://stackoverflow.com/a/76184877
has comment: http://stackoverflow.com/comment/134277347

http://stackoverflow.com/a/76180529
has comment: http://stackoverflow.com/comment/134345967
score: 1
type: Answer
answers question: http://stackoverflow.com/q/76180099
has comment: http://stackoverflow.com/comment/134345770
upvote count: 1
has body: It's written on the documentation. This is for float value, the same with double value. https://developer.apple.com/documentation/foundation/nsstring/1412321-floatvalue This property doesn’t include whitespace at the beginning of the string. This property is HUGE_VAL or –HUGE_VAL on overflow, 0.0 on underflow. This property is 0.0 if the string doesn’t begin with a valid text representation of a floating-point number.
has comment: http://stackoverflow.com/comment/134345962
downvote count: 0
has comment: http://stackoverflow.com/comment/134345682

http://stackoverflow.com/q/76186465
tagged with: ios
downvote count: 1
tagged with: objective-c
has title: Figuring out what causing a Core Data fault
tagged with: nsbatchdeleterequest
has answer: http://stackoverflow.com/a/76186620
tagged with: core-data
has answer: http://stackoverflow.com/a/76186601
answer count: 2
score: -1
type: Question
type: UnansweredQuestion
has body: I keep hitting Core Data faults when updating and deleting objects and Id like to understand why. The logic essentially fetches the entities, updates a few fields and saves. No faults are hit. The entities are then consumed for some business logic and when thats done, the entities are deleted one by one using the following code: [context deleteObject:[context objectWithID:entity.objectID]]; performed within the context block. Why does the line of code trigger fault? I did end up moving this to use NSBatchDeleteRequest where I passed it an array of object IDs and that got rid of the faults but just would like to understand why the faults got triggered in the first place.
favorite count: 0
upvote count: 0

http://stackoverflow.com/q/76176009
has answer: http://stackoverflow.com/a/76178247
has body: I'm trying to blend a source texture with some snowflakes in Metal, but I can't find blending options that work for my use case. . The blending options I'm currently using are: descriptor.sourceRGBBlendFactor = MTLBlendFactorSourceAlpha; descriptor.sourceAlphaBlendFactor = MTLBlendFactorOne; descriptor.destinationRGBBlendFactor = MTLBlendFactorOne; descriptor.destinationAlphaBlendFactor = MTLBlendFactorOne; I've tried these. I expected the blue portion of the snowflakes to blend with the blue background, not with the underlying one. Can anyone explain to me what I'm getting wrong, what the correct formula should be and how we arrive to it?
type: Question
upvote count: 1
tagged with: graphics
answer count: 1
type: UnansweredQuestion
favorite count: 0
has title: What are the correct Metal blending options for additive blending?
linked to: http://stackoverflow.com/q/52035162
tagged with: metal
downvote count: 1
tagged with: objective-c
tagged with: blending
score: 0
tagged with: alphablending

http://stackoverflow.com/comment/134113991
comment on: http://stackoverflow.com/q/76043479
type: Comment
has text: It makes perfect sense that you need to `#import <UserNotifications/UserNotifications.h>` - you are exposing your AppDelegate from Swift to Objective C. That AppDelegate conforms to the notification delegate, so the objective C side of your code needs to know about that. It doesn't matter that A.mm has nothing to do with notifications. The Objective C compiler needs to be able to resolve all of the type references it sees in the header.
type: QuestionComment
score: 0

http://stackoverflow.com/q/76156263
tagged with: wkwebview
score: 0
has body: I am using cordova-ios 6.2.0. I am creating a webview browser in my project. I recently debugged that my project is creating UIWebView instance instead of WKWebView. I scanned the whole project but i did not find any reference to UIWebView. In the header file also my property is set to WKWebView: @property (nonatomic, strong) IBOutlet WKWebView* webView; UIWebView at runtime I tried to configure WKWebView. so that the instance will set WKWebView at runtime but end up creating both the views. - (void)createViews { // We create the views in code for primarily for ease of upgrades and not requiring an external .xib to be included CGRect webViewBounds = self.view.bounds; WKUserContentController* userContentController = [[WKUserContentController alloc] init]; WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init]; NSString *userAgent = configuration.applicationNameForUserAgent; configuration.applicationNameForUserAgent = userAgent; configuration.userContentController = userContentController; configuration.processPool = [[CDVWebViewProcessPoolFactory sharedFactory] sharedProcessPool]; self.webView = [[WKWebView alloc] initWithFrame:webViewBounds configuration:configuration]; [self.view addSubview:self.webView]; [self.view sendSubviewToBack:self.webView]; self.webView.navigationDelegate = self; self.webView.backgroundColor = [UIColor whiteColor]; } WKWebView Debug View Hierarchy Also when i tried to set webView simply like the below code the UIWebView was set at runtime: - (void)setupWebView { self.webView = [[WKWebView alloc] initWithFrame: CGRectZero]; self.webView.navigationDelegate = self; [self.view addSubview:self.webView]; [self.view sendSubviewToBack:self.webView]; } Here is the config.xml I am using. <content src="index.html" /> <plugin name="cordova-sqlite-storage" spec="git+https://github.com/litehelpers/Cordova-sqlite-storage.git" /> <plugin name="cordova-plugin-splashscreen" spec="^6.0.0" /> <plugin name="cordova-plugin-statusbar" spec="…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/134304592
has answer: http://stackoverflow.com/a/76164006
possible better answer: http://stackoverflow.com/a/76164006
accepted answer: http://stackoverflow.com/a/76332451
tagged with: cordova
answer count: 2
tagged with: ios
tagged with: cordova-ios
has title: Cordova-ios is creating both UIWebView and WKWebView Components. How to switch to only WKWebView?
type: Question
has answer: http://stackoverflow.com/a/76332451
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134316749

http://stackoverflow.com/a/76180608
has body: string "NaN" to float is 0. 0 is right and you is wrong.
answers question: http://stackoverflow.com/q/76180099
type: Answer
has comment: http://stackoverflow.com/comment/134345601
upvote count: 0
score: -2
downvote count: 2

http://stackoverflow.com/q/76123444
has title: Unable to navigate to a controller using the UIPopoverPresentationController _passthroughViews method in iOS using Objective C
favorite count: 0
has comment: http://stackoverflow.com/comment/134336458
tagged with: uipopoverpresentationcontroller
downvote count: 2
tagged with: ios
upvote count: 2
has comment: http://stackoverflow.com/comment/134377625
tagged with: objective-c
has body: Unable to navigate to a controller using the UIPopoverPresentationController _passthroughViews method in iOS using Objective C. I am trying to navigate to the controller view using the UIPopoverPresentationController's passthroughView. But I can't able to set this navigation and get an error and the app gets crashed. How can I resolve this? Here I am additionally facing an error with the last item in the popover shows as a footer or not movable label and if I click this, there is no highlights, Code: SelectorViewController* sv = [[SelectorViewController alloc] initWithStyle:UITableViewStylePlain]; sv.delegate = self; sv.currentTopic = self.title; NSLog(@&quot; sv.currentTopic%@&quot;, sv.currentTopic); sv.preferredContentSize = CGSizeMake(300, 500); sv.modalPresentationStyle = UIModalPresentationPopover; UIPopoverPresentationController *popoverpresentationController = sv.popoverPresentationController; popoverpresentationController.delegate = self; popoverpresentationController.sourceView = sender.view; [self present view controller:sv animated: YES completion: nil]; popover.delegate = self; if ([popover respondsToSelector:@selector(setBackgroundColor:)]) popover.backgroundColor = [UIColor whiteColor]; [sv release];
score: 0
has answer: http://stackoverflow.com/a/76217374
has comment: http://stackoverflow.com/comment/134364584
type: Question
has comment: http://stackoverflow.com/comment/134359087
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/a/76046344
score: 0
accepted answer of: http://stackoverflow.com/q/76046184
has comment: http://stackoverflow.com/comment/134118603
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/76046184
has body: The range {8,1} means you are trying to access the 9th character. But your if check only verifies if the string has 8 or more characters. So if the string is exactly 8 characters long then you will get that error. Update your if check to: if (self.txtQty.text.length &gt; 8) { Or possibly your if check is correct and the range should be changed from {8,1}, to {7,1} to replace the 8th character. Which of those two changes you make depends on your goal (to change the 8th or 9th character). To help visualize the range, I'll attempt a bit of a drawing: Some string, its indexes, and range {8,1}: 1 2 3 4 5 6 7 8 9 0 &lt;-- The string | | | | | | | | | | | 0 1 2 3 4 5 6 7 8 9 1 &lt;-- Its indexes 0 *** &lt;-- Area for {8,1} Here you can see that the range {8,1} is getting the 9th character.

http://stackoverflow.com/comment/134298837
type: QuestionComment
comment on: http://stackoverflow.com/q/76149338
type: Comment
has text: Are you trying to reimplement the default user feedback because it's not working or does the default user feedback work and are you trying to implement a custom user feedback?
score: 0

http://stackoverflow.com/a/76092478
type: Answer
has comment: http://stackoverflow.com/comment/134197182
answers question: http://stackoverflow.com/q/76092456
has comment: http://stackoverflow.com/comment/134196780
has comment: http://stackoverflow.com/comment/134197256
has comment: http://stackoverflow.com/comment/134196832
has comment: http://stackoverflow.com/comment/134197370
score: -1
has comment: http://stackoverflow.com/comment/134197416
downvote count: 1
has body: If you have too many errors when combining two languages you need to look at #include in your C++ files. You can't include UIKit or other specific libraries in C++ files! XCode goes insane and shows a hundreds errors. To solve this problem you need a bridge using Objective-C++. Notice the details! Bridge.hh (don't include ObjCFile.h!) class Bridge { public: ... void showInterface(); } Bridge.mm (include your Objective-C header here) #import "ObjCFile.h" void Bridge::showInterface() { ObjCFile *objCFile; [objcFile showInterface]; } New CppFile.cpp #include "Bridge.hh" int main() { Bridge *bridge; bridge->showInterface(); } That's it! Many articles I've seen that was similar to my article but they omit info about XCode libraries. That confused me.
upvote count: 0

http://stackoverflow.com/comment/134345962
type: AnswerComment
type: Comment
score: 0
has text: OK, i understand that i have to check a string for "NaN" before converting to float.
comment on: http://stackoverflow.com/a/76180529

http://stackoverflow.com/comment/134277347
type: Comment
score: 0
type: QuestionComment
has text: Any iTerm2 window shows the window name with the AppleScript approach but returns a null for the window name via Objective C.
comment on: http://stackoverflow.com/q/76140643

http://stackoverflow.com/comment/134377348
score: 0
type: Comment
has text: https://stackoverflow.com/questions/24670269/how-do-you-animate-the-sublayers-of-the-layer-of-a-uiview-during-a-uiview-animat might help you
type: QuestionComment
comment on: http://stackoverflow.com/q/76199112

http://stackoverflow.com/comment/134289278
score: 0
has text: Urgh. Ah well, I guess I can't say I'm that surprised. Everything else about MacOS has been an underwhelming experience to date, so why should this be any different? :) Thanks.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76146727

http://stackoverflow.com/a/76203430
has body: As mentioned in the comments, updating from version 7 to the latest version 10 will require going through each of the changelogs between your previous version and new version. It depends on which exact version you are migrating from, but you could start by looking at version 7.0.1 and then all the way up to 10.0.0. For your case specifically, you should look at the PTDocumentController class as it provides a drop-in viewer component that handles all of the UI setup and management (and therefore also already handles most API changes between versions for you). This is the recommended approach for the majority of use cases and projects.
score: 0
answers question: http://stackoverflow.com/q/76199576
type: Answer

http://stackoverflow.com/a/76184877
has comment: http://stackoverflow.com/comment/134365094
accepted answer of: http://stackoverflow.com/q/76140643
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/134365335
has body: From a Developer forum topic, your Objective-C approach should work if the application has been given Screen Recording permission. There are a few windows (such as those in menu items) that have weird names, and some just don't have them, but most application and document windows I've tried do have names. There doesn't appear to be an entitlement for Screen Recording, so you would need to direct the user to add the application to the privacy list. When testing with Xcode 14.1 in macOS Monterey 12.6.5, the kCGWindowName key in the window list dictionary is included when permission has been granted, otherwise it is left out.
score: 0
answers question: http://stackoverflow.com/q/76140643
has comment: http://stackoverflow.com/comment/134364437

http://stackoverflow.com/comment/134311729
type: QuestionComment
has text: @Rob Because I already have a thread that manages everything network related. I have already just given up though and used the main thread, at the expense of having to add more (otherwise unnecessary) synchronisation primitives to my network system.
type: Comment
comment on: http://stackoverflow.com/q/76145816
score: 0

http://stackoverflow.com/comment/134164022
comment on: http://stackoverflow.com/q/76073275
score: 4
type: QuestionComment
type: Comment
has text: ??? What type is `myClass`? You've marked it here as `id`. Is it really `Class`? Is `doSomethingWith:` an instance method or a class method? (If "nothing happens", it is very, very likely that `myClass` is nil. You really want to be 100% certain that this is not true, because that's almost always the cause of "nothing happens.") You likely need to edit this question to post some real code (ideally a minimal, reproducible example, but at as minimum real code with precisely what is true at each line). I suspect you're not doing what you think you're doing.

http://stackoverflow.com/q/76180648
score: 0
type: Question
tagged with: swift
answer count: 1
has answer: http://stackoverflow.com/a/76185644
tagged with: http://stackoverflow.com/tag/pdf
has comment: http://stackoverflow.com/comment/134346698
favorite count: 0
accepted answer: http://stackoverflow.com/a/76185644
downvote count: 1
type: AnsweredQuestion
has body: I am trying to disable this feature in default PDFtron library. I tried a lot and not at all disable this item. If anyone knows how to disable it. Thanks in advance
has title: How to hide PDFTron popup in Objective C
tagged with: pdftron
tagged with: objective-c
upvote count: 1

http://stackoverflow.com/a/76039404
score: 0
accepted answer of: http://stackoverflow.com/q/76029695
answers question: http://stackoverflow.com/q/76029695
has body: So I extended my workflow as follows. There are a few caveats: there is a nice Github Action 'SonarSource/sonarcloud-github-c-cpp@v1'. Is this sufficient to analyze Objective-C projects? Git checkout will remove unnecessary directories. Hence you must install SonarQube AFTER having checkout out your source The build wrapper just monitors the actual build, so you still have to run the Sonar Scanner afterwards Here is the resulting code: jobs: SonarQube: runs-on: ubuntu-latest env: BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory steps: - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis submodules: recursive - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v1 - name: Run build-wrapper run: | build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make -f Makefile pkg-posix-nightly HOST_ARCH=$(uname -m) - name: Run sonar-scanner env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} # Put the name of your token here run: | sonar-scanner --define sonar.cfamily.build-wrapper-output=&quot;${{ env.BUILD_WRAPPER_OUT_DIR }}&quot;
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/76038481
type: UnansweredQuestion
tagged with: cgpdfdocument
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134106877
answer count: 0
has comment: http://stackoverflow.com/comment/134117734
has comment: http://stackoverflow.com/comment/134118444
score: 0
tagged with: completionhandler
tagged with: tvos
has body: UPDATE: At a suggestion, I tried implementing a NSURLSession to download and then draw the file. I have this now in my code, and it mostly works, but I've found if it is more than 1MB, it simply won't draw. I've also found if there are multiple pages, it skips to the second page for some reason to start off with. Do y'all see anything wrong?: NSString *theURL = [self.entry[@"SermonPDF"] url]; /*sermonPDFURL = [NSURL fileURLWithPath:_sermonString]; self.arrayOfVerses = @[@"allverses"]; CGPDFDocumentRef pdfDocument = [self openPDF:sermonPDFURL]; [self drawDocument:pdfDocument];*/ NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration]; NSURLSession *delegateFreeSession = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: nil delegateQueue: [NSOperationQueue mainQueue]]; [[delegateFreeSession dataTaskWithURL: [NSURL URLWithString: theURL] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { NSLog(@"Sermon error %@", error.description); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *pdfPath = [[documentsDirectory stringByAppendingPathComponent:[self.entry valueForKey:@"DateOfService"]] stringByAppendingString:@".pdf"]; [data writeToFile:pdfPath atomically:YES]; [self drawingSermonFinally]; }] resume]; -(void)drawingSermonFinally { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *pdfPath = [[documentsDirectory stringByAppendingPathComponent:[self.entry valueForKey:@"DateOfService"]] stringByAppendingString:@".pdf"]; self.arrayOfVerses = @[@"allverses"]; CGPDFDocumentRef pdfDocument = [self openPDFLocal:pdfPath]; [self drawDocument:pdfDocument]; } My app uses the following code to display a PDF in tvOS app: CGPDFDocumentRef pdfDocument2 = [self openPDF:[NSUR…
type: Question
has title: Add Completion Handler for when PDF has been downloaded

http://stackoverflow.com/q/76043479
linked to: http://stackoverflow.com/q/62179171
downvote count: 0
answer count: 0
tagged with: usernotifications
favorite count: 0
score: 2
type: Question
tagged with: swift
has body: I've a very similar issue to this question, but I don't know how to fix it. I have a swift bridging header file to expose ObjC classes to swift and a swift interface header (automatically generated by Xcode during compile time) to expose swift classes to ObjC. I am using swift types in an ObjC file, say A.mm, so I've included the swift interface header in that file. Recently, I extended my AppDelegate to conform to UNUserNotificationCenterDelegate to handle notifications. import UIKit import UserNotifications extension AppDelegate: UNUserNotificationCenterDelegate { .... } But this suddenly causes a compilation error in A.mm - 'Cannot find protocol declaration for 'UNUserNotificationCenterDelegate'. In the swift interface header file, I can see that UNUserNotificationCenterDelegate is referenced, so just adding this line before importing the swift interface header will work. #import &lt;UserNotifications/UserNotifications.h&gt; But it makes no sense to do so - since the code in A.mm has nothing to do with UserNotifications. I had to include swift interface header file here because I need to use some swift types, but none of that is related to UserNotifications. So, I'm not comfortable in importing UserNotifications.h as it just causes confusion. I think the swift interface header should somehow include UserNotifications.h, since that's where the problem originates. Following this answer, I ensured to include import UserNotifications in the AppDelegate file, as shown above... but it still fails to compile. So adding the swift include is not the solution. What am I missing to ensure that the swift interface header file includes the UserNotifications.h file? Is there no way but to include UserNotifications.h before including the swift interface header in A.mm? (I don't like this).
has comment: http://stackoverflow.com/comment/134113991
type: UnansweredQuestion
has title: Cannot find protocol declaration for 'UNUserNotificationCenterDelegate' in swift interface header file
tagged with: ios
upvote count: 2
has comment: http://stackoverflow.com/comment/134131158
tagged with: objective-c
linked to: http://stackoverflow.com/q/64077284

http://stackoverflow.com/comment/134315397
type: Comment
has text: Please [edit] your question and add a [example] showing what you have already tried. See also [ask].
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76160415

invalidargumentexception
type: Tag
tag name: invalidargumentexception
tags question: http://stackoverflow.com/q/76046184

http://stackoverflow.com/q/76160415
type: UnansweredQuestion
tagged with: ios-universal-links
tagged with: apple-app-site-association
has comment: http://stackoverflow.com/comment/134325391
score: 0
tagged with: ios
has title: How to display at the top of a Smart banner for Universal Links in Safari
tagged with: objective-c
answer count: 0
has body: Implemented Universal link of IOS with iPhone and iPad. My app runs the app by accessing a specific URL in the safari browser. When accessing a specific URL, a Smart banner appears at the top of the web page. This Smart Banner is a smart banner automatically created by AASA (apple-app-site-association). AASA { "applinks": { "apps": [], "details": [ { "appID": "<Team_ID>.<Bundle_ID>", "paths": [ "/path/test.asp" ] } ] }, "webcredentials": { "apps": [ "<Team_ID>.<Bundle_ID>" ] }, "related_applications": [ { "platform": "ios", "url": "https://example.co.kr/path/test.asp", "appID": <Bundle_ID>, "appName": name } ], "prefer_related_applications": true } Get Url Data - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options { self.latestLink = [url absoluteString]; return YES; } - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *_Nullable))restorationHandler { if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) { self.latestLink = [userActivity.webpageURL absoluteString]; if (!_eventSink) { self.initialLink = self.latestLink; } return YES; } return NO; } On the iPhone, when you access a specific web page, a Smart Banner is created at the top so you can launch the app through the Open button. However, on the iPad, you have to access a specific web page and scroll down to see the Smart Banner. This creates a Smart Banner, but it seems to be initially hidden. Is there a way to make the Smart Banner visible on the Ipade as it is on the Iphone, without scrolling?
has comment: http://stackoverflow.com/comment/134315397
type: Question
tagged with: swift

http://stackoverflow.com/a/76217374
score: 0
type: Answer
answers question: http://stackoverflow.com/q/76123444
has body: It seems you're trying to present a popover from a view controller and setting passthroughViews to the navigation controller's delegate. The passthroughViews property of UIPopoverPresentationController is an array of views. The correct usage should be: // Assuming `view1` and `view2` are views that you want the user to interact with while the popover is visible popoverpresentationController.passthroughViews = @[view1, view2]; If you want to navigate to another controller when the popover is presented, you can do that in the popover's delegate method, popoverPresentationControllerDidDismissPopover. As for the issue where you're not able to interact with the content, make sure that the popover's preferredContentSize is big enough to display the tableview and its cells fully. Also, check the tableview's contentSize.
has comment: http://stackoverflow.com/comment/134441726

http://stackoverflow.com/comment/134323691
has text: I've written a method which will perform the scroll in Javascript (it works well with buttons), so my intention is to trap a swipe in the window content view, determine its direction, and then execute that method.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76166846
type: QuestionComment

http://stackoverflow.com/comment/134131158
has text: @Paulw11 In the swift interface header file, there is this line `@import UserNotifications` along with other @imports and @class definitions. But it was wrapped in a macro, so maybe it got excluded. What to do to have `@import UserNotifications` in the swift interface header file? Maybe something's missed in the swift file which has defined UNNotificationCenterDelegate. Since, swift interface header has included this reference, can it not include missing references?
type: QuestionComment
comment on: http://stackoverflow.com/q/76043479
type: Comment
score: 0

http://stackoverflow.com/comment/134216676
type: QuestionComment
comment on: http://stackoverflow.com/q/76092456
has text: So what is problem? I see duplicate explains everything. Translation unit which provides bridge must have `.mm` extension. Objective C interface nicely hides C++. C++ header is also easy to hide Objective C. I did something like this for 5 years (C++ cross platform library with bindings to Objective-C (MacOS/iOS), C# (Windows) and Java - (Android), C++ (Linux)) and bridge to Objective-C was the easiest thing. The Java was hard since JNI is a real pain.
score: 0
type: Comment

http://stackoverflow.com/a/76135974
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/76135581
downvote count: 0
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/134271172
has body: nil; as a statement does nothing: it references a nil value, and then doesn't use it. else { nil; } is meaningless, and the code as written would be the same without it: NSString *tmpPath = [self temporaryFilePath:suffix]; if ([[NSFileManager defaultManager] createFileAtPath:tmpPath contents:data attributes:nil]) { return tmpPath; } return tmpPath; Because in both code paths here the code ends up returning tmpPath, this is equivalent to NSString *tmpPath = [self temporaryFilePath:suffix]; [[NSFileManager defaultManager] createFileAtPath:tmpPath contents:data attributes:nil]); return tmpPath; It seems unlikely that the original author intended to return tmpPath unconditionally this way. Instead, it seems the code here likely meant to return nil; on failure to create a temporary file: + (NSString *)createFile:(NSData *)data suffix:(NSString *)suffix { NSString *tmpPath = [self temporaryFilePath:suffix]; if ([[NSFileManager defaultManager] createFileAtPath:tmpPath contents:data attributes:nil]) { return tmpPath; } else { return nil; } } An alternative way to express this would be + (NSString *)createFile:(NSData *)data suffix:(NSString *)suffix { NSString *tmpPath = [self temporaryFilePath:suffix]; if (![[NSFileManager defaultManager] createFileAtPath:tmpPath contents:data attributes:nil]) { tmpPath = nil; } return tmpPath; } which returns tmpPath unconditionally (but assigns it a nil value on failure). The original snippet appears to be halfway between these two versions, either by accident, or because of a merge conflict, or otherwise.
accepted answer of: http://stackoverflow.com/q/76135581

http://stackoverflow.com/comment/134285712
comment on: http://stackoverflow.com/q/76140643
has text: Does this answer your question? [Getting Window Number through OSX Accessibility API](https://stackoverflow.com/questions/6178860/getting-window-number-through-osx-accessibility-api)
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/134163713
type: Comment
has text: Are you sure that in this case [myArray doSomethingWith:...]; myArray object is not nil?
comment on: http://stackoverflow.com/q/76073275
score: 0
type: QuestionComment

http://stackoverflow.com/a/76080736
type: AcceptedAnswer
type: Answer
has body: The problem is with your initWithFrame of LibraryView. You are attempting to set the library view's constraints to itself. Remove all of the constraint related code from LibraryView. You want to set the constraints in the viewDidLoad of the root view controller. After the line: [self.view addSubview:library]; you can add code to setup the constraints of library against the same margins variable used to setup l3. Also, it's easier to active a bunch of constraints as follows: [NSLayoutConstraint activateConstraints:@[ [l3.trailingAnchor constraintEqualToAnchor:margins.trailingAnchor], [l3.leadingAnchor constraintEqualToAnchor:margins.leadingAnchor], [l3.topAnchor constraintEqualToAnchor:margins.topAnchor], [l3.bottomAnchor constraintEqualToAnchor:margins.bottomAnchor], ]];
accepted answer of: http://stackoverflow.com/q/76080307
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/76080307
score: 1
has comment: http://stackoverflow.com/comment/134184804
has comment: http://stackoverflow.com/comment/134184774

http://stackoverflow.com/comment/134295971
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76151348
has text: Although exchanging implementations should work with parameters (assuming the parameter types are the same), it's actually subtly problematic. [This article](https://newrelic.com/blog/best-practices/right-way-to-swizzle) explains why. I have a GItHub repo for swizzling Obj-C methods from Swift called [SwizzleHelper](https://github.com/chipjarred/SwizzleHelper) that can help make it easier. I don't have any forwarding functions for methods that take closures (Obj-C blocks) though. I swizzle use it in another package to swizzle methods that take `NSEvent` though.
score: 0

http://stackoverflow.com/comment/134374283
comment on: http://stackoverflow.com/q/76197050
score: 0
type: QuestionComment
type: Comment
has text: Have you accidentally set the background color to black? I guess its view controller background color or the view controller's view is covered by its subView, which is black. Try to debug UI.

http://stackoverflow.com/q/76199576
has comment: http://stackoverflow.com/comment/134377458
tagged with: pdftron
tagged with: objective-c
downvote count: 0
has comment: http://stackoverflow.com/comment/134378617
score: 1
has title: PDFTron version 7 to version 10 migration is breaking existing functionality
has body: PDFtron version 7 to version 10 migration is producing the error mentioned above. How to resolve this error and how to retain existing functionality? Thanks in Advance
type: Question
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/134382016
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/pdf
has comment: http://stackoverflow.com/comment/134377508
has comment: http://stackoverflow.com/comment/134381933
favorite count: 0
has answer: http://stackoverflow.com/a/76203430

http://stackoverflow.com/comment/134374230
type: QuestionComment
has text: The issue comes from some other part of your code, i believe. I.e. check view hierarchy of the "black screen" and inspect why `LoginViewController` ends up with that result (it could be that something is broken on the storyboard, or in the `LoginViewController` code)
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76197050

http://stackoverflow.com/a/76060045
has comment: http://stackoverflow.com/comment/134141866
has comment: http://stackoverflow.com/comment/134141903
accepted answer of: http://stackoverflow.com/q/76059936
has body: You need to send the UTF8String message to the NSString object returned by NSHomeDirectory() to obtain a C string. To do this in pure C (Tested): #include <objc/runtime.h> #include <objc/message.h> void *NSHomeDirectory(); void testFunc() { puts(((const char *(*)(void *, SEL))objc_msgSend)(NSHomeDirectory(), sel_getUid("UTF8String"))); // Also use puts() instead of printf() here } Note: Compile using -framework Cocoa
has comment: http://stackoverflow.com/comment/134141837
answers question: http://stackoverflow.com/q/76059936
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/134141934
has comment: http://stackoverflow.com/comment/134141857
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/134142084
downvote count: 0
score: 3

http://stackoverflow.com/a/76178247
score: 0
type: Answer
answers question: http://stackoverflow.com/q/76176009
has body: You code is missing something. I think you need an add blend operation for both rgbBlendOperation and alphaBlendOperation. If you just want to add a snowflake on top, I think the factors you have should be enough. If you take a look at https://developer.apple.com/documentation/metal/mtlblendoperation/add, it lists some formulas RGB = Source.rgb * SBF + Dest.rgb * DBF A = Source.a * SBF + Dest.a * DBF where SBF is source blend factor, and DBF is destination blend factor. So, basically, to expand in your case, RGB = Source.rgb * Source.a + Dest.rgb A = Source.a * SBF + Dest.a Seems like it should do the trick.

http://stackoverflow.com/q/76111768
score: 0
has comment: http://stackoverflow.com/comment/134334161
tagged with: iphone
linked to: http://stackoverflow.com/q/15571767
tagged with: dns
type: Question
type: UnansweredQuestion
answer count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/134246198
has comment: http://stackoverflow.com/comment/134250087
tagged with: objective-c
has body: I am trying to get both the IPv4 and IPv6 value of a URL, say 'stackoverflow.com' for example. Ideally returning the same results as dig stackoverflow.com A stackoverflow.com AAAA +short I currently have the following, but for me it is only returning the IPv4 address struct hostent *host_entry = gethostbyname("stackoverflow.com"); char *buff; buff = inet_ntoa(*((struct in_addr *)host_entry->h_addr_list));
has comment: http://stackoverflow.com/comment/134234973
has title: How to get IPv4 & IPv6 values on iOS
tagged with: network-programming

http://stackoverflow.com/q/76149338
has comment: http://stackoverflow.com/comment/134307039
type: Question
has comment: http://stackoverflow.com/comment/134310889
has comment: http://stackoverflow.com/comment/134307392
has comment: http://stackoverflow.com/comment/134294891
has comment: http://stackoverflow.com/comment/134298837
type: UnansweredQuestion
tagged with: textcolor
has comment: http://stackoverflow.com/comment/134295548
tagged with: macos
has body: I have a split view window with an outline view on the left and a table view on the right. I want to be able to drag items from the table view and drop them onto items in the outline view. The dragging and dropping work fine, but the user feedback isn't quite visually what I want. Ideally, the behavior will be like the Finder, where folders become visually selected with white text as the dragged item passed over. In my implementation, however, the highlighting works as expected, but the text color remains black. I'm change the highlighting in my draggingUpdated call, and attempt to change the text color in dataCellForTableColumn. I actually can change the color of the text to white in that method... but not when a drag operation is in place, though the method is fired while dragging. The code: - (NSDragOperation) draggingUpdated:(id&lt;NSDraggingInfo&gt;)sender { NSPoint windowLocation = [[self window] convertScreenToBase: [NSEvent mouseLocation]]; NSPoint viewLocation = [self convertPoint: windowLocation fromView: nil]; NSInteger mouseRow = [self rowAtPoint:viewLocation]; // Get row at specified index if (highlightedRow != mouseRow) { NSTableCellView *row; // If the highlighted row changed, revert it to a normal background color if (highlightedRow &gt; -1) { row = [self viewAtColumn:0 row:highlightedRow makeIfNecessary:NO]; row.wantsLayer = YES; row.layer.backgroundColor = [[NSColor controlBackgroundColor] CGColor]; } // Make sure the mouse if pointing to an existing row if (mouseRow &lt; self.numberOfRows) { if ([[self itemAtRow:mouseRow] isKindOfClass:[ProjectTeamObject class]]) { row = [self viewAtColumn:0 row:mouseRow makeIfNecessary:NO]; row.wantsLayer = YES; row.layer.backgroundColor = [[NSColor selectedContentBackgroundColor] CGColor]; highlightedRow = mouseRow; } } else highlightedRow = -1; } return (NSDragOperationCopy); } - (NSCell *)outlineView:(NSTableView *)tableView dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item { NSCell *dataCell =…
tagged with: drag-and-drop
has comment: http://stackoverflow.com/comment/134295714
has title: Setting text color of cells in outline view while dragging
tagged with: objective-c
tagged with: nsoutlineview
answer count: 0
has comment: http://stackoverflow.com/comment/134293492
score: 0

http://stackoverflow.com/comment/134163800
type: QuestionComment
has text: Well I use first id myClass = objc_getClass( "myClass" ), which is not nil, and then I use var1 = [myClass doSomethingWith:...] (myClass as a literal).
comment on: http://stackoverflow.com/q/76073275
type: Comment
score: 0

swiftui
tag name: swiftui
type: Tag
tags question: http://stackoverflow.com/q/76199112
tags question: http://stackoverflow.com/q/76286739
tags question: http://stackoverflow.com/q/76297936
tags question: http://stackoverflow.com/q/76473669
tags question: http://stackoverflow.com/q/76521757
tags question: http://stackoverflow.com/q/77466483
tags question: http://stackoverflow.com/q/77950769
tags question: http://stackoverflow.com/q/78565146
tags question: http://stackoverflow.com/q/78844651
tags question: http://stackoverflow.com/q/79037340
tags question: http://stackoverflow.com/q/79002469
tags question: http://stackoverflow.com/q/79519362

http://stackoverflow.com/comment/134330782
has text: Already setted all neccessary steps. But no use.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/76172053
type: Comment

endpoint
tag name: endpoint
type: Tag
tags question: http://stackoverflow.com/q/76145278

http://stackoverflow.com/comment/134307065
comment on: http://stackoverflow.com/q/76151348
has text: SwizzleHelper also has unit tests where you can see how the swizzling and forwarding is done with the package.
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/139341039
has text: Did you resolve this, and could you use a piece of assembly code that does what dispcallfunc does, and use it in the vtable of a class by swapping the pointer. The source of dispcallfunc can probably be found on wine
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76027766

http://stackoverflow.com/comment/134323187
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76166846
type: QuestionComment
has text: What are you trying to accomplish? Which problem do you want to solve?

cordova
tags question: http://stackoverflow.com/q/76156263
tag name: cordova
type: Tag
tags question: http://stackoverflow.com/q/77627573

pitch-shifting
type: Tag
tags question: http://stackoverflow.com/q/76183122
tag name: pitch-shifting

http://stackoverflow.com/comment/134377458
comment on: http://stackoverflow.com/q/76199576
type: Comment
score: 0
has text: Read each migration guide to see where it's stated: https://pspdfkit.com/guides/ios/upgrade/
type: QuestionComment

http://stackoverflow.com/comment/134289577
has text: @James `NSOperationQueue` API is much more flexible in this case, since custom operation classes can have any implementation under the hood. E.g. [here](https://gist.github.com/TheDreamsWind/49bc1d11817828d627d3968364b08d5e) you can find a custom queue implemented on top of a POSIX thread, so you can potentially use your worker thread instead and dispatch your tasks in the thread's run loop
comment on: http://stackoverflow.com/a/76146727
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/a/76200243
type: AcceptedAnswer
type: Answer
score: 2
has body: The problem is that layers have their own built-in animation effects when certain properties are changed - frame begin one of them. You can disable the built-in animation like this: if let layer = gradientLayer { CATransaction.begin() CATransaction.setDisableActions(true) layer.frame.size.width = 100 + translation.x CATransaction.commit() } Which works fine while you are dragging. Unfortunately, it won't match when you animate the view's frame size. You will probably be much better off using a custom UIView subclass, setting its "base" layer to be a gradient layer. Quick example: class SomeGradientView: UIView { // this allows us to use the "base" layer as a gradient layer // instead of adding a sublayer lazy var gradLayer: CAGradientLayer = self.layer as! CAGradientLayer override class var layerClass: AnyClass { return CAGradientLayer.self } override init(frame: CGRect) { super.init(frame: frame) commonInit() } required init?(coder aDecoder: NSCoder) { super.init(coder:aDecoder) commonInit() } private func commonInit() { gradLayer.startPoint = .init(x: -1, y: 0) gradLayer.endPoint = .init(x: 1, y: 0) gradLayer.colors = [UIColor.red.cgColor, UIColor.yellow.cgColor] } } With that class, you no longer need to add sublayers, and you don't need to deal with the gradient layer frame. Your example view controller, modified slightly: class ViewController: UIViewController { var rectangle: SomeGradientView! var widthConstraint:NSLayoutConstraint! var shouldExpand = false override func viewDidLoad() { super.viewDidLoad() rectangle = SomeGradientView() view.addSubview(rectangle) rectangle.translatesAutoresizingMaskIntoConstraints = false rectangle.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: view.frame.width * 0.05).isActive = true rectangle.heightAnchor.constraint(equalToConstant: 200).isActive = true widthConstraint = rectangle.widthAnchor.constraint(equalToConstant: 100) widthConstraint.isActive = true rectangle.centerYAnchor.constraint(equalTo: view.cen…
downvote count: 0
accepted answer of: http://stackoverflow.com/q/76199112
answers question: http://stackoverflow.com/q/76199112
upvote count: 2

http://stackoverflow.com/q/76166846
has comment: http://stackoverflow.com/comment/134331790
has body: I have a WKWebView (discussed in this page - How can I paginate html in a wkwebview?) and I'm trying a different approach to solving the problem discussed there. What I want to do is trap scroll events in the view for the entire window ([self.window.contentView setAllowedTouchTypes:(NSTouchTypeMaskDirect | NSTouchTypeMaskIndirect)];) and then ignore all touch events for WKWebView and WKWebView's enclosing scrollview. I can see that my setAllowedTouchTypes is working as follows… @interface NSView ( TouchEvents ) @end @implementation NSView ( TouchEvents ) - (void)touchesBeganWithEvent:(NSEvent *)event { NSLog(@"Touched"); } @end Even though I can see the 'touched' messages in the logs, the contents of my WKWebView still scrolls around when I swipe with my fingers. For this to work, I need it not to move at all! Try as I might, I can't work out how to stop the swipes working for my WKWebView - and there doesn't seem to be anything in Interface Builder to achieve this aim either.
has comment: http://stackoverflow.com/comment/134323187
score: 0
type: Question
type: UnansweredQuestion
tagged with: macos
has comment: http://stackoverflow.com/comment/134351282
has title: How can I ignore all touch events in WKWebView and its enclosingScrolllView
answer count: 0
has comment: http://stackoverflow.com/comment/134323691
tagged with: nsscrollview
tagged with: objective-c

http://stackoverflow.com/q/76149831
has comment: http://stackoverflow.com/comment/134304136
tagged with: ios
type: Question
tagged with: objective-c
has title: Snapshot complex UIScrollview content view beyond screen bounds to speed up scrolling
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134300403
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/134300274
has body: I am working on an old app (so Obj-C, but that should not make a difference for what I am asking). It uses a big UIScrollView whose contents are made of several dozen of small views that are either icons or UILabels with text - this helps with the layout. In any case it has been working fine for years, except that with some added background information and color coding, it started making more and more sense to apply a shadow to the text and the icons. As you know, applying non-fixed shadow like I wanted (around text, or icons with transparency) is a performance hog, so scrolling became jerky. I said, hey, I only need to draw once, I could just snapshot and replace with an image. My problem is that the only method I found that actually works at getting a UIImage out of this huge (8000x500 points) UIView with its subviews: UIGraphicsBeginImageContext(scrollView.contentSize); CGRect savedFrame = scrollView.frame; scrollView.contentOffset = CGPointZero; scrollView.frame = CGRectMake(0, 0, scrollView.contentSize.width, scrollView.contentSize.height); [scrollView.layer renderInContext: UIGraphicsGetCurrentContext()]; UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); scrollView.frame = savedFrame; UIGraphicsEndImageContext(); is crazy slow. Trying on the slowest device I have, an iPad Air 2, it takes over a minute to do the renderInContext step! I tried what are more "modern" methods, e.g. : UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:scrollView.contentSize]; UIImage *img = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) { [scrollView drawViewHierarchyInRect: CGRectMake(0, 0, scrollView.contentSize.width, scrollView.contentSize.height) afterScreenUpdates:YES]; }]; This gives me a blank (transparent) image, and so does specifying the first subview of the ScrollView which is a container for all the subviews I want. Doing the same with the parent view of the scrollview, gives me an image o…
tagged with: uikit

http://stackoverflow.com/comment/134094212
has text: See these threads for examples and relevant resources: https://stackoverflow.com/questions/75531993/github-sonarcloud-action-does-not-scan-any-file and https://stackoverflow.com/questions/75192071/sonarcloud-with-googletest-and-cmake-on-github-actions
comment on: http://stackoverflow.com/q/76029695
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/q/76197050
has comment: http://stackoverflow.com/comment/134373126
has body: When debugging, viewDidLoad of LoginViewController is called, but the screen is black screen. I really don't know why.. @interface AppDelegate () @property (nonatomic, strong) AppCoordinator *appCoordinator; @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame: UIScreen.mainScreen.bounds]; UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; LoginViewController *vc = [sb instantiateViewControllerWithIdentifier:@"LoginView"]; //UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController: vc]; self.window.rootViewController = vc; [self.window makeKeyAndVisible]; return YES; } LoginViewController.m #import "LoginViewController.h" @implementation LoginViewController - (void)viewDidLoad { NSLog(@"LoginViewController viewDidLoad"); [super viewDidLoad]; self.view.backgroundColor = [UIColor redColor]; } @end
tagged with: uikit
has comment: http://stackoverflow.com/comment/134375434
tagged with: ios
has comment: http://stackoverflow.com/comment/134374230
has comment: http://stackoverflow.com/comment/134373141
has title: Objective C programmatically View ViewController But Black Screen
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134373091
has comment: http://stackoverflow.com/comment/134373129
has comment: http://stackoverflow.com/comment/134375669
score: 0
type: Question
tagged with: storyboard
has comment: http://stackoverflow.com/comment/134374283
type: UnansweredQuestion
answer count: 0

http://stackoverflow.com/comment/134304592
comment on: http://stackoverflow.com/q/76156263
has text: Post your config.xml
type: QuestionComment
score: 0
type: Comment

coreml
tag name: coreml
type: Tag
tags question: http://stackoverflow.com/q/76077379

http://stackoverflow.com/a/76186620
score: 0
type: Answer
has body: Why do you need to look up the object by ID? Is entity from a different context than context? If so, -objectWithID: will return a fault, so that’s probably the answer to your question. The fault is probably not a big deal because with entity already in memory (in the other context) the data will be in the row cache so the fault will not need to fetch from the store. If you have only one context, -objectWithID: should return the exact same object as entity, which you said was not initially a fault, so the cause of the fault must be elsewhere. (Plus, you could just pass entity directly to -deleteObject:.)
answers question: http://stackoverflow.com/q/76186465

http://stackoverflow.com/q/76077379
answer count: 0
score: 1
tagged with: ios
type: Question
upvote count: 1
tagged with: gpu
tagged with: objective-c
has body: I'm using TensorFlow Lite and I'm attempting to use a GPU processing delegate with the move net multi-pose model. The interpreter initialization fails with an ambiguous error. I'm attempting to use the Core ML GPU delegate but in the code below. I've tried TFLMetalDelegate as well and that fails as well. I'd be happy if ANY GPU processing would work with TFL. This is the link to the model: https://tfhub.dev/google/movenet/multipose/lightning/1 NSError* error = nil; TFLInterpreterOptions* options = [[[TFLInterpreterOptions alloc] init] autorelease]; options.numberOfThreads = 4; TFLCoreMLDelegateOptions* mlOptions = [[[TFLCoreMLDelegateOptions alloc] init]autorelease]; TFLCoreMLDelegate* coreMLDelegate = [[[TFLCoreMLDelegate alloc] initWithOptions:mlOptions] autorelease]; NSArray* delegates = [NSArray arrayWithObject:coreMLDelegate]; _interpreter = [[TFLInterpreter alloc] initWithModelPath:[NSBundle.mainBundle pathForResource:@"movenet_lightning_multipose" ofType:@"tflite"] options:options delegates:delegates error:&error]; The error returned says: Error Domain=org.tensorflow.lite.interpreter Code=4 "Failed to create the interpreter." UserInfo={NSLocalizedDescription=Failed to create the interpreter.} Using CPU processing is incredibly inefficient and very slow. Is there anyway to use GPU processing with the movenet model on the iPhone? Thanks for the help!!
has title: obj-c iOS TensorFlow Lite using GPU delegate with MoveNet Lightning model failure
favorite count: 0
tagged with: tensorflow-lite
tagged with: coreml
type: UnansweredQuestion
downvote count: 0

cordova-ios
type: Tag
tags question: http://stackoverflow.com/q/76156263
tag name: cordova-ios

http://stackoverflow.com/comment/134089799
score: 0
comment on: http://stackoverflow.com/q/76027766
type: Comment
type: QuestionComment
has text: SHooting at the moon, would this be of interest, https://github.com/thetrik/VBCDeclFix

http://stackoverflow.com/comment/134364584
has text: You should add error message what it say. Also i saw typo there: [[electorViewController alloc]. Missing an "s"?
comment on: http://stackoverflow.com/q/76123444
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/134289816
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/76147011
score: 0
has text: I hesitate to even suggest this, but you could replace the convenience initialiser with a static factory function that has an unpleasant name (e.g. `makeObjectiveCInstance`) and returns a new `C`. That doesn’t hide it from Swift, but makes it much harder to use accidentally and less likely to appear in autocomplete suggestions.

http://stackoverflow.com/comment/134382016
type: QuestionComment
has text: From seeing quickly the doc, it seems you can init the PTAnnotationVC with PTAnnotation Manager, and the PTAnnotationManager with a `PDFViewCtrl`. Might a clue to dig...
comment on: http://stackoverflow.com/q/76199576
type: Comment
score: 0

usernotifications
tag name: usernotifications
type: Tag
tags question: http://stackoverflow.com/q/76043479

http://stackoverflow.com/comment/134373141
has text: That part seems to be a part that needs to be improved.. but it is not the cause of the above problem.. :(
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76197050

http://stackoverflow.com/comment/134296167
has text: Why are you even bothering with a run loop for this dispatch queue? Just give these methods the queue, and you’re done. The whole point of taking a dispatch queue is to get you out of the legacy pattern (that we had to do in the pre-GCD days) of spinning up a thread ourself with its own run loop…
comment on: http://stackoverflow.com/q/76145816
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/134307039
comment on: http://stackoverflow.com/q/76149338
score: 0
type: QuestionComment
type: Comment
has text: I'm trying to reimplement the default feedback because I get no UI feedback at all when dragging items over the targets. All of the NSGragOperation methods (draggingEntered, draggingUpdated, etc) do get called, I just get no feedback. I imagine that may have something to do with how the UI elements are defined in the storyboard?

http://stackoverflow.com/comment/134346698
comment on: http://stackoverflow.com/q/76180648
score: 0
has text: You need to provide more context. How are you using it in your code? What ways have you tried to resolve it, and what was the outcome?
type: QuestionComment
type: Comment

blending
type: Tag
tag name: blending
tags question: http://stackoverflow.com/q/76176009

http://stackoverflow.com/comment/134377508
type: Comment
has text: WHat is `PTAnnotationViewController`, I guess it inherits from some PDFTronSDK ViewController, right? Which one? PSPDFNoteAnnotationViewController
comment on: http://stackoverflow.com/q/76199576
score: 0
type: QuestionComment

http://stackoverflow.com/a/76332451
has body: I found out that in my custom plugin XIB file. I was using deprecated UIWebView component. I deleted it and added WKWebView instead and it solved the problem.
answers question: http://stackoverflow.com/q/76156263
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/76156263

http://stackoverflow.com/a/76186601
score: 0
has body: Faults are a normal part of Core Data. When you execute a fetch request with resultType of managedObjectResultType (which is the default), objects are returned as faults, unless you explicitly request otherwise by setting returnObjectsAsFaults to `false. The object properties are held in the row cache and faults are returned in the result set. When you access a property, the fault fires and the data is fetched from the row cache. This process is transparent and has a relatively low overhead. If you know that you are going to access the object properties, and you have a large result set, then you can set returnsObjectsAsFaults to false to avoid the fault process.
answers question: http://stackoverflow.com/q/76186465
type: Answer

tensorflow-lite
tags question: http://stackoverflow.com/q/76077379
type: Tag
tag name: tensorflow-lite

http://stackoverflow.com/a/76110827
has body: Sending a pdf from the ipad via a native share(opened the file on device and sent it via teams), results in the same error that my app gets. Solution, wait for ios or teams to fix this issue
answers question: http://stackoverflow.com/q/76104158
type: Answer
score: 0

http://stackoverflow.com/comment/134217106
type: Comment
comment on: http://stackoverflow.com/q/76104158
has text: On the iPad, can you share the file to other apps/activities without issue? Is the problem only when sharing to Teams? Is the same version the Teams app installed on the iPhone and iPad? Is the same version of iOS on both devices?
score: 1
type: QuestionComment

http://stackoverflow.com/a/76185644
answers question: http://stackoverflow.com/q/76180648
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/76180648
upvote count: 1
downvote count: 0
score: 1
has body: You can control the behavior of the popup menu with the following PTToolManagerDelegate method: toolManager(_:, shouldShowMenu:, forAnnotation:, onPageNumber:). You would want to return false from the method to disable the menu from appearing. Note that if you are using a PTDocumentController to show the document, then you will need to create a subclass and override that method: class CustomDocumentController : PTDocumentController { override func toolManager(_ toolManager: PTToolManager, shouldShowMenu menuController: UIMenuController, forAnnotation annotation: PTAnnot?, onPageNumber pageNumber: UInt) -&gt; Bool { // Uncomment to disable popup menu in all scenarios. // return false if annotation == nil { // No annotation is selected. if toolManager.tool as? PTPanTool != nil { // This is the long-press menu over blank space in the document. // Uncomment to disable long-press menu. // return false } else if toolManager.tool as? PTTextSelectTool != nil { // This is the text-selection menu shown for selected text. // Disable text-selection menu. return false } } // Use default menu behavior from superclass. return super.toolManager(toolManager, shouldShowMenu: menuController, forAnnotation: annotation, onPageNumber: pageNumber) } } The code above will disable the text-selection menu, but leave the long-press (over blank space) and annotation-selection menus enabled. You can uncomment the commented-out lines to control those menus as well if you want.

http://stackoverflow.com/q/76145816
has comment: http://stackoverflow.com/comment/134311729
tagged with: macos
has title: How to connect a Dispatch Queue to a Run Loop?
downvote count: 1
type: Question
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/76146727
has body: I'm currently in the process of porting my existing Network library to Apple platforms. The existing implementation uses a single worker thread to process all active connections (objects wrapping raw sockets). I would like to retain this aspect of the design on Apple platforms. Instead of using raw sockets, I am using Apple's Network framework. Connection objects (nw_connection_t, nw_listener_t, et al.) in this framework expect dispatch_queue_t objects - through which event notifications will be sent. So I have created one of these and pass it to all nw_... functions that require it. My worker thread has retrieved the associated CFRunLoopRef instance (or rather created one) by calling CFRunLoopGetCurrent, and I'm processing this in my thread's main loop with the following: CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, true ); But what I don't understand, and have been unable to figure out, is how I get my dispatch queue to be processed by my thread's RunLoop object? I'm assuming I need to attach one to the other somehow so that notifications are called at the right time in my worker thread, right? So, how do I do this?
tagged with: network-programming
favorite count: 0
upvote count: 0
has comment: http://stackoverflow.com/comment/134296167
accepted answer: http://stackoverflow.com/a/76146727
type: AnsweredQuestion
score: -1

http://stackoverflow.com/comment/134141866
has text: with your code it prints extra stuff
comment on: http://stackoverflow.com/a/76060045
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134285715
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76140643
type: Comment
has text: I think you need both approaches but the AppleScipt approach can be translated to C using the Accessibility API.

http://stackoverflow.com/comment/134307385
type: QuestionComment
comment on: http://stackoverflow.com/q/76151348
score: 0
type: Comment
has text: In your example, you don't call the original implementation, so the problem with the exchange methods approach doesn't apply. If that's the case in your real code, as opposed to just a simplified example for SO, it may just be a matter of using `@convention(block)` in what you're already doing, as in `class func swizzledPullTypes(fromServer completionBlock: @escaping @convention(block) (Any) -> Void, error errorBlock: @escaping MKNKErrorBlock)`

http://stackoverflow.com/comment/134288494
type: Comment
has text: Yes, but then you need to write your init in Objective-C (not Swift) and possibly mark it with `NS_SWIFT_UNAVAILABLE` 9depends on usage really - is it public, etc)
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/76147011

http://stackoverflow.com/a/76869089
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/76147011
score: 1
has body: You cannot hide it from autocomplete, if that was your goal. What you can do is: @available(swift, obsoleted: 1.0) convenience init ( min: Int, max: Int ) { Now trying to call that method from Swift is a hard error and autocomplete will not suggest that init by default, but it's still in the list.
type: Answer

http://stackoverflow.com/comment/134354762
has text: Note that your comparison between Objective-C and Swift is comparing completely different cases. In Swift, the `Float` and `Double` structs are handling the conversion from a string. The Objective-C code is asking the `NSString` class for a primitive numeric value. Those are essentially opposite approaches. A better comparison would be if `NSNumber` in Objective-C had an initializer that accepted an `NSString` (it doesn't though). Or if in Swift, `String` had a `floatValue` or `doubleValue` property (it doesn't though). So there simply isn't a fair comparison here.
type: Comment
comment on: http://stackoverflow.com/q/76180099
type: QuestionComment
score: 2

nshomedirectory
type: Tag
tags question: http://stackoverflow.com/q/76059936
tag name: nshomedirectory

http://stackoverflow.com/comment/134197370
comment on: http://stackoverflow.com/a/76092478
type: AnswerComment
has text: There's nothing wrong with using C++, but if you're able to add your own Objective-C header files to your C++ source, then presumably you're also able to choose to compile your C++ using an Objective-C++ compiler. You wouldn't expect a C++ compiler to work if you #included a bunch of Python code, right? It's the same with Objective-C -- if you include it in your C++ code, the compiler won't know what to do with it. Using the bridge file is one way to handle the problem, but it's extra work compared to just using a compiler that knows about Objective-C.
type: Comment
score: 0

http://stackoverflow.com/comment/134197416
score: 0
has text: If you're sticking with strict C++ (no Objective-C++), then you do need to keep Objective-C code out of it, so the bridge solution is the right one. If that's the case, you should probably edit the question to make it clear that you have this restriction. As you asked it, and I restated it, the question suggests that your goal is to mix Obj-C and C++, not keep them separate.
comment on: http://stackoverflow.com/a/76092478
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134375669
has text: @GeoffHackworth That cause was correct. Thank you.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76197050
type: QuestionComment

http://stackoverflow.com/comment/134293492
score: 0
comment on: http://stackoverflow.com/q/76149338
type: Comment
type: QuestionComment
has text: Is the outline view view based or cell based?

http://stackoverflow.com/comment/134346912
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76180099
has text: You can just write: `double ddd = NAN;`
type: QuestionComment

http://stackoverflow.com/a/76172053
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/76171892
score: 1
has comment: http://stackoverflow.com/comment/134330782
has body: Make sure you add the -ObjC linker flag to the 'Build Settings' of your both the project and the target.
type: Answer

http://stackoverflow.com/a/76204570
answers question: http://stackoverflow.com/q/76189088
score: 0
type: Answer
has body: For link annotations in the document, you can edit and delete them with the link creation tool (PTLinkCreate class). While the link-create tool is active, existing link annotations will be selected when you tapped. From the annotation-selection popup menu you can tap "Delete" (the last menu option - you may need to scroll or tap the arrow in the menu to see it) to delete the link annotation.

http://stackoverflow.com/q/76147011
score: 2
tagged with: interop
type: Question
tagged with: swift
has title: Can a Swift init be made available only for ObjectiveC?
accepted answer: http://stackoverflow.com/a/76147531
has comment: http://stackoverflow.com/comment/134288494
has answer: http://stackoverflow.com/a/76869089
favorite count: 0
possible better answer: http://stackoverflow.com/a/76869089
upvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/76147531
answer count: 2
tagged with: objective-c
has body: Suppose I have a Swift class @objcMembers class C: NSObject { let range: ClosedRange&lt;Int&gt; init(range: ClosedRange&lt;Int&gt;) { self.range = range super.init() } convenience init(min: Int, max: Int) { self.init(range: min...max) } } Is there a way to make the convenience init available only from Objective-C, so that the API will be smaller?
has comment: http://stackoverflow.com/comment/134290235
has comment: http://stackoverflow.com/comment/134289816
downvote count: 0

http://stackoverflow.com/comment/134307036
has text: The `private static swizzleCustomToolTipMethods()` method is where I do the actual swizzling. Methods like `mouseExited_CustomToolTip(with:)` show how I do the forwarding. I plan to eventually add a HOW-TO section in the SwizzleHelper README, but haven't made time for it so far. At the moment, it's mainly a support package for CustomToolTip, though a couple of other people have forked it. I don't know what they're using it for. I also intend to add support for swizzling class methods.
type: Comment
comment on: http://stackoverflow.com/q/76151348
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134300403
score: 0
comment on: http://stackoverflow.com/q/76149831
type: Comment
has text: @DonMag, yes, that was one of the first things I tried - did not affect things perceivably. My question was mainly about snapshotting, as that's one way you could go and yet it did not work at all for me. In the end I avoided all layer shadows, UILabel shadows work well and for images I am just applying a shadow directly to the image instead, so it's now fast. Still curious though about if snapshotting is possible and I just did not figure it out...
type: QuestionComment

http://stackoverflow.com/comment/134373126
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76197050
has text: Screen conversion using the coordinator pattern is a basic step to implement with code.

http://stackoverflow.com/comment/134118444
type: QuestionComment
type: Comment
has text: Please don't add a separate "update" section to your question. It's too difficult to figure out what the question is _now_. Instead, _rewrite_ the question to be clear about what your code is and what the issue is. You don't need to call out the fact that the question has been edited.
comment on: http://stackoverflow.com/q/76038481
score: 0

http://stackoverflow.com/comment/136632858
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76081876
has text: Same problem here. The state does not change until I navigate to a page on another domain.

http://stackoverflow.com/comment/134359087
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76123444
has text: "But I can't able to set this navigation and get an error and the app gets crashed" Could you share the full error message?
type: QuestionComment

http://stackoverflow.com/comment/134345967
comment on: http://stackoverflow.com/a/76180529
has text: And if you want to create a "nan" on Objective-c, just simple like double nan = NAN. There is a macro to represent it.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134310820
has text: "Not working" means the Swift function `swizzledPullTypes` doesn't get called at all
comment on: http://stackoverflow.com/q/76151348
type: QuestionComment
score: 0
type: Comment

cgpdfdocument
tags question: http://stackoverflow.com/q/76038481
type: Tag
tag name: cgpdfdocument

http://stackoverflow.com/comment/134087160
comment on: http://stackoverflow.com/q/76027766
type: QuestionComment
score: 1
type: Comment
has text: See also [C late binding with unknown arguments](https://stackoverflow.com/questions/34885868).

http://stackoverflow.com/comment/134295842
has text: How does the new method look when it's imported into Objective C? There's probably a subtle difference.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76151348

textcolor
tag name: textcolor
type: Tag
tags question: http://stackoverflow.com/q/76149338
tags question: http://stackoverflow.com/q/77600151

http://stackoverflow.com/comment/134195882
type: Comment
has text: It's fine to answer your own question, but you still need to ask the question as though you don't already know the answer that you're about to give. That'll make it easier for people to figure out what you're asking. Also, you might find that people give you answers that you weren't expecting. I've rewritten your question from that perspective, but please edit if you feel that I've somehow missed the point of what you're trying to ask.
type: QuestionComment
comment on: http://stackoverflow.com/q/76092456
score: 0

http://stackoverflow.com/comment/134271172
has text: Great analysis. I fully agree that returning `nil` on file creation failure was the most likely intent. Otherwise the return value is very misleading to the caller.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76135974
score: 0

http://stackoverflow.com/comment/134293403
score: 1
has text: It doesn't solve the problem as asked, so I have to say that even though it would function, it doesn't work for me. The question, if treated as a spec, requires that there be a single unified approach. Perhaps I should have defined "single unified" more clearly. The code that I have at the moment makes an FFI call to Objective-C and then if there is no window name in the result, shells out to `osascript` to get that. What is here requires that I shell out to `osascript` and then the script may make another shell-out. "I don't care about your claims."? OK
comment on: http://stackoverflow.com/a/76141553
type: AnswerComment
type: Comment

apple-app-site-association
tags question: http://stackoverflow.com/q/76160415
type: Tag
tag name: apple-app-site-association

sonarqube
type: Tag
tag name: sonarqube
tags question: http://stackoverflow.com/q/76029695

http://stackoverflow.com/comment/134196780
comment on: http://stackoverflow.com/a/76092478
score: 0
has text: Is there a reason that you need a separate bridge file instead of just renaming `CppFile.cpp` to `CppFile.mm` so that it gets compiled as Objective-C++? If you do that, you can access the Obj-C objects directly, although you'll need to do it using Obj-C syntax `(e.g. `[objcFile showInterface]` instead of `objcFile->showInterface()`). Objective-C++'s reason for existing is to allow you to easily use the two languages together -- why not use it?
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134288288
comment on: http://stackoverflow.com/a/76146727
type: AnswerComment
type: Comment
score: 0
has text: But the very existence of dispatch_get_main_queue suggests it should be possible to execute a dispatch queue on a specific thread. I.e., on my thread. Maybe that's not with a RunLoop, but unless Apple really managed to screw this up too it should be possible, no?

http://stackoverflow.com/comment/134345770
score: 0
comment on: http://stackoverflow.com/a/76180529
has text: In case you are casting "NaN" as a Float, it's valid because Float conforms LosslessStringConvertible protocol which allows you to convert kind of "inf" as infinity or "NaN" as nan. Check on Swift.Math.Floating Foundation.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134250087
has text: You would call `getaddrinfo` with your host name and then loop through the returned results looking for results were `ai_family` is `AF_INET` (which is IPv4) and `AF_INET6`. `ai_addr` will then contain the relevant address bytes. Take a look at this https://subscription.packtpub.com/book/general/9781849698085/1/ch01lvl1sec11/performing-a-network-address-resolution
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/76111768
type: Comment

http://stackoverflow.com/comment/134196678
score: 1
type: Comment
has text: @Caleb sorry for my English it isn’t my native language Thanks for fixing my errors
type: QuestionComment
comment on: http://stackoverflow.com/q/76092456

http://stackoverflow.com/comment/134141857
score: 1
has text: I just get "/Users/mohabhisham/Library/Developer/CoreSimulator/Devices/7B0A58B1-92DD-4C1E-9544-53BC319D6AB1/data/Containers/Data/Application/7F7BBF73-A6E2-410C-B83A-0DF29D152A05"
type: AnswerComment
comment on: http://stackoverflow.com/a/76060045
type: Comment

http://stackoverflow.com/comment/134375434
has text: If this is a modern project it will use the scene lifecycle and your code for configuring the window should be in the scene delegate, not the app delegate.
type: QuestionComment
score: 1
type: Comment
comment on: http://stackoverflow.com/q/76197050

http://stackoverflow.com/comment/134246198
type: Comment
has text: @Paulw11 Thank you! Looking at the following link, do you know how I could alter it to return the IPv4 & IPv6 addresses from a given URL? https://stackoverflow.com/a/15571849/10111607
score: 0
comment on: http://stackoverflow.com/q/76111768
type: QuestionComment

http://stackoverflow.com/comment/134141484
has text: And what's your problem? It's not a good way of using `printf()` — you would be safer using `printf("%s\n", NSHomeDirectory())`, but it's unlikely to be your problem. Is the problem occurring when you compile the code, when you link the code, or when you run the code? You should probably mention that you're trying to work on macOS X, and presumably, you're using Xcode — but are you using the IDE or just the command-line tools?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/76059936
score: 1

http://stackoverflow.com/comment/134295714
score: 0
type: QuestionComment
has text: It does, yes; it returns an NSWrapperCellView which in turn includes an NSView. Setting the background color in draggingUpdated works as expected, but the setTextColor methods in dataCellForTableColumn don't have any effect while a drag is in progress. The text color remains black. My first choice is to get it working as is, but if I have to I'll move to a view based outline view. My fear, though, is that I may encounter the same behavior while dragging.
type: Comment
comment on: http://stackoverflow.com/q/76149338

http://stackoverflow.com/comment/134318394
comment on: http://stackoverflow.com/a/76164006
type: AnswerComment
type: Comment
has text: I tried your suggestions and remove everything with feature and the preferences you mentioned, but it's not working. Are there any other suggestions ? Also I scanned the whole project but i did not find any reference to UIWebView.
score: 0

http://stackoverflow.com/comment/134225448
type: QuestionComment
score: 0
type: Comment
has text: @HangarRash, both devices are on 16.4.1. I am able to use mail, air drop and one drive without problems.
comment on: http://stackoverflow.com/q/76104158

http://stackoverflow.com/comment/134311181
comment on: http://stackoverflow.com/q/76151348
score: 0
type: QuestionComment
type: Comment
has text: Okay, I think this just works. Turned out that a function that calls this `pullTypes` missed a condition during tests. I just didn't check it fully until @ChipJarred asked about the manner of not working. I appreciate your time here, Jarred.

http://stackoverflow.com/a/76902389
type: Answer
answers question: http://stackoverflow.com/q/76145278
score: 0
has body: There is a way to do this, with the es_invert_muting() function (available in MacOS 13.0 and later). You can do something like this: es_unmute_all_target_paths(client) es_invert_muting(client, ES_MUTE_INVERSION_TYPE_TARGET_PATH) es_mute_path(client, path, ES_MUTE_PATH_TYPE_TARGET_PREFIX) This removes the default mute list, "inverts" the mute logic, so only muted paths are selected, then selects one path p[refix to monitor. Note that there is a difference between ES_MUTE_PATH_TYPE_PREFIX and ES_MUTE_PATH_TYPE_TARGET_PREFIX. The former refers to the path of the executable that triggered the event, and the latter is the path of the file that was accessed.

http://stackoverflow.com/comment/134336458
type: Comment
comment on: http://stackoverflow.com/q/76123444
has text: Can you add more details like what you are looking to achieve or a sample app which can reproduce the issue ? Didn't understand what is the value of _passthroughViews and why you are presenting twice in your code
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134306991
has text: I haven't added swizzling class methods so it may not be directly useful to you after all. But for swizzling instance methods, define an extension for the object type you want to swizzle a method of, define your swizzled method to do what you want to do, and to chain to the original implementation you call the appropriate `callReplacedMethod...` method specifying the original selector. Those `callReplacedMethod...` function are in `NSObject+Swizzling.swift`. I use its the CustomToolTip package linked in the README. In it, `NSView+CustomToolTip.swift` is the place to look.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76151348
score: 0

http://stackoverflow.com/comment/134331790
type: Comment
has text: Do you want to detect a swipe or do you want to prevent scrolling? Have you tried a gesture recognizer?
score: 0
comment on: http://stackoverflow.com/q/76166846
type: QuestionComment

nsscrollview
tags question: http://stackoverflow.com/q/76166846
tag name: nsscrollview
type: Tag
tags question: http://stackoverflow.com/q/78563449

graphics
tag name: graphics
tags question: http://stackoverflow.com/q/76176009
type: Tag
tags question: http://stackoverflow.com/q/76553856
tags question: http://stackoverflow.com/q/77062432

uiview
tag name: uiview
type: Tag
tags question: http://stackoverflow.com/q/76080307
tags question: http://stackoverflow.com/q/78195402
tags question: http://stackoverflow.com/q/78195287
tags question: http://stackoverflow.com/q/79240177

http://stackoverflow.com/comment/134365094
has text: If you allow third-party apps or websites to record your screen, any information they collect is governed by their terms and privacy policies. It’s recommended that you learn about the privacy practices of those parties.
comment on: http://stackoverflow.com/a/76184877
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134117734
type: QuestionComment
has text: @HangarRash Ok, I have tried doing this, and it is still hit and miss...sometimes it works fine, other times it doesn't. I updated the OP with what I have tried now.
type: Comment
comment on: http://stackoverflow.com/q/76038481
score: 0

http://stackoverflow.com/comment/134184774
comment on: http://stackoverflow.com/a/76080736
score: 0
type: AnswerComment
type: Comment
has text: Thank you for your reply! This makes sense, but as a follow-up to the original question, if I initialize the LibraryView with the frame of the root view, why are the margins different within the LibraryView anyways? Shouldn't they be the same? Regardless, your implementation does solve the original issue.

http://stackoverflow.com/comment/134234973
type: Comment
has text: You will need to use [getaddrinfo](https://man7.org/linux/man-pages/man3/getaddrinfo.3.html) and then look in the `results` array for `AF_INET6` results. 'gethostbyname` is not ipv6 aware
comment on: http://stackoverflow.com/q/76111768
score: 1
type: QuestionComment

http://stackoverflow.com/comment/134325391
type: QuestionComment
has text: Added code from `AASA` file. However, universal link is a function that uses xcode's Associate Domain. What I'm curious about is that the 'smart banner', which is automatically created by the 'AASA' file to connect the app and the web, is visible only by scrolling on the 'ipad', but I want to make it visible on the page without scrolling.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76160415

uipopoverpresentationcontroller
tags question: http://stackoverflow.com/q/76123444
tag name: uipopoverpresentationcontroller
type: Tag
tags question: http://stackoverflow.com/q/77477713

http://stackoverflow.com/comment/134307392
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/76149338
has text: The item returned from `outlineView:child:ofItem:` must be unique, not `isEqual` to other items, and it must always be the same instance, not a copy or created every time. Otherwise `NSOutlineView` will get confused.
type: Comment

http://stackoverflow.com/comment/134377625
type: Comment
has text: UINavigationBar decoded as unlocked for UINavigationController, or navigationBar delegate set up incorrectly. Inconsistent configuration may cause problems.
score: 0
comment on: http://stackoverflow.com/q/76123444
type: QuestionComment

pdftron
tag name: pdftron
tags question: http://stackoverflow.com/q/76180648
type: Tag
tags question: http://stackoverflow.com/q/76189088
tags question: http://stackoverflow.com/q/76199576

http://stackoverflow.com/comment/134345601
comment on: http://stackoverflow.com/a/76180608
has text: Why? at swift "NaN" is nan and at C# "NaN" is also double.NaN
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/134118603
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76046344
score: 0
has text: Thank you very much, I left my if check the same and adjusted the range to {7,1} it works now.

http://stackoverflow.com/comment/134159638
has text: Does this answer your question? [Create directory/file in iOS using C++](https://stackoverflow.com/questions/38945963/create-directory-file-in-ios-using-c)
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/76059936
type: Comment

http://stackoverflow.com/comment/134373129
type: Comment
comment on: http://stackoverflow.com/q/76197050
has text: You don’t assert on nil vc
score: 0
type: QuestionComment

http://stackoverflow.com/a/76147531
score: 2
downvote count: 0
has body: You can expose the method to Objective-C runtime and make it private at the same time. This however requires you to introduce the private method's interface yourself (ideally by extending the auto-generated interface, rather than introducing a separate class declaration). Your swift class should look something like this: @objc(TDWSwiftObject) class SwiftObject: NSObject { let range: ClosedRange&lt;Int&gt; init(range: ClosedRange&lt;Int&gt;) { self.range = range super.init() } @objc private convenience init(min: Int, max: Int) { self.init(range: min...max) } } And then add the missing Objective-C parts as a class category: @interface TDWSwiftObject (Private) - (instancetype)initWithMin:(int)min max:(int)max; @end Now your Swift code won't be able to refer to the constructor (because it has private access modifier), while the Objective-C code can use it just fine.
type: AcceptedAnswer
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/134289390
accepted answer of: http://stackoverflow.com/q/76147011
answers question: http://stackoverflow.com/q/76147011

http://stackoverflow.com/comment/134351282
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76166846
has text: I tried adding a gesture recogniser to the the WKWebView - but it didn't seem to be detected reliably. Which is why I ask about removing the recognisers from the enclosing scrollview.
type: QuestionComment

http://stackoverflow.com/comment/134224931
has text: @MarekR solution from answer above suppose that definitions in C++ class implemented in Objective-C++. It's not very clear because same C++ class in this case uses 2 type of methods : 1.Implemented outside 2.Implemented inside. And inside methods will call outside methods. There’s no responsibility division (SOLID). Using wrapper as a standalone Objective-C++ class gives us that division: C++ calls methods in Objective-C++ Wrapper class and Wrapper calls Objective-C ViewController class. And vice versa
type: QuestionComment
comment on: http://stackoverflow.com/q/76092456
score: 0
type: Comment

http://stackoverflow.com/a/76241560
accepted answer of: http://stackoverflow.com/q/76193081
has body: Unfortunately the fact that the key is not given under the official documentation page means nothing in the world of Cocoa framework. You can still access the key by specifying it as a raw string (rather than a constant), however be advised that while the screen is not locked, the corresponding value may not be present in the session dictionary. Here is how you may inspect current lock status in the form of a free function: BOOL isScreenLocked() { CFDictionaryRef session = CGSessionCopyCurrentDictionary(); const void *value; if (CFDictionaryGetValueIfPresent(session, CFSTR("CGSSessionScreenIsLocked"), &value)) { if (((__bridge NSNumber *)value).boolValue) { return YES; } } return NO; }
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/76193081
type: Answer

http://stackoverflow.com/comment/134282176
comment on: http://stackoverflow.com/a/76141412
score: 0
has text: Thanks. That has lead me the right direction (nice answer). I found that I also need to `CFRelease(windows);` before return.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/76185744
answer count: 2
possible better answer: http://stackoverflow.com/a/76185902
tagged with: objective-c
has answer: http://stackoverflow.com/a/76185909
accepted answer: http://stackoverflow.com/a/76185909
type: Question
has answer: http://stackoverflow.com/a/76185902
has title: decodeObjectOfClasses is returning nil. Why?
score: 0
has body: I have the following code: #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { // Create a dictionary to be archived NSDictionary *dict = @{@"key1": @"value1", @"key2": @(42)}; // Archive the dictionary to a data object NSError *archiveError = nil; NSData *data = [NSKeyedArchiver archivedDataWithRootObject:dict requiringSecureCoding:NO error:&archiveError]; if (archiveError) { NSLog(@"Error archiving data: %@", archiveError); return 1; } // Unarchive the data object to a dictionary NSError *unarchiveError = nil; NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:&unarchiveError]; if (unarchiveError) { NSLog(@"Error creating unarchiver: %@", unarchiveError); return 1; } NSString *unarchivedDict = [unarchiver decodeObjectOfClasses:[NSSet setWithObjects:[NSDictionary class], [NSString class], [NSNumber class], nil] forKey:@"key1"]; if (!unarchivedDict) { NSLog(@"Error decoding object: %@", [unarchiver error]); return 1; } [unarchiver finishDecoding]; // Print the unarchived dictionary NSLog(@"%@", unarchivedDict); } return 0; } But unarchivedDict is returning nil. Why isn't returning value1? Do I have to use decodeObjectForKey? I know you can use forKey:@"root" to get the whole dict, but what other values can you use in forKey:?
type: AnsweredQuestion

network-programming
tags question: http://stackoverflow.com/q/76145816
tag name: network-programming
tags question: http://stackoverflow.com/q/76111768
type: Tag
tags question: http://stackoverflow.com/q/78317060

http://stackoverflow.com/comment/134141903
score: 1
has text: @Mohab Cannot reproduce. What system are you using? And what happens if you try `NSLog(NSHomeDirectory().UTF8String)` in Objective-C?
comment on: http://stackoverflow.com/a/76060045
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134181586
has text: @freeflow hah no, That's Windows 32-bit only :P The trik's work is legendary though.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76027766

nstableview
type: Tag
tag name: nstableview
tags question: http://stackoverflow.com/q/76035273
tags question: http://stackoverflow.com/q/76287510
tags question: http://stackoverflow.com/q/77705575
tags question: http://stackoverflow.com/q/78563449
tags question: http://stackoverflow.com/q/78556827
tags question: http://stackoverflow.com/q/79213356
tags question: http://stackoverflow.com/q/79286805
tags question: http://stackoverflow.com/q/79290269
tags question: http://stackoverflow.com/q/79259549
tags question: http://stackoverflow.com/q/79246671

http://stackoverflow.com/comment/134319686
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/76164006
has text: Your config.xml is very outdated, there are probably more stuff to remove / update. Just try with a new empty project and you'll see it works. You also have obsolete plugins.

http://stackoverflow.com/a/76185902
answers question: http://stackoverflow.com/q/76185744
type: Answer
has body: The keys used in archiving/unarchiving represent entire objects in the archive. You need to unarchive the whole dictionary since you archived a whole dictionary. Once you have the dictionary, you can then access values like you would any other dictionary. In other words, what you are trying to do can't be done. You are sort of mixing unarchiving and key-value coding which makes no sense. Also note that you did not use any keys when archiving so you have no keys to use when unarchiving. You need to use: + (id)unarchivedObjectOfClasses:(NSSet&lt;Class&gt; *)classes fromData:(NSData *)data error:(NSError * _Nullable *)error; to unarchive the dictionary since you used archivedDataWithRootObject:requiringSecureCoding:error: to archive it. Apple really wants everyone to use secure coding. So passing NO when archiving is frowned upon. Pretty much all of the non-secure unarchiving methods are deprecated.
score: 0

nsbatchdeleterequest
tag name: nsbatchdeleterequest
tags question: http://stackoverflow.com/q/76186465
type: Tag

http://stackoverflow.com/comment/134301944
score: 1
comment on: http://stackoverflow.com/a/76141553
type: AnswerComment
type: Comment
has text: Re: @kortschak, Good luck finding a "unified solution" as you understand it. It doesn't seem to use one of the 2 (AppleScript, which retrieves the window's name, or C code, which retrieves its ID), but magically extracts both. Also, I wish you to learn the magic word "thanks" for the user's attempt to provide help.

microsoft-teams
tag name: microsoft-teams
type: Tag
tags question: http://stackoverflow.com/q/76104158

http://stackoverflow.com/comment/136038367
type: QuestionComment
type: Comment
score: 0
has text: Did you make any progress?
comment on: http://stackoverflow.com/q/76183122

http://stackoverflow.com/comment/134263262
has text: @ДенисСолодовник if you want we can discuss what the answer is missing in more details in [the SO chat](https://chat.stackoverflow.com/rooms/253370/objective-c-c-interoperability), to avoid extensive discussion in the comment section. (so it can be improved for future readers)
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76092456

http://stackoverflow.com/comment/134306842
type: Comment
has text: Thanks, @ChipJarred. So far, I can't understand how to use your package.
comment on: http://stackoverflow.com/q/76151348
score: 0
type: QuestionComment

applescript
tag name: applescript
tags question: http://stackoverflow.com/q/76140643
type: Tag

http://stackoverflow.com/comment/134288377
has text: @James It's definitely possible if you implement your own concurrent API, but not with GCD.
comment on: http://stackoverflow.com/a/76146727
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/134295548
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/76149338
type: Comment
has text: Does `[self viewAtColumn:0 row:highlightedRow makeIfNecessary:NO]` return a view? Is converting to a view based table view an option?

http://stackoverflow.com/comment/134196596
type: Comment
has text: @Caleb Indeed! Article would be better but there is 2 moments First of all when I've searched an answer for my question I haven’t found **any** article about this And second an article needs a reviewers it's a great chance that my info doesn’t reach those who need it. Notice I'm not professional not even a person who can clearly explain technical Information. I think 90% of people decide this information is lame. My purpose is 10% persons who don’t think that it obvious and there’re no one near who can teach them And I didn’t mark my answer as accepted Thanks anyway
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76092456

http://stackoverflow.com/comment/134293441
comment on: http://stackoverflow.com/q/76140643
type: QuestionComment
score: 0
has text: The window number issue is essentially solved since it's obtained by the Objective C aproach. Would you be able to point to docs for the Accessibility API for this? I have ~0 experience in dev on MacOS.
type: Comment

http://stackoverflow.com/comment/134141934
comment on: http://stackoverflow.com/a/76060045
score: 1
has text: it prints the same "211" thing
type: AnswerComment
type: Comment

dns
type: Tag
tag name: dns
tags question: http://stackoverflow.com/q/76111768

http://stackoverflow.com/comment/134278290
type: QuestionComment
comment on: http://stackoverflow.com/q/76140890
score: 2
type: Comment
has text: Besides my answer below — I'm assuming this code is using automatic reference counting (ARC), but if for some reason not: `CGWindowListCopyWindowInfo` returns an allocated array which you would also need to `-release`

http://stackoverflow.com/comment/134218752
type: QuestionComment
has text: Not sure what you mean by "For my tasks this approach is useless". The answer to the linked question explains why you get the errors and give possible solutions to it
type: Comment
comment on: http://stackoverflow.com/q/76092456
score: 0

http://stackoverflow.com/comment/134150135
type: QuestionComment
comment on: http://stackoverflow.com/q/76059936
type: Comment
has text: `CFCopyHomeDirectoryURL()`?
score: 0

objective-c-runtime
type: Tag
tag name: objective-c-runtime
tags question: http://stackoverflow.com/q/76027766
tags question: http://stackoverflow.com/q/76571909
tags question: http://stackoverflow.com/q/76827926
tags question: http://stackoverflow.com/q/77293682
tags question: http://stackoverflow.com/q/77535525
tags question: http://stackoverflow.com/q/78259397
tags question: http://stackoverflow.com/q/78602533

http://stackoverflow.com/comment/134197256
comment on: http://stackoverflow.com/a/76092478
has text: @Caleb you’re right about Windows I need to be more correct "most C++ programmers I questioned about my problem"
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/134087255
score: 0
has text: @SteveSummit Thanks, thanks for both of these. Very interesting reads. I think resolving this will be a lot of experimentation with different approaches. ChatGPT suggested use of [`objc_msgSend`](https://developer.apple.com/documentation/objectivec/1456712-objc_msgsend) too
comment on: http://stackoverflow.com/q/76027766
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/134278321
has text: The [`kCGWindowName` docs](https://developer.apple.com/documentation/coregraphics/kcgwindowname?language=objc) mention that "Note that few applications set the Quartz window name." — running your code on my machine confirms that pretty much no window fetched by this API has a window name accessible this way. AppleScript must be using a different API, possibly Accessibility, to access this information.
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/76140643
type: Comment

ios-universal-links
tag name: ios-universal-links
tags question: http://stackoverflow.com/q/76160415
type: Tag

http://stackoverflow.com/comment/134381933
has text: Sorry, since PDFTron has been bought by Apprise, I mistook it. Check there the change notes: https://docs.apryse.com/documentation/ios/changelog/v8-0-0-76251/ but the logic is the same, maybe it's stated there since it seems to be a big change. But maybe you could also check what are now the `init` method available for `PTAnnoticationViewCOntroller`...
type: Comment
comment on: http://stackoverflow.com/q/76199576
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134441726
comment on: http://stackoverflow.com/a/76217374
score: 0
has text: I have controller and one of the two values are differ I think. Because it opens in a popup window. So while click on the title it not navigating to the app
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/139351680
has text: @Greedo No I never did get any further unfortunately, but also I haven't really switched on my mac since raising this question to test anything either
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/76027766
type: Comment

http://stackoverflow.com/comment/134347288
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76180099
type: QuestionComment
has text: You can write: `double ddd = atof("NaN");`

http://stackoverflow.com/comment/134365335
comment on: http://stackoverflow.com/a/76184877
score: 0
has text: @RobertKniazidis - Exactly. I don’t know how many actually wade though all those developer videos (I certainly don’t), but I think it would be easy to miss a small detail (from 4 years ago) that unlike many of the privacy settings, `CGWindowListCopyWindowInfo` never triggers an authorization prompt, and expects the app to be preapproved for screen recording in order to to read the names of windows (other than its own).
type: AnswerComment
type: Comment

alphablending
type: Tag
tag name: alphablending
tags question: http://stackoverflow.com/q/76176009

nsoutlineview
tags question: http://stackoverflow.com/q/76149338
type: Tag
tag name: nsoutlineview
tags question: http://stackoverflow.com/q/76953584
tags question: http://stackoverflow.com/q/77256493

wkwebview
tags question: http://stackoverflow.com/q/76156263
tags question: http://stackoverflow.com/q/76081876
tag name: wkwebview
type: Tag
tags question: http://stackoverflow.com/q/76536415
tags question: http://stackoverflow.com/q/76623872
tags question: http://stackoverflow.com/q/77140267
tags question: http://stackoverflow.com/q/77199867
tags question: http://stackoverflow.com/q/78192465
tags question: http://stackoverflow.com/q/78307909
tags question: http://stackoverflow.com/q/78476414
tags question: http://stackoverflow.com/q/78728592
tags question: http://stackoverflow.com/q/78633210
tags question: http://stackoverflow.com/q/79069233
tags question: http://stackoverflow.com/q/79402308
tags question: http://stackoverflow.com/q/79291730
tags question: http://stackoverflow.com/q/79442054
tags question: http://stackoverflow.com/q/79521891

storyboard
tags question: http://stackoverflow.com/q/76197050
type: Tag
tag name: storyboard
tags question: http://stackoverflow.com/q/76917550
tags question: http://stackoverflow.com/q/76937682
tags question: http://stackoverflow.com/q/77969695

github-actions
type: Tag
tags question: http://stackoverflow.com/q/76029695
tag name: github-actions

interop
tags question: http://stackoverflow.com/q/76147011
type: Tag
tag name: interop
tags question: http://stackoverflow.com/q/77085172

http://stackoverflow.com/comment/134289390
type: AnswerComment
type: Comment
has text: Agh... More trouble than its worth, I'm afraid. Wish there was a simpler way.
comment on: http://stackoverflow.com/a/76147531
score: 0

endpointsecurity
tag name: endpointsecurity
tags question: http://stackoverflow.com/q/76145278
type: Tag

vba
tags question: http://stackoverflow.com/q/76027766
tag name: vba
type: Tag

http://stackoverflow.com/a/76212137
score: 4
type: AcceptedAnswer
type: Answer
has body: There appear to be two questions here: Does casting a function pointer to another function pointer type and calling the result trigger undefined behavior? How can you write objc_msgSend() such that you can pass it any number of arguments and expect the correct return type, arbitrarily? Undefined Behavior For the first: I started fleshing out this part of the answer by referencing the C11 draft standard (the finalized C standard documents are behind a paywall, but the published draft docs are functionally identical), but as I'm not a language-lawyer, I'm not entirely confident in answering this part of the question to your satisfaction. The relevant parts of the standards doc to reference: §6.3.2.3¶8 A pointer to a function of one type may be converted to a pointer to a function of another type and back again; the result shall compare equal to the original pointer. If a converted pointer is used to call a function whose type is not compatible with the referenced type, the behavior is undefined. (Emphasis mine) If you cast between two "compatible" function pointer types, it's valid to call the cast function. So when are two functions "compatible"? §6.7.6.3¶15 15 For two function types to be compatible, both shall specify compatible return types. Moreover, the parameter type lists, if both are present, shall agree in the number of parameters and in use of the ellipsis terminator; corresponding parameters shall have compatible types. If one type has a parameter type list and the other type is specified by a function declarator that is not part of a function definition and that contains an empty identifier list, the parameter list shall not have an ellipsis terminator and the type of each parameter shall be compatible with the type that results from the application of the default argument promotions. If one type has a parameter type list and the other type is specified by a function definition that contains a (possibly empty) identifier list, both shall agree in the numb…
accepted answer of: http://stackoverflow.com/q/76210219
downvote count: 0
has comment: http://stackoverflow.com/comment/134399935
has comment: http://stackoverflow.com/comment/134399555
has comment: http://stackoverflow.com/comment/134399927
answers question: http://stackoverflow.com/q/76210219
upvote count: 4

http://stackoverflow.com/comment/134470686
type: QuestionComment
type: Comment
has text: You're using a bad library. Switch to https://github.com/alexeichhorn/YouTubeKit
score: 0
comment on: http://stackoverflow.com/q/76215695

http://stackoverflow.com/comment/134399555
comment on: http://stackoverflow.com/a/76212137
has text: *If a function declares that it doesn't accept any parameters, then it will never read any values passed to it, so you can safely pass whatever you want and it will ignore it.* I don't know that's guaranteed to be true, although the C standard's definition of `printf()` accepting more arguments than format specifiers in the format string does strongly imply it must be true.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/134536578
type: Comment
has text: @Willeke, i'm glad you guys can resolve any issue by discussing it in the comments section, but would you be so kind to leave an answer instead so we have less unanswered questions on SO. Alternatively we may vote to mark it a duplicate if the linked question has answers that help here
score: 0
comment on: http://stackoverflow.com/q/76285850
type: QuestionComment

http://stackoverflow.com/comment/134620381
has text: FYI - Don't define your own constant for `PI`. Foundation already provides `M_PI` which is a lot more accurate.
comment on: http://stackoverflow.com/q/76340994
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/76209219
upvote count: 1
score: 1
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/76208755
has body: Try to set status bar background color with the same color of navigation controller, add this extension: extension UINavigationController { func setStatusBar(backgroundColor: UIColor) { let statusBarFrame: CGRect if #available(iOS 13.0, *) { statusBarFrame = view.window?.windowScene?.statusBarManager?.statusBarFrame ?? CGRect.zero } else { statusBarFrame = UIApplication.shared.statusBarFrame } let statusBarView = UIView(frame: statusBarFrame) statusBarView.backgroundColor = backgroundColor view.addSubview(statusBarView) } } Now in viewDidLoad call: navigationController?.setStatusBar(backgroundColor: .yourColor)

http://stackoverflow.com/q/76319817
tagged with: objective-c
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/76321457
has body: Converting image sequences to h264 encoded mp4 file with objective-c. My code works well for one image file. But if there are more images ,images are the screen captured and png formatted images, I face this error. Video writing failed: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-16364), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x600000c78150 {Error Domain=NSOSStatusErrorDomain Code=-16364 "(null)"}} How to fix it? #import <Foundation/Foundation.h> #import <AVFoundation/AVFoundation.h> #import <AppKit/AppKit.h> #import <CoreImage/CoreImage.h> // Import CoreImage framework explicitly @interface VideoCreator : NSObject - (void)createH264VideoFromPNGImages; @end @implementation VideoCreator - (void)createH264VideoFromPNGImages { // Specify the folder path containing the PNG images NSString *imageFolderPath = @"/var/folders/example/path/"; // Specify the output file path and name for the H.264 video NSString *outputPath = @"/var/folders/example/result.mp4"; // Get a list of files in the image folder NSArray *imageFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:imageFolderPath error:nil]; // Create an AVAssetWriter to write the video file NSError *error = nil; AVAssetWriter *videoWriter = [[AVAssetWriter alloc] initWithURL:[NSURL fileURLWithPath:outputPath] fileType:AVFileTypeMPEG4 error:&error]; if (error) { NSLog(@"Failed to create AVAssetWriter: %@", error); return; } // Define the video settings NSDictionary *videoSettings = @{ AVVideoCodecKey: AVVideoCodecTypeH264, AVVideoWidthKey: @2880, // Specify the desired video width AVVideoHeightKey: @1800, // Specify the desired video height }; // Create an AVAssetWriterInput with the video settings AVAssetWriterInput *videoWriterInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:videoSettings]; videoWriterInput.expectsMediaDa…
score: 0
tagged with: avfoundation
answer count: 1
tagged with: h.264
has title: Converting image sequences to h264 video in objective-c results in AVFoundationErrorDomain
type: Question

http://stackoverflow.com/q/76229409
has comment: http://stackoverflow.com/comment/134430388
accepted answer: http://stackoverflow.com/a/76230759
type: Question
has body: I'm getting the following compiler warning when trying to determine the type of an object passed in: Messaging unqualified id This is a simplification of a situation in a large prod codebase: @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; [ViewController myMethod:@"MyString"]; [ViewController myMethod:@[@(1), @(2), @(3)]]; [ViewController myMethod:@(13)]; } + (void)myMethod:(id)authenticationData { if ([authenticationData isKindOfClass:[NSArray class]]) { // ERROR: Messaging unqualified id NSLog(@"NSArray"); } else if ([authenticationData isKindOfClass:[NSString class]]) { // No error here because the compiler stops checking after the first one. If above statement is commented out --> same error here NSLog(@"NSString"); } else { NSLog(@"Unknown"); } } @end
answer count: 1
tagged with: objective-c
downvote count: 0
has comment: http://stackoverflow.com/comment/134430855
favorite count: 0
has answer: http://stackoverflow.com/a/76230759
upvote count: 2
type: AnsweredQuestion
score: 2
has title: Objective-C "Messaging unqualified id" when trying to determine type of class from id

markdown
type: Tag
tag name: markdown
tags question: http://stackoverflow.com/q/76225320
tags question: http://stackoverflow.com/q/78616083

http://stackoverflow.com/comment/134526271
has text: How would the user dismiss it then?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76286739
score: 3

http://stackoverflow.com/comment/134639105
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76333979
score: 0
has text: I just re-read you last comment and I think I got it. The default array will be a displayed items and allowed array will have displayed and potentially displayed.

http://stackoverflow.com/q/76321041
score: 0
linked to: http://stackoverflow.com/q/5094928
tagged with: mobile-country-code
type: Question
has body: i am trying to get mobileCountryCode from device sim operator. the results i am getting from mobileCountryCode is 6553565535 which should be US or FR here is my objective-C code CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier *carrier = nil; // The CTTelephonyNetworkInfo.serviceSubscriberCellularProviders method crash because of an issue in iOS 12.0 // It was fixed in iOS 12.1 if (@available(iOS 12, *)) { NSDictionary<NSString *, CTCarrier *> *carriers = nil; if (@available(iOS 12.1, *)) { carriers = [networkInfo serviceSubscriberCellularProviders]; } else { carriers = [networkInfo valueForKey:@"serviceSubscriberCellularProvider"]; } if (carriers != nil) { for (NSString *key in carriers) { carrier = carriers[key]; NSLog(@"isoCountryCode : %@", carrier.isoCountryCode.description); } } } else { carrier = [networkInfo subscriberCellularProvider]; } NSString *codeInfo = @""; if (carrier != nil && carrier.mobileCountryCode != nil) { codeInfo = [carrier.mobileCountryCode stringByAppendingString:carrier.mobileNetworkCode]; } NSLog(@"countryCode: %@", codeInfo.description); Print our result : Carrier name: [--] Mobile Country Code: [65535] Mobile Network Code:[65535] ISO Country Code:[--] Allows VOIP? [YES] did i miss something ? i am using xCode 14.3
accepted answer: http://stackoverflow.com/a/76536164
has comment: http://stackoverflow.com/comment/134607703
type: AnsweredQuestion
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134674540
has title: Xcode 14+ serviceSubscriberCellularProviders mobileCountryCode return numbers instead of string?
has answer: http://stackoverflow.com/a/76536164
tagged with: xcode
answer count: 1

http://stackoverflow.com/comment/134609616
score: 0
has text: Is it possible?
comment on: http://stackoverflow.com/a/76333979
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134572771
type: QuestionComment
has text: `method_getTypeEncoding` and you will need to think how to decode returned result.
comment on: http://stackoverflow.com/q/76312639
type: Comment
score: 0

http://stackoverflow.com/q/76292989
score: 0
has title: Obj-C - Display emoji in UILabel?
has comment: http://stackoverflow.com/comment/134537249
type: Question
has comment: http://stackoverflow.com/comment/134537189
accepted answer: http://stackoverflow.com/a/76327067
has answer: http://stackoverflow.com/a/76327067
tagged with: emoji
tagged with: ios
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/134537332
tagged with: unicode
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134537344
answer count: 1
has body: I've configured MySQL tables to store emojis with the following: ALTER TABLE field_data_field_notes MODIFY field_notes_value VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; That said, when I return strings to my app and try to display them in a UILabel, they appear like this: Birthday emoji &amp;amp;#x1F388; The emoji is a balloon. I've tried the below code to decode it and display the actual emoji, but it doesn't seem to work (e.g. the UILabel still displays the emoji &amp;amp text)? Note, I'm using Drupal and I have the 'Unicode' module enabled, so I imagine this is why the encoded format is &amp;#x1F388. - (UITableViewCell *)tableView:(UITableView*)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath { TimeTableViewCell *cell = (TimeTableViewCell *)[self.subtableView dequeueReusableCellWithIdentifier:WeeklyTableIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@&quot;TimeTableViewCell&quot; owner:self options:nil]; cell = [nib objectAtIndex:0]; } NSString *encodedString =[self.sortedByTime valueForKey:@&quot;notes&quot;][indexPath.row]; NSString *decodedString = [self decodeString:encodedString]; cell.notes.text = decodedString; } - (NSString *)decodeString:(NSString *)string { // Decode HTML entities NSDictionary *entities = @{ @&quot;&amp;amp;&quot; : @&quot;&amp;&quot;, @&quot;&amp;quot;&quot; : @&quot;\&quot;&quot;, @&quot;&amp;apos;&quot; : @&quot;'&quot;, @&quot;&amp;lt;&quot; : @&quot;&lt;&quot;, @&quot;&amp;gt;&quot; : @&quot;&gt;&quot;, // Add more entity mappings as needed }; NSMutableString *decodedString = [NSMutableString stringWithString:string]; for (NSString *entity in entities) { NSString *replacement = [entities objectForKey:entity]; [decodedString replaceOccurrencesOfString:entity withString:replacement options:NSLiteralSearch range:NSMakeRange(0, [decodedString length])]; } // Decode Unicode escape sequences NSString *decodedUnicodeString = [decodedString stringByReplacingOccurrencesO…

http://stackoverflow.com/comment/134609654
comment on: http://stackoverflow.com/a/76333979
score: 0
has text: I don't know, it doesn't make any sense. Usually `allowsUserCustomization` is set when the toolbar is created.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/76259633
type: Question
has body: I'm facing an issue while connecting to socket on my local server, Where i am getting an error of connection time out (1001) shown in attached screen shots. Is there any default SRT socket address and port using which i can test my code on connection socket? Here is my code - (IBAction)onSender:(id)sender { int yes = 1; const char ipAddress [] = "192.168.112.45:8000"; printf("srt startup\n"); srt_startup(); printf("srt create socket\n"); srtSocket = srt_create_socket(); if (srtSocket == SRT_ERROR) { // fprintf(stderr, "srt_socket: %s\n", srt_getlasterror_str()); [NSException raise:[@(srt_getlasterror(nil)) stringValue] format:@"%s", srt_getlasterror_str()]; } printf("srt bind address\n"); struct sockaddr_in socketAddrIN; memset(&socketAddrIN, 0, sizeof(socketAddrIN)); socketAddrIN.sin_family = AF_INET; socketAddrIN.sin_port = htons(1234); inet_pton(AF_INET, ipAddress, &socketAddrIN.sin_addr); printf("srt set socket flag\n"); srt_setsockflag(srtSocket, SRTO_SENDER, &yes, sizeof(yes)); printf("srt connect\n"); int result = srt_connect(srtSocket, (struct sockaddr *)&socketAddrIN, sizeof(socketAddrIN)); if (result == SRT_ERROR) { // fprintf(stderr, "srt_connect: %s\n", srt_getlasterror_str()); [NSException raise:[@(srt_getlasterror(nil)) stringValue] format:@"%s", srt_getlasterror_str()]; } srt_close(srtSocket); srt_cleanup(); } Error log
answer count: 1
type: UnansweredQuestion
tagged with: sockets
tagged with: protocols
tagged with: ios
has title: SRT socket connection time out
tagged with: objective-c
score: 0
has answer: http://stackoverflow.com/a/76260042

android
type: Tag
tags question: http://stackoverflow.com/q/76262477
tag name: android
tags question: http://stackoverflow.com/q/77627573
tags question: http://stackoverflow.com/q/78032397

http://stackoverflow.com/comment/134674540
type: QuestionComment
comment on: http://stackoverflow.com/q/76321041
type: Comment
has text: @koen nah the device has active sim and e-sim but i think its ios deprecation issue
score: 0

http://stackoverflow.com/comment/134471390
comment on: http://stackoverflow.com/a/76248415
type: AnswerComment
type: Comment
score: 0
has text: Because this answer is very likely sufficient. Without seeing the code, I don't know the name of the header to import, but the answer is "import the header that defines `CK_PTR`." I don't believe this should be closed or the OP needs to edit the question if that's enough.

http://stackoverflow.com/comment/134609457
comment on: http://stackoverflow.com/a/76333979
score: 0
type: AnswerComment
type: Comment
has text: Why do you want to override `runCustomizationPalette:?

http://stackoverflow.com/a/76285645
type: Answer
answers question: http://stackoverflow.com/q/76279100
score: 2
downvote count: 0
has body: You're looking at non-linked data. You need to be aware of dynamic linking operations in order to meaningfully parse this. So, my question is: how does Objective-C/clang encode MD entity pointers in Mach-O files? It depends. Specifically, it depends on what runtime linking format for binds and rebases your binary uses. Broadly speaking, there are two formats: Dyld opcodes. This is the "old" format and has been used since macOS 10.6. In this format, all metadata is stored separately from the data it applies to, which is why you get clean pointers in your x86_64 binary, surrounded by zeroes. As its name suggests, it's an opcode-based sequence of instructions, which is stored somewhere in __LINKEDIT and is pointed to by the LC_DYLD_INFO/LC_DYLD_INFO_ONLY in the Mach-O header. You can dump this info specifically with xcrun dyld_info -opcodes: % xcrun dyld_info -opcodes test.macos test.macos [x86_64]: -opcodes: rebase opcodes: 0x0000 REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x0018 REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB 0x0050 REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x0058 REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x0060 REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x0080 REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x0088 REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x00D0 REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x00D8 REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x00F8 REBASE_OPCODE_DO_REBASE_IMM_TIMES regular bind opcodes: 0x00E0 BIND_OPCODE_DO_BIND 0x00B0 BIND_OPCODE_DO_BIND 0x00B8 BIND_OPCODE_DO_BIND 0x00C0 BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0x00E8 BIND_OPCODE_DO_BIND no lazy bind opcodes no weak bind opcodes The load command and dyld opcodes are defined in mach-o/loader.h. Use of the opcodes has been somewhat detailed by Jonathan Levin, though for the actual implementation, see MachOAnalyzer.cpp and MachOLayout.cpp in dyld source. Chained fixups. This is the "new" format first introduced in iOS 12 on arm64e. In this format, some metadata is stored alongside the target data it applies to, which is what you're seeing in your arm64 bi…
accepted answer of: http://stackoverflow.com/q/76279100
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/138113540
score: 0
has text: @BerryBlue I had a smilar issue to you. This fix/workaound helped me to prevent this error: https://github.com/facebook/react-native/issues/43319#issuecomment-2061251131
comment on: http://stackoverflow.com/a/76262845
type: AnswerComment
type: Comment

http://stackoverflow.com/a/76349151
type: Answer
accepted answer of: http://stackoverflow.com/q/76285850
answers question: http://stackoverflow.com/q/76285850
score: 0
has body: Change addRegions: to the following: - (void)addRegions:(NSArray *)regions { [[self.undoManager prepareWithInvocationTarget:self] removeRegions:regions]; // ... ... if (![self.undoManager isUndoing] && ![self.undoManager isRedoing]) { [self.undoManager setActionName:@"Add Region(s)"]; } } (I.e. add check to avoid setting the action name when the undo manager is redoing as well.)
type: AcceptedAnswer

http://stackoverflow.com/a/76333979
type: Answer
has comment: http://stackoverflow.com/comment/134637848
has comment: http://stackoverflow.com/comment/134609616
has comment: http://stackoverflow.com/comment/134609654
has comment: http://stackoverflow.com/comment/134639105
has comment: http://stackoverflow.com/comment/134638053
has comment: http://stackoverflow.com/comment/134626218
has comment: http://stackoverflow.com/comment/134643695
has comment: http://stackoverflow.com/comment/134638020
has comment: http://stackoverflow.com/comment/134639649
has comment: http://stackoverflow.com/comment/134609457
has comment: http://stackoverflow.com/comment/134608235
has body: Setting a property in Objective-C: self.allowsUserCustomization = YES; Using the setter method: [self setAllowsUserCustomization:YES];
has comment: http://stackoverflow.com/comment/134641714
has comment: http://stackoverflow.com/comment/134649014
has comment: http://stackoverflow.com/comment/134620800
has comment: http://stackoverflow.com/comment/134630276
has comment: http://stackoverflow.com/comment/134620414
accepted answer of: http://stackoverflow.com/q/76333097
answers question: http://stackoverflow.com/q/76333097
has comment: http://stackoverflow.com/comment/134630070
type: AcceptedAnswer
score: 0

http://stackoverflow.com/a/76247573
has body: If you use an application scene, the window you create manually in the application delegate is ignored (to be precise it remains the key window for very short period of time, until the scene makes its own window the key one). So you either should attach the window you created in the scene delegate's -[UISceneDelegate scene:willConnectToSession:options:] method: - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { UIWindow *window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene]; UIView *view = [[UIView alloc] initWithFrame:CGRectMake(160, 240, 100, 150)]; view.backgroundColor = UIColor.redColor; [window addSubview:view]; window.backgroundColor = UIColor.whiteColor; [window makeKeyAndVisible]; self.window = window; } ..OR get rid of the scene delegate in your application (you may refer to the discussion under this question for more details on how to do it) and make it work with the old good application delegate's window. Be advised that in this case you won't be able to use the window without having the rootViewController specified, so you at least need to set a dummy controller: _window.rootViewController = [UIViewController new];
type: Answer
answers question: http://stackoverflow.com/q/76245513
upvote count: 1
downvote count: 0
score: 1

http://stackoverflow.com/comment/134672540
score: 0
type: QuestionComment
has text: no it's a super old project :) so it has tons of stuff that potentially could be wrong. But I do use other swift/objective-c stuff back and forth that works, so it's not the bridging header I think.
type: Comment
comment on: http://stackoverflow.com/q/76372609

http://stackoverflow.com/comment/134528111
type: QuestionComment
has text: The join redo sets the action name to "Add Region(s)". Don't do this or set the action name to "Join Regions" again.
type: Comment
comment on: http://stackoverflow.com/q/76285850
score: 1

avfoundation
tag name: avfoundation
tags question: http://stackoverflow.com/q/76319817
type: Tag
tags question: http://stackoverflow.com/q/77504084
tags question: http://stackoverflow.com/q/77712292
tags question: http://stackoverflow.com/q/77783407
tags question: http://stackoverflow.com/q/77877558
tags question: http://stackoverflow.com/q/77961306
tags question: http://stackoverflow.com/q/78323748
tags question: http://stackoverflow.com/q/78535483
tags question: http://stackoverflow.com/q/78767018
tags question: http://stackoverflow.com/q/79144065
tags question: http://stackoverflow.com/q/79103337

http://stackoverflow.com/comment/134457043
type: Comment
has text: *"It should still work even if it's out of date right?"* - not necessarily. New apps under iOS 13 or newer do not setup the window in the app delegate. It's done in the scene delegate. What year did the 4th edition of that book come out? What version of iOS was current back then? When it comes to programming, books get out-of-date before you even buy them. Find an up-to-date tutorial online.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76245513

dart
type: Tag
tags question: http://stackoverflow.com/q/76262477
tag name: dart

http://stackoverflow.com/comment/134571842
type: QuestionComment
score: 2
type: Comment
has text: Better use `NSMutableDictionary` methods `setObject:forKey:` and `objectForKey:` instead of `NSKeyValueCoding` methods `setValue:forKey:` and `valueforKey:`.
comment on: http://stackoverflow.com/q/76313411

http://stackoverflow.com/comment/134456743
comment on: http://stackoverflow.com/q/76245513
type: Comment
score: 0
type: QuestionComment
has text: What happens if you change `self.window.backgroundColor = [UIColor whiteColor];` to `self.window.backgroundColor = [UIColor blueColor];`. Does the white screen change to blue? I suspect the book you are using is out-of-date and doesn't cover the fact that iOS apps use scenes now and most of the code they have you put in the app delegate belongs in the scene delegate.

http://stackoverflow.com/q/76223560
has answer: http://stackoverflow.com/a/76262845
type: Question
tagged with: objective-c
type: UnansweredQuestion
favorite count: 0
tagged with: objective-c-swift-bridge
has title: How to use Swift in React Native Turbo Modules
has answer: http://stackoverflow.com/a/76248294
score: 5
tagged with: react-native
tagged with: swift
downvote count: 0
has body: I followed the guide here to create a turbo module. This was fine. https://reactnative.dev/docs/the-new-architecture/pillars-turbomodules I want to use Swift code in this turbo module. I tried adding a Swift file with this code and modifying the RTNCalculator.mm so that the number addition happens in Swift called from Objective-C. SwiftCalculator.swift import Foundation @objc class SwiftCalculator: NSObject { @objc func add(a: Double, b: Double) -> Double { return a + b } } RTNCalculator.mm #import "RTNCalculatorSpec.h" #import "RTNCalculator.h" #import "RTNCalculator-Swift.h" @implementation RTNCalculator RCT_EXPORT_MODULE() - (void)add:(double)a b:(double)b resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject { SwiftCalculator *calculator = [SwiftCalculator new]; double value = [calculator addWithA:a b:b]; NSNumber *result = [[NSNumber alloc] initWithDouble:value]; resolve(result); } - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule: (const facebook::react::ObjCTurboModule::InitParams &)params { return std::make_shared<facebook::react::NativeCalculatorSpecJSI>(params); } @end I also modified the pod spec file to use a bridging header file. s.pod_target_xcconfig = { 'SWIFT_OBJC_BRIDGING_HEADER' => '../../node_modules/rtn-calculator/ios/RTNCalculator-Bridging-Header.h' } This doesn't work. I get this error in the project. Using bridging headers with framework targets is unsupported How do I use Swift in a Turbo Module?
upvote count: 5
answer count: 2
tagged with: react-native-turbomodule

http://stackoverflow.com/comment/134666136
type: QuestionComment
type: Comment
score: 0
has text: Post real Objective-C and real Swift code that properly demonstrates your issue. There are too many issues with the code you posted to determine the cause of your issue.
comment on: http://stackoverflow.com/q/76368198

http://stackoverflow.com/comment/134537189
comment on: http://stackoverflow.com/q/76292989
type: QuestionComment
has text: It would likely help if you stepped back and started with the code you use to store the string containing the emoji in the database and the code to read it back out. It seems odd that you end up with a need to decode HTML entities. That indicates to me that there is an issue with the code that stores and/or retrieves the data to/from the database.
score: 0
type: Comment

http://stackoverflow.com/comment/134521234
score: 0
type: AnswerComment
has text: I'm also getting this error about my Swift file so I think I still need to add a configuration somewhere. `RTNCalculatorSpec.h:15:2 This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.`
type: Comment
comment on: http://stackoverflow.com/a/76262845

http://stackoverflow.com/comment/134968258
has text: what is the alternative solution to get the carrier country code ?
comment on: http://stackoverflow.com/a/76536164
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/a/76230759
accepted answer of: http://stackoverflow.com/q/76229409
has body: The warning is caused by -Wobjc-messaging-id in your project. The flag is pretty much optional (and for all of my projects it is disabled by default), so you can just disable it if you need an id object being invocable without compiler analysis. If for whatever reason you cannot afford disabling the flag, you are supposed to make the object interface apparent to the compiler (so it can see the method of the object you invoke it with). Since isKindOfClass: belongs to NSObject protocol it's the minimal typing you are required to introduce for your authenticationData parameter to get rid of the warning: + (void)myMethod:(id&lt;NSObject&gt;)authenticationData
downvote count: 0
score: 1
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/76229409
upvote count: 1

http://stackoverflow.com/comment/134537332
has text: Not really. The problem is likely with the code that either sends the string to the database or retrieves the string from the database. If your Objective-C iOS app is sending a normal `NSString` then your Objective-C iOS code should receive a normal `NSString`. No encoding should be needed.
score: 0
comment on: http://stackoverflow.com/q/76292989
type: QuestionComment
type: Comment

http://stackoverflow.com/q/76286739
has body: I have scenario where I need to display an alert without any button. Is it possible to remove the buttons from the default Alert in SwiftUI? I know how to create a custom view as Alert. But I would love to use the default one instead of creating a custom one. struct ContentView: View { @State private var showingAlert = false var body: some View { Button("Show Alert") { showingAlert = true } .alert(isPresented: $showingAlert) { Alert(title: Text("Important message"), message: Text("Wear sunscreen"), dismissButton: .default(Text("Got it!"))) } } }
has title: How to remove alert view button in SwiftUI
tagged with: uialertcontroller
tagged with: swiftui
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134526852
tagged with: ios
has answer: http://stackoverflow.com/a/76286953
score: 0
tagged with: objective-c
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/134526465
answer count: 1
has comment: http://stackoverflow.com/comment/134526271
has comment: http://stackoverflow.com/comment/134526739

http://stackoverflow.com/a/76536164
accepted answer of: http://stackoverflow.com/q/76321041
downvote count: 0
has body: serviceSubscriberCellularProvider is deprecated in iOS 16 and XCode 14.3 comes with iOS 16. https://developer.apple.com/documentation/coretelephony/cttelephonynetworkinfo/3024511-servicesubscribercellularprovide
answers question: http://stackoverflow.com/q/76321041
type: AcceptedAnswer
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/134989261
score: 2
has comment: http://stackoverflow.com/comment/134968258

http://stackoverflow.com/q/76276000
tagged with: xcframework
score: 0
has comment: http://stackoverflow.com/comment/134530766
has comment: http://stackoverflow.com/comment/134531248
has comment: http://stackoverflow.com/comment/134515252
has title: modulemap in framework or headers in umbrella header are not being imported
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134512470
answer count: 0
tagged with: xcode
has body: I am converting my framework into an xcframework. Got "Using bridging headers with module interfaces is unsupported", moved the imported headers from the bridging header into my umbrella header and deleted the bridging header. I have my modulemap pointing to an umbrella header. framework module MySDK { umbrella header "MySDK.h" export * module * { export * } } The umbrella header has all the objc header files I need in Swift files imported. Other Swift files in my framework claim they can't see the files imported in "MySDK.h". "Jump to Definition" on the errors takes me exactly where it should. I have been trying to fix this for weeks with no luck. Please can anyone help me?
type: Question
tagged with: swift
type: UnansweredQuestion

function-pointers
type: Tag
tags question: http://stackoverflow.com/q/76210219
tag name: function-pointers

http://stackoverflow.com/comment/134552118
has text: Ok, I think I got it. Further research is required. Thanks
comment on: http://stackoverflow.com/q/76297936
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/q/76300750
linked to: http://stackoverflow.com/q/63914108
has comment: http://stackoverflow.com/comment/134549684
has comment: http://stackoverflow.com/comment/134549766
type: Question
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134549886
has body: I have multiple Objective-C source files. But I don't know where I can compile them. I'm not familiar with Objective-C either. So is there any platform to compile all the source files of Objective-C? (Help me with VSCode too, if I can achieve it with VSCode simply)
score: 0
has comment: http://stackoverflow.com/comment/134555316
has title: How to compile Objective-C files on Windows
has comment: http://stackoverflow.com/comment/134549755
tagged with: objective-c
tagged with: visual-studio-code
answer count: 0
tagged with: windows

http://stackoverflow.com/q/76201998
tagged with: swift
has answer: http://stackoverflow.com/a/76205910
score: 2
accepted answer: http://stackoverflow.com/a/76469404
downvote count: 0
has title: SPM library with Objective-C NSURL category not imported into Swift URL?
upvote count: 2
type: AnsweredQuestion
tagged with: objective-c-category
answer count: 2
has body: I have created a SPM package with a bunch of old Objective-C code (I want to convert some old code "Objective-C code with a big bridging header" into "Objective-C in some SPM packages") For most of the cases it works OK except for Objective-C categories like: @import Foundation; @interface NSURL (Additions) @property (copy, readonly) NSDictionary<NSString *, NSString *> *queryParams; @end Problem: Property queryParams is NOT available in Swift on URL types but only on NSURL types. This looks odd to me because when declaring the same category in an App and using the bridging header file, then queryParams is also usable from URL type too. Tests/URLUtilsTests/URLUtilsTestsSwift.swift:18:31: error: value of type 'URL' has no member 'queryParams' let queryParams = url.queryParams ~~~ ^~~~~~~~~~~ error: fatalError Question: What do I need to have queryParams in both NSURL and URL while using SPM? I have created a repo in GitHub with reproducing problem This is a screenshot of my entire package:
has answer: http://stackoverflow.com/a/76469404
tagged with: objective-c
type: Question
tagged with: swift-package-manager
possible better answer: http://stackoverflow.com/a/76205910
favorite count: 0

emoji
tags question: http://stackoverflow.com/q/76292989
type: Tag
tag name: emoji

http://stackoverflow.com/q/76349932
duplicate of: http://stackoverflow.com/q/12573816
tagged with: objective-c
tagged with: c++
has comment: http://stackoverflow.com/comment/134635024
upvote count: 1
downvote count: 0
tagged with: xcode
answer count: 0
tagged with: clang
favorite count: 0
has comment: http://stackoverflow.com/comment/134634740
type: Question
type: UnansweredQuestion
tagged with: pkcs#11
score: 1
has comment: http://stackoverflow.com/comment/134638184
has body: I have a swift project and I am trying to call C++ libraries from it. I have several .h files that I have included in project (added them in Project > Build Settings > Header Search Paths). Then created a build header: client-Bridging-header #import "DongleWrapper.hpp" Created a wrapper DongleWrapper.hpp #import "Dongle.hpp" @implementation DongleWrapper - (DongleWrapper*) init { dong = (void*)new Dongle; // create c++ class instance return self; // return objc++ instance } - (void) generateKeyPair { Dongle* d = (Dongle*)dong; d->generateKeyPair(); // call c++ method } @end Created a C++ header Dongle.hpp #ifndef Dongle_hpp #define Dongle_hpp #include <stdio.h> #endif /* Dongle_hpp */ class Dongle { public: void generateKeyPair(); }; And then finally created the C++ file Dongle.cpp #include "Include/pkcs.h" void Dongle::generateKeyPair() { ... } Note that, I have included a header file here. But I am getting an error: Full Log Undefined symbols for architecture arm64: "_C_GenerateKeyPair", referenced from: Dongle::generateKeyPair() in Dongle.o "_C_Login", referenced from: Dongle::generateKeyPair() in Dongle.o "_C_Logout", referenced from: Dongle::generateKeyPair() in Dongle.o "_fl", referenced from: FindObjects(unsigned long, CK_ATTRIBUTE*, unsigned long) in Dongle.o (maybe you meant: _CNIOBoringSSL_EVP_CIPHER_flags, _CNIOBoringSSL_X509_VERIFY_PARAM_set_flags , _c_nio_llhttp__internal__c_or_flags_15 , _CNIOBoringSSL_EC_GROUP_get_asn1_flag , _c_nio_llhttp__internal__c_test_flags_2 , _CNIOBoringSSL_BIO_flush , _CNIOBoringSSL_X509_VERIFY_PARAM_get_flags , _CNIOBoringSSL_X509_VERIFY_PARAM_clear_flags , _c_nio_llhttp__internal__c_test_lenient_flags , _CNIOBoringSSL_X509_STORE_CTX_set_flags , _c_nio_llhttp__internal__c_or_flags_3 , _c_nio_llhttp__internal__c_or_flags_6 , _CNIOBoringSSL_X509_STORE_set_flags , _$s7NIOCore15EventLoopFutureC8_flatMapyACyqd__GAExYbclF , _CNIOBoringSSL_BIO_clear_flags , _c_nio_llhttp__internal__c_test_lenient_flags_2 , _c_nio_llhttp__internal__…
has comment: http://stackoverflow.com/comment/134634942
has title: Interfacing with C++ code in XCode (Swift) Project causing Linker error
linked to: http://stackoverflow.com/q/12573816

http://stackoverflow.com/q/76305070
favorite count: 0
type: Question
type: UnansweredQuestion
has body: I am trying to get the user carrier name using this code: CTTelephonyNetworkInfo* info = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier* carrier = info.subscriberCellularProvider; NSString *mobileCountryCode = carrier.mobileCountryCode; NSString *carrierName = carrier.carrierName; NSString *isoCountryCode = carrier.isoCountryCode; NSString *mobileNetworkCode = carrier.mobileNetworkCode; But when I try to log, the result is like this: 2023-05-22 16:47:39.831078+0700 MotionTrade[7686:985518] carrier name = -- 2023-05-22 16:47:39.831260+0700 MotionTrade[7686:985518] mobileCountryCode = 65535 2023-05-22 16:47:39.831342+0700 MotionTrade[7686:985518] mobileNetworkCode = 65535 Basically I've tried every stack overflow answer but I still get the same results, I debug this on my iPhone and not using WiFi, and I only use physical sim, not e-sim. Can anyone tell me why I keep getting that "--"? And after I browse a bit, country code "65535" is this could be an indication of removed SIM card, or in general inability to make a call at the moment. Can anyone help me? Why is this happening and how to get a proper cellular provider name? I even try to do it on my new blank project with this code: override func viewDidLoad() { super.viewDidLoad() let networkInfo = CTTelephonyNetworkInfo() let carrierName = networkInfo.serviceSubscriberCellularProviders dump(carrierName) } but I still get the same result in my log: Optional(["0000000100000001": CTCarrier (0x281275d10) { Carrier name: [--] Mobile Country Code: [65535] Mobile Network Code:[65535] ISO Country Code:[--] Allows VOIP? [YES] } , "0000000100000002": CTCarrier (0x28126ca20) { Carrier name: [--] Mobile Country Code: [65535] Mobile Network Code:[65535] ISO Country Code:[--] Allows VOIP? [YES] } ] ) Please help me. Why do I keep getting "--" and 65535? Is there any way to get carrier name? Or is getting carrier name in iOS 16 not possible?
tagged with: core-telephony
downvote count: 0
tagged with: ios
upvote count: 11
has comment: http://stackoverflow.com/comment/135400120
tagged with: objective-c
score: 11
has answer: http://stackoverflow.com/a/76307912
has title: Getting "--" when try to get carrier name
answer count: 1

http://stackoverflow.com/q/76287510
tagged with: cocoa
has body: In the first column of my view-based NSTableView, I have a custom NSView subclass. In the second column, there's an NSTextField. Now I would like to adjust the drawing of the view in the first column based on when I start editing one of the text fields of the second column. I've tried setting a property on the custom view in tableView:viewForTableColumn:row:, but this doesn't work, as the table cells are only updated when I call reloadData on the table view, which in turn ends editing. To make this even more complicated, I'd like to adjust the drawing of the custom view not only in the row I'm currently editing, but for all the rows. Any ideas how to achieve this?
has comment: http://stackoverflow.com/comment/134528609
accepted answer: http://stackoverflow.com/a/76349140
has title: Update custom views in one column of NSTableView based on editing a cell in another
downvote count: 0
type: AnsweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/76349140
score: 1
answer count: 1
tagged with: macos
has comment: http://stackoverflow.com/comment/134528239
favorite count: 0
tagged with: nstableview
has comment: http://stackoverflow.com/comment/134535314
type: Question
tagged with: objective-c

http://stackoverflow.com/comment/134639398
type: QuestionComment
comment on: http://stackoverflow.com/q/76340994
type: Comment
has text: @Larme could you please turn your comment into an answer?
score: 0

http://stackoverflow.com/comment/134407524
type: AnswerComment
type: Comment
has text: Thanks for sharing solution in objective c
comment on: http://stackoverflow.com/a/76217081
score: 0

http://stackoverflow.com/comment/134422454
has text: Why don't you resize the original Image?
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76225320

http://stackoverflow.com/a/76296147
has comment: http://stackoverflow.com/comment/134550152
type: AcceptedAnswer
type: Answer
has body: You need two changes in your code. One: Change the line: protocol Fruit: NSObjectProtocol { to: @objc protocol Fruit: NSObjectProtocol { Two: Remove the line: @protocol Fruit; As your code is now, you are not using the Swift protocol in your Objective-C code. You are defining (via forward declaration) a different Objective-C protocol named Fruit. Since Pear conforms to the Swift Fruit protocol, your Objective-C code fails because the Swift Pear instance isn't an NSObject conforming to the different Objective-C Fuit protocol.
score: 2
accepted answer of: http://stackoverflow.com/q/76296059
downvote count: 0
answers question: http://stackoverflow.com/q/76296059
upvote count: 2

http://stackoverflow.com/q/76208755
accepted answer: http://stackoverflow.com/a/76217081
tagged with: ios
score: 0
tagged with: ios11
tagged with: objective-c
type: Question
tagged with: swift
has body: I've configured app to support Notch Screen devices Running my App in the iPhone X Simulator. the App is working fine in Normal views but does not use the full screen space if I have NAVIGATION CONTROLLERS a strange Transparent Black Shade is appearing over the Navigation bar Does anybody help me on this what is happening here and how to resolve this? I can't find any new settings in Interface Builder.
tagged with: xcode
possible better answer: http://stackoverflow.com/a/76209219
answer count: 2
has title: Transparent Black Shade over the Navigation Bar in iPhone-X Later Notch Screen Devices in iOS App
has answer: http://stackoverflow.com/a/76209219
has answer: http://stackoverflow.com/a/76217081
type: AnsweredQuestion

http://stackoverflow.com/a/76286953
downvote count: 0
score: 1
type: Answer
has body: No, the alert view modifier cannot create alerts without any buttons. The descriptions of the initialisers for Alert are: Creates an alert with one button. Creates an alert with two buttons. Creates a side by side button alert. All of these create alerts with buttons. Note that Alert is deprecated since iOS 16.4. Now you should use one of the new alert modifiers like this one. However, the new alert modifiers cannot create alerts without buttons either. All of their documentation mentions that: If no actions are present, the system includes a standard “OK” action.
upvote count: 1
answers question: http://stackoverflow.com/q/76286739

pkcs#11
tags question: http://stackoverflow.com/q/76349932
tag name: pkcs#11
tags question: http://stackoverflow.com/q/76246627
type: Tag

swift-protocols
tag name: swift-protocols
type: Tag
tags question: http://stackoverflow.com/q/76296059

http://stackoverflow.com/comment/134620800
has text: Post how you create the toolbar in the question please.
comment on: http://stackoverflow.com/a/76333979
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134528609
comment on: http://stackoverflow.com/q/76287510
type: Comment
has text: Using `reloadDataForRowIndexes:columnIndexes:` to only reload the first column seems to do the trick, thanks!
type: QuestionComment
score: 1

http://stackoverflow.com/q/76241132
score: 1
answer count: 0
tagged with: ios
tagged with: objective-c
has body: I am using FFmpeg to process some videos using Obj-C. I am canceling the process using the below code : -(void) cancelFFmpegProcessing { [MobileFFmpegConfig setStatisticsDelegate:self]; [MobileFFmpegConfig setLogDelegate:self]; [MobileFFmpeg cancel]; } But if I cancel using this code , the process still exist in thread and runs untill the process is complete. Now my question is how to terminate all the task/process with a proper code/steps. I want to cancel the ffmpeg process properly.
type: Question
has title: How to cancel/terminate an ongoing process of FFmpeg
upvote count: 1
downvote count: 0
type: UnansweredQuestion
tagged with: video
favorite count: 0
tagged with: multithreading
tagged with: ffmpeg

visual-studio-code
type: Tag
tags question: http://stackoverflow.com/q/76300750
tag name: visual-studio-code

http://stackoverflow.com/a/76262845
answers question: http://stackoverflow.com/q/76223560
has comment: http://stackoverflow.com/comment/134521211
has comment: http://stackoverflow.com/comment/134521217
has comment: http://stackoverflow.com/comment/134520845
score: 0
has body: To resolve the issue for your Cocoa Pod (Turbo Module) you should make the following: Mark @objc and public all needed classes, method, properties etc. in your swift code because all of them are internal by default and are not visible outside. @objc public class SwiftCalculator: NSObject { @objc public func add(a: Double, b: Double) -> Double { a + b } } Import the pod's swift/objc generated header into your obj files in the format: "<MyPodName>+Swift.h". In your case the pod name is "rtn_calculator". ... #import "rtn_calculator-Swift.h" ... RCT_REMAP_BLOCKING_SYNCHRONOUS_METHOD(add, NSNumber*, addA:(NSInteger)a andB:(NSInteger)b) { SwiftCalculator* calculator = [SwiftCalculator new]; double value = [calculator addWithA:a b:b]; return @(value); }
has comment: http://stackoverflow.com/comment/138113540
has comment: http://stackoverflow.com/comment/134521234
has comment: http://stackoverflow.com/comment/134520335
type: Answer

http://stackoverflow.com/comment/134630070
type: AnswerComment
type: Comment
has text: one more related question - it gives me error like this: `error: use of undeclared identifier 'getIdentifier'`. How do I fix it? I should be able to use getIdentifier() call right?
comment on: http://stackoverflow.com/a/76333979
score: 0

react-native-turbomodule
type: Tag
tags question: http://stackoverflow.com/q/76223560
tag name: react-native-turbomodule

http://stackoverflow.com/comment/134672162
comment on: http://stackoverflow.com/q/76372609
score: 2
type: QuestionComment
has text: Cannot reproduce, your code compiles without problems for me. Does the problem occur in a fresh new project, with only that code present and nothing else?
type: Comment

http://stackoverflow.com/q/76215695
upvote count: 2
has body: I am currently working on an iOS project and I'm utilizing the XCDYouTubeKit library (https://github.com/iOSDev-Auction/XCDYouTubeKit) to handle YouTube video playback. The library was initially compiled successfully in Xcode 14.2. However, upon upgrading to Xcode 14.3, I encountered an error stating "Mixing declarations and code is incompatible with standards before C99" during the compilation process. I have thoroughly researched the issue but haven't found any specific solutions or workarounds related to this library and Xcode version combination. I suspect that this error might be due to some changes in the compiler settings or language standards in Xcode 14.3. Already checked below solutions: 1st mention in the thread https://developer.apple.com/forums/thread/729290 by adding detail WARNING_CFLAGS = -Wno-declaration-after-statement under User-Defined in build setting 2nd by setting C Language Dialect to C99. both not working.
has comment: http://stackoverflow.com/comment/134470686
has title: New compile error in Xcode 14.3: "Mixing declarations and code is incompatible with standards before C99"
tagged with: xcode14.3
answer count: 0
score: 1
tagged with: ios
downvote count: 1
type: Question
tagged with: objective-c
type: UnansweredQuestion
tagged with: xcode
favorite count: 0
has comment: http://stackoverflow.com/comment/134552664

http://stackoverflow.com/comment/134537249
has text: See updated question :) Hope that provides more context! @HangarRash
comment on: http://stackoverflow.com/q/76292989
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/134575697
comment on: http://stackoverflow.com/q/76312639
type: QuestionComment
has text: Unfortunately, I don't think it's possible. According to [Swift.org](https://swiftdoc.org/v5.1/type/mirror/) `Mirror`'s definition is "A representation of the substructure and display style of an **instance** of any type."
type: Comment
score: 2

http://stackoverflow.com/comment/134528425
comment on: http://stackoverflow.com/q/76285850
type: QuestionComment
has text: Ok, I think I figured out how to do it: in `addRegions:`, I changed `if (![self.undoManager isUndoing])` to `if (![self.undoManager isUndoing] && ![self.undoManager isRedoing])`
type: Comment
score: 0

http://stackoverflow.com/comment/134649014
has text: done. Please see https://stackoverflow.com/questions/76359216/convert-stdvector-to-nsarray. Thx.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76333979
score: 0

nsmutabledictionary
type: Tag
tags question: http://stackoverflow.com/q/76313411
tag name: nsmutabledictionary

http://stackoverflow.com/q/76210219
tagged with: objective-c
tagged with: function-pointers
accepted answer: http://stackoverflow.com/a/76212137
answer count: 1
has comment: http://stackoverflow.com/comment/134395972
tagged with: http://stackoverflow.com/tag/c
tagged with: undefined-behavior
favorite count: 0
upvote count: 3
linked to: http://stackoverflow.com/q/188839
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/76212137
score: 3
linked to: http://stackoverflow.com/q/30269329
tagged with: objc-message-send
has comment: http://stackoverflow.com/comment/134396027
has title: How does casting and calling obj_msgSend() not invoke undefined behavior?
type: AnsweredQuestion
has body: I observed the usage of objc_msgSend to send messages to Objective-C IDs from pure C. The usage is not well documented but I found an example here. What I am confused by is the function pointer is casted to a different type with different arguments and/or return values and then called, given the macros in the linked answer: #define msg ((id (*)(id, SEL))objc_msgSend) #define msg_int ((id (*)(id, SEL, int))objc_msgSend) #define msg_id ((id (*)(id, SEL, id))objc_msgSend) #define msg_ptr ((id (*)(id, SEL, void*))objc_msgSend) #define msg_cls ((id (*)(Class, SEL))objc_msgSend) #define msg_cls_chr ((id (*)(Class, SEL, char*))objc_msgSend) However, I thought casting and calling a function pointer through a different signature was undefined behavior. How could a C or even a C-callable function such as objc_msgSend() even be implemented as to be capable of dynamically expecting different argument lists and/or return types? How does that work out, and how does doing so evidently not invoke undefined behavior?

http://stackoverflow.com/comment/134638020
type: Comment
has text: There is allowed and default items. The allowed items "Include all of your toolbar’s items" and the default items "when user settings don’t contain any custom configuration data for the toolbar". The currently displayed items are in the `items` property of the toolbar. Initially, at default, before the user customizes the toolbar, `items` is the default items. The default items are also present in the customization palette as default set.
comment on: http://stackoverflow.com/a/76333979
score: 0
type: AnswerComment

http://stackoverflow.com/comment/134422384
type: Comment
comment on: http://stackoverflow.com/q/76225320
type: QuestionComment
has text: Maybe try renaming `screenshot.png` to `screenshot@1x.png` which might resize the image accordingly.
score: 0

http://stackoverflow.com/comment/134555316
comment on: http://stackoverflow.com/q/76300750
type: QuestionComment
type: Comment
score: 0
has text: I think you can use cygwin or it's analogs.

video
tag name: video
type: Tag
tags question: http://stackoverflow.com/q/76241132
tags question: http://stackoverflow.com/q/79143690

http://stackoverflow.com/q/76373287
favorite count: 0
type: UnansweredQuestion
has body: I want to store an image file to a persistent storage path in an ios app. I hope that I could also upload the image file to my server using this persistent storage path after the app restarted. I wrote the below code, but this can't work well for me. Could anyone help me? - (NSString*)persistFilePath:(NSString*)extension { NSString* docsPath = [NSTemporaryDirectory()stringByStandardizingPath]; NSFileManager* fileMgr = [[NSFileManager alloc] init]; // recommended by Apple (vs [NSFileManager defaultManager]) to be threadsafe NSString* filePath; // unique file name NSTimeInterval timeStamp = [[NSDate date] timeIntervalSince1970]; NSNumber *timeStampObj = [NSNumber numberWithDouble: timeStamp]; do { filePath = [NSString stringWithFormat:@"%@/%@%ld.%@", docsPath, @"cdv_photo", [timeStampObj longValue], extension]; } while ([fileMgr fileExistsAtPath:filePath]); return filePath; } I tried the below code, but it doesn't work well too. - (NSString*)persistFilePath:(NSString*)extension { NSString* docsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]; NSFileManager* fileMgr = [[NSFileManager alloc] init]; // recommended by Apple (vs [NSFileManager defaultManager]) to be threadsafe NSString* filePath; // unique file name NSTimeInterval timeStamp = [[NSDate date] timeIntervalSince1970]; NSNumber *timeStampObj = [NSNumber numberWithDouble: timeStamp]; do { filePath = [NSString stringWithFormat:@"%@/%@%ld.%@", docsPath, @"cdv_photo", [timeStampObj longValue], extension]; } while ([fileMgr fileExistsAtPath:filePath]); return filePath; }
answer count: 0
tagged with: ios
tagged with: objective-c
downvote count: 1
has title: how to get a persist storage path in an ios app
type: Question
has comment: http://stackoverflow.com/comment/134673923
upvote count: 1
has comment: http://stackoverflow.com/comment/134676473
score: 0

http://stackoverflow.com/q/76297936
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134546852
score: 0
type: Question
tagged with: swiftui
has title: Using Objective-C framework in SwiftUi application
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134545993
has comment: http://stackoverflow.com/comment/134552118
answer count: 0
has body: This is my first Swift project. I did some Objective-C in the past, but I'm only just starting with Swift. I want to use the ConnectSDK within this SwiftUI project. I've created a bridging header and add some imports for a few of the headers in the SDK. With only these changes, the project builds. I'm stuck on how to make calls to the SDK from SwiftUI. Here's what I have so far: import SwiftUI import ConnectSDK struct ContentView: View { class ConnectSDKHelper { func showDevicePicker () { let dm = DiscoveryManager.shared() dm?.startDiscovery() dm?.devicePicker() } } var body: some View { VStack { } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } Through some googling, I found that I might need a helper class, hence ConnectSDKHelper, but I don't know if this even correct, or how to apply it if it is. If I try to initialize a ConnectSDK object, var body: some View { let helper = ConnectSDKHelper() VStack { helper.showDevicePicker() } } I get this error: Type '()' cannot conform to 'View' I could use a little help here, and if there is some tutorial on how to use ObjC frameworks in SwiftUI, please point me to them. The examples I've found are just a bit too trivial. Any help greatly appreciated.

http://stackoverflow.com/comment/134620414
has text: I changed those 2 and now it compiles. But when I run it the customization panel is empty. I looked thru the delegate methods and I don't see anything related to customization. I use png/xpm/svg images in the toolbar. Could you provide some simple code to make the customization panel work? TIA!!
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76333979
score: 0

http://stackoverflow.com/q/76262477
has title: FLUTTER: Lexical or Preprocessor Issue (Xcode): 'TensorFlowLiteC.h' file not found
tagged with: dart
answer count: 1
has body: My flutter project has tflite: dependency for running tflite model, But when I'm trying to build the iOS application it gives the above error. It's working fine on android. Following is my Podfile code platform :ios, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do # use_frameworks! #add here use_frameworks! :linkage => :static flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end end When I execute the command flutter build ios it gives the error like Automatically signing iOS for device deployment using specified development team in Xcode project: 937S4T5D4R Running pod install... 6.3s Running Xcode build... Xcode build done. 17.3s Failed to build iOS app Lexical or Preprocessor Issue (Xcode): 'TensorFlowLiteC.h' file not found /Users/amventuresprivatelimited/.pub-cache/hosted/pub.dev/tflite-1.1.2/ios/Classes/TflitePlugin.mm:19:8 Encountered error while building for device.
tagged with: ios
type: Question
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/139665476
has answer: http://stackoverflow.com/a/76263065
score: 0
tagged with: flutter
tagged with: android

http://stackoverflow.com/comment/134484288
comment on: http://stackoverflow.com/a/76260042
score: 0
type: AnswerComment
has text: i tried this but did not get any success.
type: Comment

http://stackoverflow.com/comment/134526465
comment on: http://stackoverflow.com/q/76286739
type: Comment
score: 0
type: QuestionComment
has text: It's requirement. Is it possible to remove button ?

http://stackoverflow.com/comment/134481413
has text: Maybe your port is wrong！8000 and 1234 need the same！
comment on: http://stackoverflow.com/a/76260042
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/134566845
score: 0
type: AnswerComment
has text: ahhh okay thanks alot mate for your answer, i can take this to explain my head manager. Cheers
type: Comment
comment on: http://stackoverflow.com/a/76307912

http://stackoverflow.com/comment/134430388
comment on: http://stackoverflow.com/q/76229409
type: Comment
score: 1
type: QuestionComment
has text: AuthenticationData may be nil, or it may not be an object.

http://stackoverflow.com/comment/134396027
type: Comment
comment on: http://stackoverflow.com/q/76210219
score: 0
type: QuestionComment
has text: Maybe this helps: [objc_msgSend's New Prototype](https://www.mikeash.com/pyblog/objc_msgsends-new-prototype.html) by Mike Ash

http://stackoverflow.com/q/76297115
type: Question
tagged with: swift
type: UnansweredQuestion
has title: How to generate Apple-style /// for code comments in Xcode?
tagged with: documentation
has body: I'm trying to find a more efficient way to generate the Apple-style /// code comments in Xcode. Although I can use Cmd + Option + Enter to automatically generate ///, it's not as convenient when copying(press option to select specific area) and pasting code. Is there a more streamlined approach to generate these comments, especially when pasting existing code? It's convenient to generate doc with old /** */
has comment: http://stackoverflow.com/comment/134544848
tagged with: objective-c
tagged with: xcode
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/134544154

http://stackoverflow.com/comment/134639649
comment on: http://stackoverflow.com/a/76333979
has text: Tes, that's right.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134610174
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76334354
has text: What do those projects produce? frameworks? apps?

http://stackoverflow.com/q/76369635
tagged with: ios
has body: Capture must be prevented due to copyright. Through stackovetflow and search I have succeeded in getting a black blank screen to be captured. Now, when capturing, I want the text to be centered on the white screen instead of the black blank screen. @interface UIWindow (Secure) - (void)makeSecure; @end @implementation UIWindow (Secure) - (void)makeSecure { UITextField *field = [[UITextField alloc] init]; field.secureTextEntry = YES; field.backgroundColor = [UIColor whiteColor]; field.textColor = [UIColor blackColor]; field.textAlignment = NSTextAlignmentCenter; field.text = @"Prevent Capture"; field.userInteractionEnabled = NO; [self addSubview:field]; [field.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = YES; [field.centerXAnchor constraintEqualToAnchor:self.centerXAnchor].active = YES; [self.layer.superlayer addSublayer:field.layer]; [field.layer.sublayers.firstObject addSublayer:self.layer]; } @end - (void)handleScreenshotNotification:(NSNotification *)notification { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Alert" message:@"prevent Capture" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]; [alertController addAction:dismissAction]; [self.window.rootViewController presentViewController:alertController animated:YES completion:nil]; } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleScreenshotNotification:) name:UIApplicationUserDidTakeScreenshotNotification object:nil]; [self.window makeSecure]; ... } I wrote the code as above but it still captures a black blank screen. I want to add text to the center of the screenshot on a white background. Is there a way?
upvote count: 2
tagged with: objective-c
type: Question
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
downvote count: 1
has title: How to prevent capture with Objective-C on iOS

http://stackoverflow.com/q/76285850
type: AnsweredQuestion
tagged with: nsundomanager
has answer: http://stackoverflow.com/a/76349151
accepted answer: http://stackoverflow.com/a/76349151
linked to: http://stackoverflow.com/q/13704535
has comment: http://stackoverflow.com/comment/134536578
tagged with: macos
has comment: http://stackoverflow.com/comment/134527601
has comment: http://stackoverflow.com/comment/134528425
type: Question
has comment: http://stackoverflow.com/comment/134555759
has title: NSUndoManager action name broken for grouped action after undo-redo cycle
has comment: http://stackoverflow.com/comment/134528111
has body: I have the following, rather simple code for adding, removing and joining MP3 audio regions in the MP3 editing app I am currently writing: - (void)addRegions:(NSArray *)regions { [[self.undoManager prepareWithInvocationTarget:self] removeRegions:regions]; // ... ... if (![self.undoManager isUndoing]) { [self.undoManager setActionName:@"Add Region(s)"]; } } - (void)removeRegions:(NSArray *)regions { [[self.undoManager prepareWithInvocationTarget:self] addRegions:regions]; // ... ... if (![self.undoManager isUndoing]) { [self.undoManager setActionName:@"Remove Region(s)"]; } } - (void)joinRegions:(NSArray *)regions { [self.undoManager beginUndoGrouping]; MP3Region *joinedRegion = [[MP3Region alloc] init]; // ... ... [self removeRegions:regions]; [self addRegions:@[joinedRegion]]; [self.undoManager setActionName:@"Join Regions"]; [self.undoManager endUndoGrouping]; } Undo and redo for adding and removing regions is working just fine. Now what's weird is that undo and redo work fine for the join regions functionality as well, but after undoing and redoing once, the menu item now wrongly reads "Undo Add Region(s)" instead of the expected "Undo Join Regions". Clicking this wrongly labeled menu item actually undoes the join action, and clicking the subsequently appearing "Redo Add Region(s)" menu item repeats the join action again. So the undo/redo functionality actually does the thing it was supposed to. It's just the action name that somehow gets messed up. I tried guarding [self.undoManager setActionName:@"Join Regions"]; with if (![self.undoManager isUndoing]) {}, but this doesn't change anything at all. (And I didn't see why it should have in the first place, anyway, but that was my only idea as to what might be wrong.) Any ideas on what's causing this issue and how to fix it?
has comment: http://stackoverflow.com/comment/134526993
answer count: 1
tagged with: objective-c
tagged with: cocoa
score: 0

http://stackoverflow.com/comment/134520335
comment on: http://stackoverflow.com/a/76262845
type: AnswerComment
type: Comment
has text: The header file seems to be picked up but it's not finding my Swift class. `Unknown type name 'SwiftCalculator'; did you mean 'RTNCalculator'?`
score: 1

http://stackoverflow.com/comment/134526852
has text: In your case you should use an overlay.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76286739

http://stackoverflow.com/comment/134634942
has text: Sorry, Updated my code `DongleWrapper.hpp` doesn't include itself. Will include more examples.
type: Comment
comment on: http://stackoverflow.com/q/76349932
type: QuestionComment
score: 0

nsundomanager
tags question: http://stackoverflow.com/q/76285850
type: Tag
tag name: nsundomanager
tags question: http://stackoverflow.com/q/78766116

http://stackoverflow.com/q/76340994
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134619517
type: Question
linked to: http://stackoverflow.com/q/3717038
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/134620424
has title: Why does my objective-c code output an incorrect area?
has comment: http://stackoverflow.com/comment/134639514
has comment: http://stackoverflow.com/comment/134620381
type: UnansweredQuestion
has body: I ran the code below, it ouput area to be 1 instead of 12.568 Can someone please check what is wrong with the code #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; // constant #define PI 3.142fat float area; int r=2; area = PI * (r*r); NSLog(@"Area is %d", area); [pool drain]; return 0; } 2023-05-26 12:36:48.839 main[16:16] Area is 1
has comment: http://stackoverflow.com/comment/134639398

core-telephony
tags question: http://stackoverflow.com/q/76305070
type: Tag
tag name: core-telephony

http://stackoverflow.com/q/76245513
downvote count: 2
has answer: http://stackoverflow.com/a/76247573
score: -1
tagged with: ios
has comment: http://stackoverflow.com/comment/134457043
type: Question
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/134462897
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134456743
favorite count: 0
linked to: http://stackoverflow.com/q/59006550
has comment: http://stackoverflow.com/comment/134457719
has body: In Chapter 4 of the Big Nerd Ranch: iOS Programming 4th Edition textbook where we're supposed to create a red rectangle appear in the middle of the view in the AppDelegate.m file and have it appear in the simulator. I've copied the code word for word and when I run the simulator I get a blank screen like this: I'm not sure why this is happening. I've already put the property for window in the AppDelegate.h file so I know that's not why. This is the code in the AppDelegate.m file: // // AppDelegate.m // Hypnosister // // // #import "AppDelegate.h" #import "BNRHypnosisView.h" @interface AppDelegate () @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; CGRect firstFrame = CGRectMake(160, 240, 100, 150); BNRHypnosisView *firstView = [[BNRHypnosisView alloc]initWithFrame:firstFrame]; firstView.backgroundColor = [UIColor redColor]; [self.window addSubview:firstView]; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; } #pragma mark - UISceneSession lifecycle - (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; } - (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOption…
has title: iOS Simulator showing Blank White Screen When Trying to Create Frame
has comment: http://stackoverflow.com/comment/134456966
has comment: http://stackoverflow.com/comment/134468260

http://stackoverflow.com/a/76368417
score: 1
type: Answer
upvote count: 1
has body: The situation that you are describing should work. There are quite a few incorrect pieces in your code though. The Objective-C class is usually defined by interface in a header and you need to use NSString to represent a String for Swift. @interface ClassA : NSObject @property (nonatomic, retain) NSString *str; @end Next your protocol is missing some pieces. It should look like protocol ProtocolDelegate: AnyObject { var str: String { get } } And now I can easily declare a class such as class ClassB: ClassA { } extension ClassB: ProtocolDelegate { } And this works as expected.
answers question: http://stackoverflow.com/q/76368198
downvote count: 0

http://stackoverflow.com/comment/134484326
score: 0
type: AnswerComment
type: Comment
has text: will you please provide a sample code related to SRT connection. that would be more better
comment on: http://stackoverflow.com/a/76260042

http://stackoverflow.com/comment/134549766
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76300750
type: QuestionComment
has text: How can i install gcc Or clang.It shows a whole big process invloving configuration and all. And i have windows

http://stackoverflow.com/q/76333097
type: Question
has answer: http://stackoverflow.com/a/76333979
answer count: 1
tagged with: objective-c
score: 0
tagged with: nstoolbar
type: AnsweredQuestion
tagged with: customization
accepted answer: http://stackoverflow.com/a/76333979
has title: NSToolbar customization not available
has body: ALL, According to the documentation the property is available since macOS 10.4. I'm on High Sierra 10.13 and getting an error: ../src/osx/cocoa/toolbar.mm:465:15: warning: instance method '-allowsUserCustomization:' not found (return type defaults to 'id') [-Wobjc-method-access] [self allowsUserCustomization:YES]; ^~~~~~~~~~~~~~~~~~~~~~~ ../src/osx/cocoa/toolbar.mm:339:12: note: receiver is instance of class declared here @interface wxNSToolbar : NSToolbar ^ ../src/osx/cocoa/toolbar.mm:466:15: warning: instance method '-autosaveConfiguration:' not found (return type defaults to 'id') [-Wobjc-method-access] [self autosaveConfiguration:YES]; ^~~~~~~~~~~~~~~~~~~~~ ../src/osx/cocoa/toolbar.mm:339:12: note: receiver is instance of class declared here @interface wxNSToolbar : NSToolbar ^ Could someone please explain what is going on? TIA!! [EDIT] I made a following implementation: - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar { auto array = [NSArray arrayWithObjects:&amp;m_default[0] count:m_default.size()];; return [NSArray arrayWithObjects:&amp;m_default[0] count:m_default.size()];; } - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar { auto array = [NSArray arrayWithObjects:&amp;m_allowed[0] count:m_allowed.size()];; return [NSArray arrayWithObjects:&amp;m_allowed[0] count:m_allowed.size()];; } However, after executing the line auto array = ..., program crashes. The variables m_allowed and m_default are of the type std::vector. The vectors do have elements in them. Running under lldb I can see their content. What am I doing wrong?

http://stackoverflow.com/comment/134526739
comment on: http://stackoverflow.com/q/76286739
has text: It can be done using `UIAlertController`.
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134527601
comment on: http://stackoverflow.com/q/76285850
has text: Not sure if this is really the same issue. In the alleged duplicate question, it's already the redo action/name that's broken. For me, both undo and redo work once, but the action name is wrong after the first redo. Also, I don't get how to "set the action name again during the undo". Where would I do this in my code?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/76365782
favorite count: 0
has body: The simulator is running iPad Pro (12.9-inch) 6th Generation iOS 16.4. A colleague is running the same iOS version on an unknown device also simulated with the same issue. The same iPad Pro (12.9-inch) 6th Generation simulator but iOS 13.7 does work. I am getting Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) on the line where I attempt to draw an image when I run it on the emulator, but it runs as expected when I run it on a hardware iPhone 12 Pro on the same iOS version (16.4). It also runs on a hardware iPad mini 5. I have tried: CGContextDrawImage(context, rect, image) [image drawAtPoint:CGPointMake(x, y)]; variations such as [image drawInRect... Image, context/currentContext, and rect are all valid, no values are decimal, the sizes fit inside of each other correctly, and it's being ran on the UI thread as it should. This is confirmed by the fact it runs fine on hardware 16.4 and simulator 13.7.
score: 0
type: UnansweredQuestion
has title: How do I prevent EXC_BAD_INSTRUCTION crashing the XCode simulator 16.4 when attempting to draw an image on a PDF but works on hardware?
upvote count: 1
has comment: http://stackoverflow.com/comment/134676495
downvote count: 1
has answer: http://stackoverflow.com/a/77358635
type: Question
answer count: 1
tagged with: objective-c

http://stackoverflow.com/comment/134535314
has text: @Willeke could you please turn you comment into an answer so OP can accept and upvote it for future readers?
comment on: http://stackoverflow.com/q/76287510
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/76248294
answers question: http://stackoverflow.com/q/76223560
score: 0
type: Answer
has body: For your example, you shouldn't need a bridging header at all. That allows you to import ObjC into Swift, not Swift into ObjC. Did you try just removing the SWIFT_OBJC_BRIDGING_HEADER bit? The RTNCalculator-Swift.h header is what lets you import Swift into ObjC, and that part of of your code looks ok. What specific error do you receive if you take out the bridging header?
has comment: http://stackoverflow.com/comment/138113535
has comment: http://stackoverflow.com/comment/134520279

http://stackoverflow.com/a/76321457
has body: Don't create a new pixelBufferPool in pixelBufferFromCIImage function. Let's try using pixelBufferPool in pixelBufferAdaptor which you created in createH264VideoFromPNGImages function. https://developer.apple.com/documentation/avfoundation/avassetwriterinputpixelbufferadaptor/1389662-pixelbufferpool Beside that, why don't you use Core Image to convert CIImage to CVPixelBuffer by CIContext directly? I think using Core graphics to convert is bad performnace https://developer.apple.com/documentation/coreimage/cicontext/1437853-render
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/76319817
score: 1

http://stackoverflow.com/comment/134607703
has text: Maybe this helps: https://stackoverflow.com/questions/5094928/detecting-whether-or-not-device-support-phone-calls
type: Comment
comment on: http://stackoverflow.com/q/76321041
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134468260
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76245513
has text: Yes it will work, if you use older versions of Xcode (the ones which supported iOS SDK 12 and below). Answer mentioned below by `The Dreams World` is the most suited answer in my view for your question: Use this inside sceneDelegate on iOS 13 and above. `self.window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene]; self.window.backgroundColor = [UIColor redColor]; [self.window makeKeyAndVisible]; UIView *view = [[UIView alloc] initWithFrame: CGRectMake(160, 240, 100, 150)]; view.backgroundColor = UIColor.whiteColor; [self.window addSubview:view];`

http://stackoverflow.com/comment/134612086
has text: So you're trying to store an Objective-C block as a value in a dictionary? That raises some memory management questions...
comment on: http://stackoverflow.com/q/76313411
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/76334354
tagged with: xcode
score: 0
tagged with: swift
has title: How to use functions of Xcode projects in workspace?
has answer: http://stackoverflow.com/a/76343120
has comment: http://stackoverflow.com/comment/134616182
tagged with: ios
has comment: http://stackoverflow.com/comment/134610174
type: Question
has body: I have an Objective-C function FirstFunc in my project 'A' in Xcode. I have a Swift function SecondFunc in my project 'B' in Xcode. Projects 'A' and 'B' are in the Xcode workspace. How I can call SecondFunc of project 'B' with my FirstFunc of project 'A'? Any ideas? I'm beginner of iOS development and don't have ideas about that.
answer count: 1
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/comment/134521211
type: AnswerComment
type: Comment
has text: Yes, the name is "rtn-calculator".
comment on: http://stackoverflow.com/a/76262845
score: 0

http://stackoverflow.com/q/76313411
has comment: http://stackoverflow.com/comment/134571842
has comment: http://stackoverflow.com/comment/134613066
has body: By chance, this code will crash: -(void)addCallbackOfFileType:(SendFileType)fileType callback:(sendProcess)callback target:(id)target{ [_hashTable addObject:target]; NSString * targetKeyStr = NSStringFromClass([target class]); if (callback && targetKeyStr) { NSString * fid = [NSString stringWithFormat:@"%d",(int)fileType+KBigFileAdded]; NSMutableDictionary * targetMdic = [[NSMutableDictionary alloc]init]; if ([_callbacks valueForKey:targetKeyStr]) { targetMdic = [_callbacks valueForKey:targetKeyStr]; } [targetMdic setValue:callback forKey:fid]; [_callbacks setValue:targetMdic forKey:targetKeyStr]; } } It crashes on this line: [targetMdic setValue:callback forKey:fid]; This is a screenshot of the crash: How to fix this crash?
answer count: 0
has comment: http://stackoverflow.com/comment/134571889
score: 0
has title: NSMutableDictionary ,setValue:forKey: crash
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134612086
type: Question
has comment: http://stackoverflow.com/comment/134571865
type: UnansweredQuestion
tagged with: nsmutabledictionary

http://stackoverflow.com/q/76225320
answer count: 0
tagged with: ios
tagged with: docc
score: 0
tagged with: objective-c
has body: I am displaying an image in the docs like this. ![](screenshot.png) But the image is too big. I would like to resize it. Any suggestion? The image is located in the Resources directory of the documentation.
type: Question
tagged with: swift
type: UnansweredQuestion
tagged with: markdown
has comment: http://stackoverflow.com/comment/134422384
has title: DocC (Apple documentation compiler) resize image
has comment: http://stackoverflow.com/comment/134422454

http://stackoverflow.com/q/76296059
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/76296147
has body: I have a swift protocol Fruit, a swift class Pear, and a method in an Objc-c file returning a pointer to Pear. protocol Fruit: NSObjectProtocol { } @objcMembers class Pear: NSObject, Fruit { init() } In an Obj-C file, I have @protocol Fruit; - (NSObject&lt;Fruit&gt; *)getFavoriteFruit { return [[Pear alloc] init]; // &lt;- Error here } The error I'm getting is: Incompatible pointer types returning 'Pear *' from a function with result type 'NSObject&lt;Fruit&gt; * _Nonnull' How are these different?
has title: Incompatible pointer types returning swift class from Obj-C function
favorite count: 0
type: Question
tagged with: swift
downvote count: 0
score: 1
tagged with: swift-protocols
type: AnsweredQuestion
tagged with: return-type
tagged with: objective-c
has answer: http://stackoverflow.com/a/76296147

http://stackoverflow.com/comment/134619517
has text: `NSLog(@"Area is %d", area);` -> `NSLog(@"Area is %f", area);`
type: QuestionComment
score: 3
type: Comment
comment on: http://stackoverflow.com/q/76340994

http://stackoverflow.com/comment/135400120
has text: have you find any solution yet ? what about country code from operator are you able to get it ? i have same issue
type: QuestionComment
score: 1
type: Comment
comment on: http://stackoverflow.com/q/76305070

http://stackoverflow.com/comment/134430855
comment on: http://stackoverflow.com/q/76229409
has text: Specifically, `id` means that you might receive an object which does not inherit from _`NSObject`_, and thus may not respond to the `-isKindOfClass:` method (defined by `NSObject` itself).
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/comment/134555759
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/76285850
score: 1
has text: @The Dreams Wind: Well, it's not like Willeke has ready-made answers for me. He just points me in the right direction with his questions so that I can figure out the rest on my own. Apparently, my questions are so badly formulated that it's not possible to provide an actual answer :( … but I can write up what I did to resolve my issues and put that in an answer.

http://stackoverflow.com/comment/134620424
type: Comment
comment on: http://stackoverflow.com/q/76340994
has text: And as a follow-on to the comment by @Larme, see the [String Format Specifiers](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFStrings/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265) documentation. You'll need to know those for things like `NSLog` and `NSString stringWithFormat:`.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/139665476
score: 0
type: QuestionComment
has text: did you manage to solve?
comment on: http://stackoverflow.com/q/76262477
type: Comment

http://stackoverflow.com/comment/134549755
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76300750
score: 2
has text: On macOS the easiest way is Xcode. Or you could use clang or gcc directly. But, to be honest, have you tried googling your question before posting here? Providing info about the platform that you're using could be also a good start.

http://stackoverflow.com/comment/134549684
has text: gcc supports obj-c & obj-c++;
type: Comment
comment on: http://stackoverflow.com/q/76300750
score: 0
type: QuestionComment

http://stackoverflow.com/a/76469404
accepted answer of: http://stackoverflow.com/q/76201998
answers question: http://stackoverflow.com/q/76201998
score: 1
has body: I asked the same question in Swift forums and I got the reason why this is not working. NSURL and URL are not the same type. The first is a class, the second a struct. ObjC categories or Swift extensions to one do not apply to the other. There's a runtime "magic" that ties them together, though. It is the URL conformance to ReferenceConvertible 5, and much probably some non-public tricks. But this does not make them the same type. So the only solution is to have a special target for swift code. import URLUtils extension URL { var queryParams: [String: String] { (self as NSURL).queryParams } } I have updated my original repository source code to and it works ok now!.
type: AcceptedAnswer
type: Answer
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/76246627
has body: I have a Safenet 5110 dongle. I am using MacOS ventura 13.2.1 (with Swift 5.7 and Xcode 14.2). I have downloaded the driver to authenticate with the dongle (Safenet Authentication Token - SAC). There, I have found libeTPkcs11.dylib which can be used to communicate with their dongle. Here is my code: import Foundation let pkcs11LibPath = "/usr/local/lib/libeTPkcs11.dylib" let pkcs11LibHandle = dlopen(pkcs11LibPath, RTLD_NOW) if pkcs11LibHandle == nil { let errorMsg = String(cString: dlerror()) print("Failed to load PKCS#11 library: \(errorMsg)") exit(1) } // Get a pointer to the C_GetInfo function let cGetInfoPtr = dlsym(pkcs11LibHandle, "C_GetInfo") typealias C_GetInfo_Type = @convention(c) (UnsafeMutableRawPointer?, UnsafeMutablePointer<CK_INFO>?) -> CK_RV let cGetInfo = unsafeBitCast(cGetInfoPtr, to: C_GetInfo_Type.self) // Call the C_GetInfo function to get information about the token var info = CK_INFO() let rv = cGetInfo(nil, &info) if rv != CKR_OK { print("Failed to get token info: \(rv)") exit(1) } print("Manufacturer ID: \(String(cString: &info.manufacturerID))") print("Model: \(String(cString: &info.model))") print("Serial number: \(String(cString: &info.serialNumber))") I am getting the following errors when I try to compile the code: Cannot find type 'CK_RV' in scope Cannot find type 'CK_INFO' in scope I think that, these come from the pkcs11.h header files from OASIS specifications. I have created a bridging header caclient-Bridging-Header.h. There I have included the file pkcs11.h. But I think xcode is recognizing the header file as a objective-c header (not c99 header).
answer count: 1
has title: Add C header files to Swift project for PKCS11 interfacing with Safenet 5110
type: Question
tagged with: swift
linked to: http://stackoverflow.com/q/19366134
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/c
tagged with: macos
has answer: http://stackoverflow.com/a/76248415
score: 0
tagged with: pkcs#11
tagged with: objective-c

mach-o
type: Tag
tags question: http://stackoverflow.com/q/76279100
tag name: mach-o
tags question: http://stackoverflow.com/q/77334043

http://stackoverflow.com/comment/134639514
type: QuestionComment
has text: Does this answer your question? [double problem in xcode or me doing something wrong](https://stackoverflow.com/questions/3717038/double-problem-in-xcode-or-me-doing-something-wrong)
comment on: http://stackoverflow.com/q/76340994
score: 1
type: Comment

http://stackoverflow.com/comment/134638053
comment on: http://stackoverflow.com/a/76333979
score: 0
has text: so if I want to initially display item 1,3 and 4 and items 3, 5 and 6 to be allowed but not initially displayed - what do I do? No custom configuration here.
type: AnswerComment
type: Comment

nstoolbar
tag name: nstoolbar
type: Tag
tags question: http://stackoverflow.com/q/76333097
tags question: http://stackoverflow.com/q/76476767
tags question: http://stackoverflow.com/q/79245494

http://stackoverflow.com/comment/134546852
score: 1
type: Comment
has text: `VStack` expects `Views`. While from the name of `showDevicePicker()`, that's an action. You can't do it like that as said. You need to understand that SwiftUI is a framework for UI, and if you want to trigger action on button, on view appearing, there are specific methods for that (like `onAppear()` as said previously).
comment on: http://stackoverflow.com/q/76297936
type: QuestionComment

http://stackoverflow.com/comment/134531248
type: Comment
comment on: http://stackoverflow.com/q/76276000
score: 0
type: QuestionComment
has text: @Cy-4AH Can you explain more on what you are suggesting? It seems like massive overkill to create a separate framework just for my objective-c code.

http://stackoverflow.com/a/76381993
score: 0
type: Answer
has body: The text property of UITextView is has already has copy as it's attribute - Apple Doc; which means whenever you try to access textView.text into your local NSString property/variable, a copy of text will be created and stored. You will have it's ownership and depending on the scope of the your property, ARC will decide to release it.
answers question: http://stackoverflow.com/q/76320148

mobile-country-code
tag name: mobile-country-code
tags question: http://stackoverflow.com/q/76321041
type: Tag

http://stackoverflow.com/a/76341613
has body: This is probably what you want: https://developer.apple.com/documentation/carplay/cpinterfacecontroller/3578118-cartraitcollection Other than that, I don't think it's possible to read the actual screen size/resolution of the display
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/76324356
upvote count: 2
type: Answer

ios11
type: Tag
tag name: ios11
tags question: http://stackoverflow.com/q/76208755

http://stackoverflow.com/a/76307912
has comment: http://stackoverflow.com/comment/134566845
has body: CTCarrier is deprecated with no replacement in iOS 16. This information is no longer available, and I would not expect it to become available again. I'm somewhat surprised it was ever available. (Apple generally avoids making information available that can be used to fingerprint the user without a very clear use case, and usually an entitlement.) You can find the announcement about returning static values in the iOS 16.4 Release Notes.
upvote count: 5
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/76305070
score: 5

http://stackoverflow.com/q/76330995
answer count: 1
tagged with: objective-c
tagged with: podio
has title: Could not build Objective-C module 'YogaKit'
score: 0
has answer: http://stackoverflow.com/a/76832938
tagged with: react-native
type: Question
type: UnansweredQuestion
has body: require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' platform: ios, '12.4' prepare_react_native_project! pod 'mailcore2-ios' pod 'GTMOAuth2',: modular_headers => true pod 'GTMAppAuth',: modular_headers => true pod 'YogaKit' flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled use_react_native!(: flipper_configuration => ENV['CI'] ? FlipperConfiguration.disabled : FlipperConfiguration.enabled, # Note: you also can pass extra params #FlipperConfiguration.enabled(['Debug', 'Staging.Debug'], { 'Flipper': '0.174.0' }) ) linkage = ENV['USE_FRAMEWORKS] if linkage != nil Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green use_frameworks!: linkage => linkage.to_sym end target 'Mailcore' do config = use_native_modules! use_frameworks!: linkage =>: static $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly', 'CocoaAsyncSocket', 'ComponentKit', 'DoubleConversion', 'glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit', 'CocoaLibEvent', 'openssl-ios-bitcode', 'boost-for-react-native' ] # Flags change depending on the env values. flags = get_default_flags() use_react_native!(: path => config[: reactNativePath], # Hermes is now enabled by default.Disable by setting this flag to false.# Upcoming versions of React Native may rely on get_default_flags(), but # we make it explicit here to aid in the React Native upgrade process.: hermes_enabled => flags[: hermes_enabled],: fabric_enabled => flags[: fabric_enabled], # Enables Flipper.# # Note that if you have use_frameworks!enabled, Flipper will not work and # you should disable the next line.#: flipper_configuration => FlipperConfiguration.disabled, # An absolute path to your application root.: app_path => "#{Pod::Config.instance.installation_root}/.." ) target 'MailcoreTests' do inherit!: complete # Pods for testing end post_instal…

http://stackoverflow.com/q/76320148
type: Question
tagged with: swift
answer count: 1
type: UnansweredQuestion
downvote count: 2
has body: Can we directly get a refrence textview.text and use it as a objC's NSString .If yes ,do we need to handle memory dellocation or is it taken care by ARC? If we cann't directly take a refrence ,do we have another option than making a copy of textview.text and use it as a ObjC's NSString? I want to use UITextView.text string in objectiveC whenever character changes.
favorite count: 0
tagged with: ios
tagged with: objective-c
upvote count: 0
has answer: http://stackoverflow.com/a/76381993
has title: Can we directly get a refrence to UITextView's textview.text or do we need to make a copy of it to use it as a NSString from objC?
score: -2

podio
tag name: podio
type: Tag
tags question: http://stackoverflow.com/q/76330995

http://stackoverflow.com/comment/134634740
comment on: http://stackoverflow.com/q/76349932
type: Comment
has text: Please show a [mre], the errors don't seem related to your code. Does `DongleWrapper.hpp` really include itself?
score: 0
type: QuestionComment

windows
tags question: http://stackoverflow.com/q/76300750
tag name: windows
type: Tag

http://stackoverflow.com/comment/134630276
score: 0
comment on: http://stackoverflow.com/a/76333979
type: AnswerComment
type: Comment
has text: No, I don't think you got it. See [Toolbar Programming Topics for Cocoa](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Toolbars/Toolbars.html#//apple_ref/doc/uid/10000109i).

http://stackoverflow.com/q/76279100
type: AnsweredQuestion
tagged with: objective-c
downvote count: 0
tagged with: mach-o
has title: How does Mach-O store pointers to Objective-C Metadata entities?
type: Question
upvote count: 1
answer count: 1
has body: A somewhat lengthy question so please bear with me. I am writing a parser to extract Objective-C metadata entities from input Mach-O binaries. And I want to better understand how pointers to metadata entities are stored/encoded in Mach-Os. For example, using this Obj-C code: #import &lt;Foundation/Foundation.h&gt; @interface Person : NSObject - (void) someMethod; @end @implementation Person - (void) someMethod {} @end int main() { return 0; } I compile it twice: 1. First using the following command: clang++ -target arm64-apple-ios16 -isysroot /path/to/iphoneos_sdk \ -framework Foundation -o test test.m Output from objdump -s test ... Contents of section __DATA_CONST.__objc_classlist: 100008000 c0c00000 00000000 ........ ... Contents of section __DATA.__objc_data: 10000c098 01000000 00001080 01000000 00001080 ................ 10000c0a8 00000000 00002080 00000000 00000000 ...... ......... 10000c0b8 00c00000 00001000 98c00000 00001000 ................ 10000c0c8 02000000 00001080 00000000 00002080 .............. . 10000c0d8 00000000 00000000 48c00000 00000000 ........H....... Note that the class pointer is stored as 0xc0c0 in the __objc_classlist section. The class is actually located at pointer: 0x0001 0000 c0c0 in the __objc_data section. 2. Then I compile the same input again using the following command (note that I have an Intel machine so the target here is x86_64 by default): clang++ -framework Foundation -o test test.m Output from objdump -s test ... Contents of section __DATA_CONST.__objc_classlist: 100004000 d8800000 01000000 ........ ... Contents of section __DATA.__objc_data: 1000080b0 00000000 00000000 00000000 00000000 ................ 1000080c0 00000000 00000000 00000000 00000000 ................ 1000080d0 00800000 01000000 b0800000 01000000 ................ 1000080e0 00000000 00000000 00000000 00000000 ................ 1000080f0 00000000 00000000 68800000 01000000 ........h....... In this case, the class pointer is stored as 0x0001 0000 80d8 in the __objc…
accepted answer: http://stackoverflow.com/a/76285645
score: 1
has answer: http://stackoverflow.com/a/76285645
tagged with: clang
favorite count: 0

documentation
tag name: documentation
tags question: http://stackoverflow.com/q/76297115
type: Tag

http://stackoverflow.com/q/76324356
has answer: http://stackoverflow.com/a/76341613
score: 0
has comment: http://stackoverflow.com/comment/134592635
type: Question
tagged with: swift
has body: How can I find the current screen scale of my CarPlay screen? I'm interested in how to understand the current scale for the screen. In a lot of cases it is 2, but on high resolution screens it turns on scale 3. We need to understand what specific scale is currently used in the application
type: UnansweredQuestion
tagged with: carplay
answer count: 1
tagged with: objective-c
has title: How can I find the current screen scale of my CarPlay screen?

ffmpeg
type: Tag
tag name: ffmpeg
tags question: http://stackoverflow.com/q/76241132
tags question: http://stackoverflow.com/q/78811299

http://stackoverflow.com/a/76248415
has comment: http://stackoverflow.com/comment/134465129
upvote count: 1
has body: Objective-C is a superset of C. It has no trouble importing C headers (because C headers are ObjC headers). The problem is the CK_PTR macro is defined in a header not included in your bridging header. You're probably supposed to import some other "umbrella" header instead of pkcs11.h, or some platform-configuration header before pkcs11.h. Without knowing exactly what library you're using, and the documentation for it, it's difficult to know how this particular code expects to be used.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/76246627
has comment: http://stackoverflow.com/comment/134471390
score: 1

http://stackoverflow.com/comment/134544154
has text: So you want to copy and paste code into the comments? I'm not sure what you are trying to do
type: QuestionComment
score: 2
type: Comment
comment on: http://stackoverflow.com/q/76297115

carplay
type: Tag
tags question: http://stackoverflow.com/q/76324356
tag name: carplay
tags question: http://stackoverflow.com/q/77579967
tags question: http://stackoverflow.com/q/79044693
tags question: http://stackoverflow.com/q/79534149

http://stackoverflow.com/comment/134673923
comment on: http://stackoverflow.com/q/76373287
score: 0
has text: What does not work? The first way is pointless anyway because – as the name implies – a *temporary* directory is certainly not the right place for persistent data. And the `while` loops make no sense either because nothing is changing in their body. Apart from this you get **always** a unique value with `timeIntervalSince1970` relative to the current date.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/134520845
score: 0
comment on: http://stackoverflow.com/a/76262845
type: AnswerComment
has text: @BerryBlue The Header file name must contain the name of your pod in a podspec file: s.name = "rtn-calculator" and a name of your class must be the same.
type: Comment

http://stackoverflow.com/a/76205910
has body: One possible solution would be to create extension(s) to handle properties that don't exist on Swift types based on the Objective-C equivalents. In your tests include a .swift extension: // URL+QueryParams.swift import Foundation extension URL { var queryParams: [String: String] { var urlDict = [String: String]() guard let query = self.query else { return urlDict } let subArray = query.components(separatedBy: &quot;&amp;&quot;) for element in subArray { let urlArray = element.components(separatedBy: &quot;=&quot;) if urlArray.count &lt; 2 { continue } urlDict[urlArray[0]] = urlArray[1] } return urlDict } }
type: Answer
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/134834681
score: 1
answers question: http://stackoverflow.com/q/76201998

http://stackoverflow.com/comment/134719230
score: 0
type: QuestionComment
has text: Is the bridging header correctly defined in the target ?
type: Comment
comment on: http://stackoverflow.com/q/76372609

http://stackoverflow.com/comment/134626218
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76333979
score: 0
has text: I think I get it. All I need to do is override the NSToolbar delegate' function `toolbarAllowedItemIdentifiers`, whee I will get a toolbar pointer, call its `items()` method and then in the loop add each item identifier into the array that will be returned. Now the question is - how do I ge the toolbar from the delegate?

http://stackoverflow.com/comment/134616182
has text: @klangfarb apps
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/76334354
type: Comment

http://stackoverflow.com/comment/134672731
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/76372609
score: 1
has text: As I said, I cannot reproduce the problem in a fresh project. I would suggest that you try that as well.

clang
tag name: clang
tags question: http://stackoverflow.com/q/76349932
type: Tag
tags question: http://stackoverflow.com/q/76279100
tags question: http://stackoverflow.com/q/79289144

http://stackoverflow.com/q/76372609
tagged with: objective-c
upvote count: 1
has comment: http://stackoverflow.com/comment/134672540
has comment: http://stackoverflow.com/comment/134672731
has title: How can I use my Objective-C enum from Swift?
type: Question
has comment: http://stackoverflow.com/comment/134719230
tagged with: swift
downvote count: 0
type: UnansweredQuestion
has body: i have an issue bridging my Objective-C enums over to my Swift class and i someone could look at it, i'd be most grateful. For example, lets say i have an enum like this defined in a MyClass.h file: @interface MyClass : NSObject typedef NS_ENUM(NSUInteger, PopupType){ INFO = 0, QUESTION = 1, WARN = 2 }; .... tons of other stuff @end i then put that in my bridging header: #import "MyClass.h" but when i try to use it in Swift, either by declaring a variable: let banana : PopupType = .INFO or as a method parameter: func doThingAt(minutes: Int32, popup: PopupType) { i get the error message Cannot find PopupType in scope. another thing it doesn't find in MyClass.h is for example extern int const COLOR_GREEN; What am I missing? Thanks in advance.
score: 1
has comment: http://stackoverflow.com/comment/134672162
favorite count: 0
answer count: 0

protocols
type: Tag
tags question: http://stackoverflow.com/q/76259633
tag name: protocols
tags question: http://stackoverflow.com/q/76945008
tags question: http://stackoverflow.com/q/77420684
tags question: http://stackoverflow.com/q/78578910

http://stackoverflow.com/a/76832938
type: Answer
has body: There is an open issue on GitHub that discusses a similar problem where YogaKit is not installed when Flipper is disabled. In the meantime - Try clearing your derived data and reinstalling your pods. rm -rf ~/Library/Developer/Xcode/DerivedData cd ios rm -rf Pods pod install
answers question: http://stackoverflow.com/q/76330995
score: 0

http://stackoverflow.com/comment/134676473
has text: Why don't you use NSFileManager APIs to get the list of existing files? For example, `contentsOfDirectoryAtPath:error:`. But it's tough to offer good advice since you don't show how you saved the file. That makes it difficult to help with the code to load the file.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/76373287
type: Comment

http://stackoverflow.com/comment/134528239
type: Comment
comment on: http://stackoverflow.com/q/76287510
score: 1
type: QuestionComment
has text: Have you tried setting `needsDisplay` or `reloadDataForRowIndexes:columnIndexes:`?

customization
tag name: customization
type: Tag
tags question: http://stackoverflow.com/q/76333097

http://stackoverflow.com/comment/134544848
type: Comment
has text: Yes, I want to paste some existing example code into /// comment to generate DocC documentation.
comment on: http://stackoverflow.com/q/76297115
type: QuestionComment
score: 0

http://stackoverflow.com/q/76368198
has answer: http://stackoverflow.com/a/76368417
score: 0
type: Question
upvote count: 1
tagged with: swift
answer count: 1
type: UnansweredQuestion
favorite count: 0
downvote count: 1
has body: I have an Objective-C ClassA: @class ClassA; @property (nonatomic, retain) String *str; @end Which then is inherited by a Swift class ClassB: class ClassB: ClassA { } Separately, I will have a protocol: protocolDelegate: AnyObject { var str: String } I will then try to extend ClassB to adhere to the protocolDelegate: extension ClassB: protocolDelegate { } I have tried many ways of doing this but I can't get it to work. Is there a way to use the inherited property to conform to the protocol?
has comment: http://stackoverflow.com/comment/134666136
has title: How to use Inherited property for protocol compliance
tagged with: objective-c

multithreading
tags question: http://stackoverflow.com/q/76241132
tag name: multithreading
type: Tag
tags question: http://stackoverflow.com/q/78291071

http://stackoverflow.com/q/76312639
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134572735
has body: I want to retrieve all classes that conform specific protocol protocol Service: NSObject {} and then build a dictionary [ClassName: [String array of property types]]. I managed to retrieve all classes using Objective-C reflection: private static func allClasses&lt;R&gt;() -&gt; [R] { var count: UInt32 = 0 let classListPtr = objc_copyClassList(&amp;count) defer { free(UnsafeMutableRawPointer(classListPtr)) } let classListBuffer = UnsafeBufferPointer(start: classListPtr, count: Int(count)) return classListBuffer.compactMap { $0 as? R } } But I have problems with retrieving property types of services. From what I see Swift API requires object to get that info Mirror(reflecting: obj).children and even tho my protocol requires NSOject I don't want to create an object just to retrieve properties. Is there any other way to achieve it? From what I saw there is obj-c method class_copyPropertyList but you can only retrieve names and attributes with that, and you still need the object to get property types.
tagged with: mirror
has comment: http://stackoverflow.com/comment/134575697
has title: Get properties types of Class.Type in Swift
upvote count: 3
type: Question
tagged with: swift
downvote count: 0
tagged with: reflection
score: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134572771
answer count: 0
favorite count: 0

return-type
tag name: return-type
tags question: http://stackoverflow.com/q/76296059
type: Tag

http://stackoverflow.com/comment/134521217
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76262845
score: 0
has text: How do I check that it's generating the header properly?

reflection
tag name: reflection
tags question: http://stackoverflow.com/q/76312639
type: Tag

http://stackoverflow.com/comment/134462897
comment on: http://stackoverflow.com/q/76245513
type: Comment
has text: @GeoffHackworth the company i'm going to work for has their codebase still in Objective-C and the project I'll be working on will still be using it. They recommended me this book to read on before I start. Thanks for the recommendation though.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134537344
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76292989
has text: How strange - see updated again. This time I've included the code I'm using to save my string to the database (the string I use for testing is just the word Birthday with a balloon emoji in the self.notesField.text field). @HangarRash

http://stackoverflow.com/comment/134457719
type: Comment
comment on: http://stackoverflow.com/q/76245513
score: 0
type: QuestionComment
has text: The fact that the book uses Objective-C is an indication that it was published a long time ago (2014 according to Amazon). @HangarRash is absolutely correct, the window is created in the scene delegate since iOS 13. It is possible to revert back to the app delegate workflow but I think you would be wasting time and effort fighting more and more incompatibilities between the book and current behaviour. Learning Objective-C as a beginner is almost certainly not a good use of your time. Start with SwiftUI using a course such as https://www.hackingwithswift.com/100/swiftui

swift-package-manager
type: Tag
tags question: http://stackoverflow.com/q/76201998
tag name: swift-package-manager
tags question: http://stackoverflow.com/q/78280183
tags question: http://stackoverflow.com/q/78511969
tags question: http://stackoverflow.com/q/78820826

http://stackoverflow.com/comment/134515252
type: Comment
score: 0
has text: This is all code in the same framework. My Obj-C classes in MySDK aren't being seen by my Swift files in MySDK.
type: QuestionComment
comment on: http://stackoverflow.com/q/76276000

http://stackoverflow.com/comment/134395972
type: Comment
comment on: http://stackoverflow.com/q/76210219
has text: IIRC objc_msgSend is written *in assembly* so it just leaves all the argument registers alone until it gets to the actual function you are calling, and then that function gets the arguments. It also doesn't call the function, but jumps to it, so the stack isn't affected either.
score: 0
type: QuestionComment

http://stackoverflow.com/a/76260042
has comment: http://stackoverflow.com/comment/134484326
has comment: http://stackoverflow.com/comment/134484288
has body: int network_socket = socket(AF_INET, SOCK_STREAM, 0); struct sockaddr_in socketAddr; socketAddr.sin_family = AF_INET; socketAddr.sin_port = kSocketPort; socketAddr.sin_addr.s_addr = INADDR_ANY; int result = connect(network_socket, (struct sockaddr *)&socketAddr, sizeof(socketAddr)); if (result == -1) { NSLog(@"Connection failed"); return; } close(network_socket);
type: Answer
answers question: http://stackoverflow.com/q/76259633
has comment: http://stackoverflow.com/comment/134481413
score: 0

objc-message-send
type: Tag
tags question: http://stackoverflow.com/q/76210219
tag name: objc-message-send

http://stackoverflow.com/comment/134641714
comment on: http://stackoverflow.com/a/76333979
score: 0
type: AnswerComment
type: Comment
has text: one hopefully last question. Please see the edit to the OP. Thx.

http://stackoverflow.com/comment/134637848
comment on: http://stackoverflow.com/a/76333979
score: 0
type: AnswerComment
has text: I read all articles from the link, but still have a question. There is an available and default toolbar items. My understanding is that available items are the ones that currently displayed in the toolbar and the defaut are the ones that are currently displayed + the ones that could potentialy be displayed in the toolbar. Am I right? If not - how the Kit differ between currently displayed and potentially displayed?
type: Comment

http://stackoverflow.com/comment/134465129
score: 0
comment on: http://stackoverflow.com/a/76248415
type: AnswerComment
type: Comment
has text: Since it's impossible to give a precise answer to the question, why not ask for extra details or even close the question with "needs debugging details" resolution?

http://stackoverflow.com/comment/134526993
type: Comment
comment on: http://stackoverflow.com/q/76285850
has text: Duplicate of [Nested redo group with NSUndoManager](https://stackoverflow.com/questions/13704535/nested-redo-group-with-nsundomanager). You can group the invocations but not the action names.
score: 1
type: QuestionComment

sockets
tag name: sockets
type: Tag
tags question: http://stackoverflow.com/q/76259633
tags question: http://stackoverflow.com/q/76773759
tags question: http://stackoverflow.com/q/78820826

http://stackoverflow.com/comment/134676495
has text: No one can help if you don't show relevant code in your question.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76365782

http://stackoverflow.com/a/76327067
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/76292989
answers question: http://stackoverflow.com/q/76292989
has body: Found a super simple solution to my question. Posting it here incase anyone else runs into it. My original data string that was returned: Birthday emoji &amp;amp;#x1F388; Here's the code I ended up using to make the emoji appear in my UILabel. ViewController.m NSString *htmlEntity = [self.finalTimes valueForKey:@&quot;notes&quot;][indexPath.row]; NSString *replacementString = [htmlEntity stringByReplacingOccurrencesOfString:@&quot;amp;&quot; withString:@&quot;&quot;]; dispatch_async(dispatch_get_main_queue(), ^{ NSData *data = [replacementString dataUsingEncoding:NSUTF8StringEncoding]; NSAttributedString *attributedString = [[NSAttributedString alloc] initWithData:data options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil]; UIFont *font = [UIFont fontWithName:@&quot;Avenir-Oblique&quot; size:11.0]; UIColor *textColor = [UIColor darkGrayColor]; // Set the correct font name and size NSDictionary *attributes = @{NSFontAttributeName: font, NSForegroundColorAttributeName: textColor}; NSMutableAttributedString *styledAttributedString = [[NSMutableAttributedString alloc] initWithAttributedString:attributedString]; [styledAttributedString addAttributes:attributes range:NSMakeRange(0, styledAttributedString.length)]; cell.notes.attributedText = styledAttributedString; });

http://stackoverflow.com/a/76217081
has comment: http://stackoverflow.com/comment/134407524
accepted answer of: http://stackoverflow.com/q/76208755
downvote count: 0
answers question: http://stackoverflow.com/q/76208755
has body: HI Please add the below code in Appdelegate did finish launch if (@available(iOS 13.0, *)) { UIView *statusBar = [[UIView alloc]initWithFrame:[UIApplication sharedApplication].keyWindow.windowScene.statusBarManager.statusBarFrame]; if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) { statusBar.backgroundColor = [UIColor whiteColor]; } [[UIApplication sharedApplication].keyWindow addSubview:statusBar]; } else { UIView *statusBar = [[UIView alloc]initWithFrame:[UIApplication sharedApplication].keyWindow.frame]; if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) { statusBar.backgroundColor = [UIColor whiteColor]; } }
score: 1
type: AcceptedAnswer
type: Answer
upvote count: 1

http://stackoverflow.com/comment/134456966
score: 0
comment on: http://stackoverflow.com/q/76245513
type: QuestionComment
has text: @HangarRash it still stays blank white. It should still work even if its out of date right?
type: Comment

http://stackoverflow.com/comment/134571865
comment on: http://stackoverflow.com/q/76313411
score: 0
has text: Is `callback` an Objective-C object?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/134549886
type: QuestionComment
has text: Building ObjC code on Windows is not always trivial. It highly depends on what the ObjC relies on. For example, it may be GNUstep code, in which case you'll need the GNUstep libraries. Or it may require CoreFoundation, in which case you'll need those. If it requires Darwin's Foundation (i.e. macOS), it may not be portable to Windows at all. We'd need more information about the specifics of this code. Do you believe it is supposed to run on Windows? For info on setting up a compiler, see https://stackoverflow.com/questions/63914108/using-clang-in-windows-10-for-c-c
type: Comment
comment on: http://stackoverflow.com/q/76300750
score: 0

http://stackoverflow.com/comment/134989261
comment on: http://stackoverflow.com/a/76536164
has text: serviceSubscriberCellularProviders and CTCarrier are deprecated with no replacement. https://developer.apple.com/forums/thread/714876?answerId=728276022#728276022 https://developer.apple.com/forums/thread/714876?answerId=728276022#728276022
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/76349140
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/76287510
answers question: http://stackoverflow.com/q/76287510
has body: Use reloadDataForRowIndexes:columnIndexes: to limit reloading to the first column.
score: 0

http://stackoverflow.com/comment/134512470
has text: Try to use dependency managers, for example Cocoapods or SPM. Don't need to do this work manually.
type: Comment
comment on: http://stackoverflow.com/q/76276000
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134520279
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76248294
has text: If I try that I'm getting this error. It goes away if I delete the Swift file. `RTNCalculatorSpec.h:15:2 This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.`

http://stackoverflow.com/comment/138113535
type: Comment
score: 0
has text: @BerryBlue I had a smilar issue to you. This fix/workaound helped me to prevent this error: https://github.com/facebook/react-native/issues/43319#issuecomment-2061251131
comment on: http://stackoverflow.com/a/76248294
type: AnswerComment

http://stackoverflow.com/comment/134571889
type: QuestionComment
comment on: http://stackoverflow.com/q/76313411
type: Comment
score: 0
has text: callback is a block

http://stackoverflow.com/comment/134550152
type: AnswerComment
has text: I had a feeling I was doing something weird interfacing between swift and Obj-C, thanks! Perfect explanation :)
type: Comment
comment on: http://stackoverflow.com/a/76296147
score: 0

http://stackoverflow.com/comment/134545993
has text: You cannot put procedural code like that in the view hierarchy. Use `onAppear` or `task`. You may want to check out a SwiftUI tutorial (Apple or Hacking with Swift) to get the basics of the framework.
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/76297936
type: Comment

http://stackoverflow.com/comment/134834681
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/76205910
has text: Query params don't always have anything to the right of `=`, which would make this crash

http://stackoverflow.com/comment/134530766
type: QuestionComment
comment on: http://stackoverflow.com/q/76276000
type: Comment
has text: Doesn't matter. Dependency manager will configure framework for you.
score: 0

http://stackoverflow.com/comment/134638184
has text: I was able to solve it. I wasn't including the **dylib** files that was required.
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76349932

http://stackoverflow.com/comment/134572735
type: Comment
score: 0
type: QuestionComment
has text: For properties you will need Swift's Reflection if they are not marked with `@objc`
comment on: http://stackoverflow.com/q/76312639

docc
tags question: http://stackoverflow.com/q/76225320
tag name: docc
type: Tag

http://stackoverflow.com/comment/134608235
type: Comment
comment on: http://stackoverflow.com/a/76333979
score: 0
type: AnswerComment
has text: Got it. Can I override this: https://developer.apple.com/documentation/appkit/nstoolbar/1516979-runcustomizationpalette?language=objc, to run my code there?

http://stackoverflow.com/comment/134643695
has text: This is an unrelated question about `NSArray`, post a new question please.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76333979
score: 0

http://stackoverflow.com/comment/134399927
comment on: http://stackoverflow.com/a/76212137
score: 0
type: AnswerComment
type: Comment
has text: @AndrewHenle I've updated the text to hopefully clarify my intention a little bit: in the contract between the function and the compiler, the function claims that it won't read any arguments, so the _compiler_ is safe to assume that it can pass in any arguments with any alignment.

http://stackoverflow.com/a/77358635
answers question: http://stackoverflow.com/q/76365782
score: 0
type: Answer
has body: A workaround I found is to first draw the image using a format that is opaque and uses a standard color range and then draw that new image in the PDF context. let image = ... // Re-draw image to adjust color range etc. let format = UIGraphicsImageRendererFormat.default() format.preferredRange = .standard format.opaque = true format.scale = 1 // non-retina let newImage = UIGraphicsImageRenderer(size: image.size, format: format).image { _ in image.draw(in: CGRect(origin: .zero, size: image.size)) } // Draw in PDF context newImage.draw(in: CGRect(origin: .zero, size: newImage.size))

http://stackoverflow.com/a/76263065
answers question: http://stackoverflow.com/q/76262477
score: 0
has body: I had the same issue using tflite_flutter. Try to follow the steps listed here for iOS. Basically, you need to add a compiled version of Tensorflow in the plugin pub cache folder. If you need to use the GPU Delegate you can follow the official docs of Tensorflow.
type: Answer

objective-c-category
type: Tag
tags question: http://stackoverflow.com/q/76201998
tag name: objective-c-category
tags question: http://stackoverflow.com/q/78160846
tags question: http://stackoverflow.com/q/79466619

unicode
tag name: unicode
type: Tag
tags question: http://stackoverflow.com/q/76292989
tags question: http://stackoverflow.com/q/76579270

http://stackoverflow.com/comment/134613066
comment on: http://stackoverflow.com/q/76313411
type: QuestionComment
score: 0
type: Comment
has text: Not quite understand

http://stackoverflow.com/comment/134552664
comment on: http://stackoverflow.com/q/76215695
type: QuestionComment
score: 0
type: Comment
has text: Maybe update the WARNING_CFLAGS settings, with the found flag "-Wno-declaration-after-statement". In the XCDYouTubeKit/XCDYouTubeKit.xcodeproj/project.pbxproj file, around line 604. Good Luck.

mirror
tag name: mirror
type: Tag
tags question: http://stackoverflow.com/q/76312639

http://stackoverflow.com/comment/134635024
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76349932
type: Comment
has text: ok, so looking at the actual build log rather than your summary it makes more sense, the code (which you've omitted) inside `Dongle::generateKeyPair` is referencing some other code which you've not provided a definition for

http://stackoverflow.com/comment/134592635
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76324356
has text: I don't use CarPlay, but I guess it's the same logic as for iDevices: https://developer.apple.com/documentation/uikit/uiscreen/1617836-scale Apple called them "Retina", but the logic is how do you divide a "point": is it 1 px, 4, 9, etc.?
type: Comment

objective-c-swift-bridge
type: Tag
tags question: http://stackoverflow.com/q/76223560
tag name: objective-c-swift-bridge
tags question: http://stackoverflow.com/q/78218464

http://stackoverflow.com/comment/134399935
comment on: http://stackoverflow.com/a/76212137
score: 0
has text: Separately, `printf` & co. are a very different case, because they take a _variable_ number of arguments — for a function which takes varargs, _any_ number of arguments of _any_ type are valid. It's up to the function to figure out how to accept them safely.
type: AnswerComment
type: Comment

xcframework
tag name: xcframework
tags question: http://stackoverflow.com/q/76276000
type: Tag
tags question: http://stackoverflow.com/q/77518160
tags question: http://stackoverflow.com/q/78260865
tags question: http://stackoverflow.com/q/78837902
tags question: http://stackoverflow.com/q/78958789

undefined-behavior
tag name: undefined-behavior
type: Tag
tags question: http://stackoverflow.com/q/76210219

http://stackoverflow.com/a/76343120
answers question: http://stackoverflow.com/q/76334354
score: 0
type: Answer
has body: There's no way to share code directly between 2 apps in 2 projects. But you can: Isolate whatever code you want to share (e.g. FirstFunc) into a separate project Include it into both apps, like explained here for example, or by making a common code an xcframework and consuming via cocoapods or package, as explained here This is the most suitable solution for most cases. But if both of your apps share most of the code (and most differences are in configuration or assets), then you can also do this: Combine both apps into 1 project, Create a separate target for each app. Each target will include common code, and bits specific to the particular app. But like I said, this is only suitable if most of the code is shared, otherwise it becomes a mess.

h.264
tag name: h.264
tags question: http://stackoverflow.com/q/76319817
type: Tag

uialertcontroller
tag name: uialertcontroller
type: Tag
tags question: http://stackoverflow.com/q/76286739

xcode14.3
type: Tag
tag name: xcode14.3
tags question: http://stackoverflow.com/q/76215695

http://stackoverflow.com/comment/135100267
comment on: http://stackoverflow.com/a/76430676
score: 0
type: AnswerComment
type: Comment
has text: New hack to test.

http://stackoverflow.com/q/76429102
has answer: http://stackoverflow.com/a/76430676
has body: I am trying to obtain the UUID of /usr/lib/dyld (dynamic linker) of an iOS device, but none of the methods I have tried seem to work. The dynamic linker image (MH_DYLINKER) is not even loaded in _dyld_get_image. I have attempted the following code: - (NSString *) getDynamicLinkerUUID { const struct mach_header *dyldHeader = NULL; for (uint32_t i = 0; i < _dyld_image_count(); i++) { const struct mach_header *header = _dyld_get_image_header(i); if (header->filetype == MH_DYLINKER) { dyldHeader = header; break; } } if (!dyldHeader) return @"Cannot found header: MH_DYLINKER"; BOOL is64bit = dyldHeader->magic == MH_MAGIC_64 || dyldHeader->magic == MH_CIGAM_64; uintptr_t cursor = (uintptr_t)dyldHeader + (is64bit ? sizeof(struct mach_header_64) : sizeof(struct mach_header)); const struct segment_command *segmentCommand = NULL; for (uint32_t i = 0; i < dyldHeader->ncmds; i++, cursor += segmentCommand->cmdsize) { segmentCommand = (struct segment_command *)cursor; if (segmentCommand->cmd == LC_UUID) { const struct uuid_command *uuidCommand = (const struct uuid_command *)segmentCommand; const uint8_t *uuid = uuidCommand->uuid; NSString* uuidString = [NSString stringWithFormat:@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7], uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]]; NSLog(@"UUID: %@", uuidString); return [uuidString lowercaseString]; } } return @""; } This always return "Cannot found header: MH_DYLINKER" Please let me know how can I get it.
score: 1
answer count: 1
favorite count: 0
tagged with: ios
type: Question
tagged with: objective-c
type: UnansweredQuestion
upvote count: 1
downvote count: 0
has title: How to obtain UUID of dynamic linker? (/usr/lib/dyld)

http://stackoverflow.com/comment/134898479
has text: I am using an external device farm. Its on a website and it will reproduce the same result. I am not sure how do I share the website with you? Can you try any iOS 14 device on aws? it will also give same result.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76430676

http://stackoverflow.com/comment/135010155
score: 0
type: AnswerComment
type: Comment
has text: So if your app running on the farm would display text or an alert would you see it somehow?
comment on: http://stackoverflow.com/a/76430676

http://stackoverflow.com/a/76430676
has comment: http://stackoverflow.com/comment/135046775
has comment: http://stackoverflow.com/comment/134940065
has comment: http://stackoverflow.com/comment/134895270
has comment: http://stackoverflow.com/comment/134898427
has comment: http://stackoverflow.com/comment/134898479
has comment: http://stackoverflow.com/comment/134894734
has comment: http://stackoverflow.com/comment/134892706
has comment: http://stackoverflow.com/comment/135008864
has comment: http://stackoverflow.com/comment/135172207
has comment: http://stackoverflow.com/comment/135100267
has comment: http://stackoverflow.com/comment/134898240
has comment: http://stackoverflow.com/comment/134906644
has comment: http://stackoverflow.com/comment/134901092
has comment: http://stackoverflow.com/comment/135381225
has comment: http://stackoverflow.com/comment/135030574
has comment: http://stackoverflow.com/comment/135038100
has comment: http://stackoverflow.com/comment/134897929
has comment: http://stackoverflow.com/comment/134925578
answers question: http://stackoverflow.com/q/76429102
has comment: http://stackoverflow.com/comment/135010563
has comment: http://stackoverflow.com/comment/134951621
has comment: http://stackoverflow.com/comment/134900877
has comment: http://stackoverflow.com/comment/135010155
type: Answer
has comment: http://stackoverflow.com/comment/135009006
has comment: http://stackoverflow.com/comment/134902241
has comment: http://stackoverflow.com/comment/134892960
has comment: http://stackoverflow.com/comment/134893510
has comment: http://stackoverflow.com/comment/134898202
has comment: http://stackoverflow.com/comment/134961949
has comment: http://stackoverflow.com/comment/135010514
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/135071252
has comment: http://stackoverflow.com/comment/135043781
has comment: http://stackoverflow.com/comment/134895088
has comment: http://stackoverflow.com/comment/135010807
has comment: http://stackoverflow.com/comment/134899579
has comment: http://stackoverflow.com/comment/134784075
has comment: http://stackoverflow.com/comment/134899901
has comment: http://stackoverflow.com/comment/135009676
has comment: http://stackoverflow.com/comment/134892655
has comment: http://stackoverflow.com/comment/134951656
score: 1
has comment: http://stackoverflow.com/comment/135039323
has body: As you already observed _dyld_get_image_header(..) will omit /usr/lib/dyld from the results. Your process does not have any easy way to access it through Apple APIs. That's what lldb does: https://github.com/apple-oss-distributions/dyld/blob/dyld-1231.3/include/mach-o/dyld_process_info.h When starting a process, lldb starts the process suspended, finds the "_dyld_debugger_notification" symbol in dyld, sets a break point on it, then resumes the process. Dyld will call _dyld_debugger_notification() with a list of images that were just added or removed from the process. Dyld calls this function before running any initializers in the image, so the debugger will have a chance to set break points in the image. This is how lldb's image list dyld [ 0] 651EB4D8-A0F0-3C97-A0C4-6A8F6FC17A56 0x00000001051c4000 /Users/username/Library/Developer/Xcode/iOS DeviceSupport/13.3 (17C54) arm64e/Symbols/usr/lib/dyld works. Update - proper solution #include <mach-o/dyld_images.h> void *getDyldBase(void) { struct task_dyld_info dyld_info; mach_vm_address_t image_infos; struct dyld_all_image_infos *infos; mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; kern_return_t ret; ret = task_info(mach_task_self_, TASK_DYLD_INFO, (task_info_t)&dyld_info, &count); if (ret != KERN_SUCCESS) { return NULL; } image_infos = dyld_info.all_image_info_addr; infos = (struct dyld_all_image_infos *)image_infos; return infos->dyldImageLoadAddress; } - (NSString *) getDynamicLinkerUUID { const struct mach_header *dyldHeader = getDyldBase() if (!dyldHeader) return @"Cannot found header: MH_DYLINKER"; BOOL is64bit = dyldHeader->magic == MH_MAGIC_64 || dyldHeader->magic == MH_CIGAM_64; uintptr_t cursor = (uintptr_t)dyldHeader + (is64bit ? sizeof(struct mach_header_64) : sizeof(struct mach_header)); const struct segment_command *segmentCommand = NULL; for (uint32_t i = 0; i < dyldHeader->ncmds; i++, cursor += segmentCommand->cmdsize) { segmentCommand = (struct segment_command *)cursor; if (segmentCommand->cmd == …
has comment: http://stackoverflow.com/comment/134879762
has comment: http://stackoverflow.com/comment/135140293
has comment: http://stackoverflow.com/comment/134901746
has comment: http://stackoverflow.com/comment/134899738
has comment: http://stackoverflow.com/comment/134939776
has comment: http://stackoverflow.com/comment/134898913

http://stackoverflow.com/a/76530285
score: -1
downvote count: 1
upvote count: 0
answers question: http://stackoverflow.com/q/76528271
has body: If you want to trigger GlobalSequencerViewController's action, then add the "GlobalSequencerViewController" as a child view controller of MainViewController. instead of adding it as subView of MainViewController Difference between both is as follows addChildViewController associates a view controller with a parent container view controller, while addSubview adds a view to the view hierarchy of the view it is being added to. So add below mentinoed line after adding the child VC's view as subView of parent view [self addChildViewController:globalControlView]; So the viewDidLoad code of MainViewController will be as below - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. GlobalSequencerControlView *globalControlView = [[GlobalSequencerControlView alloc] initWithNibName:@"GlobalSequencerControls" bundle:nil]; //self.view.userInteractionEnabled = false; [self.view addSubview:globalControlView.view]; [self addChildViewController:globalControlView]; globalControlView.view.frame = self.view.bounds; [globalControlView didMoveToParentViewController:self]; }
type: Answer
has comment: http://stackoverflow.com/comment/134975444
has comment: http://stackoverflow.com/comment/134940491

http://stackoverflow.com/q/76461631
tagged with: external-accessory
tagged with: objective-c
has title: How to discover already connected devices using the ExternalAccessoryFramework on iOS for a non-MFI Bluetooth device?
tagged with: ios-bluetooth
has comment: http://stackoverflow.com/comment/134835955
has comment: http://stackoverflow.com/comment/134858067
has comment: http://stackoverflow.com/comment/134834455
has comment: http://stackoverflow.com/comment/134836019
linked to: http://stackoverflow.com/q/17236701
favorite count: 0
score: 2
tagged with: bluetooth
type: Question
has body: I am writing an app that seeks to discover if the user is already connected to a specialized Bluetooth keyboard that I produce. My peripheral is running Bluetooth Classic, version 3.0, and uses HID to communicate with the iOS device. I cannot use Apple's CoreBluetooth Framework as I am not using BluetoothLE or GATT. I must use Apple's ExternalAccessory framework. As per Apple's rules, I DO NOT need to register with MFI because I use "standard Bluetooth profiles supported by iOS" (see here). I tried to find the connected Bluetooth peripheral by the following objective-c snippet: NSArray<EAAccessory *> *accessories = [[EAAccessoryManager sharedAccessoryManager] connectedAccessories]; However, even when my Bluetooth peripheral is connected to the iOS device, I cannot obtain any connectedAccessories when I run this command. Do I need to include a UISupportedExternalAccessoryProtocols field in my info.plist file despite not using MFI? See this related stackoverflow post for the UISupportedExternalAccessoryProtocols field. Do I need to programatically connect with my peripheral in objective-c before it returns as a connected device (even though the iOS device is already connected to the peripheral via Bluetooth)? I am really stuck, and don't know how to proceed. Any help would be much appreciated.
type: UnansweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/134844377
answer count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/134847520
upvote count: 2

http://stackoverflow.com/q/76420865
has comment: http://stackoverflow.com/comment/134755854
type: Question
has comment: http://stackoverflow.com/comment/134755809
tagged with: swift
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/78948571
linked to: http://stackoverflow.com/q/20427104
score: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/134755977
has title: Incompatible pointer types passing retainable parameter of type 'SecTrustResultType *'
has comment: http://stackoverflow.com/comment/134755274
tagged with: objective-c
has body: I'm using react-native-payments library for ApplePay and getting below error I don't know what to do, any help please? iOS: 16.4 Xcode: 14.3 react-native: 0.71.4 react-native-payments: 0.8.4 Deployment target: 14.0 in Xcode PPOTSimpleURLConnection.m file NSString *domain = challenge.protectionSpace.host; SecTrustRef serverTrust = [[challenge protectionSpace] serverTrust]; NSArray *policies = @[(__bridge_transfer id)SecPolicyCreateSSL(true, (__bridge CFStringRef)domain)]; SecTrustSetPolicies(serverTrust, (__bridge CFArrayRef)policies); SecTrustSetAnchorCertificates(serverTrust, (__bridge CFArrayRef)self.pinnedCertificateData); SecTrustResultType result; // OSStatus errorCode = SecTrustEvaluate(serverTrust, &amp;result); OSStatus errorCode = SecTrustEvaluateWithError(serverTrust, &amp;result); BOOL evaluatesAsTrusted = (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed); if (errorCode == errSecSuccess &amp;&amp; evaluatesAsTrusted) { NSURLCredential *credential = [NSURLCredential credentialForTrust:serverTrust]; completionHandler(NSURLSessionAuthChallengeUseCredential, credential); } else { completionHandler(NSURLSessionAuthChallengeRejectProtectionSpace, NULL); } }
tagged with: stripe-payments
tagged with: react-native
answer count: 1

http://stackoverflow.com/q/76451404
has answer: http://stackoverflow.com/a/76452019
tagged with: macos
has title: Add a tooltip rectangle to NSToolBarItem's default view
has comment: http://stackoverflow.com/comment/134804410
has comment: http://stackoverflow.com/comment/134804964
type: Question
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
score: 0
tagged with: nstoolbaritem
has body: I have some NSToolBarItems to allow undo/redo in my app. I want them to show the name of undo/redo actions in their tooltip. I can specify the tooltip of an NSToolBarItem vial its toolTip property. But I'm not sure when this property should be set. I haven't found a way to be notified when the undo manager has recorded a new action to undo or redo. It would be better to dynamically return the tooltip string when the user hovers the toolbar item. But this requires adding a tooltip rectangle to a view that I cannot access. Indeed, the view property of NSToolBarItem returns nil by default. It does not return nil if I set the view property with my own view, but a NSToolBarItem uses a private subclass of NSButton as view, by default. This subclass implements nice behaviours that NSButton doesn't. So I'd rather use the default view. Is there a way to add a tooltip rectangle to an NSToolBarItem's view that doesn't use a custom view? IOW, how can I access this view?

http://stackoverflow.com/q/76399199
has comment: http://stackoverflow.com/comment/134734583
has comment: http://stackoverflow.com/comment/134718519
duplicate of: http://stackoverflow.com/q/7598820
has answer: http://stackoverflow.com/a/76408942
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/134738071
has comment: http://stackoverflow.com/comment/134725246
linked to: http://stackoverflow.com/q/5381085
tagged with: properties
accepted answer: http://stackoverflow.com/a/76408942
linked to: http://stackoverflow.com/q/145154
has comment: http://stackoverflow.com/comment/134734048
has comment: http://stackoverflow.com/comment/134718517
linked to: http://stackoverflow.com/q/16208041
linked to: http://stackoverflow.com/q/46319731
upvote count: 5
linked to: http://stackoverflow.com/q/12631705
downvote count: 1
tagged with: singleton
linked to: http://stackoverflow.com/q/695980
type: Question
has title: Singleton pattern in Objective-C using a class property
has comment: http://stackoverflow.com/comment/134734578
has comment: http://stackoverflow.com/comment/134727459
answer count: 1
has comment: http://stackoverflow.com/comment/134734262
duplicate of: http://stackoverflow.com/q/695980
tagged with: objective-c
linked to: http://stackoverflow.com/q/7568935
has comment: http://stackoverflow.com/comment/134738062
has body: I'm trying to create a singleton class in Objective-C that will also be consumed in Swift. I'd like the singleton instance to be accessible in Swift as a property. It appears that Apple does something similar (though not quite a singleton) in NSFileManager. @property(class, readonly, strong) NSFileManager *defaultManager; Ref: https://developer.apple.com/documentation/foundation/nsfilemanager/1409234-defaultmanager Here's my (simplified) attempt so far: FOOMyManager.h: @interface FOOMyManager : NSObject @property(class, readonly, strong) FOOMyManager *defaultManager; - (instancetype)init NS_UNAVAILABLE; @end FOOMyManager.mm @implementation FOOMyManager + (FOOMyManager *)defaultManager { static dispatch_once_t s_once = 0; static FOOMyManager *s_instance = nil; dispatch_once(&s_once, ^{ s_instance = [[FOOMyManager alloc] initForDefaultManager]; }); return s_instance; } - (instancetype)initForDefaultManager { self = [super init]; return self; } @end I've seen instances of a similar pattern being used to create singletons using + (instancetype)defaultManager; But I'd explicitly like to try and use properties if possible. Is my attempt the "right" way to do this?
score: 4
linked to: http://stackoverflow.com/q/7598820
favorite count: 0

http://stackoverflow.com/comment/134767636
score: 1
type: QuestionComment
type: Comment
has text: Does this answer your question? [Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?](https://stackoverflow.com/questions/3088059/xcode-how-to-fix-nsunknownkeyexception-reason-this-class-is-not-key-valu)
comment on: http://stackoverflow.com/q/76428958

http://stackoverflow.com/comment/134845367
type: QuestionComment
has text: Without knowing how you're going to _use_ those bytes, it's hard to give a good recommendation here.
type: Comment
comment on: http://stackoverflow.com/q/76475957
score: 3

http://stackoverflow.com/comment/134876960
type: Comment
score: 0
has text: Does this answer your question? [Objective-C Property Getter/Setter crash EXC\_BAD\_ACCESS](https://stackoverflow.com/questions/28637799/objective-c-property-getter-setter-crash-exc-bad-access)
type: QuestionComment
comment on: http://stackoverflow.com/q/76492391

http://stackoverflow.com/q/76425767
tagged with: caemitterlayer
has title: CAEmitterLayer works for a while, then stops diplaying. Objective C
has comment: http://stackoverflow.com/comment/134795245
type: Question
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134803137
score: 0
has comment: http://stackoverflow.com/comment/134815953
tagged with: caemittercell
has body: I have added some fireworks to an app. The emitters work a few times, then stops displaying. Here is the Objective C code in the .m - (void) viewDidLoad { [super viewDidLoad]; [self setupEmitter]; [self setupFireWorkEmitterCells]; } -(void) setupEmitter{ emitterLayer = [CAEmitterLayer layer]; emitterLayer.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-100); emitterLayer.position = CGPointMake(self.view.frame.size.width/2, self.view.frame.size.height/2); emitterLayer.emitterShape = kCAEmitterLayerPoint; emitterLayer.backgroundColor = [[UIColor colorWithRed:0.0 green:0.2 blue:0.2 alpha:0.500] CGColor]; emitterLayer.emitterPosition = CGPointMake(self.view.frame.size.width/2, self.view.frame.size.height); emitterLayer.emitterSize = CGSizeMake(30, 30); emitterLayer.emitterMode = kCAEmitterLayerOutline; emitterLayer.renderMode = kCAEmitterLayerAdditive; emitterLayer.needsDisplayOnBoundsChange = YES; emitterLayer.delegate = self; [self.view.layer insertSublayer:emitterLayer below:BottomBar.layer]; } -(void) setupFireWorkEmitterCells{ NSLog(@"setupFirework cellls"); //============== EMITTER CELL 1 - Parent ============== // emitter = [NSKeyedUnarchiver unarchiveObjectWithFile:[[NSBundle mainBundle] pathForResource:@"Sparks" ofType:@"sks"]]; //Create Cell CAEmitterCell *cell1 = [CAEmitterCell emitterCell]; cell1.name = @"Parent"; cell1.birthRate = 0.0; cell1.lifetime = 2.5; cell1.lifetimeRange = 0.0; cell1.beginTime = CACurrentMediaTime(); cell1.velocity = 300.0; cell1.velocityRange = 100.0; cell1.xAcceleration = 0; cell1.yAcceleration = -100.0; cell1.emissionLatitude = 0.0 * (M_PI / 180.0); cell1.emissionLongitude = -90.0 * (M_PI / 180.0); cell1.emissionRange = 45.0 * (M_PI / 180.0); cell1.spin = 0.0 * (M_PI / 180.0); cell1.spinRange = 0.0 * (M_PI / 180.0); cell1.scale = 0.0; cell1.scaleRange = 0.0; cell1.scaleSpeed = 0.0; cell1.alphaRange = 0.0; cell1.alphaSpeed = 0.0; cell1.color = [UIColor colorWithRed:255.0/255.0 green: 255.0/255.0 blue…
has comment: http://stackoverflow.com/comment/134803207
has comment: http://stackoverflow.com/comment/134777345
has comment: http://stackoverflow.com/comment/134803452
answer count: 0

http://stackoverflow.com/comment/135004180
type: QuestionComment
comment on: http://stackoverflow.com/q/76536415
type: Comment
has text: Have you tried `contentLayoutGuide`?
score: 0

http://stackoverflow.com/comment/134872164
comment on: http://stackoverflow.com/q/76492391
has text: If you rename `- (void)setIsFoo:(BOOL)isFoo;` with `- (void)setIsFoo2:(BOOL)isFoo;`, and do `[mySpecialClass setIsFoo2:YES];`, there won't be a loop anymore. But `self.isFoo = someValue` is equal to `[self setIsFoo:someValue]`.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/135038100
score: 0
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment
has text: I've added code to print some stacktraces (at the bottom of my answer). Please edit & include the output in your question.

http://stackoverflow.com/a/76493364
accepted answer of: http://stackoverflow.com/q/76492391
type: AcceptedAnswer
type: Answer
upvote count: 3
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/76492391
has body: The important lesson here is what "dot syntax" actually means in ObjC. Originally (until around 2007) in ObjC, setting a property was always done using a method called -setX:, which would be called as [obj setThing:thing]. There was no obj.thing = thing syntax. (This existed for C structs, but that's a very different thing.) This setThing: syntax was through convention. It was not actually part of the language, and there were no @property definitions. It was just well understood that when you wanted to expose a "writable property" called thing, the object should have methods -thing and -setThing: (plus some subtle rules about BOOL properties and the is... prefix, and by-reference get... methods that I won't dive into). This all became formalized as Key-Value Coding, but was still technically "convention," not part of the language. In ObjC 2, the convention was made part of the language as "dot syntax." I do not exaggerate to say this change was extremely controversial. (It is still controversial in some circles, but most of us have kind of gotten over it.) With dot syntax, obj.thing is translated into [obj thing], and obj.thing = thing is translated into [obj setThing:thing]. It is purely syntactic sugar. As a separate feature, over a couple of iterations involving ever-less @synthesize, the @property syntax was added. This let you define "properties" that would automatically define a backing ivar (with a leading _) and the required getter and setter methods to match existing conventions. So looking at your property definition: @property (nonatomic, readwrite, assign) BOOL isFoo; This, provided that -isFoo and -setIsFoo: are not defined, will automatically create an ivar called _isFoo, and provide synthesized getter and setter methods that apply the requested memory management. (That's another story, leading eventually to ARC.) But in your case you define setIsFoo:, so the setter is not generated automatically. Instead, expanding the dot syntax sugar, you've written…

http://stackoverflow.com/comment/134755977
comment on: http://stackoverflow.com/q/76420865
has text: Now I've updated all the code and create ```CGError error;``` and passed it to ```OSStatus errorCode = SecTrustEvaluateWithError(serverTrust, *error); ``` but getting this ```Indirection requires pointer operand ('int32_t' (aka 'int') invalid)```
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134835955
type: QuestionComment
score: 0
has text: Thanks Paul. How might I go about accessing my Bluetooth peripheral through software? There must be some way to access it programatically, no?
type: Comment
comment on: http://stackoverflow.com/q/76461631

http://stackoverflow.com/comment/135140293
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment
has text: It returns a uuid but its not of dyld or dylib
score: 0

http://stackoverflow.com/q/76381280
type: Question
tagged with: objective-c
has body: Not able to understand the issue. Any help is appreciated Fatal Exception: NSInvalidArgumentException 0 CoreFoundation 0x9e88 __exceptionPreprocess 1 libobjc.A.dylib 0x178d8 objc_exception_throw 2 CoreData 0xd988 _PFRetainedObjectIDCore 3 CoreData 0x600fc -[NSManagedObjectContext objectWithID:] 4 CoreData 0x5a4c -[NSFetchedResultsController _preprocessDeletedObjects:deletesInfo:sectionsWithDeletes:] 5 CoreData 0x5ec08 __82-[NSFetchedResultsController(PrivateMethods) _core_managedObjectContextDidChange:]_block_invoke 6 CoreData 0x837e8 developerSubmittedBlockToNSManagedObjectContextPerform 7 CoreData 0x83338 -[NSManagedObjectContext performBlockAndWait:] 8 CoreData 0x61c98 -[NSFetchedResultsController _core_managedObjectContextDidChange:] 9 CoreFoundation 0x37404 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ 10 CoreFoundation 0xde474 ___CFXRegistrationPost_block_invoke 11 CoreFoundation 0xc1724 _CFXRegistrationPost 12 CoreFoundation 0x4ba08 _CFXNotificationPost 13 Foundation 0x5cffc -[NSNotificationCenter postNotificationName:object:userInfo:] 14 CoreData 0x4cae4 -[NSManagedObjectContext _postObjectsDidChangeNotificationWithUserInfo:] 15 CoreData 0x11f470 -[NSManagedObjectContext(_NSInternalNotificationHandling) _processChangedStoreConfigurationNotification:] 16 CoreData 0x11d3d4 __95-[NSManagedObjectContext(_NSInternalNotificationHandling) _sendOrEnqueueNotification:selector:]_block_invoke 17 CoreData 0x837e8 developerSubmittedBlockToNSManagedObjectContextPerform 18 CoreData 0x83338 -[NSManagedObjectContext performBlockAndWait:] 19 CoreData 0x8ed24 -[NSManagedObjectContext(_NSInternalNotificationHandling) _storeConfigurationChanged:] 20 CoreFoundation 0x37404 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ 21 CoreFoundation 0xde474 ___CFXRegistrationPost_block_invoke 22 CoreFoundation 0xc1724 _CFXRegistrationPost 23 CoreFoundation 0x4ba08 _CFXNotificationPost 24 Foundation 0x5cffc -[NSNotificationCenter postNotificationName:object:userInfo:] 25 CoreD…
type: UnansweredQuestion
favorite count: 0
has title: NSInvalidArgumentException peristent store is not rechable from NSmanagerobjectcontext coordinator
has comment: http://stackoverflow.com/comment/134686854
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/134687768
tagged with: swift
downvote count: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/134687902
tagged with: ios

http://stackoverflow.com/q/76473669
answer count: 0
has body: I add some Objective-C libraries to my SwiftUI project using bridging header, Now am facing an error: Build input file cannot be found: '/Users/.../../QPos-iOS/QPos-iOS-Bridging-Header'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? Steps That I have tried: Create a Bridging Header File and (Import Objective-C files in Bridging Header File.) Target -&gt; Build Settings -&gt; Swift Compiler - General -&gt; Ojbective-C Bridging Header (Put Bridging Header Path here) Precompile Bridging Header: Yes Clean Project. Delete Derived Data Restart Xcode Restart Machine. but no luck, any help would be greatly appreciated.
upvote count: 2
has title: Build input file cannot be found: After Creating Bridging Header
has comment: http://stackoverflow.com/comment/135896333
tagged with: file-not-found
tagged with: objective-c
score: 2
type: Question
downvote count: 0
favorite count: 0
tagged with: pch
tagged with: swiftui
tagged with: bridging-header
type: UnansweredQuestion

http://stackoverflow.com/a/76452019
type: Answer
answers question: http://stackoverflow.com/q/76451404
has body: You don't need to hack NSToolbarItem. Use the NSUndoManagerCheckpointNotification notification on your undo manager. Every time it is called you can update the tooltip of the two toolbar bar items. [NSNotificationCenter.defaultCenter addObserverForName:NSUndoManagerCheckpointNotification object:self.undoManager queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note) { NSString *undoTitle = self.undoManager.undoMenuItemTitle; NSString *redoTitle = self.undoManager.redoMenuItemTitle; // Update the toolbar items' tooltips }]; You can also access the relevant undo manager via note.object in the block.
upvote count: 1
has comment: http://stackoverflow.com/comment/134806048
has comment: http://stackoverflow.com/comment/134808147
downvote count: 0
has comment: http://stackoverflow.com/comment/134805902
score: 1

http://stackoverflow.com/comment/134787496
type: Comment
has text: You know, unless the OP acknowledges that they know it’s a really bad idea and understand the risks and problems it entails, I think it is very good to outline the problems/risks and why the practice is discouraged.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/76435609

http://stackoverflow.com/comment/134722414
type: QuestionComment
score: 0
type: Comment
has text: You haven't provided nearly enough information for us to be able to help you. You should probably create a minimal reproducible example, upload it to GitHub, and add a link in your question. (I've never heard of Qt Quick or QML, so I've got nothing to draw from to help you. I googled Qt Quick but it sounds like a pretty complex framework.)
comment on: http://stackoverflow.com/q/76401182

http://stackoverflow.com/comment/134815953
type: Comment
has text: Sorry, I added the viewDidLoad that calls the setup of the emitterlayer and cells. the two other functions, Start & StopFW are conntected to a button to trigger each function start and stop. Hope this helps. Let me know if you need anything else.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76425767

async-await
type: Tag
tag name: async-await
tags question: http://stackoverflow.com/q/76435609
tags question: http://stackoverflow.com/q/76757144
tags question: http://stackoverflow.com/q/79318039

http://stackoverflow.com/comment/134895088
score: 0
comment on: http://stackoverflow.com/a/76430676
has text: I checked 3 different device farms with 30+ devices each. All of them gave uuid of /usr/lib/system/libdyld.dylib for iOS versions below 15. My real device with 14.x returns correct dyld uuid but device farms won't. Maybe the premain function is shifted to main? -- the devices on farms are loaded into cloud but act as real devices.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/76492391
has body: I'm trying to understand why this crashes when I use self.propName notation but not when I use _ivarName notation. Happy to learn about another part of Objective-C. Thanks for the help! // .h #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN @interface FOOMySpecialClass : NSObject @property (nonatomic, readonly, assign) BOOL isFoo; - (void)setIsFoo:(BOOL)isFoo; @end NS_ASSUME_NONNULL_END // .m #import "FOOMySpecialClass.h" @interface FOOMySpecialClass() @property (nonatomic, readwrite, assign) BOOL isFoo; @end @implementation FOOMySpecialClass - (void)setIsFoo:(BOOL)isFoo { self.isFoo = isFoo; // <-- Crash here } @end But, if I change the bool to the ivar, things work fine. I'm trying to understand why. // .m #import "FOOMySpecialClass.h" @interface FOOMySpecialClass() @property (nonatomic, readwrite, assign) BOOL isFoo; @end @implementation FOOMySpecialClass - (void)setIsFoo:(BOOL)isFoo { _isFoo = isFoo; // <-- Change here and no crash } @end // main.m #import <Foundation/Foundation.h> #import "FOOMySpecialClass.h" int main(int argc, const char * argv[]) { @autoreleasepool { FOOMySpecialClass *mySpecialClass = [[FOOMySpecialClass alloc] init]; [mySpecialClass setIsFoo:YES]; NSLog(@"%@", mySpecialClass.isFoo ? @"YES" : @"NO"); // <-- boom. } return 0; }
upvote count: 2
has comment: http://stackoverflow.com/comment/134872152
answer count: 2
has answer: http://stackoverflow.com/a/76493364
accepted answer: http://stackoverflow.com/a/76493364
score: 2
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/134872164
linked to: http://stackoverflow.com/q/28637799
has answer: http://stackoverflow.com/a/76492787
favorite count: 0
has title: In Objective-C, why does setter lead to crash when I user self.propName notation but not when I use _ivarName
possible better answer: http://stackoverflow.com/a/76492787
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/134876960
tagged with: objective-c

http://stackoverflow.com/a/76401856
answers question: http://stackoverflow.com/q/76401182
upvote count: 1
downvote count: 0
has body: As it's stated in the documentation (unfortunately it's in "Documentation Archive", but I hope it still works), you can try this in your .pro file: ios { QMAKE_OBJECTIVE_CFLAGS += -fobjc-arc } If this doesn't work, you may also try to set QMAKE_IOS_DEPLOYMENT_TARGET to something like 11.0 or higher, because there might be issues with newer compiler versions.
score: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/76401182

http://stackoverflow.com/comment/134940511
type: Comment
comment on: http://stackoverflow.com/q/76528271
type: QuestionComment
has text: Please see [Creating a custom container view controller](https://developer.apple.com/documentation/uikit/view_controllers/creating_a_custom_container_view_controller?language=objc) for the correct way to add a child view controller to a container view controller.
score: 0

http://stackoverflow.com/comment/134936079
has text: Cool!! Happy to hear that your issue got resolved. To make this helpful for others I added it as answer. Please accept & upvote the answer so It will be helpful for others
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76528271

http://stackoverflow.com/q/76443344
tagged with: macos
has comment: http://stackoverflow.com/comment/134791523
has comment: http://stackoverflow.com/comment/134806948
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/134790970
tagged with: objective-c
type: UnansweredQuestion
tagged with: cocoa
has body: I'm working on a macOS app that needs to manipulate the windows of other applications, namely bringing another app's window to the front. Note that it's not enough to simply bring an application to the front (which is easily accomplished with NSRunningApplication) -- it needs to be a specific window. Normally I would use the Accessibility API to do this, but unfortunately it's not reliable. Some applications do not respond to API requests in a timely manner or will return bogus or broken information, which can break my app. Consequently, I'm looking for alternative methods of doing this. I'm open to using unofficial macOS APIs, which, while I know they are not recommended, I've found can often be a lot faster and more reliable. For example, I needed a method to figure out which window occupied a certain point on screen. While it is possible and supported to do this with the Accessibility API, it would often be very slow, or just break completely with apps that don't support Accessibility features correctly. But using the undocumented function CGSFindWindowAndOwner is much faster and more reliable, as it just queries the window server directly. I'm hoping I can find a similar method for raising a window too. That said, if there is another supported method I'll certainly go for that, but I'm not aware of any other way of doing this without resorting to unofficial / undocumented APIs. (Maybe Apple Events can do it?) Do I have any options other than trying to work around the bugs and failings of the Accessibility API?
has title: Is there a way to bring a window of another macOS application to the front without using the Accessibility API?
favorite count: 0
linked to: http://stackoverflow.com/q/13760760
downvote count: 0
has comment: http://stackoverflow.com/comment/134794341
answer count: 0
score: 1

http://stackoverflow.com/comment/138380127
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76663068
has text: just reading through your answer. It seems to be the only one that comprehensively deals with this issue. I', trying to follow the steps you've outlined but there's a few questions I had and I'm wondering if I could send you a message. Thanks
score: 0

http://stackoverflow.com/q/76520858
tagged with: server
tagged with: objective-c
has title: Is there solution available to create a SMB/CIFS "server" on iOS/tvOS/watcOS using swift or objective C
has answer: http://stackoverflow.com/a/76529449
upvote count: 1
tagged with: smb
type: Question
tagged with: swift
downvote count: 0
has body: I need to create a LAN server on iOS device and give write access to the client device. Is there any library or resource available to create SMB server on any iOS/macOS/tvOS/watchOS but using swift that i can use or work on to create a working SMB server on any of iOS/tvOS/watchOS. I have tried to create an http server but for reasons(Apple) I am not able to give write access and i can only give read access for files. I also know that there are SMB client libraries out there like AMSMB2 &amp; TOSMBClient. But i need a server on a non macOS device. I am trying to do that using SMB right now if possible. Any help would be appreciated.
answer count: 1
type: UnansweredQuestion
score: 1
favorite count: 0
tagged with: share

http://stackoverflow.com/q/76403207
tagged with: touch-id
tagged with: objective-c
upvote count: 0
has comment: http://stackoverflow.com/comment/134733715
has answer: http://stackoverflow.com/a/76403241
has title: how to determine whether the ios device is a face or a touch?
has comment: http://stackoverflow.com/comment/134725114
downvote count: 1
type: Question
answer count: 1
tagged with: face-id
type: UnansweredQuestion
tagged with: iphone
linked to: http://stackoverflow.com/q/46887547
favorite count: 0
has body: when I turn off face id on the setting，I get a error as follow： LAContext *myContext = [[LAContext alloc] init]; NSError *authError = nil; [myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError] authError is "No identities are enrolled." This error does not indicate whether the phone is touch id or face id，how I determine whether the ios device is a face or a touch？ I have tried differnt iphone device，authError is "No identities are enrolled.". I can not determine whether the ios device is a face or a touch.
score: -1
tagged with: ios

http://stackoverflow.com/comment/134898913
has text: Sorry I don't have access to aws device farm. And I don't understand how them launching apps actually differs. Other than giving one last try with x19 I don't have anything else to recommend.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76430676

http://stackoverflow.com/q/76521757
has answer: http://stackoverflow.com/a/76529546
type: Question
tagged with: swiftui
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/134934736
has title: SwiftUI - Objc @protocol delgate function usage
accepted answer: http://stackoverflow.com/a/76529546
tagged with: objective-c
has body: I cannot figure how to implement an ObjC library delegate/protocol function in a SwifUI view/app. It works well in an ObjC or swift application Here is the code and explanation (I simplified so there may be some typo) In the ObC library it is implemented like this MyClass.h from ObjC library @protocol CustomDelegate <NSObject> - (void)endEvent:(BOOL) done; @end MyClass.h is imported in bridging.h declared in ObjectiveC-bridging-header settings In a swift application we do this and it works. The delegate ObjC library function endEvent is well called ViewController.swift class ViewController: UIViewController { var myclass = Myclass() override func viewDidLoad() { super.viewDidLoad() myclass.setDelegate(self) } //Delegate methods override func endEvent(done:Bool) { print("done \(done)") } } Internally in the Objc library we store the caller and check that the protocol function is implemented in it -(void) SetDelegate:(id)delegate { myDelegate = delegate; } -(void)notifyEndEvent { if (myDelegate == nil) return; // check caller implemented the delegate function and if so call it if (([myDelegate respondsToSelector:@selector(endEvent: done:)]) { [myDelegate endEvent:done]; } else { printf("endEvent not implemented by the caller\n"); } } } How can I do the same in Switfui view ? If I do as shown below it doesn't work because in the ObjC library the respondsToSelector function shown above return false struct ContentView: View { @State var myclass = Myclass() private func start() { myclass.setDelegate(self) } func endEvent(sender: Myclass , endEvent done:Bool) { print("endEvent \(done)") } } Thanks in advance
answer count: 1
score: 0
has comment: http://stackoverflow.com/comment/134921943

http://stackoverflow.com/q/76476767
has body: ALL, I'm trying to add the toolbar customization functionality to my program. Everything works when the toolbar is horizontal on on top. When the toolbar is vertical on and the left, calling https://developer.apple.com/documentation/appkit/nstoolbar/1516979-runcustomizationpalette?language=objc doesn't have any effect. Is there a way to mitigate it?
tagged with: nstoolbar
has comment: http://stackoverflow.com/comment/134858053
score: 0
has comment: http://stackoverflow.com/comment/134882739
tagged with: objective-c
linked to: http://stackoverflow.com/q/3977343
answer count: 0
has comment: http://stackoverflow.com/comment/134858855
has title: Toolbar customization works only on horizontal toolbars
has comment: http://stackoverflow.com/comment/134884533
has comment: http://stackoverflow.com/comment/134851789
type: Question
type: UnansweredQuestion

http://stackoverflow.com/comment/134685569
has text: Post a [mre] please.
type: QuestionComment
comment on: http://stackoverflow.com/q/76378869
score: 1
type: Comment

http://stackoverflow.com/comment/134851789
type: Comment
has text: How do I make a `NSToolbar` vertical?
type: QuestionComment
comment on: http://stackoverflow.com/q/76476767
score: 0

http://stackoverflow.com/comment/134687902
type: QuestionComment
comment on: http://stackoverflow.com/q/76381280
type: Comment
has text: You still have an active NSFetchedResultsController apparently...
score: 0

http://stackoverflow.com/q/76401182
has body: I'm trying to add a QR code scanner to my iOS project written using Qt Quick. I've found this example on how to achieve it using native APIs. I've added QRCodeReaderViewController/* files to my project and trying to build it. Getting weird compilation errors. I suspect some Xcode build settings are required to be enabled, but I don't know how to do it using qmake. ../ios/QRCodeReaderViewController/QRCodeReaderViewController.m:46:1: error: cannot synthesize weak property in file using manual reference counting @implementation QRCodeReaderViewController ../ios/QRCodeReaderViewController/QRCodeReaderViewController.m:107:5: error: cannot create __weak reference in file using manual reference counting __weak __typeof__(self) weakSelf = self;
has answer: http://stackoverflow.com/a/76401856
tagged with: objective-c
type: Question
answer count: 1
score: 0
tagged with: qt
has title: Getting compilation errors when trying to add QR code scanner to a Qt project
accepted answer: http://stackoverflow.com/a/76401856
has comment: http://stackoverflow.com/comment/134722414
tagged with: ios
type: AnsweredQuestion

crashlytics
tag name: crashlytics
type: Tag
tags question: http://stackoverflow.com/q/76512900
tags question: http://stackoverflow.com/q/78466384
tags question: http://stackoverflow.com/q/79002609
tags question: http://stackoverflow.com/q/79100926
tags question: http://stackoverflow.com/q/79463591

http://stackoverflow.com/q/76513922
upvote count: 3
tagged with: uidatepicker
type: Question
score: 3
type: UnansweredQuestion
has title: UIDatePicker is not working on macOS Catalina
downvote count: 0
favorite count: 0
tagged with: mac-catalyst
tagged with: objective-c
has body: Here is the code for UIDatePicker: _datePicker = [[UIDatePicker alloc] init]; _datePicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; _datePicker.datePickerMode = UIDatePickerModeDate; _datePicker.preferredDatePickerStyle = UIDatePickerStyleWheels; _datePicker.overrideUserInterfaceStyle = UIUserInterfaceStyleLight; _datePicker.backgroundColor = [UIColor whiteColor]; It is working on macOS Ventura, but not working on macOS Catalina. It shows nothing: I have tried the other options of preferredDatePickerStyle, but it's still not working.
answer count: 0

http://stackoverflow.com/comment/134733715
type: QuestionComment
score: 1
type: Comment
comment on: http://stackoverflow.com/q/76403207
has text: Does this answer your question? [How to programmatically check support of 'Face Id' and 'Touch Id'](https://stackoverflow.com/questions/46887547/how-to-programmatically-check-support-of-face-id-and-touch-id)

http://stackoverflow.com/comment/134844377
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76461631
has text: Thanks, but I believe that the updates to CoreBluetooth in 2019 only made GATT Bluetooth Classic devices compatible. I'm using HID, so I don't think this would work.
type: Comment

http://stackoverflow.com/comment/134872152
comment on: http://stackoverflow.com/q/76492391
type: Comment
score: 4
has text: Add a `NSLog(@"Calling setIsFoo:");` at the first line of the method, you'll see: infinite loop, you're calling yourself each time.
type: QuestionComment

http://stackoverflow.com/comment/135046775
score: 0
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment
has text: The app crashed again with the new hack :((

http://stackoverflow.com/q/76475957
has comment: http://stackoverflow.com/comment/134846481
type: Question
tagged with: swift
tagged with: byte
type: UnansweredQuestion
answer count: 0
has title: Objective-C to Swift conversion question for bytes
has body: I have a very old Objective-C app that I am trying to convert to Swift. I am not well versed in Objective-C and even less so in pointers. I have this code here that I can not figure out what to do with: NSData *ucTimeData=[self getUcTime]; Byte *ucTimeByte = (Byte *)[ucTimeData bytes]; The NSData looks like this when printing the description: Printing description of data: &lt;9ea49c1d&gt; What would be the Swift equivalent of the Byte conversion? ucTimeData.bytes returns an unsafe pointer so something like: let ucTimeByte: UInt8 = UInt8(ucTimeData.bytes) which I guess would be the literal translation but it does not work.
linked to: http://stackoverflow.com/q/31821709
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134860448
score: 0
tagged with: pointers
has comment: http://stackoverflow.com/comment/134845367

http://stackoverflow.com/comment/134858855
comment on: http://stackoverflow.com/q/76476767
score: 0
type: Comment
has text: `NSToolbar` doesn't have a `position` or `size` property. Post a [mre] please.
type: QuestionComment

http://stackoverflow.com/comment/134892655
score: 0
has text: On iPhone12,1 (14.2) & iPhone12,3 (14.2, 14.3) it always returns uuid of /usr/lib/system/libdyld.dylib. iPhone12,1 (14.2) id returned: BA60CB9E95C53646BEEDD313E15586CF iPhone12,3 (14.2) id returned: BA60CB9E95C53646BEEDD313E15586CF iPhone12,3 (14.3) id returned: 785BEE7FAC2C388D865C36279D1B3DD1 Please let me know how to fix it.
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/135005078
comment on: http://stackoverflow.com/a/76529449
type: AnswerComment
has text: I am not sure this is the project, as I believe the SMB library product is not an open-source solution.
type: Comment
score: 0

http://stackoverflow.com/q/76480080
tagged with: react-native
type: Question
tagged with: iphone
tagged with: file
accepted answer: http://stackoverflow.com/a/76480451
tagged with: ios
type: AnsweredQuestion
answer count: 1
tagged with: objective-c
has body: I need to check size with Objective-C of external file which is shared to my react native app. I got url which works fine without getting file attributes: file:///private/var/mobile/Containers/Shared/AppGroup/61894F8B-0001-40C2-856E-F30D4663F7A7/File%20Provider%20Storage/Instrukcja_Welcome_to.pdf and NSDictionary *fileAttributes = [fileManager attributesOfItemAtPath:url.relativePath error:&error]; NSNumber *fileSize = fileAttributes[NSFileSize]; works perfectly on simulator but when I use physical device I got error: Error Domain=NSCocoaErrorDomain Code=257 "The file “Instrukcja_Welcome_to.pdf” couldn’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=/private/var/mobile/Containers/Shared/AppGroup/61894F8B-0001-40C2-856E-F30D4663F7A7/File Provider Storage/Instrukcja_Welcome_to.pdf, NSUnderlyingError=0x280eeb240 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}} I tried: NSFileCoordinator *fileCoordinator = [[NSFileCoordinator alloc] initWithFilePresenter:nil]; [fileCoordinator coordinateReadingItemAtURL:url options:NSFileCoordinatorReadingWithoutChanges error:&error byAccessor:^(NSURL *newURL) { fileAccessGranted = YES; }]; and added NSFileUsageDescription This app requires access to files. to info.plist
score: 0
has answer: http://stackoverflow.com/a/76480451
has title: Objective-C NSFileManager works fine on simulator but Operation not permitted error Domain=NSCocoaErrorDomain Code=257 on device when check file size

http://stackoverflow.com/comment/134975444
has text: As per his/her requirement he/she needs to fire the button action of other ViewController which was getting added only as a subview, so the answer I have given will work to fire the childController's action. I did not mention "didMoveToParentVC" method and framing/constraints of childVC, etc. As the answer is specific to fire the other controller's action. Please don't be judgemental brother
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76530285

http://stackoverflow.com/comment/134734583
type: Comment
comment on: http://stackoverflow.com/q/76399199
score: 0
type: QuestionComment
has text: Or this https://www.galloway.me.uk/tutorials/singleton-classes/ ?

http://stackoverflow.com/comment/135172207
comment on: http://stackoverflow.com/a/76430676
score: 0
has text: Is there anyway I can identify in the device if its a device farm or a real device? Just a check would be okay, i collected 13-14 all dyld uuids, will return 32 0 zero if it uses a device farm and is on 13-14 ios version but for real devices can use the original method.
type: AnswerComment
type: Comment

inheritance
type: Tag
tags question: http://stackoverflow.com/q/76528271
tag name: inheritance
tags question: http://stackoverflow.com/q/76945008

http://stackoverflow.com/comment/134935306
type: Comment
has text: Wow, that solved it, thank you. Why is it that that worked? Does assigning a subView automatically change ownership or where events are routed? Two days into iOS development here so pardon my ignorance lol
comment on: http://stackoverflow.com/q/76528271
score: 0
type: QuestionComment

http://stackoverflow.com/q/76435609
has comment: http://stackoverflow.com/comment/134779751
has comment: http://stackoverflow.com/comment/134789081
has comment: http://stackoverflow.com/comment/134778223
type: Question
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134787496
has title: Make swift async API synchronous
tagged with: async-await
favorite count: 0
has comment: http://stackoverflow.com/comment/134779827
linked to: http://stackoverflow.com/q/70962534
has comment: http://stackoverflow.com/comment/134796933
answer count: 0
duplicate of: http://stackoverflow.com/q/70962534
upvote count: 2
has body: We have received an external dependency framework from one of our partners, and their latest version (v2) of the framework only exposes Swift async interfaces. We were in the middle of integrating the previous version (v1) of the framework, which does not utilize Swift async, when the new version (v2) was released. We encountered an issue with v1, and their support team recommended switching to the latest version (v2), mentioning that v1 may contain a bug. So now we need to somehow integrate the code that looks like let data = try await storage?.data(forKey: key) in to the code that expect let data = storage?.data(forKey: key) return data which wouldn't be a problem if there was only swift code but we also have a fair bit of objc code that is using the same framework and the code NSData *data = [storage storedDataForKey:key]; return data becomes something like NSData *data = [storage storedDataForKey:key completionHandler:^(NSData* data) { // do something here and then call completion } it has a knock off effect and requires changes of quite a lot of code. Considering all we need now is just to check the v2 of the framework work as expected and has no bug I am wondering if there is a simpler solution that could wrap async interfaces of the v2 and let us test the framework.
tagged with: swift
downvote count: 1
score: 1

http://stackoverflow.com/q/76378869
downvote count: 2
has body: I need to use NSXPCService to communicate between 2 applications which is in user account it has no admin privilege, so can i use NSXPCService for this case? I tried this service between daemon application and user application. so its worked but another case which i mentioned above is not working
tagged with: objective-c
tagged with: macos
has title: Will NSXPCService work between user account processes without admin privilege in swift language?
favorite count: 0
upvote count: 2
score: 0
has comment: http://stackoverflow.com/comment/134685569
has comment: http://stackoverflow.com/comment/134739515
type: Question
tagged with: swift
type: UnansweredQuestion
answer count: 0

http://stackoverflow.com/q/76428958
has body: I am doing a project in Objective-C so when I create a custom xib and connect a couple of outlets, it gives me the error: 2023-06-07 22:50:32.194106-0700 ProturisApp[91070:2437111] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<InputCollectionViewCell 0x10403ee78> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key brickWall.' These are my classes and my extension: @implementation UIView (NIBLoader) + (instancetype)fromNib { return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil] objectAtIndex:0]; } @end #import "InputCollectionViewCell.h" #define IDENTIFFIER @"InputCollectionViewCell" @implementation InputCollectionViewCell -(instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self loadFromNib]; } return self; } - (instancetype)initWithCoder:(NSCoder *)coder { self = [super initWithCoder:coder]; if (self) { [self loadFromNib]; self.userInteractionEnabled = YES; // Initialize what is needed } return self; } + (NSString *) identifier { return IDENTIFFIER; } - (void)loadFromNib { UIView *nibView = [[self class] fromNib]; if (nibView) { nibView.frame = self.bounds; nibView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self addSubview:nibView]; nibView.backgroundColor = [UIColor redColor]; } } @end #import "MainViewController.h" @interface MainViewController () @end @implementation MainViewController @synthesize menuCollectionView; - (void)viewDidLoad { [super viewDidLoad]; [self.menuCollectionView registerClass:[InputCollectionViewCell class] forCellWithReuseIdentifier:[InputCollectionViewCell identifier]]; menuCollectionView.delegate = self; menuCollectionView.dataSource = self; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [InputCollectionViewCell dealloc]; } - (nonnull __kindof UICollectionViewCell *)collectionView:(nonnull UICollectionView …
tagged with: objective-c
has title: Load xib and put outlets in Objective-C
answer count: 0
has comment: http://stackoverflow.com/comment/134769692
score: 0
linked to: http://stackoverflow.com/q/3088059
has comment: http://stackoverflow.com/comment/134780478
type: Question
tagged with: xcode
has comment: http://stackoverflow.com/comment/134767636
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/134769589

http://stackoverflow.com/q/76512900
linked to: http://stackoverflow.com/q/63704911
tagged with: crashlytics
tagged with: macos
tagged with: firebase
upvote count: 3
has title: firebase-ios-sdk/Crashlytics/run: No such file or directory
favorite count: 0
type: Question
tagged with: objective-c
type: UnansweredQuestion
downvote count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/138516949
has body: I have a problem everytime I archive for any mac (catalyst) here is the error: enter image description here and also this is my build phase -&gt; Crashlytics run script enter image description here can anyone help me with this ? thank you I've done the suggestions I get from this thread. FirebaseCrashlytics/run: No such file or directory error while building the app - swift but the same error still exists
tagged with: swift
score: 3

http://stackoverflow.com/comment/134895270
score: 0
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment
has text: @Lucilfer at this point I'm blind coding against your farm setup but please check the new hack.

http://stackoverflow.com/a/76480451
upvote count: 1
has body: The solution turned out to be quite simple: NSURL *url = = [NSURL fileURLWithPath:@"/private/var/mobile/Containers/Shared/AppGroup/61894F8B-0001-40C2-856E-F30D4663F7A7/File Provider Storage/Downloads/Instrukcja_Welcome_to.pdf"]; BOOL isAccessGranted = [url startAccessingSecurityScopedResource]; if (isAccessGranted) { NSDictionary *fileAttributes = [fileManager attributesOfItemAtPath:url.relativePath error:&error]; NSNumber *fileSize = fileAttributes[NSFileSize]; } [url stopAccessingSecurityScopedResource]; The key thing is to use startAccessingSecurityScopedResource method on NSURL *url before using file and after finishing to use stopAccessingSecurityScopedResource
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/76480080
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/76480080
type: Answer

http://stackoverflow.com/comment/134879762
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76430676
has text: I am using several phones to test, the code you provided is giving me uuid of `/usr/lib/system/libdyld.dylib` not `/usr/lib/dyld`. I tested iPhone 8, 5s, 11 Pro, X with different iOS versions but none of them returned the correct one. Can you please double check? The `7C9C7851823738A7B1EB9CD2DEB4B746` is correct for 15.5 arm64e phone tho.

http://stackoverflow.com/comment/135071252
type: Comment
has text: Is there any other way? Really depending on you haha
score: 0
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment

http://stackoverflow.com/comment/134803137
type: QuestionComment
has text: The animation displays fine for a short time, then it does not display at all. This behavior only seems to happen when I combine both subcell1_1 AND subcell1_2 in the emitterCells array. If I use only one of the subcells, then the animation displays all the time as it is supposed to when it is called. I am not sure why the odd behavior is occurring when both subcell1_1 AND subcell1_2 are combined.
comment on: http://stackoverflow.com/q/76425767
score: 0
type: Comment

http://stackoverflow.com/a/76408942
has body: Yes, you've got the right principles. You don't need the strong, since that's an attribute used for a synthesized setter telling it that it should retain a strong reference to anything passed into the setter. In this case it's not doing anything since class properties are never synthesized automatically, and it's marked as readonly so strong wouldn't have any effect anyways. Your code looks good. dispatch_once is the preferred way of instantiating a singleton. As far as any improvements, you can add a message to the unavailable attribute: __attribute__((unavailable("Use FOOMyManager.defaultManager"))). I wouldn't say it's necessary or adds much since it's clear from the header file what to do, but I'm including it here as an option.
score: 3
answers question: http://stackoverflow.com/q/76399199
upvote count: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/76399199
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/134858053
score: 0
type: QuestionComment
has text: @Willeke, you just set the position/size of the toolbar...
type: Comment
comment on: http://stackoverflow.com/q/76476767

http://stackoverflow.com/comment/134899579
type: Comment
has text: The x19 gives uuid BA11554B5E683A00A765CCFE296A796B. This is not the correct one either. Is there any other approach to get it? I rely on external device farms so I have no other way to do it. Would be grateful if you can find any other way.
comment on: http://stackoverflow.com/a/76430676
score: 0
type: AnswerComment

http://stackoverflow.com/a/76541178
has body: A WKWebView is not as simple as a scroll view holding processed html. If you use Debug View Hierarchy you'll see how complex it can be. I would suggest: add the "bottomView" to the web view (not to its scroll view) constrain the bottom of the bottomView to the bottom of the web view's frame implement scrollViewDidScroll and update the .constant to position the bottomView You'll want to keep bottomView hidden until the page has loaded, set clipsToBounds on the web view so the bottomView is not visible outside the frame, and set the web view's .scrollView.contentInset to allow for the extra space to show the bottomView. Here's a quick example, using this page as the web view's url: ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end ViewController.m #import <WebKit/WebKit.h> #import "ViewController.h" @interface ViewController () <UIScrollViewDelegate, WKNavigationDelegate> { WKWebView *webView; UILabel *bottomView; NSLayoutConstraint *bottomC; CGFloat bottomViewHeight; } @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; webView = [WKWebView new]; webView.translatesAutoresizingMaskIntoConstraints = NO; [self.view addSubview:webView]; bottomView = [UILabel new]; bottomView.text = @"Bottom View"; bottomView.textAlignment = NSTextAlignmentCenter; bottomView.backgroundColor = UIColor.greenColor; bottomView.translatesAutoresizingMaskIntoConstraints = NO; [webView addSubview:bottomView]; bottomViewHeight = 60.0; UILayoutGuide *g = self.view.safeAreaLayoutGuide; [NSLayoutConstraint activateConstraints:@[ [webView.topAnchor constraintEqualToAnchor:g.topAnchor constant:40.0], [webView.leadingAnchor constraintEqualToAnchor:g.leadingAnchor constant:8.0], [webView.trailingAnchor constraintEqualToAnchor:g.trailingAnchor constant:-8.0], [webView.bottomAnchor constraintEqualToAnchor:g.bottomAnchor constant:-40.0], [bottomView.leadingAnchor constraintEqualToAnchor:webView.leadingAnchor constant:0.0], [bottomView.trai…
score: 0
type: Answer
answers question: http://stackoverflow.com/q/76536415

http://stackoverflow.com/q/76528271
has comment: http://stackoverflow.com/comment/134933247
tagged with: objective-c
has comment: http://stackoverflow.com/comment/134936079
upvote count: 1
tagged with: xcode
answer count: 1
has body: So I'm attempting to call an IBAction that is associated with the FileOwner of a subview instantiated from an xib file I am running into a strange issue, basically I have a base class that all views inherit from: ViewController.h #import <UIKit/UIKit.h> #import "CsoundManager.h" @interface ViewController : UIViewController -(IBAction) testActionBase:(id)sender; @end ViewController.m #import "ViewController.h" @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. } -(IBAction) testActionBase:(id)sender { NSLog(@"Test Action Fired"); } @end and then I have two other view classes which inherit from this. One is the main view that instantiates subviews. Main View Files: MainViewController.h #import "ViewController.h" @interface MainViewController : ViewController -(IBAction) testFireDerived:(id)sender; @end MainViewController.m #import "MainViewController.h" #import "GlobalSequencerControlView.h" @implementation MainViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. GlobalSequencerControlView *globalControlView = [[GlobalSequencerControlView alloc] initWithNibName:@"GlobalSequencerControls" bundle:nil]; //self.view.userInteractionEnabled = false; [self.view addSubview:globalControlView.view]; } -(IBAction) testFireDerived:(id)sender { NSLog(@"Main View Fire Derived"); } @end And below are the instantiated subclass files: GlobalSequencerControlView.h #import "ViewController.h" @interface GlobalSequencerControlView : ViewController { } -(IBAction) testFireDerived:(id)sender; @end GlobalSequencerControlView.m #import "GlobalSequencerControlView.h" @implementation GlobalSequencerControlView - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. } -(IBAction) testFireDerived:(id)sender { NSLog(@"Global Sequencer Fire Derived"); } @end When I wire up a button within the subview loaded from the xib, I am unable …
type: Question
has comment: http://stackoverflow.com/comment/134940511
has comment: http://stackoverflow.com/comment/134975458
tagged with: inheritance
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/76530285
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/134933364
has comment: http://stackoverflow.com/comment/134933276
has comment: http://stackoverflow.com/comment/134935306
score: 1
tagged with: ios
has title: Cannot call IBAction in derived class instantiated as subview

http://stackoverflow.com/comment/134834455
type: Comment
comment on: http://stackoverflow.com/q/76461631
score: 1
type: QuestionComment
has text: You don't need to register with MFi because you are using a standard keyboard HID profile, but if your device doesn't include an MFi chipset and identifier you will not discover it via external accessory framework.

http://stackoverflow.com/comment/134899901
has text: - UPDATE: The original premain function code you gave works on iOS 12, iOS 11 as well. It only gives uuid for libdyld.dylib in iOS 13 & 14 only.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76430676

http://stackoverflow.com/comment/134784075
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76430676
score: 0
has text: This does return a uuid but its not /usr/lib/dyld uuid. Please let me know how to return its uuid.

http://stackoverflow.com/comment/134769589
has text: So, where is `brickWall` outlet?
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76428958

http://stackoverflow.com/comment/134902241
comment on: http://stackoverflow.com/a/76430676
has text: Thanks. The app didn't crash but this time it gave uuid of /usr/lib/system/libsystem_c.dylib
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/134808147
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76452019
has text: In that case I'd rather use my previous solution, which was to update the tooltips in `validateUserInterfaceItem`. This is called for every user action (even if not undoable), but only once per action, while `NSUndoManagerCheckpointNotification` can be sent dozen of times in a run loop.

http://stackoverflow.com/comment/134796933
type: Comment
has text: Thanks all. I ended up using modified version of this code https://gist.github.com/sainecy/4366a1b99c7317fac63bfeb19d1cfab2 that has been posted https://stackoverflow.com/questions/70962534/swift-await-async-how-to-wait-synchronously-for-an-async-task-to-complete. That was enough to test the framework
score: 0
comment on: http://stackoverflow.com/q/76435609
type: QuestionComment

http://stackoverflow.com/comment/134939776
type: AnswerComment
type: Comment
has text: Is there no other way? Would be grateful if you could find a way.
comment on: http://stackoverflow.com/a/76430676
score: 0

http://stackoverflow.com/comment/134779827
has text: Bottom line, if v2 of this API is using asynchronous API, then you really should refactor your Objective-C code to follow completion handler patterns, as painful as that seems at this point (or start to refactor that code to Swift using Swift concurrency, which is likely even more painful). ☹️ That having been said, if (and only if) that Objective-C code is off the main thread, you can entertain semaphores within that Objective-C code (though that has its own risks), but it's impossible to advise you without a more complete example.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76435609
type: Comment

http://stackoverflow.com/q/76455043
tagged with: ios
upvote count: 3
has comment: http://stackoverflow.com/comment/134825351
type: Question
tagged with: libiconv
has answer: http://stackoverflow.com/a/76634955
tagged with: objective-c
type: UnansweredQuestion
tagged with: xcode
favorite count: 0
has answer: http://stackoverflow.com/a/76469085
has title: download xcode15beta and build errror
has body: I downloaded xcode15 beta, and then run the project and reported an error, but I did not report an error when I ran it with xcode14.3. the error info is： Library 'iconv.2.4.0' not found Linker command failed with exit code 1 (use -v to see invocation)
tagged with: iphone
score: 2
answer count: 2
downvote count: 1

properties
tags question: http://stackoverflow.com/q/76399199
tag name: properties
type: Tag
tags question: http://stackoverflow.com/q/77535525

http://stackoverflow.com/comment/134725246
has text: @lazarevzubov I did look through those. Unfortunately, none of them use @ property for this. I'd like to know if the pattern I'm using with @ property has any downfalls.
score: 2
comment on: http://stackoverflow.com/q/76399199
type: QuestionComment
type: Comment

http://stackoverflow.com/a/76663068
accepted answer of: http://stackoverflow.com/q/76486081
has body: So for anyone who's looking for such kind of implementation to be used: 1. Write code in Objective-C that provides a functionality you want (in my case, creating a window in macOS): WindowBuilderObjC.h #ifndef WindowBuilderObjC_h #define WindowBuilderObjC_h #import <Cocoa/Cocoa.h> @interface WindowBuilderObjC : NSObject - (void)buildWindowWithWidth:(int)width height:(int)height; @end @interface WindowDelegate : NSObject <NSWindowDelegate> @end #endif /* WindowBuilderObjC_h */ WindowBuilderObjC.mm #import "WindowBuilderObjC.h" @implementation WindowBuilderObjC - (void)buildWindowWithWidth:(int)width height:(int)height { @autoreleasepool { [NSApplication sharedApplication]; [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; NSRect frame = NSMakeRect(0, 0, 800, 600); NSUInteger style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskResizable; NSWindow *window = [[NSWindow alloc] initWithContentRect:frame styleMask:style backing:NSBackingStoreBuffered defer:NO]; [window setTitle:@"My Window"]; [window center]; WindowDelegate *delegate = [[WindowDelegate alloc] init]; [window setDelegate:delegate]; [window makeKeyWindow]; [window orderFrontRegardless]; [NSApp run]; } } @end @implementation WindowDelegate - (BOOL)windowShouldClose:(id)sender { [NSApp terminate:nil]; return YES; } @end 2. Create a file (still in Objective-C) with C++ headers using keyword extern "C" (so they can be used in C++ code): WindowBuilderObjCWrapper.mm extern "C" { #import "WindowBuilderObjC.h" } extern "C" WindowBuilderObjC *createWindowBuilder() { WindowBuilderObjC* builder = [[WindowBuilderObjC alloc] init]; return builder; } extern "C" void deleteWindowBuilder(WindowBuilderObjC *builder) { [builder dealloc]; } extern "C" void buildWindow(WindowBuilderObjC *builder, int* width, int* height) { [builder buildWindowWithWidth:*width height:*height]; } 3. Modify CMakeLists.txt to create a module library from your Objective-C files: CMakeLists.txt add_library(W…
has comment: http://stackoverflow.com/comment/138380127
downvote count: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/76486081
upvote count: 1
score: 1

http://stackoverflow.com/comment/134900877
score: 0
comment on: http://stackoverflow.com/a/76430676
has text: @Lucilfer I've added an edit with more stuff to test. Fingers crossed.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134825351
comment on: http://stackoverflow.com/q/76455043
type: Comment
score: 0
has text: Welcome to SO. Please take a [tour] and read [ask] for tips how to write a good question. You can [edit] your question with additional information. This will help others answering your question.
type: QuestionComment

file-not-found
tag name: file-not-found
type: Tag
tags question: http://stackoverflow.com/q/76473669

stripe-payments
type: Tag
tag name: stripe-payments
tags question: http://stackoverflow.com/q/76420865

http://stackoverflow.com/a/76403241
has body: The biometryType property of the LAContext object tells you what type of biometric authentication is available on the current device: LAContext *myContext = [[LAContext alloc] init]; switch (myContext.biometryType) { case LABiometryTypeFaceID: // Do something with Face ID break; case LABiometryTypeTouchId: // Do something with Touch ID break; case LABiometryTypeNone: // Biometrics are not available }
type: Answer
answers question: http://stackoverflow.com/q/76403207
score: 0

share
type: Tag
tags question: http://stackoverflow.com/q/76520858
tag name: share

http://stackoverflow.com/comment/134769692
has text: You need to use `registerNib:` and remove all that `fromNib`, `loadFromNib` garbage.
comment on: http://stackoverflow.com/q/76428958
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/a/76634955
score: 0
type: Answer
has body: Search for 'iconv.2.4.0' globally and replace it with 'iconv.2' , then I compiled successfully. Because I did not search for 'iconv.2.4.0' in xcode 15 beta 3, it should be renamed to 'iconv.2'.
answers question: http://stackoverflow.com/q/76455043

http://stackoverflow.com/comment/134755854
comment on: http://stackoverflow.com/q/76420865
type: Comment
score: 0
has text: Sorry, `CFError`, is "old" `NSError`. See https://stackoverflow.com/questions/20427104/casting-a-cferrorref-to-an-nserror-or-opposite-with-arc but there should be bridgeable.
type: QuestionComment

http://stackoverflow.com/comment/134804410
has text: Subclass `NSToolBarItem` and override `toolTip`?
type: Comment
comment on: http://stackoverflow.com/q/76451404
score: 0
type: QuestionComment

http://stackoverflow.com/q/76536415
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/76541178
tagged with: wkwebview
has title: Constraints a view to the bottom of WKWebView.scollView
tagged with: uikit
tagged with: ios
tagged with: autolayout
has comment: http://stackoverflow.com/comment/135004180
has body: I am trying to put a view at the bottom of the contentView of my WkWebView.scrollView, but it seems like the view always end up at the origin Y of 5000 or 8000 which is the random value of bound inside the WkWebView. I tried setting frame, but resulted the same thing. I wonder if you can actually put a view exactly after the contentView of the webView ended while still making the scrolling works? self.webView.frame = self.view.bounds; [self.webView.scrollView addSubview:self.myView]; self.myView.translateAutoresizingMaskIntoConstraints = false; [self.myView.topAnchor constraintEqualToAnchor:self.webView.scrollView.subViews.lastObject.bottomAnchor].active = true; [self.myView.bottomAnchor constraintEqualToAnchor:self.webView.scrollView.bottomAnchor].active = true; [self.myView.widthAnchor constraintEqualToAnchor:self.view.widthAnchor].active = true;
type: Question
answer count: 1
tagged with: objective-c

external-accessory
type: Tag
tag name: external-accessory
tags question: http://stackoverflow.com/q/76461631

http://stackoverflow.com/a/76529546
accepted answer of: http://stackoverflow.com/q/76521757
answers question: http://stackoverflow.com/q/76521757
score: 0
has body: Thanks to the Vadian comments I figured out how to do You have to declare and use your function in a specific class This way the objc callback are well called Declare your class that implements you objc library code and delegate class MyClassModel: ObservableObject{ var myclass = Myclass() func start(){ myclass.setDelegate(self) ... } @objc func endEvent(done:Bool) { print("endEvent \(done)") } } Another way with NSObject class MyClassModel2 : NSObject { var myclass = Myclass() func start(){ myclass.setDelegate(self) ... } @objc func endEvent(done:Bool) { print("endEvent \(done)") } } Use it in your view struct ContentView: View { @ObservedObject var myClassModel = MyClassModel() @State var myClassModel2 = MyClassModel2() myClassModel.start() myClassModel2.start() }
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/134734578
comment on: http://stackoverflow.com/q/76399199
has text: @KMehta what about this: https://stackoverflow.com/questions/12631705/singleton-property-access-in-objective-c ? does it help?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/134858067
has text: That's annoying. Thanks for your help.
comment on: http://stackoverflow.com/q/76461631
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/76529449
answers question: http://stackoverflow.com/q/76520858
has comment: http://stackoverflow.com/comment/134947924
score: 0
has body: Pentaloop has an SMB server/client for iOS
has comment: http://stackoverflow.com/comment/135005078
type: Answer
has comment: http://stackoverflow.com/comment/134948419

http://stackoverflow.com/comment/138516949
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76512900
has text: there are different scripts required depending if you are using Pods or SPM https://stackoverflow.com/questions/63704911/firebasecrashlytics-run-no-such-file-or-directory-error-while-building-the-app

http://stackoverflow.com/comment/134725114
has text: https://developer.apple.com/documentation/localauthentication/lacontext/2867583-biometrytype
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76403207

http://stackoverflow.com/q/76486081
has answer: http://stackoverflow.com/a/76663068
type: Question
tagged with: cmake
answer count: 1
has comment: http://stackoverflow.com/comment/138379976
tagged with: objective-c
has body: The Idea I'm trying to implement a game engine in C++. I'm using macOS for development (arm-64 architecture). I want to create a window using Foundation framework. CMakeLists.txt utilizes C++ and Objective-C languages, and I want to build a library containing only Objective-C code and then use this library in my C++ code (probably including the header). The end result should be a C++ executable. The Project Structure [src] ├── [Draw] ├── Window.cpp ├── Window.h └── [WindowBuilder] ├── WindowBuilder.cpp ├── WindowBuilder.h └── [macOS] ├── WindowBuilderObjC.h └── WindowBuilderObjC.mm ├── [Utils] └── Size.h ├── main.cpp └── CMakeLists.txt The Source Code src/Draw/Window.h #include <iostream> #include <Utils/Size.h> #include "WindowBuilder/WindowBuilder.h" #pragma once namespace Draw { class Window { private: bool _isPresented; Utils::Size _size = Utils::Size(0, 0); WindowBuilder::WindowBuilder *_builder; Window(); ~Window() = default; public: // Public static member function to access the singleton instance static Window &Instance() { // Guaranteed to be initialized once static Window instance; return instance; } // Delete the copy constructor and assignment operator Window(const Window &) = delete; Window &operator=(const Window &) = delete; void SetSize(Utils::Size size); void DrawWindow(); }; } src/Draw/Window.cpp #include "Window.h" namespace Draw { Window::Window() { _builder = &WindowBuilder::WindowBuilder::Instance(); } void Window::SetSize(Utils::Size size) { _size = size; } void Window::DrawWindow() { std::cout << "Draw window with size: [" << _size.GetWidth() << ":" << _size.GetHeight() << "]" << std::endl; _builder->BuildWindow(_size); } } src/WindowBuilder/WindowBuilder.h // General #include <iostream> // Internal #include <Utils/Size.h> #include <Draw/WindowBuilder/macOS/WindowBuilderObjC.h> #pragma once namespace WindowBuilder { class WindowBuilder { private: bool _isPresented; WindowBuilder() = default; ~WindowBuilder() = default; public: static WindowBu…
score: 0
tagged with: c++
accepted answer: http://stackoverflow.com/a/76663068
has title: Mix C++ and Objective-C code using CMake and get C++ executable
type: AnsweredQuestion

http://stackoverflow.com/comment/135008864
score: 0
type: AnswerComment
has text: Didn't have laptop with me for few days. I tried the new hacks but the app crashed sadly. The farms don't give console for the users so can't test it there.
type: Comment
comment on: http://stackoverflow.com/a/76430676

libiconv
tags question: http://stackoverflow.com/q/76455043
type: Tag
tag name: libiconv

http://stackoverflow.com/comment/134755274
comment on: http://stackoverflow.com/q/76420865
type: QuestionComment
score: 0
type: Comment
has text: That's Objective-C, not Swift. And I guess your error is on `OSStatus errorCode = SecTrustEvaluateWithError(serverTrust, &result);`, you should pass a `NSError` parameter, not a `SecTrustResultType`. Call later ` SecTrustGetTrustResult` is error is not nil. See the doc: https://developer.apple.com/documentation/security/2980705-sectrustevaluatewitherror?language=objc

http://stackoverflow.com/comment/135043781
comment on: http://stackoverflow.com/a/76430676
score: 0
has text: Ok, coming up with meaningful debug data will take some effort I'll think of something else. In the meantime I've edited the answer with new hack you can try.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/76492787
answers question: http://stackoverflow.com/q/76492391
has body: self.isFoo = isFoo; calls the same setter recursively. So you have an infinite recursion, and that crashes. Look at the stack in Xcode and you’ll see a gazillion of nested calls to setIsFoo.
score: 4
type: Answer
downvote count: 0
upvote count: 4

http://stackoverflow.com/comment/134933247
score: 2
type: Comment
comment on: http://stackoverflow.com/q/76528271
has text: Did not get your question exactly, but if you are trying to connect the IBAction From GlobalSequencerViewController to MainViewController the action method won't show, because the button action can be given to the same viewcontroller where it is added. If you try to connect to GlobalSequencerViewController it will show you the action method. Any way let us know what you are trying to achieve so that can guide you the correct approach. But definitely the button of one VC can not be wired up with another VC
type: QuestionComment

http://stackoverflow.com/comment/134894734
comment on: http://stackoverflow.com/a/76430676
score: 0
has text: I don't have access to that many physical iOS14.x . An iOS14.5 simulator yields same results as my physical iOS 14.2 so the `premain` works. I also tried launching without lldb (from an icon) and get the same results. Also with a release build. Your device farm seems to have a specific way of launching the apps, but I don't have a way to replicate the problem.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134734048
type: QuestionComment
has text: @Willeke I'm afraid not. I know how to create a property, as is the case in my attempt so far. I just don't know if I'm creating the property correctly when implementing the singleton pattern. The fact that I haven't been able to find examples of this and yet Apple seems to be moving in this direction is why I want to double check my approach.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/76399199

http://stackoverflow.com/comment/134789081
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76435609
type: QuestionComment
has text: Use semaphore https://stackoverflow.com/questions/70962534/swift-await-async-how-to-wait-synchronously-for-an-async-task-to-complete **BUT** as said (here in comments and in answers comments), it is **NOT RECOMMENDED**, and you might find issues (after it's not recommended as unsafe, and blocking threads) for your proof of concept, but later, you'll need anyway to convert your sync code to async one...

http://stackoverflow.com/comment/134901092
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment
has text: Sad. Both the new methods crashes app on the iPhone 11 iOS 14 at the device farm but works on real phone
score: 0

http://stackoverflow.com/comment/134739515
type: QuestionComment
score: 0
has text: okay, i removed that tag
type: Comment
comment on: http://stackoverflow.com/q/76378869

http://stackoverflow.com/comment/134727459
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76399199
type: Comment
has text: Does this answer your question? [How do I declare class-level properties in Objective-C?](https://stackoverflow.com/questions/695980/how-do-i-declare-class-level-properties-in-objective-c) Skip the answers before 2016.

http://stackoverflow.com/comment/134860448
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76475957
has text: Seems that that your data contains an array of bytes. utcTimeBute is a pointer to an array of uint8 aka bytes. Look at [this](https://stackoverflow.com/questions/31821709/nsdata-to-uint8-in-swift)
type: Comment

http://stackoverflow.com/comment/134777345
type: QuestionComment
comment on: http://stackoverflow.com/q/76425767
score: 0
has text: I noticed that if I take out either subcell1_1 or subcell1_2 from the emitterCells Array, the problem goes away. I only encounter the problem where the emitter stops working when both subcell1_1 and subcell1_2 are in the emitterCells Array. Anyone have any ideas?
type: Comment

http://stackoverflow.com/comment/134718519
has text: Also, apart from `init` don't forget to make `new` `NS_UNAVAILABLE`, too.
type: QuestionComment
comment on: http://stackoverflow.com/q/76399199
type: Comment
score: 0

http://stackoverflow.com/comment/134892960
has text: Only iOS 14 devices i am testing are returnning /usr/lib/system/libdyld.dylib. I ran on one iPhone 12 ios 14.8 and it didnt return /usr/lib/dyld either.
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/135010563
score: 0
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment
has text: You can try `os_log` first https://developer.apple.com/documentation/os/logging/generating_log_messages_from_your_code?language=objc . Maybe it will appear in the Amazon device farm console.

http://stackoverflow.com/comment/135030574
comment on: http://stackoverflow.com/a/76430676
score: 0
type: AnswerComment
type: Comment
has text: Nice, it just printed "This is a debug message" in the console after opening the app, i put this in the main function.

file
tag name: file
type: Tag
tags question: http://stackoverflow.com/q/76480080

http://stackoverflow.com/comment/134898427
type: AnswerComment
has text: I see. Without a way to reproduce the problem from your device farm, I'm really powerless to help.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/76430676

http://stackoverflow.com/comment/134795245
type: Comment
has text: Please provide a [mcve] and also explain what "they will not work" means.
comment on: http://stackoverflow.com/q/76425767
score: 0
type: QuestionComment

http://stackoverflow.com/a/76469085
score: 7
type: Answer
answers question: http://stackoverflow.com/q/76455043
has body: In my case, I seemed to be linking against an older version of libiconv that was no longer available. I was able to fix this by going into Build Phases &gt; Link Binary With Libraries, removing the old versions of libiconv (in my case I was seeing libiconv.2.4.0.tbd and libiconv.2.4.0.dylib), and adding libiconv.tbd back using the + button.
upvote count: 7
downvote count: 0

http://stackoverflow.com/comment/134738071
has text: @Andrey neither of those answer the question. They're both about calling a property on a singleton, which is different from accessing the singleton instance as a class property of an interface.
type: QuestionComment
comment on: http://stackoverflow.com/q/76399199
type: Comment
score: 0

http://stackoverflow.com/comment/134803207
has text: The minimal reproducible example is the above code. The functions "setupEmitter" and "setupFireWorkEmitterCells" setup the animation. The other two snippets of code "StartFW" and "StopFW" start and stop the animation.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76425767
score: 0

caemittercell
tag name: caemittercell
tags question: http://stackoverflow.com/q/76425767
type: Tag

http://stackoverflow.com/comment/134791523
has text: I haven't found anything yet. There is `CGSOrderWindow` and `CGSOrderFrontConditionally` but if these functions worked at some point in earlier macOS releases, I sadly cannot figure out how to get them to work now.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76443344
type: QuestionComment

http://stackoverflow.com/comment/134804964
type: Comment
comment on: http://stackoverflow.com/q/76451404
has text: Good idea, but it seems that `toolTip` is not called when the toolTip should show, but only once when the toolbar item is added to the toolbar.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/135381225
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment
has text: @Lucilfer try the new attempt
score: 0

http://stackoverflow.com/comment/135039323
score: 0
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment
has text: Its printing this only. Jun 30 16:46:49 SHC[14579] <Error>: <private> Jun 30 16:46:49 SHC[14579] <Error>: <private> Jun 30 16:46:49 SHC[14579] <Error>: This is a debug message.

http://stackoverflow.com/comment/138379976
type: QuestionComment
has text: Were you able to figure out how to fix this issue? Currently experiencing the same thing.
score: 0
comment on: http://stackoverflow.com/q/76486081
type: Comment

http://stackoverflow.com/comment/134778223
score: 1
type: Comment
comment on: http://stackoverflow.com/q/76435609
has text: "Considering all we need now is just to check the v2 of the framework work as expected" For just that purpose, you can put a `DispatchSemaphore` before each callback-based API, `.wait()` it after calling registering the callback. It'll wait until you `.signal()` from inside the callback. Note: this will bring everything to a slow, synchronous grinding halt, which you probably expect
type: QuestionComment

http://stackoverflow.com/comment/134686854
type: Comment
has text: First you call `_destroyPersistentStoreAtURL:withType:options:error` and then via a notification you get a crash in a `NSFetchedResultsController`. So maybe don't destroy the store when you have an active NSFetchedResultsController
score: 0
comment on: http://stackoverflow.com/q/76381280
type: QuestionComment

http://stackoverflow.com/comment/134961949
comment on: http://stackoverflow.com/a/76430676
score: 0
type: AnswerComment
has text: @Lucilfer I've added a new hack, but I'm skeptical I can guess the solution without knowing what's going on.
type: Comment

http://stackoverflow.com/comment/134687768
type: Comment
has text: actually we calling destroyPersistentAndResetCoreDataObjects() at the time of logout..
score: 0
comment on: http://stackoverflow.com/q/76381280
type: QuestionComment

caemitterlayer
tag name: caemitterlayer
type: Tag
tags question: http://stackoverflow.com/q/76425767

http://stackoverflow.com/comment/134899738
has text: On all versions on my real phones, the x21 register works but on all online device farms, it returns 44E7E59A17333D2E90E3473269A3DAEA. Do the cloud change the register for dyld maybe?
score: 0
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment

autolayout
type: Tag
tag name: autolayout
tags question: http://stackoverflow.com/q/76536415
tags question: http://stackoverflow.com/q/77804229
tags question: http://stackoverflow.com/q/78914923

http://stackoverflow.com/comment/134893510
has text: On my own phones running versions lower than 15 does return correct uuid of dyld but when I run the ipa on real device farms, it doesn't. The premain function doesn't work in these devices? They are real devices tho.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76430676

http://stackoverflow.com/comment/134882739
comment on: http://stackoverflow.com/q/76476767
score: 0
has text: @Willeke, it looks like only top horizontal NSToolbar can be customizable - see https://stackoverflow.com/questions/3977343/nstoolbar-on-bottom-of-window.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/134884533
comment on: http://stackoverflow.com/q/76476767
score: 0
type: QuestionComment
type: Comment
has text: So the vertical toolbar is not a `NSToolbar`?

http://stackoverflow.com/comment/135010807
has text: Like this `#import <os/log.h> os_log_with_type(OS_LOG_DEFAULT, OS_LOG_TYPE_ERROR, "This is a debug message.");`
comment on: http://stackoverflow.com/a/76430676
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134803452
comment on: http://stackoverflow.com/q/76425767
score: 0
type: QuestionComment
has text: "The minimal reproducible example is the above code" So you claim that the code you've provided is sufficient for me to run the app and see the issue, without having to make any further guesses as to what you are doing in your app to summon the animation? Because I claim that it isn't.
type: Comment

http://stackoverflow.com/comment/135896333
score: 0
comment on: http://stackoverflow.com/q/76473669
type: QuestionComment
has text: hi author, did you fix that? I have the same problem too
type: Comment

http://stackoverflow.com/comment/134898202
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/76430676
has text: The app crashed with the x20 register. With x21 register it didn't crash and returned a different uuid which is not even libdyld.dylib. Env: iPhone 11 iOS 14.0.1, the uuid it returned: 44E7E59A17333D2E90E3473269A3DAEA. On an iPhone 12 Pro running 14.4 it also returns the same uuid, looks like the x21 returns a constant uuid

http://stackoverflow.com/comment/134836019
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76461631
has text: You might be able to use IOSs dual mode Bluetooth support - https://developer.apple.com/wwdc19/901 ?

http://stackoverflow.com/comment/134940491
score: 0
comment on: http://stackoverflow.com/a/76530285
type: AnswerComment
type: Comment
has text: That is not the correct way to setup a child view controller in a container view controller. Please see the [Creating a custom container view controller](https://developer.apple.com/documentation/uikit/view_controllers/creating_a_custom_container_view_controller?language=objc) document from Apple.

smb
type: Tag
tags question: http://stackoverflow.com/q/76520858
tag name: smb

face-id
type: Tag
tag name: face-id
tags question: http://stackoverflow.com/q/76403207

http://stackoverflow.com/comment/134906644
comment on: http://stackoverflow.com/a/76430676
has text: @Lucilfer new day , new hack to try out.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134933364
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76528271
type: Comment
has text: So if you want to trigger GlobalSequencerViewController's action, then add the "GlobalSequencerViewController" as a child view controller of MainViewController. instead of adding it as subView of MainViewController

http://stackoverflow.com/comment/135010514
comment on: http://stackoverflow.com/a/76430676
score: 0
has text: I've checked their docs https://docs.aws.amazon.com/sdk-for-swift/latest/developer-guide/using-logging.html It's a little bit of a pain that it's dedicated for Swift. There is a wrapper https://github.com/srinikhil-07/swift-log-objc but that's extra setup
type: AnswerComment
type: Comment

pointers
type: Tag
tag name: pointers
tags question: http://stackoverflow.com/q/76475957
tags question: http://stackoverflow.com/q/76778283
tags question: http://stackoverflow.com/q/78038240

http://stackoverflow.com/comment/134975458
score: 0
has text: The question was different and the answer was specific to make the button enable to fire the childVC's button action.
type: QuestionComment
comment on: http://stackoverflow.com/q/76528271
type: Comment

http://stackoverflow.com/comment/134755809
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76420865
type: Comment
has text: Yes you're right @Larme I got the issue of type right? but I created it but still gives error that and this one ```Passing 'NSError' to parameter of incompatible type 'CF_RETURNS_RETAINED CFErrorRef _Nullable *' (aka 'struct __CFError **')```

http://stackoverflow.com/comment/134718517
comment on: http://stackoverflow.com/q/76399199
type: QuestionComment
has text: There are many similar queastions already: https://stackoverflow.com/questions/5381085/how-to-create-singleton-class-in-objective-c, https://stackoverflow.com/questions/46319731/objective-c-singleton-implementation, https://stackoverflow.com/questions/7568935/how-do-i-implement-an-objective-c-singleton-that-is-compatible-with-arc, https://stackoverflow.com/questions/145154/what-should-my-objective-c-singleton-look-like, https://stackoverflow.com/questions/16208041/what-is-the-use-of-singleton-class-in-objective-c.
score: 1
type: Comment

http://stackoverflow.com/comment/134846481
score: 1
comment on: http://stackoverflow.com/q/76475957
has text: General rule is it's a bad idea to convert from ObjC to Swift line by line. It's not always beneficial to even convert a single function. In many cases you need to look at a bigger picture: which inputs you need to handle, which outputs you expect, and are there Swift libraries that already handle what previously was done by hand. This especially applies to pointers - there's almost no reasons to use them in Swift. So please provide more context on what you are converting, and what are the inputs, and expected outputs
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/134734262
comment on: http://stackoverflow.com/q/76399199
score: 0
has text: Apple just changed the interfaces from a getter to a property. `NSFileManager.defaultManager` exists since OS X 10.0. Is the question about the declaration of the property or about the implementation of the singleton?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/134898240
type: AnswerComment
type: Comment
score: 0
has text: -- on my real phone manually iPhone 11 pro 14.7.1 x21 returns correct dyld uuid.
comment on: http://stackoverflow.com/a/76430676

http://stackoverflow.com/comment/134892706
has text: - I ran it on iPhone 6s 14.7.1 as well and it returned uuid of /usr/lib/system/libdyld.dylib too.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76430676

http://stackoverflow.com/comment/134806948
type: QuestionComment
has text: A mouse down event might work but has two serious downsides: it has side effects, even if you have it click something like the window's titlebar, and it only works if the window is not obscured.
comment on: http://stackoverflow.com/q/76443344
score: 0
type: Comment

http://stackoverflow.com/comment/134901746
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/76430676
has text: @Lucilfer try the new hack please.

qt
tag name: qt
tags question: http://stackoverflow.com/q/76401182
type: Tag
tags question: http://stackoverflow.com/q/78106703
tags question: http://stackoverflow.com/q/78353070
tags question: http://stackoverflow.com/q/78692256
tags question: http://stackoverflow.com/q/79109731

http://stackoverflow.com/comment/134738062
type: QuestionComment
comment on: http://stackoverflow.com/q/76399199
has text: @Willeke the question is about implementing the singleton pattern where the singleton reference is exposed as a class property.
score: 0
type: Comment

http://stackoverflow.com/comment/134951621
has text: I recently moved from android to iOS 2 weeks ago so very less knowledge. Can you please add a log code in your answer and I will send these logs to an external URL. The farms don't let us use debugger, we just upload IPA and it works as a real phone.
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/134805902
score: 0
comment on: http://stackoverflow.com/a/76452019
type: AnswerComment
type: Comment
has text: I tried it, but this notification is sent dozens of time for each user action. I managed to access the toolbar item view (by traversing the view hierarchy) and to add a tooltip rectangle. This is is not the most elegant, but I can update the tooltip only when it shows.

http://stackoverflow.com/comment/134847520
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76461631
has text: Yes, I don't believe that there is any way for your app to interact with your peripheral unless it also supports the GATT profile.

http://stackoverflow.com/comment/134921943
comment on: http://stackoverflow.com/q/76521757
score: 0
has text: In any case if you declare a class as *source of truth* in a SwiftUI view you have to mark it as `@StateObject`. And a SwiftUI view is not a controller. A better way to handle the delegate is a view model (another class conforming to `@ObservableObject`) and `@Publish` the changes. It can be even a subclass of `NSObject`.
type: Comment
type: QuestionComment

nstoolbaritem
tags question: http://stackoverflow.com/q/76451404
type: Tag
tag name: nstoolbaritem

http://stackoverflow.com/comment/134951656
has text: Ok fair enough, but does the farm provide you a way to see the console or stdout output the device generates in the web page somehow?
score: 0
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134940065
comment on: http://stackoverflow.com/a/76430676
score: 0
has text: @Lucilfer Can you use a debugger or at least print logs on this aws farm? Without that I essentially keep guessing. And the last result you provided to the best of my knowledge should technically not happen, so I'm really confused now. If we could run some diagnostic code on the farm and at least log stuff that could help finding a solution.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134790970
has text: Have a look at this question: https://stackoverflow.com/questions/13760760/how-to-get-windows-of-nsrunningapplication. It should be possible to get all windows of a running application, but I'm not sure whether there is API to move a specific window into the foreground. Probably you have to examine the CoreGraphics APIs for methods that are not exposed on NSApplication etc.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76443344

http://stackoverflow.com/comment/134780478
type: QuestionComment
score: 0
has text: No, my class is in the owner files, and the iboutlets that I connect don't work
type: Comment
comment on: http://stackoverflow.com/q/76428958

byte
type: Tag
tag name: byte
tags question: http://stackoverflow.com/q/76475957

http://stackoverflow.com/comment/134948419
score: 0
comment on: http://stackoverflow.com/a/76529449
type: AnswerComment
has text: ```https://github.com/swisspol/GCDWebServer``` would be a better solution for Http as it is well documented and maintained until the start of this year.
type: Comment

http://stackoverflow.com/comment/135009006
comment on: http://stackoverflow.com/a/76430676
score: 0
has text: @Lucilfer how can you inspect what's going on in the farm with your app? Do you see the app screen somehow there? Or in other words what can you do on the farm?
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/134934736
comment on: http://stackoverflow.com/q/76521757
score: 0
type: QuestionComment
type: Comment
has text: Thanks for your answer. It leads me to the solution I post below. Cheers

http://stackoverflow.com/comment/134779751
type: QuestionComment
type: Comment
has text: Apple explicitly tells us that semaphores are unsafe in conjunction with Swift concurrency. https://developer.apple.com/videos/play/wwdc2021/10254?time=1558. The function in question should to be, itself, an `async` method.
score: 0
comment on: http://stackoverflow.com/q/76435609

http://stackoverflow.com/comment/134925578
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
has text: This new hack also gave uuid of /usr/lib/system/libdyld.dylib :((
type: Comment
score: 0

server
type: Tag
tags question: http://stackoverflow.com/q/76520858
tag name: server

http://stackoverflow.com/comment/135009676
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
type: Comment
has text: There is an inspect option named Console but it doesn't print NSLog there. I basically install the ipa and work on it.
score: 0

http://stackoverflow.com/comment/134947924
score: 0
has text: If you are refering to ```https://github.com/Pentaloop/PLWebServer``` then it does not mention SMB... Also it is HTTP which is not what I am looking for...
comment on: http://stackoverflow.com/a/76529449
type: AnswerComment
type: Comment

singleton
tags question: http://stackoverflow.com/q/76399199
type: Tag
tag name: singleton
tags question: http://stackoverflow.com/q/78664431

http://stackoverflow.com/comment/134933276
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76528271
has text: So I essentially just have two view controllers, the main one and one that is added as a subview. The subviews button is wired up to its respective derived test action appropriately. For some reason when I click buttons within the subview that are wired to its assigned view controller, it cannot trigger the derived actions, only the actions within the base class. I'm wondering if maybe it has something to do with the main window being a storyboard and the subview being an xib. Maybe the xibs File's Owner custom class is being overwritten when it's loaded by the Main View.
type: Comment

touch-id
tags question: http://stackoverflow.com/q/76403207
tag name: touch-id
type: Tag

http://stackoverflow.com/comment/134794341
comment on: http://stackoverflow.com/q/76443344
has text: Did you try a mouse-down event?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/134806048
type: AnswerComment
type: Comment
has text: Does it matter if this notification is sent more often than needed? It still lets you correctly update the tooltips. No need to dig into the private subview structure of the toolbar item.
score: 0
comment on: http://stackoverflow.com/a/76452019

cmake
type: Tag
tag name: cmake
tags question: http://stackoverflow.com/q/76486081
tags question: http://stackoverflow.com/q/78492779
tags question: http://stackoverflow.com/q/78705702

pch
tag name: pch
type: Tag
tags question: http://stackoverflow.com/q/76473669
tags question: http://stackoverflow.com/q/77518826

ios-bluetooth
tags question: http://stackoverflow.com/q/76461631
type: Tag
tag name: ios-bluetooth
tags question: http://stackoverflow.com/q/78373566

http://stackoverflow.com/comment/134897929
comment on: http://stackoverflow.com/a/76430676
type: AnswerComment
has text: The app is crashing on my farm devices for iOS versions below 15. It works on iOS 15 & 16. I used x4 register.
type: Comment
score: 0

http://stackoverflow.com/a/78948571
score: 0
type: Answer
answers question: http://stackoverflow.com/q/76420865
has body: try this workaround it will fix your problem. but it's a temporary fix you have to make these changes on every install of pods - SecTrustResultType result; - OSStatus errorCode = SecTrustEvaluate(serverTrust, &amp;result); + CFErrorRef error; + BOOL trusted = SecTrustEvaluateWithError(serverTrust, &amp;error); - BOOL evaluatesAsTrusted = (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed); - if (errorCode == errSecSuccess &amp;&amp; evaluatesAsTrusted) { + if (trusted &amp;&amp; error == nil) {

uidatepicker
tag name: uidatepicker
tags question: http://stackoverflow.com/q/76513922
type: Tag

http://stackoverflow.com/q/76651162
type: Question
tagged with: contacts
has title: iOS - Can not sort contacts same to Contacts framework order
has comment: http://stackoverflow.com/comment/135142481
type: UnansweredQuestion
has body: Im handling a screen which show contacts from contactDictionary with same native device order. I have seen this method in Contacts framework. /*! The contact comparator for a given sort order. */ + (NSComparator)comparatorForNameSortOrder:(CNContactSortOrder)sortOrder; But when I call NSComparator comparator = [CNContact comparatorForNameSortOrder:CNContactSortOrderUserDefault]; NSArray&lt;CNContact *&gt; *sortedContacts = [listContacts sortedArrayUsingComparator:comparator]; Its not same to when I fetch all contact with CNContactSortOrderUserDefault CNContactFetchRequest *fetchRequest = [[CNContactFetchRequest alloc] initWithKeysToFetch:@[ [CNContactFormatter descriptorForRequiredKeysForStyle:CNContactFormatterStyleFullName], CNContactPhoneNumbersKey, CNContactOrganizationNameKey, CNContactJobTitleKey, CNContactBirthdayKey, CNContactImageDataKey, CNContactThumbnailImageDataKey, CNContactImageDataAvailableKey, CNContactEmailAddressesKey, CNContactPostalAddressesKey, CNContactDatesKey, CNContactSocialProfilesKey, CNContactPhoneticGivenNameKey, CNContactPhoneticMiddleNameKey, CNContactPhoneticFamilyNameKey, CNContactNicknameKey ]]; CNContactSortOrder sortOder = CNContactSortOrderUserDefault; fetchRequest.sortOrder = sortOder; NSError *fetchError = nil; [contactStore enumerateContactsWithFetchRequest:fetchRequest error:&amp;fetchError usingBlock:^(CNContact * _Nonnull contact, BOOL * _Nonnull stop){}]; List contact when fetch all: !Saz \Sa “Sa #Sa %Sa ‘Sa (Sa )Sa *Sa }Sa {Sa ,Sa -Sa A Sa .Sa /Sa :Sa Sa !!Sa !?Saz ;Sa ?Sa @Sa [Sa \Sa ]Sa ??Saz ]!Sa ![Sa !!Sa ]?Sa ?[Sa &amp;?Saz Sa ! =Sa 123hange My list after sort by comparatorForNameSortOrder: -Sa ,Sa ;Sa :Sa Sa ! !!Sa !!Sa !?Saz ![Sa !Saz ??Saz ?[Sa ?Sa .Sa ‘Sa “Sa (Sa )Sa [Sa ]!Sa ]?Sa ]Sa {Sa }Sa @Sa *Sa /Sa \Sa \Sa &amp;?Saz #Sa %Sa =Sa 123hange A Sa Sa Thanks for watching.
has comment: http://stackoverflow.com/comment/135143004
tagged with: ios
upvote count: 2
tagged with: cncontactstore
tagged with: objective-c
downvote count: 0
tagged with: cncontact
answer count: 0
has comment: http://stackoverflow.com/comment/135142905
favorite count: 0
score: 2

cncontact
type: Tag
tags question: http://stackoverflow.com/q/76651162
tag name: cncontact

http://stackoverflow.com/a/76695377
score: 2
type: Answer
has comment: http://stackoverflow.com/comment/135217712
has comment: http://stackoverflow.com/comment/135217772
accepted answer of: http://stackoverflow.com/q/76694493
answers question: http://stackoverflow.com/q/76694493
has body: You can't include standard library headers in the Metal shader files. Section 1.4.4 of Metal Shading Language Specification says Do not use the C++ standard library in Metal code. Instead, Metal has its own standard library, as discussed in section 5 of this document. That doesn't stop you from including it in the Objective-C code. What you should do is include the right header conditionally based on where the header is included or for which "platform" the source file is compiled. So, in your case it would look like this: #ifdef __METAL_VERSION__ #include <metal_stdlib> using namespace metal; #else #include <math.h> #endif #include <simd/simd.h> extern inline simd_ushort2 test(simd_float2 pos) { const float H = 16.0; return (simd_ushort2){ (ushort)ceilf(pos.x/H), (ushort)ceilf(pos.y/H) }; }
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/135217671

http://stackoverflow.com/comment/135165786
has text: Thanks, @RobNapier. Yes is part of Metal, however this bug started in early versions when I wasn't using Metal at all. Must be an OS bug.
comment on: http://stackoverflow.com/q/76649829
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/76559806
has title: How to create unit test for UISceneConnectionOptions?
tagged with: ios
has body: Is there a way to set the launch URL and source application property of connectionOptions/UISceneConnectionOptions for testing SceneDelegate? I see that the properties of UISceneConnectionOptions are all read-only but I was wondering if there are any workarounds to this. My project has an existing unit test for AppDelegate's launchOptions, and is able to set the url and source application, but I'm getting errors that the property is 'get' only with connectionOptions.
type: Question
tagged with: objective-c
type: UnansweredQuestion
favorite count: 0
tagged with: uiscenedelegate
score: 2
tagged with: swift
downvote count: 0
tagged with: appdelegate
answer count: 0
upvote count: 2

http://stackoverflow.com/comment/135090287
has text: That sounds like a new question. I recommend closing this one as "not reproducible" and opening a new one with the details of your issue. MPRemoteCommandCenter is not attached to view controllers in anyway. It's behavior isn't going to change unless you do write code to interact with it.
type: Comment
comment on: http://stackoverflow.com/q/76577713
score: 0
type: QuestionComment

http://stackoverflow.com/a/76586958
score: 1
has body: NSString can work with encodings. Extract the data from the string and write it to disk: NSData *dataBE = [fileName dataUsingEncoding:NSUTF16BigEndianStringEncoding]; [dataBE writeToFile:@"/Users/user/Desktop/test" options:NSDataWritingAtomic error:&error]; or write the string to disk: [fileName writeToFile:@"/Users/user/Desktop/test" atomically:YES encoding:NSUTF16BigEndianStringEncoding error:&error];
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/76579270
type: Answer
answers question: http://stackoverflow.com/q/76579270
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/76621276
linked to: http://stackoverflow.com/q/21737444
score: 2
type: Question
type: UnansweredQuestion
downvote count: 0
tagged with: macos
favorite count: 0
has body: I'm trying to create a custom authentication plugin for MacOS Ventura (instead of using a password i want to use a 4 digit code), and i was going to try and follow the code from this repository NameAndPassword, since i saw alot of positive feedback from this repository. But i follow the steps to add the .bundle file and update the authorizationdb but it just makes my MacOS stop working, after the Mac logo the screen just stays black. I have follow the steps from this links: Creating an OS X authentication plugin Custom login/lock screen in OS X Mavericks How to customize the Mac OSX login? Does anyone know if for MacOS Ventura the configuration to add a authorization plugin have changed, and does anyone can confirm if the NameAndPassword plugin works for MacOS Ventura?
upvote count: 2
linked to: http://stackoverflow.com/q/45719864
tagged with: sfauthorizationpluginview
tagged with: objective-c
has answer: http://stackoverflow.com/a/79007237
tagged with: authentication
has title: How to add a custom authentication plugin for MacOS Ventura?
tagged with: xcode
answer count: 1
linked to: http://stackoverflow.com/q/21582995

http://stackoverflow.com/q/76649829
answer count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/135165786
tagged with: objective-c
tagged with: crash
score: 0
tagged with: tvos
has comment: http://stackoverflow.com/comment/135139432
has body: *** -[NSObject allocWithZone:]: attempt to allocate an object of class 'AGXA12FamilyCommandBuffer' failed happens on tvOS to many users that use my product. Does anybody know what this class is AGXA12FamilyCommandBuffer and what could cause the crash?
type: Question
tagged with: swift
type: UnansweredQuestion
has title: How to fix crash `*** -[NSObject allocWithZone:]: attempt to allocate object of class 'AGXA12FamilyCommandBuffer' failed`?

http://stackoverflow.com/q/76628939
type: Question
tagged with: bigdecimal
type: UnansweredQuestion
has body: I have a problem with converting NSString to NSDecimalNumber. NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: --------------------------------------------------------------------ㅍ"); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.0001"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.0002"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.0003"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.0004"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.0005"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.0006"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.0007"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.0008"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.0009"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.001"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.002"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.003"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.004"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.005"]); NSLog(@"calcuMax_test - calculateMaxForCross feeRateDecimal: %@",[NSDecimalNumber decimalNumberWithString:@"0.006"]); NSLog(@"calcuMax_test - c…
linked to: http://stackoverflow.com/q/588004
answer count: 0
tagged with: ios
tagged with: objective-c
has title: How do I fix the conversion problem to the DecimalNumberWithString function?
has comment: http://stackoverflow.com/comment/135107257
score: 0
has comment: http://stackoverflow.com/comment/135103987

tuist
type: Tag
tag name: tuist
tags question: http://stackoverflow.com/q/76668394

http://stackoverflow.com/q/76560981
has title: How can I wrap Objective-C code for visionOS only?
upvote count: 4
has answer: http://stackoverflow.com/a/76608381
tagged with: objective-c
score: 4
tagged with: xcode
answer count: 3
tagged with: visionos
type: Question
downvote count: 0
has body: I have the following code in Objective-C: if (@available(iOS 13.0, tvOS 13.0, *)) { indicator.indicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleLarge; } else { indicator.indicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; } But this is producing an error. 'UIActivityIndicatorViewStyleWhiteLarge' is unavailable: not available on xrOS I think I need that first conditional to get run so it doesn't even try to access UIActivityIndicatorViewStyleWhiteLarge. But when I change the line to if (@available(iOS 13.0, tvOS 13.0, visionOS 1.0, *)). I get the following error: Unrecognized platform name visionOS I also tried changing it to xrOS 1.0 (since I heard that some internal usages had it as xrOS for a while. And while I don't get the second compiler error, it does still say it's unavailable. Any ideas on how to fix this?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/76561973
favorite count: 0
has answer: http://stackoverflow.com/a/77806413

http://stackoverflow.com/comment/135186437
type: Comment
has text: Is there a [mac-privateapi] tag (or equivalent)? I couldn’t find it if there is; sorry.
score: 0
comment on: http://stackoverflow.com/q/76677790
type: QuestionComment

http://stackoverflow.com/comment/135011698
type: QuestionComment
comment on: http://stackoverflow.com/q/76568196
score: 1
type: Comment
has text: *"... subclasses UIImageView"* -- will these custom views also have (other) images? If not, is there a reason you're generating `UIImage` from the shape layer? *"... various types of complex shapes"* -- I think you need to show some complex shape examples, and clarify what you want the results to look like. For example, doing something the two examples here - https://imgur.com/a/JuVLotk - is fairly straightforward task.

http://stackoverflow.com/q/76579270
accepted answer: http://stackoverflow.com/a/76586958
has comment: http://stackoverflow.com/comment/135022336
has comment: http://stackoverflow.com/comment/135021477
tagged with: hex
has comment: http://stackoverflow.com/comment/135021768
has comment: http://stackoverflow.com/comment/135024760
favorite count: 0
has comment: http://stackoverflow.com/comment/135019506
score: 0
has title: Write Unicode text to a file in 'wb' mode using C and Objective C?
has comment: http://stackoverflow.com/comment/135024617
has comment: http://stackoverflow.com/comment/135020323
has comment: http://stackoverflow.com/comment/135020845
has comment: http://stackoverflow.com/comment/135022284
has comment: http://stackoverflow.com/comment/135022378
type: AnsweredQuestion
tagged with: unicode
has comment: http://stackoverflow.com/comment/135024968
has body: I have this unicode text which contains unicode characters NSString *fileName = @"Tên tình bạn dưới tình yêu.mp3"; const char *cStringFile = [fileName UTF8String]; Now I need to save this string in hex/binary format to a file in this format T ê n t ì n h b ạ n 54 EA 6E 20 74 EC 6E 68 20 62 1EA1 6E ...... and so on As you can see the character 'ê' is written as EA, but 'ạ' is written as '1E A1' which is correct as per the Vietnamese character set (https://vietunicode.sourceforge.net/charset/) To achieve this, this is the code, I used to write multibyte characters to the file // Determine the required size for the wchar_t string size_t input_length = strlen(cStringFile); size_t output_length = mbstowcs(NULL, stringText, input_length); // Allocate memory for the wchar_t string wchar_t *output = (wchar_t *)malloc((output_length + 1) * sizeof(wchar_t)); if (output == NULL) { printf("Memory allocation failed.\n"); return 1; } // Convert the C string to wchar_t string mbstowcs(output, cStringFile, input_length); output[output_length] = L'\0'; // Add null-termination unsigned long lenth = wcslen(output); // Loop through each character in the Unicode text for (int i = 0; i < lenth; i++) { // Write the Unicode character to the file fwprintf(fd, L"%lc", output[i]); } // Free the allocated memory free(output); Now the issue is the multibyte characters are not being converted to the correct HEX value with the code above Example 1) For this text = "Tên tình bạn dưới tình yêu.mp3" Expected: T ê n t ì n h b ạ n 54 EA 6E 20 74 EC 6E 68 20 62 1EA1 6E ...... and so on Actual: Wrong! T ê n t ì n h b ạ n 54 C3AA 6E 20 74 C3AC 6E 68 20 62 E1BAA1 6E ...... and so on Example 2) For this text = "最佳歌曲在这里.mp3" Expected: 最-\u6700 佳-\u4F73 歌-\u6B4C 歌-\u66F2 曲-\u5728 67 00 4F 73 6B 4C 66 F2 57 28 ..... Actual: Wrong! 最 佳 歌 歌 曲 E6 9C 80 BD B3 AD 8C 9B B2 9C So I think it is writing 2 bytes in the case of 'ê' and 'ì' and 3 bytes in the case of 'ạ'. The code is not wri…
has comment: http://stackoverflow.com/comment/135023217
upvote count: 1
has comment: http://stackoverflow.com/comment/135019936
has comment: http://stackoverflow.com/comment/135021907
has comment: http://stackoverflow.com/comment/135021857
has answer: http://stackoverflow.com/a/76586958
has comment: http://stackoverflow.com/comment/135025604
has comment: http://stackoverflow.com/comment/135033302
tagged with: http://stackoverflow.com/tag/c
has comment: http://stackoverflow.com/comment/135025866
has comment: http://stackoverflow.com/comment/135021729
has comment: http://stackoverflow.com/comment/135026121
has comment: http://stackoverflow.com/comment/135032134
has comment: http://stackoverflow.com/comment/135020075
tagged with: multibyte-characters
has comment: http://stackoverflow.com/comment/135021868
has comment: http://stackoverflow.com/comment/135024811
has comment: http://stackoverflow.com/comment/135023743
has comment: http://stackoverflow.com/comment/135024605
downvote count: 1
has comment: http://stackoverflow.com/comment/135020858
has comment: http://stackoverflow.com/comment/135025915
has comment: http://stackoverflow.com/comment/135032055
type: Question
has comment: http://stackoverflow.com/comment/135032044
answer count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135019761

http://stackoverflow.com/q/76668394
tagged with: string-literals
upvote count: 1
tagged with: xcode
score: 1
has body: I'd like to use Tuist and SwiftGen to generate Localizable strings that are also available for Objective-C. When I generate my TuistStrings+{name}.strings files they contain what is written in my strings stencil, so I think I did something wrong. Here is my configuration in the Project.swift in Manifests let project = Project( name: &quot;{name}&quot;, organizationName: &quot;{name}&quot;, settings: .settings( configurations: Configuration.{name}Configuration(basic: true) ), targets: targets, schemes: schemes, resourceSynthesizers: [ .strings(), .assets() ] ) I've tested to use this in my stencil strings: inputs: path/to/Localizable.strings outputs: - templateName: objc-h output: Localizable.h - templateName: objc-m output: Localizable.m My workspace I've tried to rename my stencil to Assets.stencil and it does the same thing to my TuistAssets file.
has title: Generate objective-c string literal with Tuist
type: Question
type: UnansweredQuestion
downvote count: 0
favorite count: 0
answer count: 0
tagged with: tuist
tagged with: swiftgen
tagged with: objective-c

http://stackoverflow.com/comment/135024605
score: 0
type: QuestionComment
has text: @IanAbbott Actually encoding ASCII characters as two bytes with a dummy 00 is exactly what the software does which we need to match! I thought 00 was a separator all this time! So they are actually encoding in UTF-16BE. That is interesting. So 'T' = 00 54 : ê = 00 EA : n = 00 6E : ạ = 1E A1 : If ASCII characters are encoded as two bytes, How many bytes will Unicode characters be encoded in, with UTF-16BE? The software that does this crazy obfuscation is called Serato - a DJ management tool.
comment on: http://stackoverflow.com/q/76579270
type: Comment

http://stackoverflow.com/comment/135020858
score: 0
type: Comment
has text: @Jabberwocky I'm on macOS. wchar is found in <wchar.h> Not sure if it is Microsoft dependent?
comment on: http://stackoverflow.com/q/76579270
type: QuestionComment

http://stackoverflow.com/q/76597435
score: 1
has title: Search RTF for Bold font
tagged with: ios
tagged with: rtf
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/135055097
answer count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135054865
favorite count: 0
has answer: http://stackoverflow.com/a/76602592
type: AnsweredQuestion
has body: In my app I sort through thousands of lines of questions to create a property list file. As part of this, I need it to detect which texts are in bold, as those are the ones marked as the correct answer. It would be something like 1. What is 1+1? A. 2 B. 3 C. 4 D. 5 And in this case, A. 2 would be BOLD. What I'm having issues with is detecting the bold text to easily load all the correct answers. What I am trying so far returns absolutely nothing. I simply drag the RTF into the sidebar in Xcode to make sure it is accessible. It is, and everything in this code runs fine, except for trying to find the bold text: -(void)editTextFile { NSError *error = nil; NSString *filepath = [[NSBundle mainBundle] pathForResource:@"2024ROMANSEDITED" ofType:@"rtf"]; NSAttributedString *fileContent = [[NSAttributedString alloc] initWithFileURL:[NSURL fileURLWithPath:filepath] options:@{NSDocumentTypeDocumentAttribute: NSRTFTextDocumentType} documentAttributes:nil error:&error]; NSArray *questionItems = [fileContent.string componentsSeparatedByString:@"\n\n"]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsPath = paths.firstObject; NSString *plistPath = [documentsPath stringByAppendingPathComponent:@"chatgptoptions.plist"]; NSMutableArray *questions = [NSMutableArray array]; for (NSString *questionItem in questionItems) { NSArray *items = [questionItem componentsSeparatedByString:@"\n"]; NSString *theQuestion = items.firstObject; NSArray *answerOptions = [items subarrayWithRange:NSMakeRange(1, items.count - 1)]; NSString *correctAnswerIndex = @""; for (NSUInteger i = 0; i < answerOptions.count; i++) { NSString *answerOption = answerOptions[i]; NSRegularExpression *boldRegex = [NSRegularExpression regularExpressionWithPattern:@"(.*?)<\\/b>" options:NSRegularExpressionCaseInsensitive error:nil]; NSArray *boldMatches = [boldRegex matchesInString:answerOption options:0 range:NSMakeRange(0, answerOption.length)]; if (boldMa…
downvote count: 0
accepted answer: http://stackoverflow.com/a/76602592

http://stackoverflow.com/q/76595578
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/135056057
tagged with: objective-c
has title: port swift in react native deprecated function
has body: i'm porting swift code on React Native with Objective-C, there is a function that is deprecated what's the correct one fixing with void doesn't work if i try to import swift func in react native and then run the app the code in RNWebViewManager and AwesomeProject...Header is respectively RNWebViewManager import Foundation @objc(RNWebVeiewManager) class RNWebViewManager(): RCTViewManager { override func view() -> UIView! { let label = UILabel() label.text = "hello there" label.textAlignment = .center return label } } AwesomeProject...Header #import "React/RCTBridgeModule.h" #import "React/RCTViewManager.h"
has comment: http://stackoverflow.com/comment/135054493
has comment: http://stackoverflow.com/comment/135058875
tagged with: react-native
has comment: http://stackoverflow.com/comment/135058992
score: 0
has comment: http://stackoverflow.com/comment/135053236
has comment: http://stackoverflow.com/comment/135052340
type: Question

http://stackoverflow.com/comment/135082214
score: 0
type: Comment
has text: zero means location unknown. Have you tried Freeway drive?
comment on: http://stackoverflow.com/q/76615959
type: QuestionComment

http://stackoverflow.com/comment/135021868
type: QuestionComment
has text: @KamyFC The first column does not count. That is the actual Unicode code point U+1EA1. In UTF-8 it is represented by the bytes 'E1 BA A1'. In UTF-16LE it is represented by the bytes 'A1 1E'. In UTF-16BE it is represented by the bytes '1E A1'. In UTF-32LE it is represented by the bytes 'A1 1E 00 00'. In UTF-32BE it is represented by the bytes '00 00 1E A1'.
comment on: http://stackoverflow.com/q/76579270
type: Comment
score: 0

http://stackoverflow.com/q/76633529
tagged with: uicollectionview
score: 0
tagged with: uisheetpresentationcontroller
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/135241894
has comment: http://stackoverflow.com/comment/135240415
has title: objc - How to disable the present view bounces
answer count: 0
has body: I use the following code to present an NavigationController GridMenuViewController* vc = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"GridMenuViewControllerID"]; GridMenuNavigationController *nav = [[GridMenuNavigationController alloc] initWithRootViewController:vc]; vc.sheetPresentationController.prefersScrollingExpandsWhenScrolledToEdge = NO; nav.modalPresentationStyle = UIModalPresentationPageSheet; if (@available(iOS 16.0, *)) { if (nav.sheetPresentationController) { id detent = [UISheetPresentationControllerDetent customDetentWithIdentifier:UISheetPresentationControllerDetentIdentifierLarge resolver:^CGFloat(id<UISheetPresentationControllerDetentResolutionContext> _Nonnull context) { return [[UIScreen mainScreen] bounds].size.height * 0.6; }]; nav.sheetPresentationController.detents = @[detent]; nav.sheetPresentationController.prefersGrabberVisible = YES; } } nav.sheetPresentationController.prefersScrollingExpandsWhenScrolledToEdge = NO; [self presentViewController:nav animated:YES completion:nil]; I woluld like to disable the bounces when scroll up the present view, how can I do that? Support video https://www.youtube.com/watch?v=P53ZPxzdWCU I tried so many code like if (@available(iOS 11.0, *)) { self.collectionView.contentInsetAdjustmentBehavior = 2; } else { self.collectionView.automaticallyAdjustsScrollIndicatorInsets = NO; } self.collectionView.verticalScrollIndicatorInsets = UIEdgeInsetsMake(0, 0, self.view.safeAreaInsets.bottom, 0); - (void)scrollViewDidScroll:(UIScrollView *)scrollView { [scrollView setContentOffset: CGPointMake(scrollView.contentOffset.x, 0)]; } I expecting there no any bounces behavior when scroll up.
tagged with: ios
type: Question
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135224331

http://stackoverflow.com/q/76615959
has title: Location Manger is not updating location on ios 16+
has comment: http://stackoverflow.com/comment/135085598
has body: I am using this code snippet which enables location tracking - (void)enableOrDisableLocationTracking { NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; NSInteger trackingSetting = [userDefaults integerForKey:@"trackingSetting"]; if (trackingSetting == 0) { NSLog(@"Location tracking is enabled"); self.locationTracker = [[CustomLocationTracker alloc] init]; self.locationTracker.delegate = self; [self.locationTracker.normalLocationManager requestAlwaysAuthorization]; NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; NSInteger gpsSetting = [userDefaults integerForKey:@"gpsSetting"]; if (self.sharedModel.isFollowMeActive) { if (gpsSetting > 3) { [self.locationTracker updateGPSSensitivity:gpsSetting]; [self.locationTracker updateSignificantGPSSensitivity:gpsSetting]; } else { [self.locationTracker updateGPSSensitivity:3]; [self.locationTracker updateSignificantGPSSensitivity:3]; } } else { [self.locationTracker updateGPSSensitivity:gpsSetting]; [self.locationTracker updateSignificantGPSSensitivity:gpsSetting]; } [self.locationTracker.normalLocationManager startUpdatingLocation]; // Significant location changes [self.locationTracker.significantLocationManager requestAlwaysAuthorization]; [self.locationTracker.significantLocationManager startMonitoringSignificantLocationChanges]; switch (CLLocationManager.authorizationStatus) { case kCLAuthorizationStatusDenied: { NSLog(@"User denied location access request"); [self.locationTracker.normalLocationManager requestAlwaysAuthorization]; UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Limited Functionality" message:@"GPS Denied. Go to Settings and set Allow Location Access to Always" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; }]; [a…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/135082258
score: 1
linked to: http://stackoverflow.com/q/37544514
linked to: http://stackoverflow.com/q/74588726
tagged with: ios
upvote count: 2
has comment: http://stackoverflow.com/comment/135085370
has comment: http://stackoverflow.com/comment/135082214
tagged with: objective-c
downvote count: 1
tagged with: core-location
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/76618251
favorite count: 0
has comment: http://stackoverflow.com/comment/135093435

http://stackoverflow.com/comment/135024811
has text: I don't know Objective C, but you can use something called an "iconv" library.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76579270
type: Comment

http://stackoverflow.com/comment/135093435
score: 0
comment on: http://stackoverflow.com/q/76615959
has text: @chanadboy Yes i have all these setups already significantLocationManager.distanceFilter = 2; significantLocationManager.desiredAccuracy = kCLLocationAccuracyBest;
type: QuestionComment
type: Comment

http://stackoverflow.com/a/76601655
answers question: http://stackoverflow.com/q/76553856
score: 0
has body: I found a solution. I just misunderstood how the stencil test works. Building a texture for stencil test at the initializing point of the Renderer. // build a texture for stencil test void Renderer::buildStencilTest() { auto* pStencilDesc = MTL::TextureDescriptor::texture2DDescriptor( MTL::PixelFormatDepth32Float_Stencil8, _viewSize[0], _viewSize[1], false); pStencilDesc->setStorageMode( MTL::StorageModePrivate ); pStencilDesc->setUsage( MTL::TextureUsageRenderTarget | MTL::TextureUsageShaderRead ); _pDepthStencilTexture = _pDevice->newTexture( pStencilDesc ); } In the update() method, set the texture what we built for stencil test to the stencil attachment of current render pass of a view. Clear stencil value as ZERO. Draw the area what I want to mask. (I am not gonna use Depth test, so disable it.) Set the stencil compare function to "Pass Always" and depth/stencil pass operation as "Replace". Set stencil reference value to 1. Stencil test is gonna compare this and the value of stencil texture. At this time, stencil test "always PASS" and replace the drawing area of texture as the result of logical AND of "reference value (1)" and "write mask (0xff)" therefore 1. Draw elements. void Renderer::update() { // Clear stencil pRPD->stencilAttachment()->setLoadAction( MTL::LoadActionClear ); pRPD->stencilAttachment()->setStoreAction( MTL::StoreActionStore ); pRPD->stencilAttachment()->setTexture( _pDepthStencilTexture ); pRPD->stencilAttachment()->setClearStencil( 0 ); auto* pDsDesc = MTL::DepthStencilDescriptor::alloc()->init(); pDsDesc->setDepthCompareFunction( MTL::CompareFunctionAlways ); pDsDesc->setDepthWriteEnabled( false ); auto* pStencil = MTL::StencilDescriptor::alloc()->init(); pStencil->setStencilCompareFunction(MTL::CompareFunctionAlways); pStencil->setDepthFailureOperation( MTL::StencilOperationKeep ); pStencil->setStencilFailureOperation( MTL::StencilOperationKeep ); pStencil->setDepthStencilPassOperation( MTL::StencilOperationReplace ); pStencil->setReadM…
type: Answer

http://stackoverflow.com/comment/135058875
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76595578
has text: Where is RCT_EXTERN_MODULE declared ?
type: QuestionComment

http://stackoverflow.com/comment/135054493
has text: In RNWebViewManager.m. That’s what the error says : you cannot declare the interface category if you do not specify (aka import) the original interface definition.
type: Comment
comment on: http://stackoverflow.com/q/76595578
type: QuestionComment
score: 0

http://stackoverflow.com/q/76626212
tagged with: ios
type: Question
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/76752995
has comment: http://stackoverflow.com/comment/135111243
tagged with: apple-m1
favorite count: 0
score: 5
has comment: http://stackoverflow.com/comment/135099958
tagged with: swift
downvote count: 0
tagged with: charts
has title: DGCharts EXC_BAD_ACCESS (code=2, address=0x12a113e30)
accepted answer: http://stackoverflow.com/a/76752995
type: AnsweredQuestion
upvote count: 5
has body: Previously this Repository was imported as Charts, but after their library updates, it was changed to DGCharts. After I change the pod file, it installed successfully but the app getting crashed while accessing the charts. previously it was working properly. The only change was the pod name (Charts -&gt; DGCharts). Note that I'm using M1 Macbook. Also, I tried to import the library as pod 'DGCharts' as well. but the result was the same.

http://stackoverflow.com/comment/135085598
has text: please check this also locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.pausesLocationUpdatesAutomatically = NO; locationManager.distanceFilter =5;
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76615959
type: QuestionComment

http://stackoverflow.com/comment/135142481
has text: Means your contacts are not sorted ? Can not get. It seems sorted
type: Comment
comment on: http://stackoverflow.com/q/76651162
score: 0
type: QuestionComment

http://stackoverflow.com/q/76707092
accepted answer: http://stackoverflow.com/a/76754348
score: 0
has body: I am working on a framework project written in Objective-C. I'm trying to ensure the resulting public Swift API follows modern standards. As a result I'm looking into macros such as NS_SWIFT_NAME and NS_REFINED_FOR_SWIFT. I've been through Apple's documentation for Objective-C and C Code Customization. But they only have one example using NS_REFINED_FOR_SWIFT and it's at the method level. I happen to be looking at some of the Apple header files in the CloudKit framework, specifically for the new CKSyncEngine related types. I noticed that every Objective-C class is prefixed with NS_REFINED_FOR_SWIFT. Since now every class name and method name is hidden with the double-underscore prefix, I imagine that this means that there is more than just a simple Swift class extension to help better map the method and property names. What I need help with is a starting example when several Objective-C classes are marked with NS_REFINED_FOR_SWIFT. What Swift code must be provided in the framework to properly expose those refined class names? Let's start with an example that looks a lot like UIButton and UIButton.Configuration. The Objective-C header file might look like this: NS_REFINED_FOR_SWIFT @interface MyButtonConfiguration: NSObject @end NS_REFINED_FOR_SWIFT @interface MyButton: UIControl - (instancetype)initWithConfiguration:(MyButtonConfiguration *)configuration NS_SWIFT_NAME(init(configuration:)); @end This is a greatly oversimplified example as a starting point. If the code was really this simple I could easily use NS_SWIFT_NAME on the class names and be done. But I'm trying to understand the starting point for a far more complicated API. I want to end up with the Swift API having the class names MyButton and MyButton.Configuration (like a nested scope). If I had not used NS_REFINED_FOR_SWIFT on the whole class, but just some method/properties, then I would add Swift code such as: extension MyButton { func someRefinedAPI() { __someOriginalAPI() } } But having NS_REFINED_F…
has title: Trying to understand NS_REFINED_FOR_SWIFT when used on a whole class
type: AnsweredQuestion
tagged with: frameworks
tagged with: swift
possible better answer: http://stackoverflow.com/a/76759696
has answer: http://stackoverflow.com/a/76754348
answer count: 2
has answer: http://stackoverflow.com/a/76759696
type: Question
tagged with: objective-c

http://stackoverflow.com/comment/135025604
type: Comment
has text: Does `[songInfo.fileNamePath dataUsingEncoding:NSUTF16BigEndianStringEncoding]` return the data you want?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76579270

cncontactstore
type: Tag
tags question: http://stackoverflow.com/q/76651162
tag name: cncontactstore

http://stackoverflow.com/comment/135058992
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76595578
has text: You must create a file named RNWebViewManager.h which declared the interface for RNWebViewManager. Then in RNWebViewManager.m import it and declare the implementation of the class. BTW declaring inheritance and protocol conformance in Objective-C is done with : @interface className: parentClassName <protocolName, orherProtocolName..>

http://stackoverflow.com/comment/135011306
score: 0
comment on: http://stackoverflow.com/q/76571909
type: QuestionComment
has text: yeah, the more I stare at this, the more I expect that the compiler is able to optimize away adding a release in the call to`objectAtIndex:` (since the compiler knows the details of NSArray), because it can see that you never use the object past the expression. I would expect your swizzle to not cooperate with that properly, and it's probably adding a retain that the caller isn't expecting. Should definitely be a lot of fun to explore the assembly output for all of this. Best of luck. Great little toy project to understand it better.
type: Comment

http://stackoverflow.com/comment/135019761
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/76579270
has text: Also, isn't it the input string that is encoded as UTF-8? The output in the `output` buffer should contain wide characters (probably 4 bytes per character on Mac OS X and iOS), not multibyte character sequences.

http://stackoverflow.com/q/76577713
has comment: http://stackoverflow.com/comment/135083130
has title: How to use audio remote control device as input device for iOS app
downvote count: 1
tagged with: objective-c
tagged with: ios
score: 0
has body: I have a bicycle app for which I would like to add user input capability in a safe way. I want to use a simple handlebar mounted, thumb activated audio remote control device (+vol, -vol, next track, previous track) for app input rather than user touching phone screen. I want to use the audio control buttons for app specific inputs - not related to audio. I started out assuming I would need to bring in media player features to my main view controller. I'm not getting any errors, but not getting any results interface: #import &lt;MediaPlayer/MediaPlayer.h&gt; @property (nonatomic, strong) MPRemoteCommandCenter *commandCenter implementation: inside view did load MPRemoteCommandCenter *commandCenter =[MPRemoteCommandCenter sharedCommandCenter] ; [commandCenter.nextTrackCommand addTargetWithHandler: ^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent *event) { [self.mysong play]; //for testing return MPRemoteCommandHandlerStatusSuccess ; }]; Please help. Any suggestions on how to accept input from audio remote? Is there something better than media plyer? A bluetooth method?
tagged with: bluetooth
type: Question
upvote count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/135090287
answer count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/135041689

http://stackoverflow.com/q/76571909
tagged with: ios
tagged with: objective-c
has title: OC memory continued to grow after using method swapping（swizzle）
upvote count: 1
favorite count: 0
type: Question
has body: By using method exchange, the problem of NSMutableArray array out of bounds is determined. myCode like this: static inline void swizzleSelectorKK(Class theClass, SEL originalSelector, SEL swizzledSelector) { Method originalMethod = class_getInstanceMethod(theClass, originalSelector); Method swizzledMethod = class_getInstanceMethod(theClass, swizzledSelector); method_exchangeImplementations(originalMethod, swizzledMethod); } and call it in the load function: +(void)load{ [super load]; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ swizzleSelectorKK(NSClassFromString(@"__NSArrayM") , @selector(objectAtIndex:), @selector(kk_objectAtIndex:)); }); } the replace function like this: - (id)kk_objectAtIndex:(NSUInteger)index { if (self.count == 0) { return nil; } if (index >= self.count) { return nil; } return [self kk_objectAtIndex:index]; } in my viewcontroll: - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; self.arr = [[NSMutableArray alloc]init]; [self.arr addObject:@"this is a array"]; [self.arr addObject:@"this 2 array"]; [self.arr addObject:@"this 3"]; UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; button.backgroundColor = [UIColor systemBlueColor]; [button setTitle:@"click" forState:UIControlStateNormal]; [button addTarget:self action:@selector(reloadDataxxx) forControlEvents:UIControlEventTouchUpInside]; button.frame = CGRectMake(200, 100, 200, 200); [self.view addSubview:button]; } - (void)reloadDataxxx { self.index = self.index % 3; NSLog(@"index of is %ld data = %@", self.index, [self.arr objectAtIndex:self.index]); self.index ++; } As you continue to click, you will find that the memory continues to grow, as long as you remove the exchange method, the memory will not change. It's been a long day. Thank you
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/135016427
tagged with: objective-c-runtime
downvote count: 0
has comment: http://stackoverflow.com/comment/135011306
has comment: http://stackoverflow.com/comment/135011170
answer count: 0

http://stackoverflow.com/comment/135056057
has text: it doesn't have sense RNWebViewManager.h does not exist in my project in fact it gives me the error: 'RNWebViewManager.h' file not found
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76595578

http://stackoverflow.com/comment/135053236
comment on: http://stackoverflow.com/q/76595578
type: Comment
has text: where this file must be imported
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134997174
score: 1
type: Comment
comment on: http://stackoverflow.com/a/76565249
has text: Why do you call `interpretKeyEvents` if you don't implement `NSTextInputClient`?
type: AnswerComment

http://stackoverflow.com/comment/135023743
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76579270
score: 0
has text: @KamyFC UTF-16BE would encode ASCII characters as two bytes, e.g. `T` would be encoded as hex bytes 00 54. That is different to what you expected, where `T` would be encoded as a single hex byte 54. What software actually needs the text to be encoded in your weird (and impossible to reliably decode) format?

http://stackoverflow.com/comment/135241894
score: 0
comment on: http://stackoverflow.com/q/76633529
type: QuestionComment
type: Comment
has text: `UICollectionView` inherits from `UIScrollView`

http://stackoverflow.com/comment/135011170
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76571909
type: Comment
has text: Clearly this is a terrible idea, and you should never ship this, but it's a fascinating thing to explore how class clusters are implemented. My guess would be that the underlying class is hand-tuned to either optimize away an extra release or add an autorelease. I would probably first step through the __NSArrayM implementation to see what memory management calls it does internally. You might experiment with compiling your swizzle w/o ARC, and adding an autorelease by hand. (How Apple implements this may change from OS release to release of course, so any hack may crash in the future.)

http://stackoverflow.com/comment/135065069
has text: I tried this out and the NSLog came back with an empty array
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76602592
score: 0

http://stackoverflow.com/q/76648688
favorite count: 0
has answer: http://stackoverflow.com/a/78142376
tagged with: appdelegate
score: 1
has title: No visible @interface for 'EXAppDelegateWrapper' declares the selector 'application:openURL:options:'
has body: I am upgrading an Expo app from react native 0.63 to 0.71 and am running into this error in my AppDelegate.m file. // Linking API - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { // error below return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options]; } // Universal Links - (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler { BOOL result = [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result; } @end I am not very familiar with objective c so I am unsure how to solve this issue. The error is occurring on the line below the comment "error below" and the error is as follows No visible @interface for 'EXAppDelegateWrapper' declares the selector 'application:openURL:options:'
tagged with: ios
tagged with: objective-c
tagged with: react-native
type: Question
upvote count: 1
tagged with: swift
downvote count: 0
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/135229187

http://stackoverflow.com/comment/135025915
has text: Thanks @IanAbbott, I'm checking if we can do UTF16BigEndian in Objective C, if not, I will check iconv_open(). I'm on macOS, when I run 'iconv -l' in Terminal, I see many encoding entries - and we find the ones I'm interested in "UTF-8 UTF8" and "UTF-16BE". So will I have to use the iconv library to convert every character and then write the character to the file, or write it as usual and then convert the entire file contents to "UTF-16BE"? What do you propose is the right approach?
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76579270

grand-central-dispatch
tag name: grand-central-dispatch
type: Tag
tags question: http://stackoverflow.com/q/76565935
tags question: http://stackoverflow.com/q/76742126
tags question: http://stackoverflow.com/q/77564862
tags question: http://stackoverflow.com/q/77689811
tags question: http://stackoverflow.com/q/77918816
tags question: http://stackoverflow.com/q/78309419
tags question: http://stackoverflow.com/q/78967569

http://stackoverflow.com/q/76696283
type: UnansweredQuestion
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/135239724
favorite count: 0
tagged with: ios
tagged with: metal
has comment: http://stackoverflow.com/comment/135218175
tagged with: objective-c
has title: Is there a way to share global constant in Swift/Obj-C and Metal code
has comment: http://stackoverflow.com/comment/135218174
has body: I know it's possible to declare custom structs in Obj-C header file, and reuse this one declaration in both Metal shaders as well as in Obj-C/Swift host code. Can we declare and define global constants in one place without duplication in such a way that they will be accessible in both Metal and host code in Swift/Obj-C as well? The only way I have come up by myself is to use #define SOME_CONST 123.45f in this same shared Obj-C header file, but #define is not constant per se and I'm looking to more standard typed definition.
type: Question
upvote count: 1
tagged with: swift
downvote count: 0

http://stackoverflow.com/comment/135015065
type: QuestionComment
comment on: http://stackoverflow.com/q/76568196
type: Comment
has text: Still need to clarify what you're really trying to do. I added two more variations with "shapes" here: https://imgur.com/a/JuVLotk ... does that look similar to your goal?
score: 0

http://stackoverflow.com/comment/136168841
score: 0
type: QuestionComment
type: Comment
has text: Hey Jaco, did you solve this?
comment on: http://stackoverflow.com/q/76604747

http://stackoverflow.com/q/76555630
type: Question
has answer: http://stackoverflow.com/a/76556130
type: UnansweredQuestion
has title: AVPlayer playing the last link only in NSMutableArray
has comment: http://stackoverflow.com/comment/134979653
tagged with: ios
answer count: 1
tagged with: objective-c
tagged with: avplayer
tagged with: xcode
tagged with: avplayerviewcontroller
score: 0
has body: I'm trying to play a list of .mp4 links imported from .m3u file, File is save locally in the app and it contains 10 movie titles and links. Full code App Transport Security Settings Added in info.plist vController.h #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> #import <AVKit/AVKit.h> @interface ViewController : UIViewController { NSMutableArray *movieTitle; NSMutableArray *movieURL; NSMutableArray *tempArray; NSArray *lines; } @property (nonatomic, retain) NSMutableArray *movieTitle; @property (nonatomic, retain) NSMutableArray *movieURL; @property (nonatomic, retain) NSMutableArray *tempArray; @property (nonatomic, retain) NSArray *lines; vController.m @synthesize movieURL,movieTitle,tempArray,lines; - (void)viewDidLoad { [super viewDidLoad]; movieURL = [[NSMutableArray alloc] init]; movieTitle = [[NSMutableArray alloc] init]; tempArray = [[NSMutableArray alloc] init]; [self addM3UFile]; } - (void)addM3UFile { NSString *addPath = [[NSBundle mainBundle] pathForResource:@"Test" ofType:@"m3u8"]; NSString *fileContents1 = [NSString stringWithContentsOfFile:addPath encoding:NSUTF8StringEncoding error:NULL]; lines = [fileContents1 componentsSeparatedByString:@"\n"]; [tempArray addObjectsFromArray:lines]; [self sortM3UFile]; } - (void)sortM3UFile { int i; for (i=0; i<[tempArray count]; i++) { NSString *tempTitle = [tempArray objectAtIndex:i]; if ([tempTitle containsString:@"://"]) { [movieURL addObject:tempTitle]; } if ([tempTitle containsString:@"#EXTINF:-1 ,"]) { [movieTitle addObject:tempTitle]; } } } Code to play the video NSString *url = [movieURL objectAtIndex:9]; NSLog(@"URL: %@", url); AVPlayer *player = [AVPlayer playerWithURL:[NSURL URLWithString:url]]; AVPlayerViewController *controller = [[AVPlayerViewController alloc] init]; [self presentViewController:controller animated:YES completion:nil]; controller.player = player; [player play]; Works fine ONLY with the last object in the list Links example : http://www.wwwwwwww.com/1234.mp4 I tested al…
has comment: http://stackoverflow.com/comment/134979391

http://stackoverflow.com/comment/135022284
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76579270
has text: @KamyFC You show `最` "actually" encoded as 2 bytes, but actually it is encoded (in UTF-8) as 3 bytes (hex E6 9C 80). You incorrectly show the third byte as encoding the first byte of the next character: `最` (which is actually encoded in UTF-8 as hex E4 BD B3).

http://stackoverflow.com/comment/135021729
type: Comment
score: 0
type: QuestionComment
has text: @KamyFC None of the columns in that charset table contain the hex byte sequence '1E A1'.
comment on: http://stackoverflow.com/q/76579270

http://stackoverflow.com/a/76561973
type: Answer
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/76560981
score: 1
has body: Sadly Objective-C is terrible when it comes to @available. If you were to write that same logic in Swift you would not get the deprecation warning. I don't know why Objective-C doesn't work better in this regard. As you've seen, adding xrOS 1.0 to the @available doesn't eliminate the deprecation warning despite the fact that at runtime, the else will not be executed due to the @available. So while it works at runtime, the compiler needlessly complains about a situation that it should not. In my own experience, the only solution is to make use of compiler directives. While my experience is with Mac Catalyst and not visionOS, the issue is the same. You need to write ugly code similar to the following: #if TARGET_OS_VISION indicator.indicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleLarge; #else if (@available(iOS 13.0, tvOS 13.0, *)) { indicator.indicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleLarge; } else { indicator.indicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; } #endif The bad part of this is the code duplication. Your only other options are converting to Swift or accepting the deprecation warning.

http://stackoverflow.com/comment/135296403
has text: Please check orientation in uiImage.
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76710556

http://stackoverflow.com/comment/135229143
comment on: http://stackoverflow.com/q/76701581
score: 0
type: QuestionComment
has text: Could you share the full error message and the stack trace?
type: Comment

http://stackoverflow.com/comment/135217772
score: 0
has text: It doesn't compile with either `extern` or `inline` missing or definition given in .m file instead of the header. So I guess Metal compiler do not inline anything automatically, and defining the function in the header with `inline` explicitly is the only way. Also with `extern` for some reason.
comment on: http://stackoverflow.com/a/76695377
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/135032134
type: Comment
score: 0
type: QuestionComment
has text: Also super thanks to @IanAbbott for helping me decipher that the encoding expected was indeed "UTF16BigEndian", which pointed me to the right direction.
comment on: http://stackoverflow.com/q/76579270

http://stackoverflow.com/comment/135038841
comment on: http://stackoverflow.com/q/76568196
type: QuestionComment
has text: *"When this class uses an image..."* -- sorry, but that is confusing me. I posted an answer using a **paths** approach. Hopefully it will help you out.
score: 0
type: Comment

http://stackoverflow.com/comment/135111243
has text: There is no any error console.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76626212
type: Comment

http://stackoverflow.com/comment/135024760
comment on: http://stackoverflow.com/q/76579270
has text: Each UTF-16(BE or LE) code unit is 2 bytes. All characters below U+010000 (i.e. characters in the Unicode Basic Multilingual Plane) will be encoded in a single code unit (i.e. 2 bytes). Characters U+010000 onwards will be encoded in two code units (i.e. 4 bytes) with special values. The first code unit (the "high surrogate") will be in the range U+D800 to U+DBFF and the second code unit (the "low surrogate") will be in the range U+DC00 to U+DFFF. Together, the high surrogate and low surrogate code units form a "surrogate pair".
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/q/76604747
type: UnansweredQuestion
score: 2
downvote count: 0
tagged with: live-connect-sdk
has comment: http://stackoverflow.com/comment/136168841
answer count: 0
tagged with: flutter
has body: We have a Flutter app where we implemented the ConnectSDK with Objective-C platform code. On the iOS Simulator devices are detected but on a physical device we get: nehelper sent invalid result code [1] for Wi-Fi information request and no devices are detected. We checked the following: NSLocalNetworkUsageDescription is in the plist. Access Wi-Fi Information Entitlement is enabled under Signing and Capabilities and on the Identifier. Tried enabling Network Extensions. Tried requesting location access permission and setting NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationAlwaysUsageDescription, NSLocationWhenInUseUsageDescription in the plist. The native popup to allow network access does not appear and using the permission_handler we see that all permissions including Notifications and Location is set to permanently denied. Local Network Access is enabled in Settings. Any advice will be greatly appreciated.
upvote count: 2
tagged with: ios
type: Question
tagged with: objective-c
favorite count: 0
has title: Invalid result code for Wi-Fi information request - Flutter iOS - ConnectSDK
has comment: http://stackoverflow.com/comment/136454281

http://stackoverflow.com/a/76565249
score: 0
has body: Turns out the issue was with the character accent popover menu. This issue helped me figure it out. No popover was ever displayed for me, hence my confusion. I assume that is because I did not provide any system cursor information therefore the application doesn't know where to display it, however I haven't confirmed this. Adding [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"ApplePressAndHoldEnabled"]; disabled the accent popover for my application and solved the problem.
accepted answer of: http://stackoverflow.com/q/76546729
answers question: http://stackoverflow.com/q/76546729
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/134997174
has comment: http://stackoverflow.com/comment/134997659

http://stackoverflow.com/comment/135020845
type: Comment
has text: @GiacomoCatenazzi Thanks. I tried an approach without using wchar. I added it to the query. It did not work. Can you check?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76579270

http://stackoverflow.com/comment/135021477
type: QuestionComment
type: Comment
has text: I added couple of examples - Chinese text and Vietnamese text Also added an alternate approach of checking if a character is a multibyte character and writing all bytes if true. This too did not work. The edited question has the alternate approach.
comment on: http://stackoverflow.com/q/76579270
score: 0

frameworks
tags question: http://stackoverflow.com/q/76707092
tag name: frameworks
type: Tag
tags question: http://stackoverflow.com/q/77270424
tags question: http://stackoverflow.com/q/77727458
tags question: http://stackoverflow.com/q/77787569
tags question: http://stackoverflow.com/q/78607713
tags question: http://stackoverflow.com/q/78757491
tags question: http://stackoverflow.com/q/78796285
tags question: http://stackoverflow.com/q/78958789
tags question: http://stackoverflow.com/q/79451132

http://stackoverflow.com/a/76752995
score: 13
upvote count: 13
downvote count: 0
has comment: http://stackoverflow.com/comment/135409073
answers question: http://stackoverflow.com/q/76626212
has body: I encountered the same issue. It turned out that the module name of the PieChartView in my Storyboard still was the old library name. Just make sure the PieChartView's Module is set to "DGCharts". Images: Before and After
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/137998548
type: Answer
accepted answer of: http://stackoverflow.com/q/76626212

http://stackoverflow.com/q/76568196
has title: How to detect when two CAShapeLayers intersect and to change the color of the intersecting pixels
tagged with: ios
has answer: http://stackoverflow.com/a/76590594
tagged with: uiimageview
has comment: http://stackoverflow.com/comment/135014372
tagged with: core-graphics
tagged with: objective-c
tagged with: uiimage
has comment: http://stackoverflow.com/comment/135015567
has body: I have a class called ShapeView which subclasses UIImageView. Within this class, there is a CALayer property called shape which I use to define various types of complex shapes. Using UIGraphicsBeginImageContextWithOptions, ShapeView will translate shape into a UIImage which is then set as the UIImageView's image property. Using this set up, I'm wanting to merge two shapes that intersect each other like following: As you can see, I'm setting the stroke property of each CAShapeLayer so that each shape has a black border. I'm wanting to make it so that if two shapes intersect each other, I can detect the part of the stroke that's inside the other shape and change the color of those pixels to UIClearColor so that it gives the impression that the two shapes are merging. I'm a little confused though as to how to detect if a certain area of a CAShapeLayer, which has been converted to a UIImage, is in another CAShapeLayer which has also been converted to a UIImage. And also how to change the color of those exact pixels to UIClearColor (is this even possible?). Thanks!
score: 0
has comment: http://stackoverflow.com/comment/135038841
type: Question
has comment: http://stackoverflow.com/comment/135011698
answer count: 1
has comment: http://stackoverflow.com/comment/135015065
type: UnansweredQuestion

http://stackoverflow.com/a/76577804
score: 0
type: Answer
answers question: http://stackoverflow.com/q/76565935
has body: The dispatch_group_async will enter the group immediately, and will leave the group when the called block returns. But the blocks are simply calling methods that launch asynchronous tasks, but doesn’t know when that work finishes. The net effect is that the dispatch group will be prematurely notified, as soon as these two asynchronous tasks are started, but not when this asynchronous work is complete. So, the challenge is how to defer the dispatch group until the asynchronous work finishes. We would often reach for completion handler blocks: - (void)getOneDataWithCompletion:(void (^ _Nullable)(void))completion { [self requestData:^(id _Nullable datas, NSError * _Nullable error) { … if (completion) { completion(); } }]; } And we would do the same with the second API call, too. Having done that, we can now “enter” the group before making the asynchronous call and only “leave” the group in the completion handler block, e.g.: dispatch_group_t group = dispatch_group_create(); dispatch_group_enter(group); [self getOneDataWithCompletion:^{ dispatch_group_leave(group); }]; dispatch_group_enter(group); [self getTwoDataWithCompletion:^{ dispatch_group_leave(group); }]; dispatch_group_notify(group, dispatch_get_main_queue(), ^{ … }); As a general rule, if you have an asynchronous method, it is prudent to give it completion handler block parameter that you call when the asynchronous method is done. And if you think you might not need that parameter, make it _Nullable (which is why I’m checking that it is not null before I call it).

http://stackoverflow.com/comment/135139432
has text: It's part of Metal. I would expect running out of GPU memory if I had to guess. Could be an OS bug or yours depending on your code. If you're not using Metal directly, or using frameworks that make heavy use of the GPU, I'd reach out to Apple with it.
type: QuestionComment
score: 1
type: Comment
comment on: http://stackoverflow.com/q/76649829

http://stackoverflow.com/comment/135020075
has text: Avoid use wchar_t and such functions (if you can, they are *obsolete*). Use `char` and things should often be "automatic" with UTF-8 (just remember that one glyphs/characters can have many *char* (but this is also UTF_16, and wchar usually is UCS2, but also in such case there are combining characters, etc.).
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/76579270

http://stackoverflow.com/a/77806413
has body: Use TARGET_OS_VISION #if TARGET_OS_VISION #else #endif
answers question: http://stackoverflow.com/q/76560981
score: 1
has comment: http://stackoverflow.com/comment/137172614
downvote count: 1
upvote count: 2
type: Answer

http://stackoverflow.com/comment/135103987
type: Comment
comment on: http://stackoverflow.com/q/76628939
has text: Does this answer your question? [Is floating point math broken?](https://stackoverflow.com/questions/588004/is-floating-point-math-broken)
type: QuestionComment
score: 2

http://stackoverflow.com/comment/135019936
type: QuestionComment
comment on: http://stackoverflow.com/q/76579270
score: 0
has text: @IanAbbott - The reference can be found here (https://vietunicode.sourceforge.net/charset/) The character 'ê' is written as EA and 'ạ' is written as '1E A1' which is what the 'expected' result shows.
type: Comment

http://stackoverflow.com/comment/135082258
comment on: http://stackoverflow.com/q/76615959
has text: yes i just tried same issue
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/a/76671111
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/76670798
upvote count: 2
has body: When I locate the Compass storyboard file, I check the name and it is Compass.storyboard then you should load it like this let storyboard = UIStoryboard(name: "Compass", bundle: nil)
has comment: http://stackoverflow.com/comment/135175199
answers question: http://stackoverflow.com/q/76670798
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/76565935
tagged with: ios
type: Question
tagged with: objective-c
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/76577804
score: 0
answer count: 2
tagged with: grand-central-dispatch
has answer: http://stackoverflow.com/a/76568660
has body: I use dispatch_group_t to handle my three network requests with the following code: dispatch_group_t group = dispatch_group_create(); dispatch_queue_t queue = dispatch_get_global_queue(0, 0); [self.permissionData removeAllObjects]; dispatch_group_async(group, queue, ^{ [self getOneData]; }); [self.bannerData removeAllObjects]; dispatch_group_async(group, queue, ^{ [self getTwoData]; }); dispatch_group_notify(group, dispatch_get_main_queue(), ^{ [self.tableView.mj_header endRefreshing]; }); and - (void)getOneData { [self requestData:^(id _Nullable datas, NSError * _Nullable error) { if (error != nil) { [self.tableView.mj_header endRefreshing]; } else { if ([datas isKindOfClass:[NSArray class]]) { self.datas = datas; } [self.tableView reloadData]; } }]; } This will cause the callbacks of both methods getOneData and getTwoData to go twice. I don't know why they both go twice, but if I don't use dispatch_group_t, there is no problem. May I ask why this is?
has title: Question about dispatch_group_t results in two callbacks in a network request

http://stackoverflow.com/q/76686566
accepted answer: http://stackoverflow.com/a/76710181
score: 0
linked to: http://stackoverflow.com/q/38192343
has title: Objective-C Generated Interface Header Cannot Find Pod Header
type: Question
tagged with: swift
has body: I am having a problem with a Pod in Xcode. It has both Objective-C and Swift, and I just added some more Swift classes to it. However, now when building, the Objective-C Generated Interface Header file (Test_Pod-Swift.h) cannot find the Test_Pod.h file, so it isn't building. The pod is called Test_Pod, and the Interface Header file says "'Test_Pod/Test_Pod.h' file not found". It seems to only happen after making the classes public, which is needed for access outside of the pod, but I dont understand how that is breaking the build.
has answer: http://stackoverflow.com/a/76686979
possible better answer: http://stackoverflow.com/a/76686979
tagged with: ios
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/76710181
answer count: 2
tagged with: objective-c

http://stackoverflow.com/q/76623872
downvote count: 1
tagged with: macos
has body: I've danced around this question previously, asking specific questions which I hoped might lead me to the next step in solving the larger problem. That didn't work (no answers), so this is the larger problem. Original questions How can I ignore all touch events in WKWebView and its enclosingScrolllView How can I paginate html in a wkwebview? Context Apple originally provided a very full featured and functional API for displaying HTML - WebView. Many tools were written for WebView, for example to display the pages of an e-book. WebView is now deprecated in favour of WKWebView, which 'feels' minimally functional - a lot of the features that made WebView easy to work with don't exist in WebView, and I can't find any tools for displaying the pages of an e-Book neatly. I want to produce a tool which can be shared publicly on GitHub which will provide this e-book functionality, both so that I can benefit from it myself - but also so that everyone else can. Problem At minimum, this needs to work on macOS (I'll worry about iOS later) So far, my code scrolls the book content neatly one page at a time if you press the buttons - but if you swipe on the mouse or trackpad (guessing here) acceleration ruins the functionality (it should work in the same way as pressing the buttons). I can get it so that a swipe will move the book content along by one page - but once the page has been updated the acceleration / deceleration effect of the swipe continues - and the page moves on past the point where it should have stopped moving. The page scroll is horizontal. The code I have so far is // // ReaderWindowController.m // #import "ReaderWindowController.h" #import "LibrarianFormatPluginInterface.h" #define WindowSideLeft 0 #define WindowSideRight 1 @interface WKWebView (SynchronousEvaluateJavaScript) - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script; @end @implementation WKWebView (SynchronousEvaluateJavaScript) - (NSString *)stringByEvaluatingJavaScriptFromString:…
tagged with: javascript
score: 0
tagged with: objective-c
linked to: http://stackoverflow.com/q/76166846
has answer: http://stackoverflow.com/a/76694164
type: Question
upvote count: 1
has title: How can I page through an e-Book using WKWebView
answer count: 1
tagged with: wkwebview
type: UnansweredQuestion
favorite count: 0

http://stackoverflow.com/comment/134969268
has text: Welcome to Stack Overflow. What is the question, "Why are certain repeated keys ignored?" or "how to debug `interpretKeyEvents`?"? Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and edit the question.
type: Comment
comment on: http://stackoverflow.com/q/76546729
score: 0
type: QuestionComment

http://stackoverflow.com/q/76694493
type: Question
upvote count: 1
has title: Sharing code between C/C++/Objective-C and Metal
tagged with: http://stackoverflow.com/tag/c
accepted answer: http://stackoverflow.com/a/76695377
favorite count: 0
tagged with: ios
tagged with: metal
type: AnsweredQuestion
downvote count: 1
has body: I know it's possible to declare custom structs in Obj-C header file, and reuse this one declaration in both Metal shaders as well as in Obj-C/Swift host code. Now I was thinking about reusing the small helper function in both Obj-C/Swift and my Metal shaders. After many attempts I was able to do that, but with many limitations and strange compiler quirks. This is the C-function declared and defined in Objective-C bridging header: #include &lt;simd/simd.h&gt; extern inline simd_ushort2 test(simd_float2 pos) { const float H = 16.0; return (simd_ushort2){ (ushort)(pos.x/H), (ushort)(pos.y/H) }; } This function works in both Swift and Metal shader. But it doesn't work in Metal if I define it in implementation file instead of the header. So it seems like Metal can only operate with C-functions defined in the header? Also for some reason this doesn't work without extern keyword, which to my understanding doesn't do anything for functions defined in header. Then if I want to do some more math in this function, like using ceilf, for example... #include &lt;simd/simd.h&gt; #include &lt;math.h&gt; extern inline simd_ushort2 test(simd_float2 pos) { const float H = 16.0; return (simd_ushort2){ (ushort)ceilf(pos.x/H), (ushort)ceilf(pos.y/H) }; } ...it doesn't compile in Metal, spawning countless errors related to importing &lt;math.h&gt; like 'double' is not supported in Metal So it seems to me the scale of incompatibility between Metal and even the plain C reaches the scale of even the most basic math operations. Am I right that trying to share implementation between Metal and host-code is bad idea, and it's better to limit sharing to struct declarations and some global constants if needed?
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/76695377
score: 0

http://stackoverflow.com/comment/135041689
comment on: http://stackoverflow.com/q/76577713
type: Comment
has text: This looks fine. I would start by checking that the code you expect to run actually runs. There are many reasons `[self.mysong play]` might not play; you don't demonstrate that this is known good. And there are lots of other little things that could be wrong and you don't show. Start by setting breakpoints and make sure that the code you mean to run actually does or doesn't run. Start with https://developer.apple.com/documentation/mediaplayer/becoming_a_now_playable_app, make sure that works, and then adapt to do what you want.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/135107257
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76628939
has text: What OS version are you using? It works fine for me on iOS 16.4 simulator. You might want to use the method that also takes a locale because all those numbers can parse to 0 if the users' locale has a comma instead of a dot as decimal separator.
score: 0

http://stackoverflow.com/comment/135021857
score: 0
type: QuestionComment
type: Comment
has text: @Jabberwocky: Objective-C is not Microsoft. In any case, can you find some interchangeable format which still recommend UTF-16? (I'm not speaking about using it internally) OTOH I have some impression that also Microsoft is moving to UTF-8 (it would be much easier, but then, like JavaScript, there are API for UCS-2, for UFT-16 and for UTF-8).
comment on: http://stackoverflow.com/q/76579270

http://stackoverflow.com/comment/135025866
score: 0
has text: @Willeke Thanks for the suggestion. I tried *** NSData *dataBE = [songInfo.fileNamePath dataUsingEncoding:NSUTF16BigEndianStringEncoding]; NSString *objCStringPath = [[NSString alloc] initWithData:dataBE encoding:NSUTF16BigEndianStringEncoding]; const char *cStringPath = (const char *)[objCStringPath cStringUsingEncoding:NSUTF16BigEndianStringEncoding]; *** Interesting thing is I can see the path in 'objCStringPath' but cStringPath is "". cStringUsingEncoding does not seem to like NSUTF16BigEndianStringEncoding. Will check.
type: QuestionComment
comment on: http://stackoverflow.com/q/76579270
type: Comment

http://stackoverflow.com/comment/135022336
type: Comment
comment on: http://stackoverflow.com/q/76579270
type: QuestionComment
score: 0
has text: @IanAbbott Thank you. So "UTF-16BE" is what I need to look at? As that is the expected output that I need to match. Any pointers on how to write char in "UTF-16BE"?

http://stackoverflow.com/comment/135085370
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76615959
type: Comment
has text: did you add Privacy - Location Always Usage Description or Privacy - Location When In Use Usage Description include ??

http://stackoverflow.com/comment/135093738
score: 0
has text: i do have all the permissions and accuracy setup but location updates are not happening it just throw this Error Domain=kCLErrorDomain Code=0 "(null)" and does nothing
comment on: http://stackoverflow.com/a/76618251
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/135015567
type: Comment
comment on: http://stackoverflow.com/q/76568196
score: 0
has text: @DonMag Thanks for doing all that, yeah that's correct except for the ones with images. When this class uses an image, it will just be the image itself (no shape or stroke) and it won't have to do the merging thing I want, will be completely separate. But the other ones with the shapes merging, that's exactly right.
type: QuestionComment

http://stackoverflow.com/q/76701581
tagged with: ios
type: Question
has comment: http://stackoverflow.com/comment/135229143
tagged with: objective-c
type: UnansweredQuestion
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/135235761
has title: 'NSInvalidArgumentException' but types of parameter look fine?
has body: I'm working on refactoring my project a little and I'm making some minor adjustments to the function names. However, after doing this to all relevant classes that have the method to be renamed, I seem to be getting some 'NSInvalidArgumentException' errors where I don't think they should be. I have this line where my application crashes: [super sceneDidConnectWithOptions:connectionOptions]; where the function signature that has this super class invocation is (and reaches this with the debugger telling me connectionOptions is of type UISceneConnectionOptions): - (void)sceneDidConnectWithOptions:(UISceneConnectionOptions *)connectionOptions{ where also, the super class's method is defined as: - (void)sceneDidConnectWithOptions:(UISceneConnectionOptions *)connectionOptions; I'm not sure where the NSInvalidArgumentException error would be coming from and don't see any syntax issues as well. I suspected that it could be crashing because of connectionOptions being 'nil', but that's not the case as I put a code block checking for it and it wasn't as well as the debugger showing me that it's not nil.

http://stackoverflow.com/comment/135055097
has text: It’s definitely bold in preview, TextEdit, and even when I see it in Xcode as a preview
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76597435

multibyte-characters
type: Tag
tags question: http://stackoverflow.com/q/76579270
tag name: multibyte-characters

http://stackoverflow.com/comment/135235761
type: Comment
has text: Got it resolved -- needed to make sure the base class also reflected the function name change. Thanks for offering to help, though!
comment on: http://stackoverflow.com/q/76701581
type: QuestionComment
score: 0

bigdecimal
tags question: http://stackoverflow.com/q/76628939
type: Tag
tag name: bigdecimal

http://stackoverflow.com/comment/135068769
score: 0
type: AnswerComment
type: Comment
has text: I have the attributed string with all the font data, but I guess it isn't finding anything when it enumerates, but I can verify even looking at the RTF file in Xcode that it is bolded
comment on: http://stackoverflow.com/a/76602592

http://stackoverflow.com/comment/135239724
type: Comment
score: 0
type: QuestionComment
has text: @JustSomeGuy thank you! I haven't thought of conditional macro myself. I use `#define CONSTANT constant constexpr` for Metal and `#define CONSTANT const static` for Swift. Worked out okay so far.
comment on: http://stackoverflow.com/q/76696283

http://stackoverflow.com/comment/136454281
has text: Hi @iDec, we were not able to resolve this. We dropped the ConnectSDK library as a result and used the `flutter_cast_video` and `flutter_ios_airplay` plugins instead.
type: QuestionComment
score: 1
type: Comment
comment on: http://stackoverflow.com/q/76604747

hex
tag name: hex
type: Tag
tags question: http://stackoverflow.com/q/76579270

visionos
tag name: visionos
tags question: http://stackoverflow.com/q/76560981
type: Tag

http://stackoverflow.com/comment/137172614
score: 0
type: AnswerComment
type: Comment
has text: Please do not post duplicate answers.
comment on: http://stackoverflow.com/a/77806413

contacts
type: Tag
tags question: http://stackoverflow.com/q/76651162
tag name: contacts

http://stackoverflow.com/comment/135409073
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/76752995
has text: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).

http://stackoverflow.com/q/76710556
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/137066063
type: UnansweredQuestion
tagged with: google-mlkit
has title: MLKit iOS Face Detection Not Working with CoreImage object
has comment: http://stackoverflow.com/comment/135309946
answer count: 0
tagged with: ios
tagged with: firebase-mlkit
has body: G'day, I've been trying to use MLKit for iOS for face detection task. I referred their code samples through codelab and sample app. So right out of the box, the MLKit seems to be working alright. I however ran into a problem where if the image comes as CoreImage object, the resulting VisionImage will not work with MLKit (i.e. not detecting any faces in it, no crashes or errors presented). Here is an example code. /// Processes an Image and detects faces in it /// - Parameter coreImage: Image Taken Out of Core Image Pipeline func detectFaces(coreImage: CIImage) { let ciImage = coreImage // image taken out of a core image pipeline guard let cgImage = getCGImageFromCIImage(ciImage) else { return } let uiImage = UIImage(cgImage: cgImage) let visionImage = VisionImage(image: uiImage) faceDetector.process(visionImage) { result, error in if let error = error { print(error.localizedDescription) return } guard let result = result else { print("no features") return } print(result.count) // <<<< ALWAYS RESULTS IN 0 // Other relevant processing later } } private func getCGImageFromCIImage(_ ciImage: CIImage) -> CGImage? { let context = CIContext() if let cgImage = context.createCGImage(ciImage.clampedToExtent(), from: ciImage.extent) { return cgImage } return nil } private lazy var faceDetectorOption: FaceDetectorOptions = { let option = FaceDetectorOptions() option.performanceMode = .accurate option.isTrackingEnabled = false return option }() private lazy var faceDetector = FaceDetector.faceDetector(options: faceDetectorOption) The code above does not crash or produce any error. It simply outputs 0 results. However if I bypass the CoreImage pipeline's work and pass in the original UIImage MLKit outputs the desired result. The core image pipeline is required for the work I'm doing as it's doing a crop and rotate based on the user's input from UI. Any ideas for what might be the problem is really appreciated. I tried passing the core image through CoreML's CIDetector and it does…
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135296403
score: 0

http://stackoverflow.com/comment/135032055
score: 0
has text: @Willeke Thank you, you can add an answer and I can mark it as answered, so you get the credit.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76579270

http://stackoverflow.com/comment/135265901
score: 0
comment on: http://stackoverflow.com/a/76694164
has text: Thank you for your suggestion. Unfortunately, it doesn't make any difference. `hitTest:withEvent:` is a UIView method, not an NSView method. I did have another idea - a very hacky workaround - which kind of, sort of, if you squint does what I need. But not really. See code above which has been updated accordingly.
type: AnswerComment
type: Comment

uisheetpresentationcontroller
type: Tag
tag name: uisheetpresentationcontroller
tags question: http://stackoverflow.com/q/76633529

http://stackoverflow.com/comment/135143004
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76651162
has text: @ArpitBParekh that's right. The next time start app, my contacts are not sorted.
type: QuestionComment

uiimageview
tags question: http://stackoverflow.com/q/76568196
tag name: uiimageview
type: Tag

http://stackoverflow.com/a/76558526
has comment: http://stackoverflow.com/comment/134988059
upvote count: 2
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/76553856
downvote count: 0
has comment: http://stackoverflow.com/comment/135012502
score: 2
accepted answer of: http://stackoverflow.com/q/76553856
has body: You are misunderstanding how states and descriptors work. MTLDepthStencilState is an immutable object, not like OpenGL states, which means that you can't change it after the fact, even if you change the descriptor. So you need to create a proper descriptor before you call newDepthStencilState. Also, Property frontFaceStencil and backFaceStencil are defined as @property (copy, nonatomic, null_resettable) in Metal headers: @property (copy, nonatomic, null_resettable) MTLStencilDescriptor *frontFaceStencil; @property (copy, nonatomic, null_resettable) MTLStencilDescriptor *backFaceStencil; This means the MTLStencilDescriptor inside MTLDepthStencilDescriptor is copied by value, and not set by reference. All of this means that in order for update to work, you need to write Renderer::Renderer like this: _pOrcDepthStencilDesc = MTL::DepthStencilDescriptor::alloc()-&gt;init(); // Set up orc depth stencil state auto* pOrcStencil = MTL::StencilDescriptor::alloc()-&gt;init(); pOrcStencil-&gt;setStencilCompareFunction( MTL::CompareFunctionAlways ); // glStencilFunc(func, _, _); pOrcStencil-&gt;setWriteMask( 0xff ); // glStencilFunc(_, _, mask); pOrcStencil-&gt;setStencilFailureOperation( MTL::StencilOperationReplace ); // glStencilOp( _, _, zpass ); _pOrcDepthStencilDesc-&gt;setFrontFacingState(...); _pOrcDepthStencilDesc-&gt;setBackFacingState(...); _pOrcStencilState = _pDevice-&gt;newDepthStencilState( _pOrcDepthStencilDesc ); _pGrassDepthStencilDesc = MTL::DepthStencilDescriptor::alloc()-&gt;init(); // Set up grass depth stencil state _pGrassDepthStencilDesc-&gt;setFrontFacingState(...); _pGrassDepthStencilDesc-&gt;setBackFacingState(...); _pGrassStencilState = _pDevice-&gt;newDepthStencilState( _pGrassDepthStencilDesc ); and then in update: { // draw orc pEnc-&gt;setDepthStencilState( _pOrcStencilState ); pEnc-&gt;setStencilReferenceValue( 1 ); // glStencilFunc(_, ref, _); orc-&gt;update( delta ); drawImage( orc-&gt;texture(), { 0.0f, 0.0f }, { 100.0f, 100.0f }, orc-&gt;fra…

http://stackoverflow.com/comment/135193088
has text: FYI - there is nothing wrong with providing links to relevant documentation in a question. That will not trigger any SPAM flags.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76677790
type: Comment

http://stackoverflow.com/comment/135022378
type: Comment
comment on: http://stackoverflow.com/q/76579270
has text: @IanAbbott You are right, my 'actual table' for the expected is not right. if you look at the CJK set https://www.compart.com/en/unicode/block/U+4E00 最 is mapped to \u6700 - I'm assuming this too is "UTF-16BE"?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/135016427
type: Comment
comment on: http://stackoverflow.com/q/76571909
has text: Thank you very much for your reply. I will continue to study according to your idea
score: 0
type: QuestionComment

http://stackoverflow.com/comment/135024617
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76579270
type: Comment
has text: @IanAbbott Thanks for the correction in the loop. I will attempt to use your suggestion. Also I will see how to encode in UTF-16BE using Objective C

http://stackoverflow.com/comment/135014372
score: 0
comment on: http://stackoverflow.com/q/76568196
type: QuestionComment
has text: @DonMag Thanks, it's funny you mention the thing about generating UIImages because I've been considering just using CAShapeLayers. In some instances, this class will just use a user defined UIImage instead of a CAShapeLayer so I wanted to be able to accommodate both scenarios, but I think I can convert that UIImage to a CAShapeLayer somehow? Regarding complex shapes, they just might have more sides then a square or might be a circle, but nothing too crazy. The result doesn't have to be what you linked to, just want them to intersect if the user moves them together.
type: Comment

http://stackoverflow.com/comment/135024968
comment on: http://stackoverflow.com/q/76579270
has text: The functions you are looking for are `iconv_open()`, `iconv()`, and `iconv_close()`, which are part of the POSIX standard, but the names of the "tocode" and "fromcode" character sets are implementation defined. You will need to find out the names that your target OS uses for these character sets.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/135099958
type: QuestionComment
has text: Is there an error message in Console when it crashes?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76626212

http://stackoverflow.com/a/76608381
has body: Use TARGET_OS_VISION to distinguish RealityKit only targets: #if TARGET_OS_VISION #else #endif // TARGET_OS_VISION
upvote count: 2
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/76560981

authentication
tags question: http://stackoverflow.com/q/76621276
tag name: authentication
type: Tag
tags question: http://stackoverflow.com/q/79512314

http://stackoverflow.com/q/76553856
has title: How can I fix drawing overlapping 2D objects in Metal (stencil, clipping)?
tagged with: metal
answer count: 2
has body: I am currently making a simple 2D rendering application using Apple Metal 3 in C++. I want to draw overlapping 2D objects using stencil test, but it does not work. A constructor for the Renderer class. Creating a stencil texture, descriptor and stencilState object. Renderer::Renderer( MTL::Device* pDevice, MTK::View* pView ) { ... auto* pTexDesc = MTL::TextureDescriptor::alloc()->init(); pTexDesc->setTextureType( MTL::TextureType2D ); pTexDesc->setWidth( _viewWidth ); pTexDesc->setHeight( _viewHeight ); pTexDesc->setPixelFormat( MTL::PixelFormatStencil8 ); pTexDesc->setStorageMode( MTL::StorageModePrivate ); pTexDesc->setUsage( MTL::TextureUsageRenderTarget ); _pStencilTexture = _pDevice->newTexture( pTexDesc ); _pDepthStencilDesc = MTL::DepthStencilDescriptor::alloc()->init(); _pStencilState = _pDevice->newDepthStencilState( _pDepthStencilDesc ); ... } Update method(called every frame). void Renderer::update( float delta ) { NS::AutoreleasePool* pPool = NS::AutoreleasePool::alloc()->init(); _pCurrentDrawableView->setClearColor( MTL::ClearColor::Make(1.0f, 1.0f, 1.0f, 1.0f) ); MTL::CommandBuffer* pCmd = _pCommandQueue->commandBuffer(); MTL::RenderPassDescriptor* pRPD = _pCurrentDrawableView->currentRenderPassDescriptor(); auto* pStencilAttach = pRPD->stencilAttachment(); pStencilAttach->setTexture( _pStencilTexture ); pStencilAttach->setClearStencil( 0 ); pStencilAttach->setLoadAction( MTL::LoadActionClear ); pStencilAttach->setStoreAction( MTL::StoreActionStore ); MTL::RenderCommandEncoder* pEnc = pCmd->renderCommandEncoder(pRPD); // ADD WHAT YOU WANT TO DRAW pEnc->setDepthStencilState( _pStencilState ); auto* pStencil = MTL::StencilDescriptor::alloc()->init(); _pDepthStencilDesc->setFrontFaceStencil( pStencil ); _pDepthStencilDesc->setBackFaceStencil( pStencil ); { // draw orc pStencil->setStencilCompareFunction( MTL::CompareFunctionAlways ); // glStencilFunc(func, _, _); pEnc->setStencilReferenceValue( 1 ); // glStencilFunc(_, ref, _); pStencil->setWriteMask( 0xf…
tagged with: objective-c
tagged with: c++
type: Question
upvote count: 1
downvote count: 0
tagged with: graphics
has answer: http://stackoverflow.com/a/76558526
accepted answer: http://stackoverflow.com/a/76558526
possible better answer: http://stackoverflow.com/a/76601655
score: 1
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/76601655

apple-m1
type: Tag
tag name: apple-m1
tags question: http://stackoverflow.com/q/76626212
tags question: http://stackoverflow.com/q/78499204

http://stackoverflow.com/comment/135020323
has text: @GiacomoCatenazzi _"... they are obsolete"_: can you point to any Microsoft documentation that says they are obsolete?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/76579270

http://stackoverflow.com/comment/135217671
score: 0
has text: Thank you! This works! Do you know also if defining the function inside the header itself and prefixing it with `extern inline` the only way to go in this case as well?
comment on: http://stackoverflow.com/a/76695377
type: AnswerComment
type: Comment

firebase-mlkit
type: Tag
tag name: firebase-mlkit
tags question: http://stackoverflow.com/q/76710556

http://stackoverflow.com/a/79007237
score: 0
type: Answer
answers question: http://stackoverflow.com/q/76621276
has body: Its not possible to have a custom logic(4 digit PIN) to authenticate a user on login window as Login Keychain needs to be unlocked before login. To unlock login keychain you would need password. I have tried and replaced the builtin mechanisms in auth db which allowed me to login using custom logic but since the login keychain couln't be unlocked my mac started behaving in weird way like all apps got logged out, lost touch id, accounts in browsers got logged ot etc... Note: Repo you shared works perfectly fine just make sure to update correct mechanism 'loginwindow:login' with your custom auth plugin.

http://stackoverflow.com/a/76568660
type: Answer
score: 0
has body: As the work you are doing in your submitted blocks is, itself, asynchronous, you can't rely on dispatch_group_async to manage group entry and exit for you. You need to call dispatch_group_enter before you call each function and dispatch_group_leave in the completion handler of each function. With your current code, the group is entered when the block is submitted and the group is left when the submitted block is complete. Because requestData is asynchronous, getOneData returns but the network operation is not complete. As getOneData (and presumably getTwoData) is asynchronous there is little value to calling it from an asynchronous block. You also have a bug where both your completion handler for getOneData and your dispatch_group_notify call endRefreshing. This will result in an "unbalanced calls" exception if there is an error in the first data request.
answers question: http://stackoverflow.com/q/76565935

http://stackoverflow.com/comment/134997659
type: AnswerComment
type: Comment
score: 0
has text: Input from the emoji and symbol character viewer only comes through on `insertText`, so I needed to implement that path anyway. `interpretKeyEvents` appeared to be the convention for passing character data from `keyDown` to `insertText`, as opposed to getting it out of the `NSEvent` and calling `insertText` myself.
comment on: http://stackoverflow.com/a/76565249

http://stackoverflow.com/a/76694164
type: Answer
has comment: http://stackoverflow.com/comment/135265901
answers question: http://stackoverflow.com/q/76623872
score: 0
has body: It seems that the provided code aims to implement e-book functionality using WKWebView on macOS. However, there are issues with touch event handling and achieving smooth scrolling. To ignore touch events in WKWebView, override the hitTest:withEvent: method in the NSView category (TouchEvents) and return nil. For pagination, modify the webView:didFinishNavigation: delegate method to set the CSS properties column-count and column-gap of the body element to achieve a single column layout without gaps. To achieve smooth scrolling, modify the buttonPressed: method. Use scrollTo with behavior: "smooth" in JavaScript to scroll to the desired position smoothly. Here's a suggested modification to the buttonPressed: method: - (void)buttonPressed:(id)sender { if ([[sender className] isEqualToString:@"NSButton"]) { if ([sender tag] == WindowSideLeft) { pageCount--; } else { pageCount++; } } else if ([[sender className] isEqualToString:@"NSConcreteNotification"]) { if ([[sender userInfo][@"direction"] isEqualTo: @(WindowSideLeft)]) { pageCount--; } else { pageCount++; } } pageCount = MAX(pageCount, 0); NSInteger pageWidth = self.window.contentView.frame.size.width; NSString *jsString = [NSString stringWithFormat:@"window.scrollTo({top: 0, left: %ld, behavior: \"smooth\"});", pageWidth * pageCount]; [bookPages evaluateJavaScript:jsString completionHandler:nil]; }

http://stackoverflow.com/comment/135026121
type: QuestionComment
has text: If this is the data you want then you can write it to a file. You don't need the C string. from the documentation of `cStringUsingEncoding`: "UTF-16 and UTF-32 are not considered to be C string encodings, and should not be used with this method—the results of passing NSUTF16StringEncoding, NSUTF32StringEncoding, or any of their variants are undefined."
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76579270

http://stackoverflow.com/comment/135032044
type: Comment
has text: @Willeke Thanks for the nudge towards the approach of using NSString methods. The following worked - ***** NSData *dataBE = [fileName dataUsingEncoding:NSUTF16BigEndianStringEncoding]; NSString *objCStringPath = [[NSString alloc] initWithData:dataBE encoding:NSUTF16BigEndianStringEncoding]; [objCStringPath writeToFile:@"/Users/user/Desktop/test" atomically:YES encoding:NSUTF16BigEndianStringEncoding error:nil]; **** Now I can see the UTF-16BE encoding in the file with the correct output as expected.
comment on: http://stackoverflow.com/q/76579270
score: 0
type: QuestionComment

http://stackoverflow.com/a/78142376
downvote count: 0
has body: Have you tried renaming your AppDelegate.m (one "m") file to AppDelegate.mm (two "m"s) inside xcode? I had a similar error when upgrading from React Native 0.68.2 to 0.70.8 and Expo 46 to 47: no visible @interface for 'EXAppDelegateWrapper' declares the selector 'application:didFinishLaunchingWithOptions:' Renaming my AppDelegate.m file to .mm did the trick. The main difference between the two file extensions is that AppDelegate.mm allows you to include Objective-C, C++ or Objective-C++, but AppDelegate.m only allows Objective-C code. It's likely that EXAppDelegateWrapper (which comes from expo-modules-core) was updated to include C++ or ObjectiveC++, which is why building with an AppDelegate.m file failed in my case.
upvote count: 2
answers question: http://stackoverflow.com/q/76648688
type: Answer
score: 2

http://stackoverflow.com/comment/135309946
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76710556
type: Comment
has text: Thanks, it was literally the first thing I did, but didn't work. Do you know if original image is oriented up, and during core image work it was cropped and rotated (say 20 degrees as example), what's the output image's orientation be?

uiscenedelegate
tags question: http://stackoverflow.com/q/76559806
type: Tag
tag name: uiscenedelegate

http://stackoverflow.com/comment/135142905
has text: Actually, my case is after I load contacts all, I will save it into a cache. The next time start the app, I will get it from the cache and sort it again same to Contacts order like when I fetch all from Contacts through CNContactStore.enumerateContact (its my business rules)
comment on: http://stackoverflow.com/q/76651162
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/76602592
has comment: http://stackoverflow.com/comment/135068769
downvote count: 0
has comment: http://stackoverflow.com/comment/135068594
has comment: http://stackoverflow.com/comment/135065069
type: AcceptedAnswer
upvote count: 2
type: Answer
has body: As you already have the RTF string as NSAttributedString you can enumerate the attributed string to get all ranges of the bold parts. And I recommend to use the URL related API of NSBundle NSError *error = nil; NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"2024ROMANSEDITED" withExtension:@"rtf"]; NSAttributedString *fileContent = [[NSAttributedString alloc] initWithURL: fileURL options:@{NSDocumentTypeDocumentAttribute: NSRTFTextDocumentType} documentAttributes:nil error: &error]; NSMutableArray *result = [NSMutableArray new]; [fileContent enumerateAttribute: NSFontAttributeName inRange:NSMakeRange(0, fileContent.length) options: 0 usingBlock:^(id _Nullable value, NSRange range, BOOL * _Nonnull stop) { if (([[(UIFont *)value fontDescriptor] symbolicTraits] & UIFontDescriptorTraitBold) != 0) { [result addObject:[NSValue valueWithRange: range]]; } }]; NSLog(@"%@", result); result contains the ranges wrapped in NSValue objects.
score: 2
accepted answer of: http://stackoverflow.com/q/76597435
answers question: http://stackoverflow.com/q/76597435

http://stackoverflow.com/a/76710181
answers question: http://stackoverflow.com/q/76686566
accepted answer of: http://stackoverflow.com/q/76686566
type: AcceptedAnswer
score: 0
type: Answer
has body: This turned out to be the same issue as in this thread: Building a Cocoapod with both Swift and Objective-C: How to Deal with Umbrella Header Issues? Adding the header to the top level of pod classes and naming it "Test_Pod.h" with just: #import "Test_Pod-umbrella.h"

http://stackoverflow.com/comment/134989768
has text: I tried to reproduce the issue but `insertText` is called for all repeated keys. Post a [mre] please.
type: QuestionComment
comment on: http://stackoverflow.com/q/76546729
type: Comment
score: 0

http://stackoverflow.com/q/76670798
type: Question
upvote count: 1
tagged with: swift
downvote count: 0
accepted answer: http://stackoverflow.com/a/76671111
score: 1
type: AnsweredQuestion
answer count: 1
tagged with: objective-c
has body: I am new to the Swift world, and have created a very basic app that loads up 3 views from a storyboard controller called Main @IBAction func view2ButtonClicked(_ sender: Any) { if let vc = self.storyboard?.instantiateViewController(withIdentifier: String(describing: Test2ViewController.self)) as? Test2ViewController { self.navigationController?.pushViewController(vc, animated: true) } } @IBAction func view3ButtonClicked(_ sender: Any) { if let vc = self.storyboard?.instantiateViewController(withIdentifier: String(describing: Test3ViewController.self)) as? Test3ViewController { self.navigationController?.pushViewController(vc, animated: true) } } However, I have also copied over a .h & .m as well as a storyboard from an older obj-c project, I have setup the bridging header, and I am trying to load it using the following method; @IBAction func view1ButtonClicked(_ sender: Any) { let storyboard = UIStoryboard(name: "CompassView", bundle: nil) let vc = storyboard.instantiateViewController(withIdentifier: "CompassViewController") self.navigationController!.pushViewController(vc, animated: true) } However it crashes with the error; *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'CompassView' in bundle NSBundle When I locate the Compass storyboard file, I check the name and it is Compass.storyboard and the custom class is CompassViewController and storyboard ID is CompassView
has answer: http://stackoverflow.com/a/76671111
has title: Loading obj-c files with storyboard in Swift project
favorite count: 0
tagged with: ios

http://stackoverflow.com/comment/135068594
score: 0
has text: I tested the code successfully with a sample RTF file. May something is wrong with your RTF data.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76602592

http://stackoverflow.com/q/76677790
score: 0
type: Question
tagged with: iphone-privateapi
tagged with: mac-catalyst
tagged with: objective-c
type: UnansweredQuestion
tagged with: swift
answer count: 0
has title: Private API to embed a Mac Catalyst component in a native AppKit app?
has comment: http://stackoverflow.com/comment/135193088
has comment: http://stackoverflow.com/comment/135186437
has body: I would like to embed a Mac Catalyst component, like TOCropViewController or MessageKit (I am not providing a link to either to avoid getting this post flagged as spam, but if you google them you will find that they handle a lot of functionality that cannot be easily replicated), in a native AppKit app. I do not distribute my app in the App Store, so I am OK with private APIs. To be clear: I do not want do add an AppKit component to a Mac Catalyst app; I want to do the reverse, as I already have a very large AppKit codebase
tagged with: appkit

http://stackoverflow.com/comment/135033302
type: QuestionComment
comment on: http://stackoverflow.com/q/76579270
type: Comment
has text: Hey, I think you should know that, the code point is a bit different from the multibyte stored in your file. It's very different for different encoding formats, eg: UTF-8, UTF-16, UTF-32.
score: 0

swiftgen
tags question: http://stackoverflow.com/q/76668394
tag name: swiftgen
type: Tag

http://stackoverflow.com/comment/135012502
score: 0
comment on: http://stackoverflow.com/a/76558526
type: AnswerComment
type: Comment
has text: I suggest seeing qhat the stencil looks like before the grass is drawn in the Metal debugger

charts
tags question: http://stackoverflow.com/q/76626212
tag name: charts
type: Tag

http://stackoverflow.com/comment/135054865
has text: Now the question is why is the bold text not being represented in the rtf
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76597435

http://stackoverflow.com/comment/135021907
comment on: http://stackoverflow.com/q/76579270
type: QuestionComment
score: 0
type: Comment
has text: @KamyFC: right, With char your code cannot work. You should do the *contrary*. You want to get the Unicode codepoint (warning: most wchar interfaces works with code units so never with the 4-byte UTF-8 characters). So if you start with UTF-8, you should calculate codepoint, so the contrary: check the forst byte)

http://stackoverflow.com/a/76754348
accepted answer of: http://stackoverflow.com/q/76707092
score: 1
downvote count: 0
type: AcceptedAnswer
type: Answer
has body: NS_REFINED_FOR_SWIFT is used for API's methods that return values by pointer in parameters. Refined API will return values in tuple instead. NS_REFINED_FOR_SWIFT can't create nested classes. Still you can write: extension MyButton { typealias Configuration = __MyButtonConfiguration }
upvote count: 1
answers question: http://stackoverflow.com/q/76707092

http://stackoverflow.com/comment/134979653
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76555630
has text: @Larme Thanks for the advice, definitely will do
type: QuestionComment

http://stackoverflow.com/comment/135224331
comment on: http://stackoverflow.com/q/76633529
score: 0
type: QuestionComment
has text: Maybe https://developer.apple.com/documentation/uikit/uiscrollview/1619383-alwaysbouncevertical ?
type: Comment

http://stackoverflow.com/comment/137066063
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76710556
type: Comment
has text: Unfortunately, ML Kit does not provide direct support for converting a CoreImage to a VisionImage. Users are required to accurately set the orientation in VisionImage prior to feeding it into ML Kit's detection pipeline for face detection. To ensure correct orientation, you can verify it in two ways: Save the UIImage locally and check if its orientation aligns with the .orientation set in VisionImage. Experiment with all possible .orientation values on the VisionImage to determine which one yields a valid detection.

http://stackoverflow.com/a/76759696
type: Answer
answers question: http://stackoverflow.com/q/76707092
score: 0
has body: With the push in the right direction by @Cy-4AH I figured out how to get a 3rd level as well. For example, if I want the Objective-C class MyButtonConfigurationSize to be exposed as MyButton.Configuration.Size in Swift, then after adding the first extension, I would need: extension MyButton.Configuration { typealias Size = __MyButtonConfigurationSize } It seems so obvious now.

http://stackoverflow.com/a/76590594
type: Answer
downvote count: 0
upvote count: 3
has body: I really don't understand what you're trying to do with images ... but let's look at a Path option (instead of generating a UIImage from each path / shape). If you're targeting iOS 16.0+ we can take advantage of CGPathCreateCopyByUnioningPath (for prior iOS versions, you can find some Bezier Path libraries out there). Quick description... Suppose we create two rectangle paths with these separated rects: CGRect r1 = CGRectMake(60, 20, 100, 100); CGRect r2 = CGRectMake(200, 60, 100, 100); CGPathRef pthA = CGPathCreateWithRect(r1, nil); CGPathRef pthB = CGPathCreateWithRect(r2, nil); If we then add those paths to a mutable path: CGMutablePathRef pth = CGPathCreateMutable(); CGPathAddPath(pth, nil, pthA); CGPathAddPath(pth, nil, pthB); shapeLayer.path = pth; we get this: Now let's change the rects so they will overlap: CGRect r1 = CGRectMake(100, 20, 100, 100); CGRect r2 = CGRectMake(160, 60, 100, 100); CGPathRef pthA = CGPathCreateWithRect(r1, nil); CGPathRef pthB = CGPathCreateWithRect(r2, nil); CGMutablePathRef pth = CGPathCreateMutable(); CGPathAddPath(pth, nil, pthA); CGPathAddPath(pth, nil, pthB); shapeLayer.path = pth; and we get this result: Since your goal is to "remove the overlapping lines" we can use CGPathCreateCopyByUnioningPath ... same overlapping rects as above: CGRect r1 = CGRectMake(100, 20, 100, 100); CGRect r2 = CGRectMake(160, 60, 100, 100); CGPathRef pthA = CGPathCreateWithRect(r1, nil); CGPathRef pthB = CGPathCreateWithRect(r2, nil); CGPathRef pth = CGPathCreateCopyByUnioningPath(pthA, pthB, NO); shapeLayer.path = pth; Now we get this as the output: I posted a sample project here: https://github.com/DonMag/CGPathUnion
score: 3
answers question: http://stackoverflow.com/q/76568196

http://stackoverflow.com/a/76556130
has body: After digging more into find out the problem, I finally found the issue. For some reason when adding urls into the array it added a space after each link except for the last one, I found the problem by counting the string length then logging each character individually. so I added this lines of code in the sortM3UFile and it fixed the problem NSArray *words = [tempTitle componentsSeparatedByCharactersInSet :[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSString *nospaces = [words componentsJoinedByString:@&quot;&quot;]; [movieURL addObject:nospaces]; hope that would help someone
type: Answer
score: 0
answers question: http://stackoverflow.com/q/76555630

http://stackoverflow.com/a/76686979
has body: Try removing the Test_Pod from your project and reinstalling it pod deintegrate pod install
score: 0
type: Answer
answers question: http://stackoverflow.com/q/76686566

http://stackoverflow.com/comment/135218175
has text: If you are using pure Objective-C, it might be more challenging, since you would either just keep using defines or create a separate `extern` declaration and a definition in `.m` file.
type: QuestionComment
comment on: http://stackoverflow.com/q/76696283
score: 1
type: Comment

rtf
tag name: rtf
type: Tag
tags question: http://stackoverflow.com/q/76597435

http://stackoverflow.com/q/76546729
score: 0
accepted answer: http://stackoverflow.com/a/76565249
tagged with: objective-c
tagged with: cocoa
tagged with: nsresponder
has comment: http://stackoverflow.com/comment/134969268
type: Question
answer count: 1
has title: Why are certain repeated keys ignored by interpretKeyEvents in NSResponder?
has comment: http://stackoverflow.com/comment/134989768
has answer: http://stackoverflow.com/a/76565249
has body: I have an NSView that calls interpretKeyEvents for keyDown events. For some keys like the letter 'a', pressing and holding the key results in repeated calls to insertText. For other keys like 'x', insertText is called once and that is it. I would like press and hold to always call insertText. I'm guessing press and hold for these keys is interpreted as something else, but I cannot find it. I have implemented doCommandBySelector as described by the documentation, but that is never called either. Below is a minimal example program that demonstrates the behaviour. // clang++ -framework AppKit -o proof-of-concept proof-of-concept.mm #include <stdio.h> #import <Cocoa/Cocoa.h> @interface AppView : NSView<NSTextInputClient> @end @implementation AppView - (void)keyDown:(NSEvent *)event { printf("keydown\n"); [self interpretKeyEvents:[NSArray arrayWithObject:event]]; } - (void)insertText:(id)string replacementRange:(NSRange)replacementRange { printf("insertText\n"); } - (BOOL)acceptsFirstResponder { return YES; } - (void)setMarkedText:(id)string selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange {} - (void)unmarkText {} - (NSRange)selectedRange { return NSMakeRange(NSNotFound, 0); } - (NSRange)markedRange { return NSMakeRange(NSNotFound, 0); } - (BOOL)hasMarkedText { return NO; } - (nullable NSAttributedString *)attributedSubstringForProposedRange:(NSRange)range actualRange:(nullable NSRangePointer)actualRange { return nil; } - (NSArray<NSAttributedStringKey> *)validAttributesForMarkedText { return [NSArray array]; } - (NSRect)firstRectForCharacterRange:(NSRange)range actualRange:(nullable NSRangePointer)actualRange { return NSMakeRect(0, 0, 0, 0); } - (NSUInteger)characterIndexForPoint:(NSPoint)point { return 0; } @end int main(int argc, char **argv, char **envp, char **apple) { [NSApplication sharedApplication]; [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; NSRect windowDimensions = NSMakeRect(0, 0, 300, 300); NSWindow *wind…
type: AnsweredQuestion

http://stackoverflow.com/comment/135023217
comment on: http://stackoverflow.com/q/76579270
type: Comment
has text: Your other approach with `for(int k = 0; k < byteCount; k++)` skips the first byte of the following character when byteCount is greater than 1. It should be something like `fprintf(fd, "%c", character);` `for (int k = 1; k < byteCount; k++)` `{` `character = *++stringText;` `fprintf(fd, "%c", character);` `}`.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/134979391
has text: Unrelated, but you should keep a `NSDictionary`, or a custom class which will have the url and the title, and use an unique array to have that.
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76555630

http://stackoverflow.com/comment/137998548
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/76752995
has text: +1, you saved my life bro, thank you so much. Such a stupid thing to be updated manually instead of Automatic by XCODE.

string-literals
tags question: http://stackoverflow.com/q/76668394
type: Tag
tag name: string-literals

appdelegate
type: Tag
tags question: http://stackoverflow.com/q/76559806
tag name: appdelegate
tags question: http://stackoverflow.com/q/76648688
tags question: http://stackoverflow.com/q/79227303

google-mlkit
type: Tag
tags question: http://stackoverflow.com/q/76710556
tag name: google-mlkit
tags question: http://stackoverflow.com/q/79103337

http://stackoverflow.com/comment/135240415
has text: Thanks for reply, but where I can find the UIScrollView? ViewController ,UINavigationController and presentedViewController also not find ScrollView inside
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76633529

http://stackoverflow.com/comment/135217712
type: AnswerComment
comment on: http://stackoverflow.com/a/76695377
type: Comment
score: 1
has text: I think, for Metal compiler, if you are not trying to compile a dynamic library, all the definitions go into the same module, and the compiler will most probably also inline all of them, so I'm not sure if you even need that. I don't think it hurts in this case, just be careful not to violate the ODR.

sfauthorizationpluginview
tag name: sfauthorizationpluginview
tags question: http://stackoverflow.com/q/76621276
type: Tag

http://stackoverflow.com/comment/135218174
type: QuestionComment
comment on: http://stackoverflow.com/q/76696283
has text: I think defines are okay, but you can use macros as well to be more expressive. In case of program scope constants in Metal, you want your constants to be `constant constexpr` and in Objective-C, if you are using the C++ dialect of it, you can just keep it as constexpr. You can use `#ifdef __METAL_VERSION_` to define a different version of `CONSTANT` macro or whatever you wanna call it that will generate the left hand of the constant definition and use it as `CONSTANT(int) myConstant = 123;`.
score: 1
type: Comment

http://stackoverflow.com/comment/135229187
type: QuestionComment
score: 0
has text: If we don't use Expo, could you clarify what's the definition of `EXAppDelegateWrapper`? Could you also check https://github.com/expo/expo/issues/21042 ?
comment on: http://stackoverflow.com/q/76648688
type: Comment

http://stackoverflow.com/a/76618251
downvote count: 1
has comment: http://stackoverflow.com/comment/135093738
type: Answer
upvote count: 1
score: 0
answers question: http://stackoverflow.com/q/76615959
has body: Please follow these points. check permission in plist file locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.pausesLocationUpdatesAutomatically = NO; locationManager.distanceFilter = 5; ( you can change it) for reference link Getting location update after certain distance (5 m in my case) How to work with user location in iOS 16 App Intents?

http://stackoverflow.com/comment/134988059
comment on: http://stackoverflow.com/a/76558526
type: AnswerComment
type: Comment
score: 0
has text: Thank you! `MTL::DepthStencilDescriptor` does not have setFront/BackFacingState(). You mean setFrontFaceStencil() right? And I've tried this, the result is same. The grass should be drowed as a background but it just covered all screen. (It seems stencil test does not work)

appkit
tag name: appkit
type: Tag
tags question: http://stackoverflow.com/q/76677790
tags question: http://stackoverflow.com/q/76860334
tags question: http://stackoverflow.com/q/78076129
tags question: http://stackoverflow.com/q/78360107
tags question: http://stackoverflow.com/q/78467796
tags question: http://stackoverflow.com/q/78633101
tags question: http://stackoverflow.com/q/79218608
tags question: http://stackoverflow.com/q/79213356
tags question: http://stackoverflow.com/q/79228264
tags question: http://stackoverflow.com/q/79305765
tags question: http://stackoverflow.com/q/79334360
tags question: http://stackoverflow.com/q/79269479
tags question: http://stackoverflow.com/q/79245494
tags question: http://stackoverflow.com/q/79270160
tags question: http://stackoverflow.com/q/79327312
tags question: http://stackoverflow.com/q/79508792
tags question: http://stackoverflow.com/q/79518299

http://stackoverflow.com/comment/135019506
type: Comment
has text: Do you have a reference for your "expected" multibyte character encoding scheme (which does not look very sensible to me). The "actual" sequence is using standard Unicode UTF-8 encoding.
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/76579270

http://stackoverflow.com/comment/135083130
type: QuestionComment
comment on: http://stackoverflow.com/q/76577713
type: Comment
has text: Thank-You Rob As you observed the code was fine. Dumb mistake on my part. This is an older project that I was updating. I had forgotten that I have a 'sound-off' button in the UI. After allowing sound all works fine. I have a new twist - The remote control device is active while on 'other' screens in my app, not just the VC attached to the 'view did load' in which I added code. I did not expect that. What is the proper way to limit to just the desired VC? I can just add some booleans to 'view did appear/disappear' - is there a more proper way? Thanks
score: 0

uicollectionview
tags question: http://stackoverflow.com/q/76633529
type: Tag
tag name: uicollectionview
tags question: http://stackoverflow.com/q/77490512
tags question: http://stackoverflow.com/q/77518382
tags question: http://stackoverflow.com/q/77513052
tags question: http://stackoverflow.com/q/78214804

http://stackoverflow.com/comment/135021768
type: QuestionComment
comment on: http://stackoverflow.com/q/76579270
type: Comment
score: 0
has text: @IanAbbott If you open the link, search for '1EA1', you will find the mapping with 'ạ'

http://stackoverflow.com/comment/135052340
has text: You need to import RNWebViewManager.h
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76595578

nsresponder
type: Tag
tag name: nsresponder
tags question: http://stackoverflow.com/q/76546729

uiimage
tag name: uiimage
tags question: http://stackoverflow.com/q/76568196
type: Tag
tags question: http://stackoverflow.com/q/76738986
tags question: http://stackoverflow.com/q/76945838
tags question: http://stackoverflow.com/q/77614453

live-connect-sdk
tag name: live-connect-sdk
tags question: http://stackoverflow.com/q/76604747
type: Tag

iphone-privateapi
type: Tag
tag name: iphone-privateapi
tags question: http://stackoverflow.com/q/76677790
tags question: http://stackoverflow.com/q/78373313

http://stackoverflow.com/comment/135175199
score: 0
comment on: http://stackoverflow.com/a/76671111
type: AnswerComment
has text: Sometimes it's so easy to miss the obvious! I appreciate your answer thank you!
type: Comment

http://stackoverflow.com/comment/135287451
score: 0
type: QuestionComment
has text: After thinking more about it, I think you are confusing `self` -- which is a pointer to your class -- with the _location_ of the first implicit argument. I.e. you probably want something like `((uintptr_t)&self) + sizeof ...`. However, even if the implicit argument is located on the stack, the compiler may return the location of a local copy of the argument rather than the actual argument location.
type: Comment
comment on: http://stackoverflow.com/q/76735865

http://stackoverflow.com/comment/135512227
has text: @sgx, please pay attention to that `char*`→`*NSString` conversion problem which I have overlooked initially (I have no exposure to Cocoa).
comment on: http://stackoverflow.com/a/76868430
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/135484026
score: 2
type: Comment
has text: Objective-C exceptions are not crashes. In Swift there are no such "exceptions" at all. In Swift, Objective-C exceptions are a very legacy concept. Yet, neither Swift Errors nor Objective-C exceptions are "crashes". Crashes may be caught by signal handlers. The library you linked, "Crash Eye" gives a clue what this is and how you catch those events.
comment on: http://stackoverflow.com/q/76851823
type: QuestionComment

http://stackoverflow.com/comment/135317897
score: 0
comment on: http://stackoverflow.com/q/76735865
type: Comment
has text: For some simple implementations of this, see the trampolines in https://github.com/iosptl/ios7ptl/tree/master/ch24-DeepObjC/ObserverTrampoline.
type: QuestionComment

http://stackoverflow.com/q/76857514
has body: I'm looking for a way (if it's even possible) to hierarchically group my XCTestCases. I've been googling and the only somewhat similar thing I found is Grouping Tests into Substeps with Activities, which is not what I want (grouping individual tests and groups into other groups). For example, here's what the thing I want to do looks like in other languages, e.g. Dart (but it's very similar with Jest in JavaScript land as well): void main() { group('Top group', () { group('nested group 1', () { test('test case 1', () {}); test('test case 2', () {}); // ... }); group('some other nested group', () { /* test cases here ... */ }); }); } The structure is detected by the tooling such as IDEs: Is it possible to accomplish this with XCTestCase? Ideally the solution could be accomplished entirely at runtime, it could even involve some dark magic with Objective-C runtime, as long as it had a chance to work. If it's not possible, I'd like to hear that as well. Thanks in advance!
tagged with: ios
downvote count: 1
upvote count: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/76880736
tagged with: xctest
answer count: 1
tagged with: objective-c
tagged with: xcuitest
has title: Can XCTestCases be grouped hierarchically?
has answer: http://stackoverflow.com/a/76880736
type: Question
tagged with: swift
score: 1
favorite count: 0

http://stackoverflow.com/comment/135299925
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76742126
has text: thanks for all the response guys, i am new here, i already edited the question. Cheers

http://stackoverflow.com/q/76827926
upvote count: 6
has comment: http://stackoverflow.com/comment/135443309
has comment: http://stackoverflow.com/comment/135941201
has comment: http://stackoverflow.com/comment/135940977
score: 6
has comment: http://stackoverflow.com/comment/135982405
linked to: http://stackoverflow.com/q/41502199
has comment: http://stackoverflow.com/comment/136365345
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/135982457
has comment: http://stackoverflow.com/comment/135983356
has comment: http://stackoverflow.com/comment/136365312
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/76828863
tagged with: objective-c-runtime
downvote count: 0
has comment: http://stackoverflow.com/comment/135941110
favorite count: 0
has comment: http://stackoverflow.com/comment/136365341
has title: What's the format for `objc_method_description.types` for swift blocks?
linked to: http://stackoverflow.com/q/11527385
has comment: http://stackoverflow.com/comment/135983386
tagged with: method-signature
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135939795
has body: The Objective-C method encoding produced by the Swift compiler for swift methods with blocks seems to use syntax not documented anywhere. For instance the method: func DebugLog2(message: String) async -> String has the method encoding: v32@0:8@"NSString"16@?<v@?@"NSString">24 and there are at least three characters (", <, and >) not covered in the documentation: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html The NSMethodSignature class also doesn't like this encoding: [NSMethodSignature signatureWithObjCTypes:"\"NSString\"16@?<v@?@\"NSString\">24"]; results in: '+[NSMethodSignature signatureWithObjCTypes:]: unsupported type encoding spec '"' in '"NSString"16@?<v@?@"NSString">24'' I tried looking through Swift's code, and it seems there's something called "extended method type encodings": https://github.com/apple/swift/blob/c2fc7ee9e72e9a39854548e3202c667e4934dc65/test/IRGen/objc_methods.swift#L13-L14 but I got lost trying to figure out where in the Swift codebase the method type encoding is generated. Related questions that don't answer this: How to decipher "objc_method_description" from protocol method description list? What are the digits in an ObjC method type encoding string? Sample code: decodeProto() @objc class TestClass : NSObject { @objc func DebugLog(message: String) -> String { print(message) return message } @objc func DebugLog2(message: String) async -> String { do { try await Task.sleep(nanoseconds: 1_000_000_000) } catch {} print(message); return message; } } func decodeProto() { var methodCount : UInt32 = 1 let methodList = class_copyMethodList(TestClass.self, UnsafeMutablePointer<UInt32>(&methodCount))! for i in 0..<Int(methodCount) { let method = methodList[i]; let desc = method_getDescription (method); let name = desc.pointee.name! let types = String(validatingUTF8: desc.pointee.types!)! print("Selector: \(name) Description: \(types)") } } prints: Selector: DebugLog2With…
answer count: 1
linked to: http://stackoverflow.com/q/11491947

http://stackoverflow.com/a/76860536
answers question: http://stackoverflow.com/q/76804325
upvote count: 1
accepted answer of: http://stackoverflow.com/q/76804325
downvote count: 0
has body: On tvOS platform you should work with focuses instead of selections for the navigation purposes so just use indexPathForPreferredFocusedViewInTableView to inform UITableView for a focused index path, e.g: @interface ViewController () &lt;UITableViewDataSource, UITableViewDelegate&gt; ... @property (nonatomic) NSIndexPath* focusedIndexPath; @end @implementation ViewController ... - (void)focusRow:(NSInteger)row { self.focusedIndexPath = [NSIndexPath indexPathForRow:row inSection:0]; [self.tableView setNeedsFocusUpdate]; } #pragma mark - UITableViewDelegate - (NSIndexPath *)indexPathForPreferredFocusedViewInTableView:(UITableView *)tableView { return self.focusedIndexPath; } @end
score: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/135347471
type: Comment
has text: Do you mean you want to check `challenge.protectionSpace.host`?
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/76772945

http://stackoverflow.com/q/76849065
favorite count: 0
answer count: 0
type: Question
tagged with: swift
type: UnansweredQuestion
has title: React native method not a recognized objective C method
score: 1
tagged with: ios
has body: I am trying to create bridge from native module to react native. I have tried all errors and solutions related to the same subject with no luck to get it running Following is my swift code import Foundation @objc(MyModule) class MyModule: NSObject { let mySdk = MySdkBuilder.build() @objc func renderForm(_ intentId: String, intentType: String, withResolver resolve: @escaping RCTPromiseResolveBlock, withRejecter reject: @escaping RCTPromiseRejectBlock) { let rootViewController: UIViewController? if #available(iOS 13.0, *) { rootViewController = (UIApplication.shared.connectedScenes.first as? UIWindowScene)?.windows.first(where: { $0.isKeyWindow })?.rootViewController } else { rootViewController = UIApplication.shared.delegate?.window??.rootViewController } mySdk.renderForm( on: rootViewController, intentId: intentId, intentType: intentType ) { details in do { resolve(details) } catch { let error = NSError(domain: "MyDomain", code: -1, userInfo: nil) reject("1000", "Error message", error) } } } } #import "MyModule.h" @implementation MyModule RCT_EXPORT_MODULE() RCT_EXTERN_METHOD(renderForm:(NSString *)intentId intentType:(NSString *)intentType withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject) // Don't compile this code when we build for the old architecture. #ifdef RCT_NEW_ARCH_ENABLED - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule: (const facebook::react::ObjCTurboModule::InitParams &)params { return std::make_shared<facebook::react::NativeMyModuleSpecJSI>(params); } #endif @end and here is my .h file #ifdef RCT_NEW_ARCH_ENABLED #import "RNMyModuleSpec.h" @interface MyModule : NSObject <NativeMyModuleSpec> #else #import <React/RCTBridgeModule.h> @interface MyModule : NSObject <RCTBridgeModule> #endif @end But I got the following error when tried to run the app Exception 'renderForm:intentType:withResolver:withRejecter: is not a recognized Objective-C method.' was thrown while invoking renderForm on target MyModul…
tagged with: objective-c
tagged with: react-native
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/135512025
comment on: http://stackoverflow.com/q/76867855
score: 0
type: QuestionComment
type: Comment
has text: Thanks, I see now: you want to get a value _from_ the returned `NSDictionary` using some key.

http://stackoverflow.com/q/76731017
type: AnsweredQuestion
has title: Creating iOS framework with Objective-C
has answer: http://stackoverflow.com/a/76732073
downvote count: 0
score: 3
has body: I have some trouble creating a framework for iOS. I created a new project (called Logger) and selected the Framework option. Then, Xcode created the folder structure and it had a few files including Logger.h, but no Logger.m was created. Then, I have created new Cocoa Touch file called AppLogger and added some basic logic to it. I imported the AppLoger.h file in my Logger.h like this: #import <Logger/AppLoger> I also tried it like this: #import "Logger/AppLoger" But it gives me an error: 'Logger/AppLogger.h' file not found I don't understand what the problem is with my setup. Attached is also an image of my project structure.
upvote count: 3
type: Question
accepted answer: http://stackoverflow.com/a/76732073
answer count: 1
tagged with: objective-c
tagged with: ios-frameworks
favorite count: 0
tagged with: ios

http://stackoverflow.com/comment/135425920
type: QuestionComment
has text: What does the documentation of `NSPredicate` say about evaluating a decoded predicate?
type: Comment
comment on: http://stackoverflow.com/q/76816936
score: 0

http://stackoverflow.com/comment/135471917
comment on: http://stackoverflow.com/q/76841203
type: QuestionComment
score: 0
type: Comment
has text: @koen nope it doesn't

http://stackoverflow.com/comment/135468202
comment on: http://stackoverflow.com/q/76841203
type: QuestionComment
score: 1
type: Comment
has text: Does this answer your question? [Skproduct skipping product because no price was available](https://stackoverflow.com/questions/73810958/skproduct-skipping-product-because-no-price-was-available)

http://stackoverflow.com/comment/135298934
comment on: http://stackoverflow.com/q/76742126
score: 0
type: QuestionComment
has text: As an aside, semaphores should be removed. (They are so susceptible to problems that they’re best considered an anti-pattern nowadays.) This can easily be refactored to eliminate the semaphores and `dispatch_group_async` and just `dispatch_group_enter` before your async calls and `dispatch_group_leave` in the final completion handler. That’s much simpler than what you have here and less brittle.
type: Comment

http://stackoverflow.com/comment/135428846
comment on: http://stackoverflow.com/q/76815699
type: QuestionComment
type: Comment
score: 0
has text: How are you going to use the predicate, in a Core Data fetch?

http://stackoverflow.com/q/76748425
tagged with: objective-c
tagged with: cocoa
upvote count: 1
downvote count: 0
favorite count: 0
tagged with: nsvisualeffectview
type: Question
has body: I want to make a backwards-compatible background view for my application (OS X 10.6+) and then use it inside my Application.xib. I made a subclass of NSView which returns NSVisualEffectView or NSView (depends on macOS version). BackgroundView.h #import <Cocoa/Cocoa.h> NS_ASSUME_NONNULL_BEGIN @interface BackgroundView : NSView @end NS_ASSUME_NONNULL_END BackgroundView.m #import "BackgroundView.h" @implementation BackgroundView - (instancetype)init { if (@available(macOS 10.10, *)) { NSVisualEffectView *visualEffectView = [[NSVisualEffectView alloc] init]; [self applyPropertiesForVisualEffectView: visualEffectView]; } return [super init]; } - (instancetype)initWithCoder:(NSCoder *)coder { if (@available(macOS 10.10, *)) { NSVisualEffectView *visualEffectView = [[NSVisualEffectView alloc] initWithCoder:coder]; [self applyPropertiesForVisualEffectView: visualEffectView]; // !!!"This coder requires that replaced objects be returned from initWithCoder:"!!! return (BackgroundView *)visualEffectView; } return [super initWithCoder:coder]; } - (instancetype)initWithFrame:(NSRect)frameRect { if (@available(macOS 10.10, *)) { NSVisualEffectView *visualEffectView = [[NSVisualEffectView alloc] initWithFrame:frameRect]; [self applyPropertiesForVisualEffectView: visualEffectView]; return (BackgroundView *)visualEffectView; } return [super initWithFrame: frameRect]; } - (void)applyPropertiesForVisualEffectView: (NSVisualEffectView *)visualEffectView API_AVAILABLE(macos(10.10)){ [visualEffectView setState:NSVisualEffectStateActive]; [visualEffectView setBlendingMode:NSVisualEffectBlendingModeBehindWindow]; } @end Then I inserted my BackgroundView class name as the class for the windows' main view. And then ticked off "Prefers coder at runtime": But I'm getting this error for whatever reason. How can I fix this issue? I don't want to use some dynamic class injections like here because it looks like an awful solution in 2023. I know I can add NSVisualEffect as a subview but I don't thi…
type: UnansweredQuestion
score: 1
tagged with: macos
tagged with: nsview
linked to: http://stackoverflow.com/q/25914918
answer count: 0
has title: Returning another NSView subclass in 'initWithCoder' results in error "This coder requires that replaced objects be returned from initWithCoder""

http://stackoverflow.com/q/76729747
favorite count: 0
has body: I'm using this code to get NSData of a specific file: NSData* data = [[NSData alloc] initWithContentsOfURL:object.fileURL]; Before this line the memory usage was 18MB and after this line it become 66.1. right after i want release this object(Non-ARC class) so i call [data release]; And the data memory usage becomes 43 instead of 18MB. Any idea what can be the problem? how i. can fix it?
tagged with: ios
has title: Release NSData not release all memory
type: AnsweredQuestion
tagged with: objective-c
downvote count: 0
accepted answer: http://stackoverflow.com/a/76731783
has answer: http://stackoverflow.com/a/76731783
type: Question
upvote count: 1
answer count: 1
tagged with: nsdata
score: 1

http://stackoverflow.com/comment/136365312
has text: Yes, I agree corrupting data due to catching Objective-C isn't a good thing. However, the alternative may be worse... AppKit _already_ catches Objective-C exceptions and blithely ventures forth, which is another level of bad if there are managed frames on the stack. Converting them back/from managed exceptions and the native/managed code boundary makes managed developers actually able to figure out what's happening and do something about it.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76827926
type: QuestionComment

http://stackoverflow.com/a/76763475
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/76757144
has body: I would organize delegate methods loosely into two general categories: Methods which just inform you of certain events, giving you the opportunity to react, but not necessarily immediately. Methods which are called to request your code to achieve some immediate effect, such as returning some kind of data as an immediate return value of the method call. Group 1 methods are easy, you can usually just kick off your work in a Task (or dispatch async to another queue, etc.), and have your effect take place after the method's completion. Group 2 methods are the trickier ones, because you need the result synchronously, but there are some tricks: As Rob pointed out, in some cases like UITableViewDataSource.tableView(_:numberOfRowsInSection:), you can return 0 for the item count at first (while you start off your load in the background), and then reload shortly after, to give the "real answer". In some other cases, you can return a "half baked" object synchronously, and flesh out the details asynchronously. For example, for UITableViewDataSource.tableView(_:cellForRowAt:) you might immediately return an empty cell, but kick off some background task that will asynchronously fill it in. In the worst case, you have methods where a result is immediately required, with its full details. You basically have no recourse here, you need to block in some way (ideally off the main thread), to do the work and have the result ready by the time the method returns.
score: 1

http://stackoverflow.com/q/76772945
answer count: 0
tagged with: objective-c
has title: URLSession.didReceiveChallenge : how to ignore one specific certificate check on server-side authentication
has comment: http://stackoverflow.com/comment/135355579
type: Question
score: 0
has body: I'm using macOS native framework to sent https requests (nsurlsession). In order to handle TLS flows of server-side authentication, I've implemented the didReceiveChallenge callback. In my special case, My https request's URL composed of IP instead of URL, so i'd like to remove one default check of matching the URL with the server certificate's common name, but remains all the other checks. Perhaps anybody can verify my code ? Thanks is it possible to eliminate this check for specific connections ? UPDATE: Thanks to the comment below by Larme, I was able to further research the topic and bind the hostname check to a specific URL instead of the ip address. - (void)URLSession:(NSURLSession*)session didReceiveChallenge:(NSURLAuthenticationChallenge*)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential* credential))completionHandler { if (challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust) { BOOL allow = true; if (URL_IS_IP) { SecTrustRef trust; trust = challenge.protectionSpace.serverTrust; OSStatus err; SecPolicyRef policy; policy = SecPolicyCreateSSL(true, CFSTR("matchinUrl.com")); err = SecTrustSetPolicies(trust, policy); if (err == errSecSuccess) { allow = evaluateTrust(trust); } CFRelease(policy); } if (allow) { completionHandler( NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:trust]); } else { completionHandler( NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil); } } else { completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); } }
tagged with: ssl
type: UnansweredQuestion
tagged with: nsurlsession
has comment: http://stackoverflow.com/comment/135347471

http://stackoverflow.com/q/76742126
has comment: http://stackoverflow.com/comment/135300190
answer count: 0
has comment: http://stackoverflow.com/comment/135299925
tagged with: ios
has comment: http://stackoverflow.com/comment/135298841
type: Question
tagged with: objective-c
type: UnansweredQuestion
has body: I'm trying to update MBProgressHUD in my controller. From only showing a static message, i want to put either progressbar/progress percentage to show uploading process to user. YBWeakSelf; [[YBStorageManage shareManage]getCOSInfo:^(int code) { dispatch_async(dispatch_get_main_queue(), ^{ if (code == 0) { [weakSelf startUpload]; } }); }]; [self networkState]; -(void)startUpload{ YBWeakSelf; dispatch_group_t group = dispatch_group_create(); dispatch_queue_t queue = dispatch_get_global_queue(0, 0); dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); NSString *filePath =_videoPath; //传图片 dispatch_group_async(group, queue, ^{ NSData *imageData = UIImagePNGRepresentation(_videoCoverImage); if (!imageData) { [MBProgressHUD hideHUD]; [MBProgressHUD showError:YZMsg(@"请重新选择")]; return; } UIImage *herfImg = [UIImage imageWithData:imageData]; NSString *imageName = [PublicObj getNameBaseCurrentTime:@".png"]; [[YBStorageManage shareManage]yb_storageImg:herfImg andName:imageName progress:^(CGFloat percent) { }complete:^(int code, NSString *key) { //图片成功 [weakSelf uploadimagesuccess:key]; dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); }); dispatch_group_async(group, queue, ^{ //传视频 NSString *videoName = [PublicObj getNameBaseCurrentTime:@".mp4"]; [[YBStorageManage shareManage]yb_storageVideoOrVoice:filePath andName:videoName progress:^(CGFloat percent) { } complete:^(int code, NSString *key) { //请求app业务服务器给标题 [weakSelf uploadvideosuccess:key andTitle:mytitle]; dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); }); //上传水印视频 NSString *mkfilePath =_videoWmkPath; dispatch_group_async(group, queue, ^{ NSData *imageData = UIImagePNGRepresentation(_videoWmkCoverImage); if (!imageData) { [MBProgressHUD hideHUD]; [MBProgressHUD showError:YZMsg(@"请重新选择")]; return; } UIImage *herfImg = [UIImage imageWithData:imageData]; NSString *imageName = [PublicObj getNameBaseCurrentTime:@"_m…
tagged with: upload
score: 0
has comment: http://stackoverflow.com/comment/135298763
has comment: http://stackoverflow.com/comment/135300034
has comment: http://stackoverflow.com/comment/135298937
tagged with: grand-central-dispatch
has title: I am having trouble updating MBProgressHUD in dispatch main thread
has comment: http://stackoverflow.com/comment/135298934

http://stackoverflow.com/q/76773759
tagged with: network.framework
score: 2
downvote count: 0
tagged with: sockets
answer count: 0
has title: How do I completely stop & cleanup nw_connection_create?
tagged with: macos
upvote count: 2
tagged with: ios
type: Question
has body: I'm creating a socket using apple's Network.Framework with nw_connection_create() (which as far as I can tell is the modern, non-deprecated approach to make a TCP connection) My flow Create end point nw_endpoint_create_host() Create a connection nw_connection_create() I create a dispatch queue dispatch_queue_create(DISPATCH_QUEUE_SERIAL) assign with nw_connection_set_queue() set status callback nw_connection_set_state_changed_handler() Start nw_connection_start Request first recv (incrementing RecvCallCount atomic first - see below) nw_connection_receive I send &amp; recieve packets/data, status, no problem. Every callback from recv decrements RecvCallCount atomic so I know I'm no longer waiting for a callback. When I want to shutdown the socket nw_connection_force_cancel() nil or release the connection nil or release the dispatch queue My class destructs After this, I can get spurious callbacks from the recv callback, or state changed handler. (Which crash as they access my object which has been destructed) The thunk seems to come from nowhere according to xcode, as I'm down to a single thread (Not sure how this is true) I have a mutex around any use of the connection handle, as calling send or recv after nw_connection_force_cancel() can crash (or possibly I had null'd it) Same effect with ARC on or off (with retain/release in applicable places) Same effects on ios &amp; macos There's no documentation mentioning this, but I can only assume there's a 1:1 call &amp; response with nw_connection_receive given the effects, so I tried setting an atomic (a ref counter) for every recv call and then made a .wait() in my destructor to wait for the atomic to get to zero (if not zero). This was fine for a while, but I'm getting some cases where the recv callback never occurs. Am I supposed to Never free until I've had the cancel status update? Stop the nw_connection_t in a different way? Flush the dispatch queue? (I tried enqueueing blocks and they come back so I assume nothin…
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/135357942
favorite count: 0

loadimage
tag name: loadimage
tags question: http://stackoverflow.com/q/76793320
type: Tag

http://stackoverflow.com/q/76851823
type: Question
tagged with: swift
linked to: http://stackoverflow.com/q/40631334
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/135494407
has comment: http://stackoverflow.com/comment/135494616
has body: Is there a way to find if my app has crashed on previous launch. I want it from both swift and obj-c without using any 3rd party libraries? I want a way to note that my app has crashed, no stack trace needed just want some count of crashes stored to user defaults. I saw NSSetUncaughtExceptionHandler being used but it is only catching obj-c related errors. eg. force unwrapping nil is not caught here. I want a universal way of catching the crashes, also want to know if this can affect the crash reporting by 3rd party libraries. How do 3rd party libraries do this? Found a repo: Crash Eye but it is not really catching all the crashes. This might seem repetitive but most answers on SO are not complete.
has comment: http://stackoverflow.com/comment/135483985
has comment: http://stackoverflow.com/comment/135488702
tagged with: ios
has comment: http://stackoverflow.com/comment/135483901
has comment: http://stackoverflow.com/comment/135487594
has answer: http://stackoverflow.com/a/76859350
has comment: http://stackoverflow.com/comment/135526070
has comment: http://stackoverflow.com/comment/135484026
answer count: 1
has comment: http://stackoverflow.com/comment/135502572
tagged with: objective-c
has title: How to detect if iOS app has crashed previously?
linked to: http://stackoverflow.com/q/37220379
has comment: http://stackoverflow.com/comment/135488617
has comment: http://stackoverflow.com/comment/135508770
score: 0

http://stackoverflow.com/q/76841203
tagged with: in-app-purchase
type: Question
has comment: http://stackoverflow.com/comment/135468699
type: UnansweredQuestion
has body: I have an app using in app purchase to buy diamonds. And to buy diamonds I want to use in app purchase. Paid Apps agreement activated. I already defined product_id from API. -(void)applePay:(NSDictionary *)dic{ [self.delegate applePayShowHUD]; NSDictionary *dics = @{ @"uid":[Config getOwnID], @"coin":[dic valueForKey:@"coin_ios"], @"money":[dic valueForKey:@"money"], @"changeid":dic[@"id"] }; [YBToolClass postNetworkWithUrl:@"Charge.getIosOrder" andParameter:dics success:^(int code, id _Nonnull info, NSString * _Nonnull msg) { if (code == 0) { NSString *infos = [[info firstObject] valueForKey:@"orderid"]; self.OrderNo = infos;//订单 //苹果支付ID NSString *setStr = [NSString stringWithFormat:@"%@_testing",[dic valueForKey:@"product_id"]]; NSSet *set = [[NSSet alloc] initWithObjects:setStr, nil]; self.request = [[SKProductsRequest alloc] initWithProductIdentifiers:set]; self.request.delegate = self; [self.request start]; } else{ [self.delegate applePayHUD]; dispatch_async(dispatch_get_main_queue(), ^{ [MBProgressHUD showError:msg]; }); } } fail:^{ }]; } - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { [self.delegate applePayHUD]; self.products = response.products; self.request = nil; for (SKProduct *product in response.products) { NSLog(@"已获取到产品信息 %@,%@,%@",product.localizedTitle,product.localizedDescription,product.price); self.product = product; } if (!self.product) { dispatch_async(dispatch_get_main_queue(), ^{ [self showAlertView:YZMsg(@"无法获取商品信息")]; }); return; } //3.获取到产品信息，加入支付队列 SKPayment *payment = [SKPayment paymentWithProduct:self.product]; [[SKPaymentQueue defaultQueue] addTransactionObserver:self]; [[SKPaymentQueue defaultQueue] addPayment:payment]; } and I already put the product in app store connect like this: I put configuration too inn Xcode: this is for the scheme: I always get skipping product, am I missing something here ?
answer count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/135478552
linked to: http://stackoverflow.com/q/73810958
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135468202
has title: I already put my product in app store connect, but it keep showing "skipping product because no price was available"
score: 0
has comment: http://stackoverflow.com/comment/135471917

http://stackoverflow.com/q/76878213
score: 0
has answer: http://stackoverflow.com/a/76878356
tagged with: nsarray
type: AnsweredQuestion
has body: I can't manage to get the responseCompletion type correct, at the for cycle. Tried to replace it with typedef, but got no luck, only more errors. @interface ImageManager : NSObject //typedef void(^responseBlock)(UIImage * _Nullable image); @property (nonatomic, strong) NSDictionary&lt;NSString *,NSMutableArray&lt;void(^)(UIImage * _Nullable image)&gt; *&gt; *loadingResponses; @end -(void)fetchImage:(NSString *)urlString and:(void (^_Nonnull)(UIImage * _Nullable image))completionhHandler { UIImage *image = [self.cache objectForKey:urlString]; if (image != nil) { completionhHandler(image); return; } if (self.loadingResponses[urlString] != nil) { [self.loadingResponses[urlString] addObject:completionhHandler]; return; } else { [[self.loadingResponses objectForKey:urlString] setArray:[[NSMutableArray alloc] initWithObjects:completionhHandler, nil]]; } NSURL *url = [[NSURL alloc] initWithString:urlString]; [[self.session dataTaskWithURL:url completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { if (error != nil) { UIImage *image = [[UIImage alloc] initWithData:data]; [self.cache setObject:image forKey:urlString]; completionhHandler(image); NSArray *array = [self.loadingResponses objectForKey:urlString]; for ((void(^)(UIImage * _Nullable image) *responseCompletion) in array) { responseCompletion(image); } } }] resume]; }
has title: Defining the type of a completionHandler in Objective-C
tagged with: nsdictionary
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/76878356
type: Question
tagged with: xcode
answer count: 1
tagged with: nsurl

http://stackoverflow.com/q/76748789
has comment: http://stackoverflow.com/comment/135310347
has comment: http://stackoverflow.com/comment/135310092
score: 0
has comment: http://stackoverflow.com/comment/135310216
tagged with: jailbreak
has comment: http://stackoverflow.com/comment/135310219
has title: audioPlayerDidFinishPlaying method is not fired in the CLI application on iOS
has body: I am trying to make a CLI audio player in Objective-C on jailbroken iOS14. But the audioPlayerDidFinishPlaying method is not fired. I wrote some codes like this. #import <Foundation/Foundation.h> #import <AVFoundation/AVFoundation.h> #include <unistd.h> @interface AVAPDelegate: NSObject<AVAudioPlayerDelegate> @end @implementation AVAPDelegate -(void) audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag { NSLog(@"ok"); } @end int main(){ AVAPDelegate *dele = [[AVAPDelegate alloc] init]; AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:@"test.mp3"] error:nil]; player.delegate = dele; [player prepareToPlay]; [player play]; while(player.isPlaying){ sleep(1); } return 0; } Result: no output What should I do?
tagged with: ios
has answer: http://stackoverflow.com/a/76751029
type: Question
answer count: 1
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/a/76732073
has comment: http://stackoverflow.com/comment/135307556
downvote count: 0
upvote count: 4
has body: I just went through this myself a few days ago. The header files that you add to the main framework header are meant to be the public headers of your framework. This means you need to mark the header as being public (versus project or private). The following screenshot shows what you need to do: Select the header that should be public. Ensure the Inspectors pane is being shown on the right side of Xcode. Select the File Inspector tab. Under Target Membership, ensure the header is marked as Public. It defaults to Project. With those steps complete you can add the #import <Logger/AppLogger.h> line to the Logger.h file. For other .h files in the project, you need to follow the same steps but select "Project" (not Public or Private). And use a "normal" import. For example, in AppLogger.m you might need to import BaseLog.h. Use: #import "BaseLog.h" after setting BaseLog.h was a target membership of "Project".
score: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/135304031
type: Answer
accepted answer of: http://stackoverflow.com/q/76731017
answers question: http://stackoverflow.com/q/76731017

http://stackoverflow.com/comment/135320824
has text: @LeoDabus I'm not following how that applies here. The synchronous delegate method is being called by the framework. The value that needs to be returned must come from an async call.
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76757144

http://stackoverflow.com/comment/135377808
score: 0
type: QuestionComment
has text: I have done very little with MacOS apps, however... On iOS, we set the layer contents to a `CGImage` which will not, of course, change with appearance changes. It seems possible (likely?) that assigning a `NSImage` as a layer's content does the same (under-the-hood). Would adding a `NSImageView` as a subview be an option for your use case?
type: Comment
comment on: http://stackoverflow.com/q/76786372

http://stackoverflow.com/a/76780414
score: 2
has body: To answer your specific questions... First, as to "what is the purpose of [screenshot drawInRect:drawRect]" ... It has no purpose there. Presumably, the post you got that from intended to say something like: "Now you have a 100 x 100 UIImage "screenshot" which you can draw into some other rect in some other graphics context." Second... The label is not drawing at (10, 10) because you are rendering the label's layer -- which has an origin of (0, 0). If you want it rendered at (10, 10) you can modify the layer's bounds before drawing it: myLabel.backgroundColor = [UIColor clearColor]; // change the label's layer bounds // to the drawRect rect myLabel.layer.bounds = drawRect; UIGraphicsBeginImageContextWithOptions(CGSizeMake(size, size), NO, 0); So, if we run your code (no idea why you have two let statements): CGFloat size = 100.0; CGRect drawRect = CGRectMake(10, 10, 80, 25); UILabel *myLabel = [[UILabel alloc] initWithFrame:drawRect]; myLabel.font = [UIFont fontWithName:@"HelveticaNeue-BoldItalic" size:16]; myLabel.text = "Hello text!"; myLabel.minimumScaleFactor = 0.5; myLabel.adjustsFontSizeToFitWidth = YES; myLabel.textAlignment = NSTextAlignmentCenter; myLabel.backgroundColor = [UIColor clearColor]; // change the label's layer bounds // to match the drawRect myLabel.layer.bounds = drawRect; UIGraphicsBeginImageContextWithOptions(CGSizeMake(size, size), NO, 0); [[myLabel layer] renderInContext:UIGraphicsGetCurrentContext()]; UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); // do something with screenshot, such as someImageView.image = screenshot; You will now have a 100 x 100 point (not pixel) UIImage named "screenshot" with the label frame at (10, 10) (again, 10-points not pixels). This is the result... note that the code you posted specifies a CGContextRef at the device’s main screen scale factor. I'm running this on an iPhone 14 Pro which has a @3x factor, so the output is a 300x300 pixel image, with the label fra…
accepted answer of: http://stackoverflow.com/q/76738986
has comment: http://stackoverflow.com/comment/135373013
answers question: http://stackoverflow.com/q/76738986
downvote count: 0
has comment: http://stackoverflow.com/comment/135369683
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/76859350
has comment: http://stackoverflow.com/comment/135502597
has comment: http://stackoverflow.com/comment/135509321
has comment: http://stackoverflow.com/comment/135503531
has comment: http://stackoverflow.com/comment/135497122
type: Answer
has comment: http://stackoverflow.com/comment/135522488
answers question: http://stackoverflow.com/q/76851823
upvote count: 1
has body: If you do not want to use third party solutions, you may use userdefaults, set to "crash" just after the app launch and to "no crash" when cleanly quitting. It will read to crash if and only if the app did not quit cleanly. Global variables let keyCrash = "keyCrash let userDefaults = UserDefaults.standard ViewDidLoad in ViewController let didCrash = userDefaults.value(forKey: keyCrash) as? Bool ?? false if didCrash { // handle crash } userDefaults.set(true, forKey: keyCrash) AppDelegate func applicationWillTerminate(_ application: UIApplication){ userDefaults.set(false, forKey: keyCrash) }
has comment: http://stackoverflow.com/comment/135506475
has comment: http://stackoverflow.com/comment/135497113
score: -1
downvote count: 2
has comment: http://stackoverflow.com/comment/135519950

http://stackoverflow.com/comment/135509321
type: Comment
comment on: http://stackoverflow.com/a/76859350
score: 0
has text: matt is right here. The vexing thing here is – according the [official documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623111-applicationwillterminate) – "this method **may be called** in situations where the app is running in the background (not suspended) and the system needs to terminate it for some reason." So, it may or may not be called. I have to agree, that this is not exactly what we developers expect. alas.
type: AnswerComment

http://stackoverflow.com/q/76860334
tagged with: nswindow
type: UnansweredQuestion
answer count: 1
tagged with: appkit
has title: How can I move window controls (traffic lights) down in an NSWindow?
has answer: http://stackoverflow.com/a/77238897
tagged with: objective-c
tagged with: cocoa
has body: I am writing an application using React Native on macOS. By default, the window shows as such: I have managed to hide the title and make the titlebar transparent, as such (ignore the title in the screenshot): I would now like to move the 'traffic lights' down/set the toolbar style to match the style shown below: Unfortunately, I can't seem to figure out the combination of settings or so required to do this. I am constrained to extending an objective-c AppDelegate implementation. I have the current code; - (void)applicationWillBecomeActive:(NSNotification *)notification { NSWindow *window = [[NSApplication sharedApplication] mainWindow]; window.titleVisibility = NSWindowTitleHidden; window.titlebarAppearsTransparent = true; window.styleMask |= NSWindowStyleMaskFullSizeContentView; } This works to get to the second stage. I have tried variations such as ; - (void)applicationWillBecomeActive:(NSNotification *)notification { NSWindow *window = [[NSApplication sharedApplication] mainWindow]; window.titleVisibility = NSWindowTitleHidden; window.titlebarAppearsTransparent = true; window.styleMask |= NSWindowStyleMaskFullSizeContentView; NSToolbar *toolbar = [NSToolbar init]; window.toolbar = toolbar; } or - (void)applicationWillBecomeActive:(NSNotification *)notification { NSWindow *window = [[NSApplication sharedApplication] mainWindow]; window.titleVisibility = NSWindowTitleHidden; window.titlebarAppearsTransparent = true; window.styleMask |= NSWindowStyleMaskFullSizeContentView; window.toolbarStyle = NSWindowToolbarStyleUnified; } and other variations of toolbarStyle, to no avail.
tagged with: react-native
type: Question
score: 0

http://stackoverflow.com/q/76857927
type: UnansweredQuestion
has title: Write to AppGroup shared directory
tagged with: ios-app-group
answer count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135494701
has body: I try to write to the AppGroup shared container with the following Ojecttive-C code: NSFileManager *fileManager = [NSFileManager defaultManager]; NSURL *path = [fileManager containerURLForSecurityApplicationsGroupIdentifier:@"group.*myGroupIdentifier*"]; NSString *vtPath = [path.absoluteString stringByAppendingPathComponent:*fileName*]; [fileManager createFileAtPath:vtPath contents:nil attributes:nil]; NSFileHandle *vtData = [NSFileHandle fileHandleForWritingPath: vtPath]; At this point vtData is always nil, so I can't write there. The Path with appended fileName looks like @"file:///Users/***/Library/Developer ... /data/Containers/Shared/AppGroup/ ... /Library/filename.dat" I have not found a solution after searching for hours. What am I doing wrong?
score: 0
has answer: http://stackoverflow.com/a/76865492
type: Question

http://stackoverflow.com/q/76804325
has answer: http://stackoverflow.com/a/76860536
accepted answer: http://stackoverflow.com/a/76860536
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/135419383
tagged with: uitableview
score: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/135419406
tagged with: ios
type: AnsweredQuestion
tagged with: objective-c
has title: Navigating tvOS UITableView By Letter of Alphabet
upvote count: 1
tagged with: tvos
has body: Here's a clip on YouTube showing the issue. Video I have a UITableView that lists the files located in the app alphabetically. As there are over 1500 files, I'm trying to implement functionality to navigate by letter of the alphabet when the right button is clicked on the remote. The issue I'm having is that the TableView indeed moves to the right spot, but instead of being highlighted like it normally would, I get a lighter highlighted color, and clicking select does nothing. If I then navigate normally by pressing down, it moves it back up to the 2nd item in the list. What am I doing wrong? - (void)viewDidLoad { [super viewDidLoad]; self.tableView.delegate = self; self.tableView.dataSource = self; self.definesPresentationContext = YES; // know where you want UISearchController to be displayed self.currentIndex = 0; [self populateTheView]; } - (void)populateTheView { NSBundle *bundle = [NSBundle mainBundle]; self.title = @"Devo Songs"; self.files = [bundle pathsForResourcesOfType:@"pdf" inDirectory:@"WorshipSongs"]; NSString *documentsDirectoryPath = [self.files objectAtIndex:thepath.row]; self.filenames = [[documentsDirectoryPath lastPathComponent] stringByDeletingPathExtension]; NSMutableArray *names = [NSMutableArray arrayWithCapacity:[self.files count]]; for (NSString *path in self.files) { [names addObject:[[path lastPathComponent] stringByDeletingPathExtension]]; } //self.files = names; self.files = [names sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; NSLog(@"FILESLOAD%@", self.files); } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [self becomeFirstResponder]; // Make the view controller the first responder to handle remote control events. } - (BOOL)canBecomeFirstResponder { return YES; } // Override pressesBegan method to detect right arrow key press event. - (void)pressesEnded:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event { [super pressesEnded:presses withEvent:event]; for (UIPress *press in…
tagged with: pagination

http://stackoverflow.com/comment/135483901
comment on: http://stackoverflow.com/q/76851823
type: QuestionComment
has text: If you don't want to add a third party library, and very likely also don't want to add your own crash handler (which is quite complex), the answer is No. The things you can actually do in a crash handler (not an exception handler!) is very, very limited and requires special knowledge to implement properly.
type: Comment
score: 0

http://stackoverflow.com/comment/139869665
comment on: http://stackoverflow.com/q/76729297
score: 0
type: QuestionComment
type: Comment
has text: Working on a solution, see [https://stackoverflow.com/questions/79318039/mac-appstore-local-receipt-validation-using-storekit-apptransaction-from-swift](https://stackoverflow.com/questions/79318039/mac-appstore-local-receipt-validation-using-storekit-apptransaction-from-swift)

http://stackoverflow.com/comment/135511809
type: QuestionComment
type: Comment
score: 0
has text: There's no question in your question. You show some code and, if I get it correctly, a screenshot of the output `GetLarkPos()` produces, when called. But then there's no actual problem statement. What do you want to ask?
comment on: http://stackoverflow.com/q/76867855

http://stackoverflow.com/comment/135378515
type: Comment
score: 0
has text: @Scott: the issue has certainly something to do with caches, but your suggestion didn't work. I also tried to call `-recache` on the image before/after removing and re-adding all images representation, together with, `NSImageCacheNever` (which should be redundant with `-recache`)... nothing works. I'd rather not use an `NSImageView`. I think I'll end up using different images for dark/light modes as I'm out of ideas.
comment on: http://stackoverflow.com/q/76786372
type: QuestionComment

http://stackoverflow.com/comment/135310200
comment on: http://stackoverflow.com/q/76735865
type: QuestionComment
has text: @Rob Napier I want to get the arguments of existing method dynamically which is not created with varargs.
type: Comment
score: 0

http://stackoverflow.com/comment/135320753
score: 3
type: Comment
comment on: http://stackoverflow.com/q/76757144
type: QuestionComment
has text: You can’t convert an asynchronous method into a synchronous method.

http://stackoverflow.com/comment/135511890
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76867855
score: 0
has text: @kostix 科斯蒂克斯 Objective-c, what is actually returned is a NSDictionary*, type of (* getlark._Ctype_struct_NSDictionary). I received it with dd in GetLarkPos (). How can I get the value of dd? I tried dd.Height,dd ["Height"], dd {}, but could not get the value of Height.

http://stackoverflow.com/comment/135310238
type: QuestionComment
has text: Each platform has its own convention for passing arguments, and it depends on the number and types of the arguments. If you're working with aarch64, start with the [ABI](https://github.com/ARM-software/abi-aa/blob/844a79fd4c77252a11342709e3b27b2c9f590cf1/aapcs64/aapcs64.rst), taking into account [Apple's differences](https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms). You'll probably want to skip down to section 6.8 to get started. A major reason for varargs to provide a consistent way to do this. Note many things are passed in registers, not the stack.
type: Comment
comment on: http://stackoverflow.com/q/76735865
score: 0

http://stackoverflow.com/comment/135292488
type: Comment
has text: What exactly do you mean by *"How do I get the text at the desired point (10, 10)"* ??? Do you want the **label frame** at (10, 10)? The first **character**? The text's glyph bounding box? Examples: https://i.sstatic.net/gM1Zz.png
score: 1
comment on: http://stackoverflow.com/q/76738986
type: QuestionComment

http://stackoverflow.com/comment/135483985
has text: So what is outlined in the posts above is an exception handler and not a crash handler and that is why we are unable to catch crashes like nil unwrapping?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76851823
type: Comment

http://stackoverflow.com/q/76867855
accepted answer: http://stackoverflow.com/a/76868430
tagged with: go
tagged with: cgo
score: 2
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/135511809
answer count: 1
has body: package getlark /* #cgo CFLAGS: -x objective-c #cgo LDFLAGS: -framework Cocoa #import <Cocoa/Cocoa.h> #import <CoreGraphics/CGWindow.h> static NSDictionary* FindChrome(void){ NSArray *windows = (NSArray *)CGWindowListCopyWindowInfo(kCGWindowListExcludeDesktopElements|kCGWindowListOptionOnScreenOnly,kCGNullWindowID); NSLog(@"数组长度:%lu",windows.count); for(NSDictionary *window in windows) { NSString *currentApp = window[(NSString *)kCGWindowOwnerName]; NSString *currentWindowTitle = window[(NSString *)kCGWindowName]; if ([currentApp isEqualToString:@"Google Chrome"]){ NSDictionary *currentBounds= window[(NSString *)kCGWindowBounds]; NSLog(@"%@",currentBounds); return currentBounds; break; } } } */ import "C" import ( "fmt" "reflect" ) func GetLarkPos() { var dd *C.NSDictionary dd = C.FindChrome() fmt.Println(reflect.TypeOf(dd)) fmt.Println(dd) } enter image description here The value on the picture, how can I call the function of golang Sorry, I am not familiar with cgo and objective-c. I hope I can get some help from you.
has comment: http://stackoverflow.com/comment/135512513
favorite count: 0
has comment: http://stackoverflow.com/comment/135512065
has answer: http://stackoverflow.com/a/76868430
linked to: http://stackoverflow.com/q/10797350
upvote count: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/135512025
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135511093
has comment: http://stackoverflow.com/comment/135511890
has title: How to get the a value of particular key out of Cocoa's NSDictionary?

http://stackoverflow.com/q/76815699
type: Question
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135428846
has answer: http://stackoverflow.com/a/76824005
score: 0
has title: Can NSPredicate Compare a Property to an Array of Wildcards?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/76824005
has comment: http://stackoverflow.com/comment/135435417
has comment: http://stackoverflow.com/comment/135428895
tagged with: swift
has comment: http://stackoverflow.com/comment/135422019
has comment: http://stackoverflow.com/comment/135435442
answer count: 1
has body: I need an NSPredicate that compares a property to an array of wildcards. Something like... NSArray *collection = @[@"Jerry*",@"George*",@"Elaine*"]; [NSPredicate predicateWithFormat:@"property LIKE IN %@", collection]; Is this possible?
tagged with: nspredicate

http://stackoverflow.com/q/76719292
answer count: 0
has title: how to hook prerender video with MobileVLCKit on iOS
has body: I want to hook realtime video data to get realtime base64 image from an video play by MobileVLCKit. I researched about this and get this: https://wiki.videolan.org/Stream_to_memory_(smem)_tutorial/ https://gist.github.com/TimSC/4121862 But I don't know how to use this using Objective-c or Swift.
type: UnansweredQuestion
score: 1
favorite count: 0
tagged with: libvlc
tagged with: objective-c
type: Question
upvote count: 1
tagged with: swift
downvote count: 0
tagged with: vlc

http://stackoverflow.com/q/76729297
has comment: http://stackoverflow.com/comment/139869665
tagged with: objective-c
has title: What changes need to be made for the new local receipt validation requirement using SHA-256?
favorite count: 0
upvote count: 3
type: Question
downvote count: 0
score: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/135280679
tagged with: app-store
has comment: http://stackoverflow.com/comment/139866938
tagged with: appstore-sandbox
answer count: 0
tagged with: ios
linked to: http://stackoverflow.com/q/79318039
has body: I have an old app that was built using Objective-C and uses this library for local receipt validation for IAPs. Recently Apple announced that local receipt validation code must change from SHA1 to SHA256 as described in: TN3138: Handling App Store receipt signing certificate changes. I read the document but I'm still not clear on what exactly I'm supposed to change in the code. I tried changing the hashing algorithm in the verify receipt method from: SHA1((const uint8_t*)data.bytes, data.length, (uint8_t*)expectedHash.mutableBytes); to: SHA256((const uint8_t*)data.bytes, data.length, (uint8_t*)expectedHash.mutableBytes); But the computed hash was different than the one in the receipt. Using the original SHA1 the computed hash equals the one in the receipt. According to the article linked above, the Sandbox should have updated certificates that work with the new SHA-256 hash since the 20th of June, 2023. So I'm not sure what I should be doing to make sure the app and all IAPs work fine by the 14th of August when this change goes live. Any help would be appreciated!

http://stackoverflow.com/comment/135310219
type: Comment
has text: Well, that is not what i suggested.
comment on: http://stackoverflow.com/q/76748789
score: 0
type: QuestionComment

http://stackoverflow.com/comment/135939795
has text: I've added an addendum explaining the reason why.
type: QuestionComment
score: 2
type: Comment
comment on: http://stackoverflow.com/q/76827926

http://stackoverflow.com/a/76819294
type: Answer
has comment: http://stackoverflow.com/comment/135427104
upvote count: 1
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/76816936
has body: You need to do [decodedPredicate allowEvaluation]; first before using it. From the doc of allowEvaluation: Forces a securely decoded predicate to allow evaluation. Discussion When securely decoding NSPredicate objects that are encoded using NSSecureCoding, evaluation is disabled because it is potentially unsafe to evaluate predicates you get out of an archive. Before you enable evaluation, you should validate key paths, selectors, and other details to ensure no erroneous or malicious code will be executed. Once you’ve verified the predicate, you can enable the receiver for evaluation by calling allowEvaluation. Sample tests (if someone wants to verify it): //Test Sample array NSArray *array = @[@{@"name":@"test"}, @{@"name": @"other"}]; NSPredicate *filterPredicate = [NSPredicate predicateWithFormat:@"name == 'test'"]; NSArray *filtered1 = [array filteredArrayUsingPredicate:filterPredicate]; NSLog(@"Filtered: %@", filtered1); NSError *encodingError = nil; NSData *filterPredicateData = [NSKeyedArchiver archivedDataWithRootObject:filterPredicate requiringSecureCoding:YES error:&encodingError]; if (encodingError) { NSLog(@"Encoding error: %@", encodingError); } NSError *decodingError = nil; NSPredicate *decodedPredicate = [NSKeyedUnarchiver unarchivedObjectOfClass:NSPredicate.class fromData:filterPredicateData error:&decodingError]; if (decodingError) { NSLog(@"Decoding error: %@", decodingError); } NSLog(@"Initial: %@", filterPredicate); //Let's check the `description` if there it's seems correct NSLog(@"Decoded: %@", decodedPredicate); //Let's check the `description` if there it's seems correct if ([filterPredicate isEqualTo:decodedPredicate]) { // YES [decodedPredicate allowEvaluation]; //Comment this line and it will fail NSArray *filtered2 = [array filteredArrayUsingPredicate:decodedPredicate]; NSLog(@"Filtered with decoded predicate: %@", filtered2); }
accepted answer of: http://stackoverflow.com/q/76816936
type: AcceptedAnswer

http://stackoverflow.com/q/76735865
has comment: http://stackoverflow.com/comment/135317766
type: Question
has body: I create a simple example trying to get the first argument of the method, if it works I plan to extend it to any number of arguments: + (void)simpleTest:(NSInteger)teamId { unsigned int argumentCount = method_getNumberOfArguments(class_getClassMethod([self class], _cmd)); for (unsigned int i = 2; i < argumentCount; i++) { const char *argumentType = method_copyArgumentType(class_getClassMethod([self class], _cmd), i); if (strcmp(argumentType, @encode(NSInteger)) == 0) { NSInteger argumentValue = *((NSInteger *)(((uintptr_t)self) + sizeof(void *) * i)); NSLog(@"Argument %d: %ld", i - 1, (long)argumentValue); } free((void *)argumentType); } } I call it like this: [self simpleTest:22]; the log print: Argument 1: 140703128941760 I think the problem happens at the piece of code where I want to get 'argumentValue', but I don`t know how to fix it.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/135310537
has title: How to get arguments of an objective-c method while executing it
has comment: http://stackoverflow.com/comment/135288464
has comment: http://stackoverflow.com/comment/135317897
answer count: 0
has comment: http://stackoverflow.com/comment/135317730
has comment: http://stackoverflow.com/comment/135310236
tagged with: objective-c
linked to: http://stackoverflow.com/q/4804674
has comment: http://stackoverflow.com/comment/135310200
duplicate of: http://stackoverflow.com/q/4804674
has comment: http://stackoverflow.com/comment/135284963
has comment: http://stackoverflow.com/comment/135310282
score: 0
has comment: http://stackoverflow.com/comment/135310238
has comment: http://stackoverflow.com/comment/135287451

nsurl
tags question: http://stackoverflow.com/q/76878213
tags question: http://stackoverflow.com/q/76763164
tag name: nsurl
type: Tag
tags question: http://stackoverflow.com/q/77391385

network.framework
tag name: network.framework
type: Tag
tags question: http://stackoverflow.com/q/76773759
tags question: http://stackoverflow.com/q/77689811

http://stackoverflow.com/a/76759804
answers question: http://stackoverflow.com/q/76748378
has body: Yes you can, first you have to confirm that UNUserNotificationCenter.current().delegate inside AppDelegate func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool { //here you have to put these line of code to confirm relevant delegate and to enable device for remote notification if device is still not given access for it UIApplication.shared.registerForRemoteNotifications() UNUserNotificationCenter.current().delegate = self return true } after that you have to you have to add following two separate method to handle push notification. if your device iOS version is below than 10.0 then use this method.. func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -&gt; Void) { //To print notification payload print(userInfo) } otherwise you can use this method to handle push notification.. @available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -&gt; Void) { //To print notification payload: print(response.notification.request.content.userInfo) }
has comment: http://stackoverflow.com/comment/135357112
score: 0
type: Answer

http://stackoverflow.com/comment/135355156
type: Comment
comment on: http://stackoverflow.com/q/76738986
has text: @DonMag I didn't understand why the label did not appear at (10, 10). And, related to that, what the purpose of `[screenshot drawInRect:drawRect]` is (nobody commented/answered on that). I don't understand your confusion, because my only question was about how to get the label at the desired (10, 10) instead of (0, 0); I asked nothing about alignment. Of course in any conversation there are two, so it appears I could have been more clear (and replied quicker). Your suggestion above worked, yet I'm still interested to get my questions answered.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/135435417
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76815699
score: 0
has text: @Ananth using just IN will search the collection but not for wildcard values. Property, for example, might be "Jerry S", "George C" or "Elaine B" and I want to match those.

http://stackoverflow.com/comment/135369683
type: Comment
has text: Does `UIGraphicsImageRenderer` have a better performance too perhaps? Thanks for that suggestion, easy to miss by starting with copy-paste of older code.
score: 0
comment on: http://stackoverflow.com/a/76780414
type: AnswerComment

http://stackoverflow.com/a/76739452
has body: It's quite simple, just wrap your label in a view then capture the view instead of the label. CGRect drawRect = CGRectMake(0, 0, 90, 35); UIView *container = [[UIView alloc] initWithFrame: drawRect] ... UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 80, 25)]; [container addSubview:myLabel]; ... [[container layer] renderInContext:UIGraphicsGetCurrentContext()]; Before After
answers question: http://stackoverflow.com/q/76738986
type: Answer
upvote count: 1
downvote count: 0
score: 1

http://stackoverflow.com/comment/135378939
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76786372
has text: Update: The `NSImage` properly adapts to the appearance when I call `-drawInRect:` on it (within a `-drawRect:` method), without the need to recache anything. I just wouldn't change its appearance if I use it in a `CALayer`, even if I don't set it as `contents` and instead call `-drawInRect:` on the image it within `-drawLayer:InContext:`

http://stackoverflow.com/comment/135512065
score: 0
has text: @kostix Yes, I want to get the contents of the return value of dd in GetLarkPos (), but I don't know how to unlock it.
comment on: http://stackoverflow.com/q/76867855
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/135426818
has text: https://developer.apple.com/documentation/foundation/nspredicate/1416310-allowevaluation
comment on: http://stackoverflow.com/q/76816936
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/76822622
tagged with: ios
tagged with: objective-c
upvote count: 3
has comment: http://stackoverflow.com/comment/138674305
type: Question
tagged with: react-native
answer count: 1
tagged with: xcode
type: UnansweredQuestion
has title: Cannot find generated -Swift.h file from local pod
favorite count: 0
has comment: http://stackoverflow.com/comment/140185227
tagged with: swift
score: 3
has body: I am creating a Turbo Module for React Native. The TM depends on another pod that I have created locally. I'm getting a compilation error stating that my generated -Swift.h header file is missing. Heres the setup: I have a local pod (lets call it "MyLocalPod") that is written in Swift. It is intended to use this pod with Objective-C code from my Turbo Module, so I have placed @objc attributes to the relevant public code in the pod. I have also updated some structs to be class objects that extends NSObject as well. I have a React Native Turbo Module package setup with an example RN project included. The TM package's podspec uses the above local pod like so: s.dependency "MyLocalPod" Now I know you cannot add a local development pod to a podspec file so I used a workaround from this answer https://stackoverflow.com/a/49422999/10820594. My example app's Podfile is like the following: pod 'MyLocalPod', :path => '/Users/dev/Projects/MyLocalPod' In my Objective-C (.mm file) source code for the TM I import my local pod like: #import <MyLocalPod/MyLocalPod-Swift.h> But I always get a compilation error when I run npm run ios that says fatal error: 'MyLocalPod/MyLocalPod-Swift.h' file not found. The MyLocalPod-Umbrella.h file is found, but not the -Swift.h file. I have tried a few things: Cleaned the product build, manually deleted DerivedData, and deleted Pods folder and Podfile.lock before completely re-adding the TM, codegen, and pod install multiple times (and in different orders) I manually built MyLocalPod before doing pod install in the example app Found the generated MyLocalPod-Swift.h header file deep in DerivedData and added its path to HEADER_SEARCH_PATHS in XCode Set Defined Modules to YES in MyLocalPod's target's Build Settings Each possible fix never found the generated -Swift.h file.
linked to: http://stackoverflow.com/q/46052798
downvote count: 0
has answer: http://stackoverflow.com/a/79489532

http://stackoverflow.com/q/76738986
type: Question
upvote count: 1
has answer: http://stackoverflow.com/a/76739452
possible better answer: http://stackoverflow.com/a/76739452
tagged with: uigraphicscontext
has answer: http://stackoverflow.com/a/76780414
tagged with: ios
has body: I'm using code found here to create an image with text that is scaled to available size: CGFloat size = 100.0; CGRect drawRect = CGRectMake(10, 10, 80, 25); UILabel *myLabel = [[UILabel alloc] initWithFrame:drawRect]; myLabel.font = [UIFont fontWithName:@"HelveticaNeue-BoldItalic" size:16]; myLabel.text = "Hello text!"; myLabel.minimumScaleFactor = 0.5; myLabel.adjustsFontSizeToFitWidth = YES; myLabel.textAlignment = NSTextAlignmentCenter; myLabel.backgroundColor = [UIColor clearColor]; UIGraphicsBeginImageContextWithOptions(CGSizeMake(size, size), NO, 0); [[myLabel layer] renderInContext:UIGraphicsGetCurrentContext()]; UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); [screenshot drawInRect:drawRect]; return screenshot; This creates a 100x100 image with the rendered label in the top-left corner: (0, 0). How do I get the text at the desired point (10, 10)? To clarify: I want the label to be the size I specify, be centred horizontally, and its text to scale according to the available size. Also, what is the purpose of [screenshot drawInRect:drawRect] because I seem to get the same result without it?
downvote count: 1
type: AnsweredQuestion
answer count: 3
has answer: http://stackoverflow.com/a/76739637
has comment: http://stackoverflow.com/comment/135292488
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135306757
tagged with: uiimage
favorite count: 0
linked to: http://stackoverflow.com/q/17633032
accepted answer: http://stackoverflow.com/a/76780414
score: 0
has comment: http://stackoverflow.com/comment/135293587
has comment: http://stackoverflow.com/comment/135316103
has comment: http://stackoverflow.com/comment/135303945
has comment: http://stackoverflow.com/comment/135298325
has title: How to render UILabel at certain point in UIImage?
has comment: http://stackoverflow.com/comment/135355156

http://stackoverflow.com/a/76778670
type: AcceptedAnswer
type: Answer
has body: You are trying to return a char**, so the C function parameter needs to be a char***: FOUNDATION_EXPORT int _GetAllKeys(char*** pointer) { NSArray* array = @[@"key1", @"key2"]; // dummy strings int size = (int)array.count; *pointer = malloc(size * sizeof(char *)); for (int i = 0; i < size; i++) { (*pointer)[i] = MakeStringCopy(array[i]); } return size; } The C# code looks fine, except that IntPtr.Add returns a new IntPtr, so it has to be: keys.Add(Marshal.PtrToStringUTF8(buffer)); buffer = IntPtr.Add(buffer, IntPtr.Size);
accepted answer of: http://stackoverflow.com/q/76778283
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/135357354
score: 1
has comment: http://stackoverflow.com/comment/135358242
answers question: http://stackoverflow.com/q/76778283

http://stackoverflow.com/a/77238897
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/76860334
type: Answer
upvote count: 1
has body: The following code works for me: - (void)applicationWillBecomeActive:(NSNotification *)notification { NSWindow *window = [[[NSApplication sharedApplication] windows] firstObject]; window.titleVisibility = NSWindowTitleHidden; window.titlebarAppearsTransparent = true; window.styleMask |= NSWindowStyleMaskFullSizeContentView; window.toolbar = [NSToolbar new]; // &lt;-- Note this is `new` and not `init` window.toolbarStyle = NSWindowToolbarStyleUnified; }

cgo
tags question: http://stackoverflow.com/q/76867855
type: Tag
tag name: cgo
tags question: http://stackoverflow.com/q/79290109

http://stackoverflow.com/q/76757060
has body: I am trying to figure out the differences in Math (there shouldn't be any) between a quick calculation in Swift and Objective-C: Swift let z1 = 1.0 let width = 0.02197265625 let extent = 4096.0 let dx = z1 * width / extent print(dx) // 5.364418029785156e-06 Objective-C double z1 = 1.0; double width = 0.02197265625; double extent = 4096.0; double dx = z1 * width / extent; NSLog(@"%f", dx); // 0.000005 Inputting the numbers into a calculator return what Objective-C provides. What is Swift doing differently here?
upvote count: 2
downvote count: 1
type: Question
tagged with: swift
answer count: 1
has title: Math differences in Swift and Objective-C
score: 1
has comment: http://stackoverflow.com/comment/135320381
favorite count: 0
has comment: http://stackoverflow.com/comment/135320354
tagged with: ios
accepted answer: http://stackoverflow.com/a/76757111
has answer: http://stackoverflow.com/a/76757111
type: AnsweredQuestion
tagged with: objective-c

http://stackoverflow.com/comment/135427104
type: Comment
score: 0
comment on: http://stackoverflow.com/a/76819294
has text: Thanks. I searched for "evalua" on the NSPredicate documentation page in Safari, and it found nothing. I should have looked more carefully.
type: AnswerComment

http://stackoverflow.com/comment/135523043
type: Comment
comment on: http://stackoverflow.com/a/76868430
score: 0
has text: @sgx, oh, and one more note. The solution proposed in this answer presupposes you might want to deal with _any_ `NSDictionary` values. If, instead, your problem is quite narrow, and you'd want to basically only deal with "coordinates of windows", and nothing more, a better approach would be to define a custom `struct` type in your C code, with four `int`-typed fields, and merely "gateway" values of the fields of interest from the returned `NSDictionary` into the fields of a variable of that custom type, and returning that variable. At the call site–in Go code–you'd then work with plain fields.
type: AnswerComment

http://stackoverflow.com/comment/135316103
score: 0
type: QuestionComment
has text: I'm really trying to understand exactly what you want, and why it's problematic... see this image: https://i.sstatic.net/zyyaU.png
type: Comment
comment on: http://stackoverflow.com/q/76738986

http://stackoverflow.com/comment/135511093
type: Comment
comment on: http://stackoverflow.com/q/76867855
score: 0
type: QuestionComment
has text: In fact, my ultimate goal is to get the location of other software windows through golang. If you have an answer or golang has a better solution, you can let me know.

http://stackoverflow.com/comment/135310282
comment on: http://stackoverflow.com/q/76735865
type: Comment
has text: If you can update your question to cover the specific architecture(s) you're looking for, and what kinds of arguments (will it always be series of 64-bit integers, or could it be arbitrary things?), it would be reasonable to reopen this. It tends to be a bit tedious and fiddly, so I don't know if you'll get an answer, but it would be a different question. Some sense of why you're doing this might help us get you onto an easier path.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/135506475
type: Comment
comment on: http://stackoverflow.com/a/76859350
score: 0
has text: For this I thought I can have crash set to false in `applicationDidEnterBackground` , set it back to true in `applicationWillEnterForeground` so in case user goes to background we automatically make it false to avoid this case. @matt does it sound good now. Additionally I want to look at all the lifecycle methods too to check for false positives.
type: AnswerComment

http://stackoverflow.com/q/76816936
score: 0
has title: NSPredicate error after decoding from NSData: "This predicate has evaluation disabled"
tagged with: nskeyedarchiver
type: Question
answer count: 1
accepted answer: http://stackoverflow.com/a/76819294
has comment: http://stackoverflow.com/comment/135426818
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/135425920
has body: I'm trying to save an NSPredicate to the user defaults and I thought I should encode is like so, since this class conforms to NSSecureCoding: NSPredicate *filterPredicate = [NSPredicate predicateWithFormat:@"name == 'test'"]; NSData *filterPredicateData = [NSKeyedArchiver archivedDataWithRootObject:filterPredicate requiringSecureCoding:YES error:nil]; I then decode it. NSPredicate *decodedPredicate = [NSKeyedUnarchiver unarchivedObjectOfClass:NSPredicate.class fromData:filterPredicateData error:nil]; if([filterPredicate isEqualTo:decodedPredicate]) { // YES someNSArrayController.filterPredicate = filterPredicate; // this works someNSArrayController.filterPredicate = decodedPredicate; // this throws an exception [someNSArray filteredArrayUsingPredicate: decodedPredicate]; // this throws an exception } I'm getting this exception: This predicate has evaluation disabled Notes: decodedPredicate works as the predicate of an NSFetchRequest without issue. decodedPredicate and filterPredicate return the same predicateFormat. Can anyone explain this error?
tagged with: objective-c
has answer: http://stackoverflow.com/a/76819294
has comment: http://stackoverflow.com/comment/135427820
tagged with: nspredicate

http://stackoverflow.com/comment/135317730
comment on: http://stackoverflow.com/q/76735865
has text: I'm not 100% what you're trying to build here, but I strongly suspect what you really want is an NSProxy-based surrogate object that implements `forwardInvocation:`. This will create the NSInvocation for you, and you can then pass that along to the underlying object and also save it. For more details, see https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtForwarding.html#//apple_ref/doc/uid/TP40008048-CH105
type: Comment
score: 0
type: QuestionComment

vlc
type: Tag
tags question: http://stackoverflow.com/q/76719292
tag name: vlc

uigraphicscontext
tags question: http://stackoverflow.com/q/76738986
tag name: uigraphicscontext
type: Tag

http://stackoverflow.com/comment/135941110
has text: I'm sure you're aware, but just for anyone reading along it's worth noting that your code may leak memory and even violate preconditions since a lot of ObjC code is not exception-safe (exceptions are intended to terminate the program "soon" and much ObjC code relies on that fact; except in very controlled cases, there is no safe way to use `@catch` to continue the program). At a minimum you would want to to enable `-fobjc-arc-exceptions` since ARC is not exception-safe by default and would definitely leak memory. I'm guessing you have a good use, but others should be careful not to copy this.
type: Comment
comment on: http://stackoverflow.com/q/76827926
score: 0
type: QuestionComment

http://stackoverflow.com/comment/135983386
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76827926
has text: To the latter, "just copy the entire chunk of memory from A to B" is a mandatory starting point. But I think you'll eventually discover you **also** need to understand each argument, which is hard, and always subject to change. (And Apple absolutely does change how these things work, mercilessly, within anything allowed by their ABI, which is a lot.)
score: 0

http://stackoverflow.com/comment/135419383
has text: I'm curious why you insist on tagging your tvOS question with the iOS tag. Tags should represent what your question is about. Since your question is about an issue using a table view on tvOS, why tag with iOS?
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76804325

http://stackoverflow.com/comment/135306757
type: QuestionComment
has text: Is there a reason you don't simply add the label as a subview, constrain its top/leading/trailing (or top/leading/width), and render the view as a UIImage? I guess you need to ***show us*** what you're getting, and explain why it's not what you want.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/76738986

nsvisualeffectview
tags question: http://stackoverflow.com/q/76748425
tag name: nsvisualeffectview
type: Tag

http://stackoverflow.com/a/76731783
has body: This is likely not an actual problem. Apps do not always return all memory since they may need it again. The OS may later require the memory back, but in the meantime it is much more efficient to let apps keep allocated memory if there is no pressure. If you continue to allocate and release memory, does the app's memory footprint continue to grow, or does it stabilize at 43MB? If it continues to grow, then you do have a memory leak, and can debug that using various tools. If it has a one-time jump, then that is intentional.
type: AcceptedAnswer
type: Answer
upvote count: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/76729747
answers question: http://stackoverflow.com/q/76729747
score: 3

http://stackoverflow.com/q/76793136
has answer: http://stackoverflow.com/a/76819635
accepted answer: http://stackoverflow.com/a/76819635
tagged with: ios
tagged with: objective-c
linked to: http://stackoverflow.com/q/16483635
type: Question
answer count: 1
tagged with: pjsip
has body: I want to start pjsip default example on iPhone(simulator). When I make a call I get this error: 12:00:29.220 pjsua_aud.c .Set sound device: capture=-1, playback=-2, mode=0, use_default_settings=0 12:00:29.221 pjsua_aud.c ..Error retrieving default audio device parameters: Unable to find default audio device (PJMEDIA_EAUD_NODEFDEV) [status=420006] 12:00:29.223 pjsua_media.c .Call 0: deinitializing media.. 12:00:29.223 call.cpp pjsua_call_make_call(acc.getId(), &pj_dst_uri, param.p_opt, this, param.p_msg_data, &id) error: Unable to find default audio device (PJMEDIA_EAUD_NODEFDEV) (status=420006) [../src/pjsua2/call.cpp:701] pjsua_call_make_call(acc.getId(), &pj_dst_uri, param.p_opt, this, param.p_msg_data, &id) error: Unable to find default audio device (PJMEDIA_EAUD_NODEFDEV) I configured and compiled the pjsip like this sudo make distclean sudo make clean export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/ export ARCH="-arch x86_64" CFLAGS="-O2 -m32 -mios-simulator-version-min=5.0" LDFLAGS="-O2 -m32 -mios-simulator-version-min=5.0" ./configure-iphone sudo make dep sudo make sudo make install I tried it on my iPhone and got the same error. I find solution here, but i can’t install libasound2-dev on MacOS I use example from pjsipproj/pjsip-apps/src/pjsua2/ios-swift-pjsua2 PJSIP version: 2.13.1 OS: MacOS Ventura 13.5 IOS: 16.4
has title: pjsip can't detect audio device ios
score: 0
type: AnsweredQuestion

http://stackoverflow.com/a/76824005
has body: I ended up using NSCompoundPredicate to get this done. I was hoping there was a shorter route but it's fairly painless. NSArray *collection = @[@"Jerry*",@"George*",@"Elaine*"]; NSMutableArray *thePredicateArray = [NSMutableArray arrayWithCapacity:3]; for (id *theItem in collection) { [thePredicateArray addObject:[NSPredicate predicateWithFormat:@"property LIKE %@",theItem]]; } NSCompoundPredicate *theCompoundPredicate = [NSCompoundPredicate orPredicateWithSubpredicates:thePredicateArray];
answers question: http://stackoverflow.com/q/76815699
score: 0
accepted answer of: http://stackoverflow.com/q/76815699
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/76778283
has title: Marshalling variable-sized string C array into C# (Unity iOS)
score: 0
accepted answer: http://stackoverflow.com/a/76778670
type: AnsweredQuestion
tagged with: pointers
tagged with: c#
has answer: http://stackoverflow.com/a/76778670
tagged with: ios
tagged with: marshalling
type: Question
answer count: 1
tagged with: objective-c
has body: I need to return a collection of strings from Objective-C to C# and can't wrap my head around how to do this properly. When I print the returned pointer on managed side its value is 0. Objective-c FOUNDATION_EXPORT int _GetAllKeys(char** pointer) { NSArray* array = @[@"key1", @"key2"]; // dummy strings int size = (int)array.count; pointer = malloc(size * sizeof(char *)); for (int i = 0; i < size; i++) { pointer[i] = MakeStringCopy(array[i]); } return size; } C# [DllImport("__Internal")] private static extern int _GetAllKeys(out IntPtr buffer); internal static IEnumerable<string> GetAllKeys() { int count = _GetAllKeys(out var buffer); List<string> keys = new List<string>(); for (int i = 0; i < count; i++) { keys.Add(Marshal.PtrToStringUTF8(IntPtr.Add(buffer, IntPtr.Size))); //eventually when i make this work the strings will be returned as UTF8 but for now its not even making it to this line, so ignore the encoding. } return keys; } ---------------- SOLUTION ---------------- Objective-c FOUNDATION_EXPORT int _GetAllKeys(char*** pointer) { NSArray* array = @[@"key1", @"key2"]; int size = (int)array.count; *pointer = malloc(size * sizeof(char *)); for (int i = 0; i < size; i++) { (*pointer)[i] = MakeStringCopy(array[i]); } return size; } C# [DllImport("__Internal")] private static extern int _GetAllKeys(out IntPtr buffer); internal static IEnumerable<string> GetAllKeys() { int count = _GetAllKeys(out var buffer); List<string> keys = new List<string>(); for (int i = 0; i < count; i++) { IntPtr ptr = Marshal.ReadIntPtr(buffer); keys.Add(Marshal.PtrToStringAuto(ptr)); buffer = IntPtr.Add(buffer, IntPtr.Size); } return keys; }

http://stackoverflow.com/comment/135535983
comment on: http://stackoverflow.com/a/76880736
score: 0
has text: I was also thinking about creating XCTestSuite and XCTestCases dynamically with Objective-C runtime, using methods like XCTestSuite.addTest (which accepts an XCTest, and XCTestSuite is a subclass of XCTest, so I was thinking that it *may* be possible). Curious to hear what you think about it.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/76786372
tagged with: calayer
has answer: http://stackoverflow.com/a/76820794
has comment: http://stackoverflow.com/comment/135377808
type: AnsweredQuestion
answer count: 1
has comment: http://stackoverflow.com/comment/135379016
has comment: http://stackoverflow.com/comment/135376935
score: 0
accepted answer: http://stackoverflow.com/a/76820794
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135378515
type: Question
has body: I have an NSView whose layer has various sublayers. Its needsDisplay property is set to YES when the app changes its effective appearance, which ends up calling: -(void)updateLayer { // this is a simplified version sublayer1.backgroundColor = NSColor.windowBackgroundColor.CGColor; sublayer2.content = [NSImage imageNamed:@"dynamic image"]; // "dynamic image" is an image asset that has light and dark variants. } Both layers render properly according to the theme after the app launches, but when the app changes theme (without being relaunched), the appearance of sublayer2 does not change. The appearance of sublayer1 does change, but I have to relaunch the app for sublayer2 to update to the app theme. Using "dynamic image" as template image or original image has no effect on this issue. Note that the same image used in an NSButton does change appearance properly without having to relaunch the app. Any suggestion?
has title: How to make a CALayer with NSImage dynamically adapt to the app appearance?
has comment: http://stackoverflow.com/comment/135378939
tagged with: nsimage

pjsip
tags question: http://stackoverflow.com/q/76793136
type: Tag
tag name: pjsip

http://stackoverflow.com/comment/135298841
type: Comment
has text: The questions in my mind would be (a) what these “yb” routines do (i.e., we need to know whether these blocks are already called on the main queue or not); and (b) you say you’re getting that priority inversion error when you add code, but don’t show us the code that generated that error.
score: 0
comment on: http://stackoverflow.com/q/76742126
type: QuestionComment

http://stackoverflow.com/comment/140185227
type: QuestionComment
comment on: http://stackoverflow.com/q/76822622
type: Comment
has text: I am in the exact same situation, does someone have any news or solution ?
score: 0

http://stackoverflow.com/comment/135422019
comment on: http://stackoverflow.com/q/76815699
score: 0
type: QuestionComment
type: Comment
has text: Try with just `IN` - Refer - https://nspredicate.xyz/#is-included-in-an-array-of-values.

http://stackoverflow.com/comment/138674305
type: QuestionComment
has text: Did you ever find a solution?
type: Comment
comment on: http://stackoverflow.com/q/76822622
score: 0

nsimage
tags question: http://stackoverflow.com/q/76786372
tag name: nsimage
type: Tag
tags question: http://stackoverflow.com/q/77017420
tags question: http://stackoverflow.com/q/78799874
tags question: http://stackoverflow.com/q/79218608

ios-frameworks
tags question: http://stackoverflow.com/q/76731017
tag name: ios-frameworks
type: Tag
tags question: http://stackoverflow.com/q/77499394
tags question: http://stackoverflow.com/q/78448106

http://stackoverflow.com/comment/135298937
type: QuestionComment
type: Comment
has text: Also, be aware that the `wait` on one block can satisfied by the `signal` of a completely different async call. Not a big deal, but it’s something to be cautious about when using semaphores (but becomes moot when you retire them). Finally, note that your first `dispatch_semaphore_wait` is using a QoS for the duration, which is obviously a typo.
score: 0
comment on: http://stackoverflow.com/q/76742126

http://stackoverflow.com/comment/135357354
score: 0
has text: Thank you very much, the missing third pointer was the culprit, although in the C# code I had to also first read the underlaying pointers from the returned pointer and then marshal them as string: `IntPtr ptr = Marshal.ReadIntPtr(buffer);` `keys.Add(Marshal.PtrToStringAuto(ptr));` `buffer = IntPtr.Add(buffer, IntPtr.Size);`
type: AnswerComment
comment on: http://stackoverflow.com/a/76778670
type: Comment

http://stackoverflow.com/comment/135357942
has text: Explicitly waiting until I get a close/cancel state seems to be my only reliable recourse at the moment. (even after releasing `nw_connection_t`)
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76773759
type: QuestionComment

http://stackoverflow.com/comment/135300190
type: Comment
has text: I would encourage you to retire `dispatch_group_async`, too. It is superfluous. Just enter/leave/notify.
comment on: http://stackoverflow.com/q/76742126
score: 0
type: QuestionComment

http://stackoverflow.com/comment/135300034
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76742126
has text: i think im gonna try it using dispatch_group_async and just dispatch_group_enter before my async calls and dispatch_group_leave in final completion handler, ill let you know the result @Rob

http://stackoverflow.com/comment/135535959
type: AnswerComment
comment on: http://stackoverflow.com/a/76880736
type: Comment
has text: Thank you for your answer. From what I see on Quick's website, the hierarchy is still flat when in the Xcode report viewer.
score: 0

http://stackoverflow.com/comment/135357112
comment on: http://stackoverflow.com/a/76759804
score: 0
type: AnswerComment
type: Comment
has text: didReceiveRemoteNotification doesn't get called if mac app isn't running

http://stackoverflow.com/a/76828863
type: Answer
score: 4
answers question: http://stackoverflow.com/q/76827926
has body: I don't believe the encoding format is publicly documented. You can work out most of it from the ASTContext source. Mattt's Type Encodings blog post sums it up well: So what do we gain from our newfound understanding of Objective-C Type Encodings? Honestly, not that much (unless you’re doing any crazy metaprogramming). But as we said from the very outset, there is wisdom in the pursuit of deciphering secret messages. And I agree, it's a worthy pursuit. Just don't expect this to be all that useful in Swift. To answer this specific situation: v32@0:8@"NSString"16@?<v@?@"NSString">24 As you know from your previous research, the numbers don't mean much, so we won't worry about those. The syntax @"..." is an object with the class name given in quotes. You can find that in the Type::ObjCObjectPointer case: 8501 S += '@'; 8502 if (OPT->getInterfaceDecl() && 8503 (FD || Options.EncodingProperty() || Options.EncodeClassNames())) { 8504 S += '"'; 8505 S += OPT->getInterfaceDecl()->getObjCRuntimeNameAsString(); 8506 for (const auto *I : OPT->quals()) { 8507 S += '<'; 8508 S += I->getObjCRuntimeNameAsString(); 8509 S += '>'; 8510 } 8511 S += '"'; 8512 } The syntax @?<...> is a block pointer, as detailed in the Type::BlockPointer case: 8401 case Type::BlockPointer: { 8402 const auto *BT = T->castAs<BlockPointerType>(); 8403 S += "@?"; // Unlike a pointer-to-function, which is "^?". 8404 if (Options.EncodeBlockParameters()) { 8405 const auto *FT = BT->getPointeeType()->castAs<FunctionType>(); 8406 8407 S += '<'; 8408 // Block return type 8409 getObjCEncodingForTypeImpl(FT->getReturnType(), S, 8410 Options.forComponentType(), FD, NotEncodedT); 8411 // Block self 8412 S += "@?"; 8413 // Block parameters 8414 if (const auto *FPT = dyn_cast<FunctionProtoType>(FT)) { 8415 for (const auto &I : FPT->param_types()) 8416 getObjCEncodingForTypeImpl(I, S, Options.forComponentType(), FD, 8417 NotEncodedT); 8418 } 8419 S += '>'; 8420 } 8421 return; 8422 } What this is encoding is the followin…
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/135320354
type: Comment
score: 8
comment on: http://stackoverflow.com/q/76757060
has text: `print` is not the same as `NSLog` with a format string
type: QuestionComment

http://stackoverflow.com/comment/135298763
type: Comment
comment on: http://stackoverflow.com/q/76742126
has text: See [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example). We generally cannot help if we can’t reproduce the problem (and we shouldn’t have to go through a lot of kruft to get there). And, to HangarRash’s observation, that link says “[DO NOT use images of code](https://meta.stackoverflow.com/q/285551). Copy the actual text from your code editor, paste it into the question, then [format it as code](https://stackoverflow.com/editing-help#code).”
score: 0
type: QuestionComment

http://stackoverflow.com/a/76751029
score: 0
has body: I changed the code and finally got the "ok" output. #import <Foundation/Foundation.h> #import <AVFoundation/AVFoundation.h> @interface AVAPDelegate: NSObject<AVAudioPlayerDelegate> @end @implementation AVAPDelegate -(void) audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag { NSLog(@"ok"); } @end int main(){ AVAPDelegate *dele = [[AVAPDelegate alloc] init]; AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:@"test.mp3"] error:nil]; player.delegate = dele; [player prepareToPlay]; [player play]; [[NSRunLoop currentRunLoop] run]; return 0; }
type: Answer
answers question: http://stackoverflow.com/q/76748789

http://stackoverflow.com/a/76818453
score: 0
type: Answer
has body: I have managed to figure out my issue using the guidance of the example from this stackoverflow post. Upload multipart image to PHP server from iOS app . I did have to convert the example from Swift to Objective C with a few minor changes to suit my needs but it worked well.
answers question: http://stackoverflow.com/q/76763164

nskeyedarchiver
type: Tag
tags question: http://stackoverflow.com/q/76816936
tag name: nskeyedarchiver

http://stackoverflow.com/comment/135310216
comment on: http://stackoverflow.com/q/76748789
type: QuestionComment
has text: @matt I changed `while(player.isPlaying)` loop to `while(true)` but output is still nothing...
type: Comment
score: 0

http://stackoverflow.com/q/76757144
has comment: http://stackoverflow.com/comment/135320782
score: 2
has answer: http://stackoverflow.com/a/76763475
type: Question
tagged with: swift
type: UnansweredQuestion
has body: I've been given an Objective-C framework that has the following API (simplified for this question): @protocol SomeClassDelegate; NS_REFINED_FOR_SWIFT @interface SomeClass: NSObject @property (weak) id<SomeClassDelegate> delegate; - (instancetype)initWithDelegate:(id<SomeClassDelegate>)delegate NS_SWIFT_NAME(init(delegate:)); @end NS_REFINED_FOR_SWIFT @protocol SomeClassDelegate - (BOOL)someClass:(SomeClass *)object shouldProcessData:(UUID *)recordID NS_SWIFT_NAME(someClass(_:shouldProcessData:)); - (nullable SomeHelper *)someClass:(SomeClass *)object helperFor:(UUID *)recordID NS_SWIFT_NAME(someClass(_:helerFor:)); @end The Swift version of this API is being dictated as: public class SomeClass { public weak var delegate: SomeClassDelegate init(delegate: SomeClassDelegate) } public protocol SomeClassDelegate : AnyObject { func shouldProcessData(recordID: UUID, someClass: SomeClass) async -> Bool func helperFor(recordID: UUID, someClass: SomeClass) async -> SomeHelper? } Given these APIs, I need to implement the Swift wrapper of the existing Objective-C framework. My biggest hurdle is that the Swift delegate methods are meant to be async but the Objective-C delegate methods are not asynchronous and do not have completion handlers. Here's my first pass at the Swift wrapper which includes a delegate adapter. public class SomeClass { public weak var delegate: SomeClassDelegate init(delegate: SomeClassDelegate) { wrapper = __SomeClass() delegateAdapter = SomeClassDelegateAdapter(self, delegate: delegate) wrapper.delegate = delegateAdapter } private wrapper: __SomeClass private delegateAdapter: SomeClassDelegateAdapter } fileprivate class SomeClassDelegateAdapter: NSObject, __SomeClassDelegate { private let delegate: SomeClassDelegate private let wrapper: SomeClass init(_ wrapper: SomeClass, delegate: SomeClassDelegate) { self.wrapper = wrapper self.delegate = delegate } func someClass(_ someClass: __SomeClass, shouldProcessData recordID: UUID) -> Bool { // The following g…
downvote count: 0
has title: How do I call a Swift async method from within a synchronous method that has a return value and completion handlers can't be used?
favorite count: 0
has comment: http://stackoverflow.com/comment/135320753
upvote count: 2
answer count: 2
tagged with: objective-c
tagged with: adapter
has comment: http://stackoverflow.com/comment/135320824
tagged with: async-await
has answer: http://stackoverflow.com/a/76758906
tagged with: synchronous

http://stackoverflow.com/comment/135304031
has text: thanks. Maybe you could help me with something else. I created more `.h` and `.m` files - let's say they're called `BaseLog`. When I try to import `BaseLog.h` in my `AppLogger.h` I get an error `BaseLog.h file not found`. Do you know want might be the problem?
score: 0
comment on: http://stackoverflow.com/a/76732073
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/139866938
type: Comment
has text: I'm into the same boat here. Old objective-c app that does the appstore downloaded certificate check using own code, decrypting and checking the receipt. Could test that in the past with a dummy apple id. Despite Apple's promises that objective-c would be treated equally to Swift new Storekit is Swift-only, and an asynchronous one too. Not too easy to call from objective-c, but I got that to work I think, calling AppTransaction.shared. TN3138 and docs give the impression you don't have to the receipt any further, but now the sandbox is causing trouble.
comment on: http://stackoverflow.com/q/76729297
score: 0
type: QuestionComment

http://stackoverflow.com/q/76816843
type: Question
tagged with: swift
upvote count: 1
downvote count: 0
tagged with: photokit
type: UnansweredQuestion
score: 1
tagged with: macos
favorite count: 0
answer count: 0
tagged with: ios
linked to: http://stackoverflow.com/q/63294309
tagged with: objective-c
has body: G'day For a photos processing application, I have to fetch and filter out images and videos saved from other applications and exclude screenshots and screen recordings. For screenshots I'm using PHAsset's PHAssetMediaSubtype property to filter the PHAssetMediaSubtypePhotoScreenshot types and it works really well. For screen recordings I haven't found a good way unfortunately. I stumbled onto this but it is not really working well because calling PHAssetResource on each asset is a very heavy operation. The closest I've found is to use PHAssetCollection and use it's localised name but this not really a good way either. Lastly how do I filter out images and videos saved from other apps such as messenger apps and other apps such as tiktok. When you open apple's native Photos app and view info for an image/video it shows if the resource is taken from a camera or saved from other app. But is there a way to get this information from Photos Kit apis? Attached picture below to show what I mean by "saved by" shown on photos app. Thanks!
has title: iOS Photo Kit Filter screenshots, screen recordings and assets saved other apps

http://stackoverflow.com/comment/135310236
score: 0
has text: @mschmidt I think I only care about the value of the argument that passed in
type: QuestionComment
comment on: http://stackoverflow.com/q/76735865
type: Comment

http://stackoverflow.com/comment/135427820
type: Comment
comment on: http://stackoverflow.com/q/76816936
has text: D'oh. No wonder why no one else complained about this issue... Shame on me. I must have looked up the doc for some subclass (NSComparisonPredicate maybe) rather than NSPredicate. Thanks.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/135497122
has text: Moreover even the user killing the app is not a crash.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76859350
score: 0

http://stackoverflow.com/comment/135310092
type: QuestionComment
score: 0
has text: You probably need to run the runloop long enough for `audioPlayerDidFinishPlaying` to be called. Otherwise `main` exits before the delegate method has a chance to be called.
type: Comment
comment on: http://stackoverflow.com/q/76748789

appstore-sandbox
type: Tag
tags question: http://stackoverflow.com/q/76729297
tag name: appstore-sandbox

http://stackoverflow.com/comment/135522488
has text: @Keer if your purpose is to do some internal cleanup, without any visible display to the user, you may accept some amount of false positive. In my experience (I use it to store some state of the app to be restored at next launch), `applicationWillTerminate` is called most of the times. Alternatively, as you mention cleanup, an approach would be not to test for crashes, but for the actual need for cleanup, eg checking if the tmp files to be cleaned up have been left behind by the previous run of your app.
comment on: http://stackoverflow.com/a/76859350
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/135317766
type: QuestionComment
comment on: http://stackoverflow.com/q/76735865
type: Comment
has text: And don't forget about [NSUndoManager](https://developer.apple.com/documentation/foundation/nsundomanager?language=objc), which is possibly relevant to problems in this space.
score: 0

http://stackoverflow.com/comment/135497113
comment on: http://stackoverflow.com/a/76859350
has text: Just wrong. An app can quit cleanly without `applicationWillTerminate` being called. In fact, nowadays `applicationWillTerminate` is just about never called.
type: AnswerComment
score: 1
type: Comment

nspredicate
tags question: http://stackoverflow.com/q/76816936
tags question: http://stackoverflow.com/q/76815699
type: Tag
tag name: nspredicate
tags question: http://stackoverflow.com/q/78066067

http://stackoverflow.com/a/76820794
accepted answer of: http://stackoverflow.com/q/76786372
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/76786372
has body: From Apple's docs for CALayer.contents: Discussion The default value of this property is nil. If you are using the layer to display a static image, you can set this property to the CGImageRef containing the image you want to display. (In macOS 10.6 and later, you can also set the property to an NSImage object.) Assigning a value to this property causes the layer to use your image rather than create a separate backing store. If the layer object is tied to a view object, you should avoid setting the contents of this property directly. The interplay between views and layers usually results in the view replacing the contents of this property during a subsequent update. So, when setting: sublayer2.content = [NSImage imageNamed:@"dynamic image"]; the layer gets a CGImageRef, not a NSImage ... and appearance changes will have no effect. One approach would be to replace the CALayer with a NSImageView as a subview. Set the .image property, and you're done. If you need to use CALayer, we need to get the CGImageRef from the image with the current appearance in updateLayer. Quick example: LayeredView.h #import <Cocoa/Cocoa.h> NS_ASSUME_NONNULL_BEGIN @interface LayeredView : NSView @end NS_ASSUME_NONNULL_END LayeredView.m #import "LayeredView.h" #import <Quartz/Quartz.h> @interface LayeredView() { CALayer *imgLayer; NSImage *img; } @end @implementation LayeredView - (id)initWithFrame:(NSRect)frame { NSLog(@"%s", __PRETTY_FUNCTION__); self = [super initWithFrame:frame]; if (self) { [self commonInit]; } return self; } - (instancetype)initWithCoder:(NSCoder *)coder { NSLog(@"%s", __PRETTY_FUNCTION__); self = [super initWithCoder:coder]; if (self) { [self commonInit]; } return self; } - (void)commonInit { NSLog(@"%s", __PRETTY_FUNCTION__); [self setWantsLayer:YES]; // load the image img = [NSImage imageNamed:@"i100x100"]; // create layer imgLayer = [CALayer new]; // .contentsGravity as desired imgLayer.contentsGravity = kCAGravityCenter; // add the layer [self.layer addSublayer:imgL…
upvote count: 2

http://stackoverflow.com/comment/135419406
comment on: http://stackoverflow.com/q/76804325
has text: @HangarRash Because tvOS comes straight from iOS, so many of the same issues can apply, and many people who might see iOS questions and have a wealth of iOS knowledge would likely be able to help out on this one as well.
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/135494701
comment on: http://stackoverflow.com/q/76857927
has text: Tip: use URLs instead of paths.
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/135487594
type: Comment
score: 0
type: QuestionComment
has text: Does this answer your question? [Swift: Natively Detect if App has Crashed](https://stackoverflow.com/questions/37220379/swift-natively-detect-if-app-has-crashed)
comment on: http://stackoverflow.com/q/76851823

http://stackoverflow.com/comment/135488702
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76851823
has text: @CouchDeveloper the signal handler approach is not able to catch all crash occurrences. Any suggestions around this? I implemented it as given in the Crash Eye library.

http://stackoverflow.com/comment/136365345
score: 1
type: QuestionComment
has text: At least with Swift the corruption problem seems to have been fixed!
type: Comment
comment on: http://stackoverflow.com/q/76827926

http://stackoverflow.com/q/76748378
tagged with: swift
upvote count: 0
tagged with: macos
score: -1
downvote count: 1
has answer: http://stackoverflow.com/a/76759804
type: Question
answer count: 1
tagged with: objective-c
has body: Is it possible to get a callback when a push notification is received but the mac app is force killed ?
type: UnansweredQuestion
tagged with: cocoa
has title: Push notification of mac OSX when is force quit
favorite count: 0
tagged with: apple-push-notifications

http://stackoverflow.com/comment/135310347
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76748789
has text: @matt Sorry. I deleted while loop and added `[[NSRunLoop currentRunLoop] run];` and got "ok" output. Thank you very much!

http://stackoverflow.com/comment/135443309
has text: So what is the problem? How you want to use that information?
type: Comment
comment on: http://stackoverflow.com/q/76827926
score: 0
type: QuestionComment

http://stackoverflow.com/comment/135330773
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76763164
has text: Also the PHP file in the Objective C code should read "TokenUpload.php"
type: QuestionComment

http://stackoverflow.com/q/76763164
tagged with: ios
has body: I am trying to upload a text file to a web server from an iOS application. I have written an objective C method to handle the upload request and a PHP file to handle the POST request at the server. I have also written a small HTML page to test the upload from a browser (which is working fine using the same PHP file). When the iOS App runs it should upload a text file (which is empty ie 0 bytes in size) to a specified folder on the web server, and although the debug window shows the response as success(200) the file is not uploaded. Here is the Objective C method + (void)fileUpload{ NSString *localFilePath = [self GetTokenFilePath]; NSURL *localFile = [NSURL fileURLWithPath:localFilePath]; NSData *data = [[NSData alloc] initWithContentsOfFile:localFilePath]; NSString *filename = [self GetTokenFilename]; // Set up the body of the POST request. // This boundary serves as a separator between one form field and the next. // It must not appear anywhere within the actual data that you intend to // upload. NSString * boundary = @"---------------------------14737809831466499882746641449"; // Body of the POST method NSMutableData * body = [NSMutableData data]; // The body must start with the boundary preceded by two hyphens, followed // by a carriage return and newline pair. // // Notice that we prepend two additional hyphens to the boundary when // we actually use it as part of the body data. // [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; // This is followed by a series of headers for the first field and then // TWO CR-LF pairs. set tag-name to submit upload [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"file\"; filename=\"%@.txt\"\r\n", filename] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; // Next is the actual data for that field (called "tag_name") followed by…
has comment: http://stackoverflow.com/comment/135330773
tagged with: objective-c
has answer: http://stackoverflow.com/a/76818453
has title: Why does NSURL POST file upload task fail to upload to web server
linked to: http://stackoverflow.com/q/32934329
score: 0
type: Question
tagged with: post
answer count: 1
has comment: http://stackoverflow.com/comment/135330649
type: UnansweredQuestion
tagged with: nsurl

http://stackoverflow.com/a/76880736
has comment: http://stackoverflow.com/comment/135535983
has comment: http://stackoverflow.com/comment/135535959
downvote count: 0
score: 1
type: AcceptedAnswer
has body: With plain XCTest, no. But with the third-party library Quick, yes. https://github.com/Quick/Quick
type: Answer
answers question: http://stackoverflow.com/q/76857514
upvote count: 1
has comment: http://stackoverflow.com/comment/135543746
accepted answer of: http://stackoverflow.com/q/76857514

http://stackoverflow.com/comment/135502597
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76859350
score: 0
has text: From what I saw `applicationWillTerminate` is not called only when we move to background and then quit the app. Can you pls throw light on how this is never called, the apple docs are not very helpful? @matt

http://stackoverflow.com/comment/135435442
score: 0
has text: @Willeke No, this is not Core Data, just filtering an array of objects. Regarding NSCompoundPredicate I did end up going that route. I had to iterate my wildcard items to build the compounds but it seems the best solution.
comment on: http://stackoverflow.com/q/76815699
type: QuestionComment
type: Comment

marshalling
type: Tag
tags question: http://stackoverflow.com/q/76778283
tag name: marshalling

ios-app-group
tag name: ios-app-group
type: Tag
tags question: http://stackoverflow.com/q/76857927

http://stackoverflow.com/comment/136365341
score: 0
type: QuestionComment
type: Comment
has text: Another painpoint we hit was during debugging - inspecting an object's properties shouldn't terminate the process, but inspecting properties often results in "selector not found" exceptions (in particular when running on an earlier OS version - inspecting any property only available in a later OS version will throw a "selector not found" exception).
comment on: http://stackoverflow.com/q/76827926

http://stackoverflow.com/comment/135288464
has text: What you're looking for is varargs. I'm duping this to the question that answers that. Please comment here if you believe there is more to your question and we can reopen this one. The code you're writing here relies on a particular parameter passing approach that is neither correct (see mschmidt's discussion of the ABI), nor reliable if it happened to be correct. But it's luckily also unnecessary.
comment on: http://stackoverflow.com/q/76735865
score: 1
type: Comment
type: QuestionComment

xcuitest
type: Tag
tags question: http://stackoverflow.com/q/76857514
tag name: xcuitest
tags question: http://stackoverflow.com/q/77494930
tags question: http://stackoverflow.com/q/79259799

http://stackoverflow.com/comment/135468699
type: Comment
comment on: http://stackoverflow.com/q/76841203
score: 0
type: QuestionComment
has text: Look at your screenshot from App Store Connect. You need to finish setting up the in-app purchases so it doesn't say "Missing metadata".

http://stackoverflow.com/comment/135355579
score: 0
has text: @Larme, thanks for you comment. I've changed my code, I think this should do the trick, perhaps you can approve it ? thnaks !
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/76772945

http://stackoverflow.com/a/76868430
upvote count: 1
answers question: http://stackoverflow.com/q/76867855
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/135512227
has body: No, the cgo-generated getlark._Ctype_struct_NSDictionary is certainly not a Go map so dd["Height"] won't obviously work. Please note that cgo is a rather thin layer, it does not do any special magic like somehow turning random implementations of assotiative arrays done in C into Go maps. What you should probably do is to write helper code in your C part (that bit which defined GetChrome) which would operate on NSDictionarys. Say, something like this (completely untested): char *getNSDictInt(NSDictionary *dict, char *key) int { s_key = convertKeyToNSString(key); /* must be implemented */ return dict[s_key]; } and then call them like this: dd := C.FindChrome() height := C.getNSDictInt(dd, "Height") You'd need to provide such "accessors" for each type of values your NSDictionary may hold. (!) Note that after some digging I found out that the keys in a NSDictionary are NSStrings which are sequences of UTF-16 code units, so you must use something like this to get an *NSString out of the incoming char *key. (This can also be done on the Go side, but let's start small.) Another solution should be to get a ready-made package which is already prepared to deal with Cocoa API's code types–such as this or this–which both were found by a simple search.
accepted answer of: http://stackoverflow.com/q/76867855
has comment: http://stackoverflow.com/comment/135512276
has comment: http://stackoverflow.com/comment/135523043
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/135478552
has text: @HangarRash still same, i just added review information there, still stuck
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76841203

http://stackoverflow.com/q/76793320
has body: I have a framework mixed Objective-C and Swift using CocoaPods for distribution. The issue is it cannot load images stored in the framework's Assets. This is the code I used to load the image: let currentBundle = Bundle(for: <MyClass>.self) let image1 = UIImage(named: "someImage", in: currentBundle, compatibleWith: nil) The image1 returns nil. After some trials, it worked with the code below: let bundleWithIdentifier = Bundle(identifier: "org.cocoapods.MyFramework") let image2 = UIImage(named: "someImage", in: bundleWithIdentifier, compatibleWith: nil) currentBundle and bundleWithIdentifier are not the same bundles. 'org.cocoapods.MyFramework' is the identifier of this framework generated in the hosted app after running pod install. The original identifier is: "com.be.MyFramework". This is part of the podspec file used to store assets in the resource bundle: spec.subspec 'Core' do |core| core.source_files = '<MyFramework>/**/*.{h,m,swift}' core.public_header_files = '<MyFramework>/<MyFramework>.h', core.frameworks = 'UIKit', 'Foundation', 'Security', 'QuartzCore' core.library = 'c++' core.resource_bundles = { '<MyFramework>' => ['<MyFramework>/**/*.{xcassets,xib,storyboard,png,jpg,lproj}'] } end I have another framework, the podspec file, and everything is the same except this framework was mixed with Swift and Objective-C. The other framework can load images without any issues using Bundle(for: .self). Can someone help me explain why there are differences even though the two frameworks are almost the same?
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135392725
has comment: http://stackoverflow.com/comment/135436075
score: 0
linked to: http://stackoverflow.com/q/50625036
has title: Cocoapods framework: Assets is in different bundle with framework's bundle
tagged with: xcasset
tagged with: cocoapods
type: Question
tagged with: swift
tagged with: loadimage
type: UnansweredQuestion
answer count: 0

http://stackoverflow.com/comment/135320381
comment on: http://stackoverflow.com/q/76757060
type: QuestionComment
score: 2
type: Comment
has text: AFAIK, they both strictly follow IEEE754, so you shouldn't see any differences in the actual values. As far as _presentation_ goes though, all bets are off. `print` and `NSLog` clearly differ, and there's no real reason to expect them to behave identically.

http://stackoverflow.com/comment/135436075
has text: @larme thank you, your suggestion worked for me with this option: s.resources = "Resources/**/*.{png,storyboard}"
score: 0
comment on: http://stackoverflow.com/q/76793320
type: QuestionComment
type: Comment

xcasset
type: Tag
tags question: http://stackoverflow.com/q/76793320
tag name: xcasset

http://stackoverflow.com/comment/135982405
comment on: http://stackoverflow.com/q/76827926
score: 0
has text: @RobNapier Yes, bridging ObjC exceptions over to C# is exactly what we're doing in https://github.com/xamarin/xamarin-macios. Here's a document describing what we support: https://learn.microsoft.com/en-us/xamarin/ios/platform/exception-marshaling. I know very well that ObjC exceptions are much more _exceptional_ than C# exceptions, but at some point we have to be pragmatic and deal with what we've got. Just terminating the process is not a very good user experience, for a number of reasons.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/135373013
has text: Without diving deep into profiling I couldn't give you a definitive answer. That said, it's rare that Apple introduces a new API that is less efficient. Aside from performance, there are other reasons why it might be wise to switch to `UIGraphicsImageRenderer` -- such as color formats, memory optimization, etc... But for *your specific task* I can't imagine you would see any difference.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/76780414
type: Comment

uitableview
type: Tag
tags question: http://stackoverflow.com/q/76804325
tag name: uitableview
tags question: http://stackoverflow.com/q/77600508
tags question: http://stackoverflow.com/q/77672746
tags question: http://stackoverflow.com/q/78975078
tags question: http://stackoverflow.com/q/78952984

http://stackoverflow.com/comment/135494407
has text: What kind of crash do you mean specifically? Note, that "crashes" are caused by special CPU instructions generated by the source code (Int overflow, array index out of range,...) or caused CPU exceptions generated by the CPU itself (div by zero). We say it's a "crash" when the app terminates or aborts unexpectedly. However, the app also terminates, when the OS orderly terminates your app, or when the source code executes `fatalError()`. There are also CPU exceptions which are vital to the system, for example to implement virtual memory.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76851823
type: Comment

http://stackoverflow.com/comment/135293587
type: Comment
score: 0
has text: @DonMag I want the top-left corner of the label's bounding box to be at (10, 10).
comment on: http://stackoverflow.com/q/76738986
type: QuestionComment

method-signature
type: Tag
tags question: http://stackoverflow.com/q/76827926
tag name: method-signature

http://stackoverflow.com/comment/135307556
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76732073
has text: Follow the same steps but in step 4 you want to choose Project (not Public or Private). Also use `#import "BaseLog.h"` in `AppLogger.h`.

http://stackoverflow.com/a/76757111
score: 5
accepted answer of: http://stackoverflow.com/q/76757060
answers question: http://stackoverflow.com/q/76757060
has body: Both languages return the same number but they are formatted differently. I assume that you understand the scientific notation 5.36e-06 is the same as 0.00000536. The format specifiers of NSLog follow the IEEE printf specification. When describing the specifier f, it says: If the precision is missing, it shall be taken as 6; So it's rounded to 6 digits after the point, without using scientific notation (like e-06). It means that all except a single digits are removed. Swift's print function doesn't use format specifiers. Instead, the documentation state: The textual representation for each item is the same as that obtained by calling String(item). It obviously choses to print it with scientific notation and the maximum number of relevant digits.
type: AcceptedAnswer
upvote count: 5
type: Answer
downvote count: 0

app-store
tag name: app-store
tags question: http://stackoverflow.com/q/76729297
type: Tag
tags question: http://stackoverflow.com/q/79318039

http://stackoverflow.com/comment/135324672
type: Comment
comment on: http://stackoverflow.com/a/76758906
type: AnswerComment
has text: Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/254648/discussion-between-rob-and-hangarrash).
score: 0

http://stackoverflow.com/comment/135543746
type: AnswerComment
type: Comment
score: 0
has text: I'm afraid the XCTest reporter may still flatten things, but you never know until you try an experiment.
comment on: http://stackoverflow.com/a/76880736

nsarray
type: Tag
tag name: nsarray
tags question: http://stackoverflow.com/q/76878213
tags question: http://stackoverflow.com/q/79100189

http://stackoverflow.com/comment/135940977
type: Comment
has text: Don't forget varargs, which are unbounded. But since you're already in assembly, I would think you'd check the frame pointer here to determine the size. Otherwise you have to consider all the padding issues. Is there a reason you're trying to compute it directly rather than use the FP-SP? (I haven't tried to build what you're building, so it's very possible I'm missing something obvious.) Also be sure to check Apple's slight alternations to the standard arm64 calling conventions: https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms
score: 0
comment on: http://stackoverflow.com/q/76827926
type: QuestionComment

http://stackoverflow.com/a/76758906
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/76757144
has body: You asked: Is there a valid way to get a return value from a Swift async method and return it from inside a non-async method? No, there really isn’t. Apple is very specific that blocking should be avoided and that, where absolutely needed, things like locks must be isolated to a “tight, well-known critical section”. (The example would be a lock used for a very quick synchronization within a task, but not across separate tasks or continuations.) For more information, see Swift concurrency: Behind the scenes. But we have a contract with Swift concurrency to never “impede forward progress”. It's the whole idea behind a “concurrency system” (as in contrast to “parallelism”). You raised the example of a UITableViewDataSource. The table view is requesting data and expects/requires the data source to return the results immediately and synchronously. You cannot return the result asynchronously. And you would never block to fetch the results with some anti-pattern (like semaphores, locks, etc.). What you can do is initiate the asynchronous process and return nothing for now. Then, when the async fetch is done, tell the table view to reloadData, which will initiate a new query of the UITableViewDataSource. So keep the data source synchronous, but go ahead and use Swift concurrency to launch a task and later initiate a reloadData. You also mention the CKSyncEngineDelegate example. That is a curious implementation, where the Swift rendition is async, but the Objective-C rendition is not (it has no completion handler). So, clearly the framework has been implemented with an asynchronous delegate for Swift developers, but they simply do not offer asynchronous support for Objective-C clients. (I can only guess that they did not want to encumber Objective-C developers with the burden of calling a completion handler, while offering Swift developers a very natural asynchronous interface, where you might have a suspension point, but you might not. That results in an unusual asymmetry b…
upvote count: 2
has comment: http://stackoverflow.com/comment/135324672

post
tag name: post
tags question: http://stackoverflow.com/q/76763164
type: Tag

http://stackoverflow.com/comment/135376935
has text: `NSImage` will cache images based on their names. I suspect that when you try to re-fetch the image using `imageNamed`, it is returning the cached image instead of re-searching for an image to display (and finding the one in your asset catalog). Try doing `[(NSImage *)sublayer2.content setName: nil];` right before you set `sublayer2.content` and see if that flushes the cached image and forces the system to search for the one in the asset catalog.
type: Comment
comment on: http://stackoverflow.com/q/76786372
score: 0
type: QuestionComment

http://stackoverflow.com/a/79489532
has body: On my case adding the following line in the iOS .podspec fix the problem (in the podspec from your iOS Swift library, not from the React Native library): s.pod_target_xcconfig = { 'DEFINES_MODULE' =&gt; 'YES' } Then re-run pod install in your react native example app and Clean the Build folder EDIT: Finally this doesn't work at all (it was a cache issue that make it temporary working in my case), I'm still looking for a solution...
score: 0
answers question: http://stackoverflow.com/q/76822622
type: Answer

http://stackoverflow.com/comment/135310537
comment on: http://stackoverflow.com/q/76735865
score: 0
type: Comment
has text: @RobNapier Generally speaking, I want to save the method name and the arguments of any method, then I could 'reproduce' the method at any time with NSInvocation instance created with the saved method name and arguments
type: QuestionComment

http://stackoverflow.com/comment/135941201
type: Comment
score: 1
has text: (I'd love to hear more about what you're doing with this. Maybe trying to bridge ObjC exceptions over to C#? That would be very clean for Swift `throws`, but I worry the differences in intent between what ObjC and C# mean by "exception" would break that. Anyway; best of luck with your project.)
comment on: http://stackoverflow.com/q/76827926
type: QuestionComment

http://stackoverflow.com/comment/135284963
score: 2
has text: `self` is a pointer to your class containing function `+simpleTest`. Why should the argument to a function be located at a certain offset behind `self`? Its probably located on the stack or in a register depending on the ABI to call a function...
type: QuestionComment
comment on: http://stackoverflow.com/q/76735865
type: Comment

photokit
tag name: photokit
tags question: http://stackoverflow.com/q/76816843
type: Tag
tags question: http://stackoverflow.com/q/77735215

http://stackoverflow.com/comment/135494616
type: QuestionComment
type: Comment
score: 0
has text: If you are not successful with "Crash Eye", you may try [PLCrashReporter](https://github.com/microsoft/plcrashreporter). In my experience, the most reliable and battle tested library for mac and iOS.
comment on: http://stackoverflow.com/q/76851823

http://stackoverflow.com/comment/135379016
has text: Update: it doesn't seem to be related to caching. if I create the `CALayer` and the `NSImage` objects only *after* the app has changed appearance, the layer renders the image with the appearance that the app had on launch. It seems that `CALayer` ignores the app current appearance and relies on its initial state. Is this a bug?
score: 0
comment on: http://stackoverflow.com/q/76786372
type: QuestionComment
type: Comment

nsdictionary
type: Tag
tag name: nsdictionary
tags question: http://stackoverflow.com/q/76878213
tags question: http://stackoverflow.com/q/79472383

http://stackoverflow.com/comment/135280679
type: QuestionComment
comment on: http://stackoverflow.com/q/76729297
score: 0
has text: Does your code check the creation date in asn 1 field type 12 when determining which algorithm to use?
type: Comment

http://stackoverflow.com/comment/135358242
comment on: http://stackoverflow.com/a/76778670
has text: i looked at it again and i missed it, the extra step is indeed required, you are correct, glad you figured it out anyway
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/comment/135503531
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76859350
has text: The typical way in which your app stops running is that we move to the background and then the _system_ quits the app. In that case, `applicationWillTerminate` is not called. So that is the most common situation. We did not crash at all; we terminated _in good order_.
score: 0

http://stackoverflow.com/comment/135982457
has text: We don't really handle varargs at all, so that's not a problem at the moment. I hadn't thought about just computing FP-SP, but we also have to copy all the arguments into the new stack frame, so some understanding of each argument is nice (although I guess we could just copy the entire chunk of memory from A to B and hope for the best?)
comment on: http://stackoverflow.com/q/76827926
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/135526070
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76851823
type: Comment
has text: I think you can find desired implementation from firebase sources: https://github.com/firebase/firebase-ios-sdk

c#
type: Tag
tags question: http://stackoverflow.com/q/76778283
tag name: c#
tags question: http://stackoverflow.com/q/77431878

nsview
tags question: http://stackoverflow.com/q/76748425
tag name: nsview
type: Tag
tags question: http://stackoverflow.com/q/77502487
tags question: http://stackoverflow.com/q/78799874

http://stackoverflow.com/comment/135508770
type: QuestionComment
score: 0
has text: You can read about `applicationWillTerminate(_:)` in the [official documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623111-applicationwillterminate). This delegate method will only be called, when the app will be terminated in an _orderly fashion_ – not when it crashes. BUT, my definition what "crash" means might be different than yours ;) Please define _exactly_ what a "crash" is in your view.
type: Comment
comment on: http://stackoverflow.com/q/76851823

http://stackoverflow.com/a/76819635
has body: If you put the complete log, I could guide you better. But in general, since I myself faced this error, it is probably because your VOIP codecs are not installed. Therefore, make sure that the codecs are installed. To do this, you can add the following piece of code to the program's main function and recompile it to find the number and name of each installed codec, although in your program, I guess it will return 0: unsigned codeccount = 256; pjsua_codec_info codecinfo[codeccount]; pj_status_t codecnum = pjsua_enum_codecs(codecinfo, &codeccount); fprintf(stderr, "codec Count: %d ", codeccount); for (int i = 0; i < codeccount; i++) { fprintf(stderr, "id: %s ", codecinfo[i].codec_id); }
answers question: http://stackoverflow.com/q/76793136
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/76793136

http://stackoverflow.com/comment/135303945
type: QuestionComment
score: 0
type: Comment
has text: @DonMag The size is an example. For your understanding, this text image will act as an overlay to an icon image of for example 100x100. I need to place the text in a certain box at a certain position on the icon image. (Already have logic to compose the icon from one or more image assets.)
comment on: http://stackoverflow.com/q/76738986

http://stackoverflow.com/comment/135519950
has text: @CouchDeveloper thanks, as a dev I feel we should have some way of identifying why my past session terminated and not having any info around this is not helpful. In my case I would at least want to get this metrics to perform a few clean ups before allowing the user to enter the normal flow but seems like there is no straight forward way without using 3rd party libraries that can add to my appsize given I am already using one for crash reporting this is going to be difficult :(
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76859350

http://stackoverflow.com/comment/135983356
score: 0
type: QuestionComment
type: Comment
has text: "Not good user experience" needs to include "corrupting their persistent data" which is absolutely possible once you violate basic preconditions, which is what the majority of ObjC exceptions indicate has happened. I agree there may be debate on this topic, but recovering from arbitrary ObjC exceptions is something we've discussed in the Cocoa world for decades, and the answer we came to was "let it crash." Changing that long-forged decision is a big lift.
comment on: http://stackoverflow.com/q/76827926

http://stackoverflow.com/comment/135502572
comment on: http://stackoverflow.com/q/76851823
has text: @CouchDeveloper Thanks but I don't think I can use a 3rd party library and implementing something on the level of PLCrashReporter may take time. Does the answer given below by Kasparian seem like a possible approach?
type: QuestionComment
score: 0
type: Comment

upload
tags question: http://stackoverflow.com/q/76742126
tag name: upload
type: Tag

http://stackoverflow.com/comment/135392725
type: QuestionComment
score: 0
has text: Maybe some infos there https://stackoverflow.com/questions/50625036/use-resource-bundles-in-cocoapods
type: Comment
comment on: http://stackoverflow.com/q/76793320

http://stackoverflow.com/a/76865492
answers question: http://stackoverflow.com/q/76857927
has body: The problem was with the URL I got back: It startet with "file:///". After converting to a path, it started with "file:/" After removing the "file:" at the beginning it works now.
type: Answer
score: 0

http://stackoverflow.com/comment/135320782
score: 0
type: Comment
has text: Make your async call, get the result, post a notification and then call your sync call with the result from the notification object. Be careful when combining notification with async calls.
comment on: http://stackoverflow.com/q/76757144
type: QuestionComment

nsdata
type: Tag
tag name: nsdata
tags question: http://stackoverflow.com/q/76729747

synchronous
tags question: http://stackoverflow.com/q/76757144
tag name: synchronous
type: Tag

pagination
type: Tag
tags question: http://stackoverflow.com/q/76804325
tag name: pagination

jailbreak
tags question: http://stackoverflow.com/q/76748789
tag name: jailbreak
type: Tag
tags question: http://stackoverflow.com/q/76987652
tags question: http://stackoverflow.com/q/77616167
tags question: http://stackoverflow.com/q/78835604

http://stackoverflow.com/comment/135512513
has text: …in order to try to clear some magic around what you're observing by calling `fmt.Print*` on the returned value–quite possibly the Cocoa's type embeds some sort of a "token" or a "handle" which is used to look up a real runtime-allocated data structure when you're accessing entries that an `NSDictionary` holds. Go "sees" it as an array of 8 bytes (which is quite likely a 64-bit integer in fact, but I'd not guess further, as it's opaque anyway).
type: Comment
comment on: http://stackoverflow.com/q/76867855
score: 0
type: QuestionComment

http://stackoverflow.com/a/76878356
downvote count: 0
has body: Your typedef is fine as-is though I would name it ResponseBlock, not responseBlock. typedef void(^ResponseBlock)(UIImage * _Nullable image); When you use ResponseBlock, don't use a pointer. I also suggest changing loadingResponses to be an NSMutableDictionary so you can assign values to it. Here's an updated version of your code: The interface: typedef void(^ResponseBlock)(UIImage * _Nullable image); @interface ImageManager : NSObject @property (nonatomic, strong) NSMutableDictionary&lt;NSString *, NSMutableArray&lt;ResponseBlock&gt; *&gt; *loadingResponses; @end The method: - (void)fetchImage:(NSString *)urlString and:(ResponseBlock)completionHandler { UIImage *image = [self.cache objectForKey:urlString]; if (image != nil) { completionHandler(image); return; } if (self.loadingResponses[urlString] != nil) { [self.loadingResponses[urlString] addObject:completionHandler]; return; } else { self.loadingResponses[urlString] = [NSMutableArray arrayWithObject:completionHandler]; } NSURL *url = [[NSURL alloc] initWithString:urlString]; [[self.session dataTaskWithURL:url completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { if (error != nil) { UIImage *image = [[UIImage alloc] initWithData:data]; [self.cache setObject:image forKey:urlString]; completionHandler(image); NSArray *array = [self.loadingResponses objectForKey:urlString]; for (ResponseBlock responseCompletion in array) { responseCompletion(image); } } }] resume]; } I'm assuming somewhere you initialize loadingResponses as: self.loadingResponses = [NSMutableDictionary dictionary]; You also need to call the completion handler if there is an error. Perhaps you mean to do: [[self.session dataTaskWithURL:url completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { UIImage *image = nil; if (error != nil) { image = [[UIImage alloc] initWithData:data]; [self.cache setObject:image forKey:urlString]; } completionhHand…
score: 1
accepted answer of: http://stackoverflow.com/q/76878213
answers question: http://stackoverflow.com/q/76878213
type: AcceptedAnswer
type: Answer
upvote count: 1

xctest
tag name: xctest
tags question: http://stackoverflow.com/q/76857514
type: Tag
tags question: http://stackoverflow.com/q/77494930

http://stackoverflow.com/comment/135488617
score: 0
has text: @HangarRash yes I saw this but as you have mentioned this is not called in all cases and I want some way of assuring that a crash has occurred. There is a chance that it may not get called giving me a false crash. I want a solid way of identifying that the crash has occurred. Also how do the 3rd party libraries do it? Very curious.
type: QuestionComment
comment on: http://stackoverflow.com/q/76851823
type: Comment

http://stackoverflow.com/comment/135428895
comment on: http://stackoverflow.com/q/76815699
score: 0
type: QuestionComment
has text: Have you tried constructing the predicate in code with `[NSPredicate predicateWithFormat:@"property LIKE %@", string]` and `NSCompoundPredicate`?
type: Comment

http://stackoverflow.com/comment/135298325
comment on: http://stackoverflow.com/q/76738986
type: QuestionComment
score: 0
has text: OK - before we get into complicated sizing issues... is this your actual goal? `100x100` pixel image, with MAX font-size of `16`? Or is this just an "example" and you may have a target of `300x300` image, with maybe a MAX font-size of `50`?
type: Comment

calayer
tags question: http://stackoverflow.com/q/76786372
tag name: calayer
type: Tag
tags question: http://stackoverflow.com/q/77502487
tags question: http://stackoverflow.com/q/78195402
tags question: http://stackoverflow.com/q/79135341

libvlc
type: Tag
tags question: http://stackoverflow.com/q/76719292
tag name: libvlc

go
tags question: http://stackoverflow.com/q/76867855
type: Tag
tag name: go
tags question: http://stackoverflow.com/q/78172699
tags question: http://stackoverflow.com/q/78846311
tags question: http://stackoverflow.com/q/79290109

adapter
tags question: http://stackoverflow.com/q/76757144
tag name: adapter
type: Tag

http://stackoverflow.com/comment/135330649
comment on: http://stackoverflow.com/q/76763164
type: QuestionComment
has text: I forgot to add this line in at the start of the PHP file "echo "The PHP script has started"." ";" this will then tie up with the debug output.
score: 0
type: Comment

http://stackoverflow.com/a/76739637
type: Answer
answers question: http://stackoverflow.com/q/76738986
upvote count: 1
downvote count: 0
has body: Inset the rectangle used to initialize the label's frame... // ... let drawRect = CGRectMake(10, 10, 80, 25); // Inset the drawRect with UIEdgeInsetsInsetRect() // I've set the (... bottom, left) insets to (... -20, -20) in case // you wish to center the label. If not, set those to (... 0, 0) const UIEdgeInsets insets = UIEdgeInsetsMake(10, 10, -20, -20); const CGRect insetRect = UIEdgeInsetsInsetRect(drawRect, insets); // changed drawRect to insetRect UILabel *myLabel = [[UILabel alloc] initWithFrame: insetRect]; // ... Disclaimer: it has been years since I used Objective-C. (Regarding what the drawInRect: is for, that's how you might choose to use the image after creating it. You might choose to draw it. If you don't need to, or are drawing it elsewhere later, you can remove that line).
score: 1

nsurlsession
tag name: nsurlsession
type: Tag
tags question: http://stackoverflow.com/q/76772945
tags question: http://stackoverflow.com/q/76910618
tags question: http://stackoverflow.com/q/76997256
tags question: http://stackoverflow.com/q/77330943
tags question: http://stackoverflow.com/q/77855536
tags question: http://stackoverflow.com/q/78153217

http://stackoverflow.com/comment/135512276
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/76868430
has text: Okay, thank you for following up on this question. I'll try.

ssl
tags question: http://stackoverflow.com/q/76772945
tag name: ssl
type: Tag

uifont
tag name: uifont
tags question: http://stackoverflow.com/q/76937682
type: Tag

http://stackoverflow.com/q/76901393
has comment: http://stackoverflow.com/comment/135569310
has comment: http://stackoverflow.com/comment/135569560
has comment: http://stackoverflow.com/comment/135569609
has body: As we see in this code, Text should be "Program Started" after 3 seconds, but in the view it is still stuck in "Hello World". Does anyone have a solution for this? NSString *Text = @"Hello World"; NSLog(Text); // Hello World UIViewController *vc = [HelloWorldViewFactory createWithText:Text]; vc.view.backgroundColor = [UIColor systemBackgroundColor]; [vc.sheetPresentationController setPreferredCornerRadius:0]; [vc.sheetPresentationController setDetents:@[UISheetPresentationControllerDetent.mediumDetent]]; [vc.sheetPresentationController setPrefersScrollingExpandsWhenScrolledToEdge:false]; [UIApplication.sharedApplication.keyWindow.rootViewController presentViewController:vc animated:YES completion:nil]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ Text = @"Program started"; }); NSLog(Text); // Program started
has answer: http://stackoverflow.com/a/76901987
type: Question
accepted answer: http://stackoverflow.com/a/76901987
upvote count: 1
downvote count: 0
has title: How to update text of a presented view controller after a delay?
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/135569329
tagged with: ios
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/135569538
has comment: http://stackoverflow.com/comment/135568999
answer count: 1
tagged with: objective-c

http://stackoverflow.com/comment/135593823
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76910618
score: 0
has text: What's happening? What are the logs saying? What's the cURL equivalent in POSTMAN, or the Objective-C generated code? What's calling that method? Is the object deallocated too soon?

http://stackoverflow.com/a/76939270
score: 0
accepted answer of: http://stackoverflow.com/q/76919529
answers question: http://stackoverflow.com/q/76919529
type: AcceptedAnswer
type: Answer
has body: So it seems that metro does things a bit differently in dev vs prod and I didn't account for that. Bundling JS with --dev true works. In order to avoid the hmrClient error it's better to use [bridge.batchedBridge executeApplicationScript] rather than executeSourceCode.

http://stackoverflow.com/comment/135593097
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76910618
has text: Have you used the debugger to see what is actually happening at runtime?
score: 0

http://stackoverflow.com/comment/135596300
has text: What difficulty are you experiencing?
score: 1
comment on: http://stackoverflow.com/q/76917235
type: Comment
type: QuestionComment

http://stackoverflow.com/a/76930388
downvote count: 1
answers question: http://stackoverflow.com/q/76917550
type: AcceptedAnswer
type: Answer
has body: - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { NSDictionary *notificationData = response.notification.request.content.userInfo; NSString *title = notificationData[@"title"]; NSString *description = notificationData[@"description"]; // Instantiate the JustNotifications view controller UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; JustNotifications *newViewController = [mainStoryboard instantiateViewControllerWithIdentifier:@"JustNotifications"]; newViewController.titleText = title; newViewController.descriptionText = description; // Wrap the JustNotifications view controller in a new navigation controller UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:newViewController]; // Present the navigation controller modally UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController; [rootViewController presentViewController:navController animated:YES completion:nil]; completionHandler(); }
accepted answer of: http://stackoverflow.com/q/76917550
upvote count: 0
score: -1

http://stackoverflow.com/comment/135659938
score: 0
type: QuestionComment
has text: Ask one question per question please. Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask).
type: Comment
comment on: http://stackoverflow.com/q/76953584

http://stackoverflow.com/q/77037290
has comment: http://stackoverflow.com/comment/135824502
score: 0
type: Question
tagged with: swift
tagged with: realm
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/135835993
has comment: http://stackoverflow.com/comment/135807501
has comment: http://stackoverflow.com/comment/135824576
has comment: http://stackoverflow.com/comment/135843011
has comment: http://stackoverflow.com/comment/135838476
has body: I designed a full class to manage Realm Database on my app. Every method seems to work fine with the same instance of Realm. But when I go to the query methods I get an EXC_BAD_ACCESS Error. For example lets take my method getLogin(): public func getLogin() -> Login { guard let realm = self.realm else { fatalError("Didnt find Realm instance") } let loginObjects: Results<Login> = realm.objects(Login.self) guard let loginObject: Login = loginObjects.first else { --- Thread1: EXC_BAD_ACCESS fatalError("Error getting Login object from Realm") } return objetoLogin } My Login object is defined in an independent class: import Foundation import RealmSwift class Login : Object{ @objc dynamic var cif : String = "" @objc dynamic var password : String = "" @objc dynamic var iosToken : String = "" @objc dynamic var iag_id : Int32 = 0 @objc dynamic var iat_id : Int32 = 0 convenience init(cif: String, password: String, iosToken: String) { self.init() self.cif = cif self.password = password self.iosToken = iosToken self.iag_id = 0 self.iat_id = 0 } override static func primaryKey() -> String? { return "cif" } } I tried controlling an error that's not working, since I never get to see any of the fatalErrors on the console. I made sure to define an instance of Realm that would be used in the entire app without leaving the instance. I made sure I have at least 1 Login object in the database when initiating the app. Maybe I got the syntax wrong for handling Objects in Realm. I am using the following software versions: Realm 10.39.1 RealmDatabase 13.10.1 -- Both imported by SwiftPackageManager -- Xcode 13.4 And building for iOS 12+
has comment: http://stackoverflow.com/comment/135851042
has title: EXC_BAD_ACCESS quey consulting Realm database with RealmSwift library retrieving Object from Database
tagged with: objective-c

http://stackoverflow.com/comment/135738865
comment on: http://stackoverflow.com/q/76932655
type: QuestionComment
has text: Showing your current Swift code might help, and printing `data` and `items` might help too.
type: Comment
score: 0

http://stackoverflow.com/a/77239747
answers question: http://stackoverflow.com/q/76923569
type: Answer
has body: To answer my own question, I ended up modifying SDL and made a PR, see here: https://github.com/libsdl-org/SDL/pull/8356 If that gets through then there will be SDL_UNIVERSALLINK that gets triggered on every new URL.
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/76923569

http://stackoverflow.com/comment/135597934
score: 0
comment on: http://stackoverflow.com/q/76917550
has text: `self.window` could be nil. Modern apps (iOS 13+) do not use `UIApplicationDelegate window` any more due to the use of scenes.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/76932655
upvote count: 0
has comment: http://stackoverflow.com/comment/135622237
accepted answer: http://stackoverflow.com/a/76932773
downvote count: 1
type: Question
answer count: 1
tagged with: objective-c
favorite count: 0
has body: I'm currently working on converting a piece of code written in Objective-C to Swift, and I've encountered a bit of a roadblock. The part that's giving me trouble involves extracting properties from a bookmark data. NSMutableArray *extractItems(NSString *path) { NSDictionary *data = [NSDictionary dictionaryWithContentsOfFile:path]; NSMutableArray* items = [[NSMutableArray alloc] init]; NSData* bookmark = nil; NSDictionary* properties = nil; // Extract items for(id object in data[@"$objects"]) { // Reset bookmark bookmark = nil; // Extract bookmark data if([object isKindOfClass:[NSData class]] == YES) { bookmark = object; } // Extract bookmark from dictionary if([object isKindOfClass:[NSDictionary class]] == YES) { bookmark = [object objectForKey:@"NS.data"]; } // Skip if no bookmark if(bookmark == nil) { continue; } // Extract properties properties = [NSURL resourceValuesForKeys:@[@"AllPropertiesKey"] fromBookmarkData:bookmark][@"AllPropertiesKey"]; if(properties == nil) { // Skip this item continue; } // Create item Item *item = [[Item alloc] init]; item.path = path; item.executable = properties[@"_NSURLPathKey"]; item.type = [NSNumber numberWithInt:ItemType]; item.user = extractUserFromPath(path); item.content = nil; // Use name from bundle or NSURLNameKey item.name = [NSBundle bundleWithPath:item.executable].infoDictionary[@"CFBundleName"]; if(item.name.length == 0) { item.name = properties[@"NSURLNameKey"]; } // Skip if there are issues if (item.name == nil || item.executable == nil) { continue; } // Add item [items addObject:item]; } return items; } The challenge I'm facing is related to the extraction of properties using the resourceValuesForKeys method and then accessing the NSURLBookmarkAllPropertiesKey dictionary within it
has answer: http://stackoverflow.com/a/76932773
has title: "Translating Objective-C Code to Swift: Struggling with Properties Extraction from Bookmark Data"Help me to translate this code
type: AnsweredQuestion
score: -1
has comment: http://stackoverflow.com/comment/135738865
tagged with: swift

http://stackoverflow.com/comment/135657836
comment on: http://stackoverflow.com/q/76945838
score: 1
type: QuestionComment
type: Comment
has text: @YosiFZ - this line: `image = [[newImage retain] autorelease];` is really out of place. Have you disabled **ARC** for some reason? If so, why?

http://stackoverflow.com/a/77010258
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/77009569
type: Answer
upvote count: 3
has body: The various attributes of Objective-C properties are grouped into mutually exclusive sets of values. You can only pick one value from each group. A property is either atomic or nonatomic. A property is either readwrite or readonly. A property is either assign, weak, strong, or copy. A property is either nullable or nonnull. So you can't make a property that is both assign and strong. It can only be one of them. Picking a value from each group has no effect on the values in any other group. For a reference type (NSString * for example), the defaults are atomic, readwrite, and strong as you have stated. Explicitly choosing a non-default value for one value does not change the other defaults. You asked: are these 2 statements equivalent? @property (assign) NSString* name; @property (assign,atomic,readwrite,strong) NSString * name; No since once you pick assign, strong is not used. On a side note, never use assign with a reference type unless you really, really have a good and fully understood reason to do so. In other words, these are the same: @property (assign) NSString *name; @property (assign, atomic, readwrite) NSString *name; Though again, don't use assign with reference types. You asked if the following are equivalent: @property (nonatomic,weak) NSString * name; @property (nonatomic,weak,readwrite) NSString * name; Yes, these are the same. I use the 1st all of the time and the property is always readwrite as well. I said you can only pick one value from each group. This is actually only partially true. In a class's public interface you can declare a property as readonly. And then in the class's private class extension, you can redeclare the property as readwrite. For example: .h file: @interface SomeClass @property (readonly) NSString *someValue; @end .m file @interface SomeClass () @property (readwrite) NSString *someValue; @end What this does is expose a readonly property to users of the class but allow the private implementation of the class to also write val…
downvote count: 0
score: 3
accepted answer of: http://stackoverflow.com/q/77009569

http://stackoverflow.com/comment/135758091
has text: `assign` and `strong` are mutually exclusive. `assign` says "don't retain" and `strong` says "retain". Is there a reason you're trying to use `assign`? (See "Setter Semantics" in https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocProperties.html for more info) The basic answer is "yes", though: if you don't specify an attribute, the default applies
comment on: http://stackoverflow.com/q/77009569
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/a/76989789
answers question: http://stackoverflow.com/q/76987652
type: Answer
has body: I did a little redesign but it should work correctly for your purposes. Example Code: NSError *error = nil; // Open the file and create it if it doesn't exist NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths firstObject]; NSString *filePath = [NSString stringWithFormat:@"%@/myFile.txt", documentsDirectory]; NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:filePath]; if (fileHandle == nil) { [[NSFileManager defaultManager] createFileAtPath:filePath contents:nil attributes:nil]; } // Open the output stream NSOutputStream *outputStream = [NSOutputStream outputStreamToFileAtPath:filePath append:YES]; [outputStream open]; // Open the input stream NSInputStream *inputStream = [NSInputStream inputStreamWithFileAtPath:filePath]; [inputStream open]; // What you are writing NSString *printString = [NSString stringWithFormat:@"Hello Logos\n"]; // Write to file [fileHandle seekToEndOfFile]; NSData *contentData = [printString dataUsingEncoding:NSUTF8StringEncoding]; [outputStream write:contentData.bytes maxLength:contentData.length]; // Read from file size_t fileSize = [[[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:&error] fileSize]; if(error) { NSLog(@"Error reading file: %@", error); return; } NSMutableData* data = [NSMutableData dataWithLength:fileSize]; size_t result = [inputStream read:(uint8_t *)data.bytes maxLength:fileSize]; if(result != fileSize) { NSLog(@"Failed to read %zu bytes, only read %zu!", fileSize, result); } NSLog(@"%@: contains:\n%@", filePath, [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]); Test run: ❯ xcrun clang -arch x86_64 -isysroot $(xcrun --sdk macosx --show-sdk-path) -O3 -DNDEBUG test.m -o test -framework Foundation /var/folders/x2/gjkg0qk92j92svxfk1x1cn100000gn/T ❯ rm ~/Documents/myFile.txt rm: cannot remove '/Users/cryptic/Documents/myFile.txt': No such file or directory /var/folders/x2/gjkg0qk92j92s…
has comment: http://stackoverflow.com/comment/135731521
score: 0

http://stackoverflow.com/a/77032687
upvote count: 1
downvote count: 0
has body: By default, the maximum depth of the document tree is indeed limited to 256. You should get an error message like: Excessive depth in document: 256 use XML_PARSE_HUGE option As the message explains, you get around this limitation by using the XML_PARSE_HUGE parser option.
accepted answer of: http://stackoverflow.com/q/77006982
has comment: http://stackoverflow.com/comment/135804592
score: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/77006982
type: Answer

http://stackoverflow.com/q/76945008
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135645557
tagged with: protocols
score: 0
has title: A better way of instantiating a class that follows a protocol
has comment: http://stackoverflow.com/comment/135647304
type: Question
answer count: 1
tagged with: inheritance
has answer: http://stackoverflow.com/a/76947501
accepted answer: http://stackoverflow.com/a/76947501
has comment: http://stackoverflow.com/comment/135648052
has comment: http://stackoverflow.com/comment/135644129
has comment: http://stackoverflow.com/comment/135648061
has comment: http://stackoverflow.com/comment/135643689
type: AnsweredQuestion
has body: I'm working on my first iOS app part of which uses a protocol which then has a number of classes that follow it. @protocol unitLoadoutDataController <NSObject> @required - (void)setDefaultLoadout:(NSString *)unitType unitId:(NSNumber *)uniqueUnitId; - (void)resizeDefaultLoadout:(NSString *)unitType unitId:(NSNumber *)uniqueUnitId number:(NSNumber *)models; - (UIAlertController *)updateLoadout:(NSInteger)section row:(NSInteger)row unitType:(NSString *)unitType unitId:(NSNumber *)uniqueUnitId number:(NSNumber *)models; @end and then a set of classes that use it. e.g. @interface heavyIntercessorSquad : NSObject <unitLoadoutDataController> @end @interface eradicatorSquad : NSObject <unitLoadoutDataController> @end Both of these include the three 3 methods my protocol defines with different implementations. When the user clicks on one of the units from the list in a tableview I need an instance of that class so they can configure it on the next screen. I don't know which class I need until the row is clicked. To solve this problem I'm using a set of local variables and a big if/else block to get the class I need. selectedUnit.name contains the name of the squad the user clicked and depending on that value I create a class of the appropriate type. Once I have the pointer to the class I need I assign it to squadToConfigure and call the method I need. Here's the definition of squadToConfigure which holds the class once created. @property (weak, nonatomic) id <unitLoadoutDataController> squadToConfigure; Here is a subset of the code that works out which class I need (I have about 30 of these so far) based on selectUnit.name heavyIntercessorSquad *heavyIntercessorSquadToConfigure; eradicatorSquad *eradicatorSquadToConfigure; if ([selectedUnit.name isEqualToString:@"Heavy Intercessor Squad"]) { heavyIntercessorSquadToConfigure=[[heavyIntercessorSquad alloc] init]; self.squadToConfigure=heavyIntercessorSquadToConfigure; } else if ([selectedUnit.name isEqualToString:@"Eradicator…

http://stackoverflow.com/q/76923569
answer count: 1
tagged with: objective-c
tagged with: c++
score: 0
has answer: http://stackoverflow.com/a/77239747
type: AnsweredQuestion
has body: I was tasked with adding support for universal links into our iOS app written in C++ with an additional complication that the app uses SDL 2 for wrapping iOS specific code (like the AppDelegate). From my brief research SDL does not provide any API to get the url, or did I miss something ? Is there a way to get the URL from SDL without modifying SDL itself ? If not, then at least an outline (a code snippet) of how to get the URL from Objective C to C++ would be nice, as my Objective-C knowledge is zero.
accepted answer: http://stackoverflow.com/a/77239747
tagged with: sdl
has title: Universal links in iOS with C++ and SDL
tagged with: ios
type: Question

http://stackoverflow.com/a/76952021
answers question: http://stackoverflow.com/q/76945838
upvote count: 0
score: -2
type: Answer
downvote count: 2
has body: image resize with OC. - (void)resizeImage:(UIButton *)sender { UIImage* originalImage = [UIImage imageNamed:@"big_image"]; for (int i = 0; i < 1000; i++) { @autoreleasepool { [[self class] resizedImage:originalImage andPreferredSize:CGSizeMake(768, 1024)]; NSLog(@"index:%d", i); } } } + (UIImage *)resizedImage:(UIImage*)image andPreferredSize:(CGSize)size { if (size.width != 0 && size.height != 0 && image.size.height > size.height && image.size.width > size.width) { // 这里image创建的时候需要考虑屏幕倍数 iphone7,8是2，x,xs，11pro是3. float device_pixel = 2; float ratio1 = size.height / image.size.height / device_pixel; float ratio2 = size.width / image.size.width / device_pixel; float ratio3 = ratio1 < ratio2 ? ratio1 : ratio2; UIGraphicsBeginImageContextWithOptions(CGSizeMake(image.size.width * ratio3, image.size.height * ratio3), NO, 0.0); [image drawInRect:CGRectMake(0, 0, image.size.width * ratio3, image.size.height * ratio3)]; // 由于涉及到float运算，返回值的图片分辨率可能有+-1的差异。 UIImage* resizedImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return resizedImage; } return image; }

http://stackoverflow.com/q/76970382
tagged with: ios
has comment: http://stackoverflow.com/comment/135689876
has comment: http://stackoverflow.com/comment/135688519
type: Question
answer count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135689317
has comment: http://stackoverflow.com/comment/135688758
has answer: http://stackoverflow.com/a/76971544
score: 0
has comment: http://stackoverflow.com/comment/135689908
has title: iCarousel iOS with reduced size views on the sides
tagged with: xamarin.ios
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/135687971
tagged with: swift
has body: I am trying to create a circular carousel. I would like to always show 3 at a time. One view is centralized and the other two (the previous and the next) on a reduced size like the image below: I am working with Xamarin.iOS but a solution in swift and object-c is welcomed. This is the closest I could get: I have this inside the iCarouselDelegate public override nfloat ValueForOption(iCarousel carousel, iCarouselOption option, nfloat value) { switch (option) { case iCarouselOption.OffsetMultiplier: return 2f; case iCarouselOption.Wrap: return 1.5f; case iCarouselOption.VisibleItems: return count; case iCarouselOption.Spacing: return 2f; default: return value; } } and also: ViewCarousel.Type = iCarouselType.Rotary;
has comment: http://stackoverflow.com/comment/135688692
accepted answer: http://stackoverflow.com/a/76971544

http://stackoverflow.com/comment/135569206
score: 0
has text: Maybe this helps: [Difference between Instruments (Zombies and leaks)](https://stackoverflow.com/questions/19122803/difference-between-instruments-zombies-and-leaks) and [Why am I seeing all these leaks when NSZombie is enabled?](https://stackoverflow.com/questions/10801051/why-am-i-seeing-all-these-leaks-when-nszombie-is-enabled)
type: Comment
comment on: http://stackoverflow.com/q/76893657
type: QuestionComment

http://stackoverflow.com/comment/135597122
has text: @HangarRash it’s in appdelegate where the remote notifications normally are handled
type: Comment
comment on: http://stackoverflow.com/q/76917550
score: 0
type: QuestionComment

http://stackoverflow.com/comment/135597543
has text: So back to my first comment above. Have you used the debugger to see what your code is actually doing? Update your question with details about what is actually happening in your code.
comment on: http://stackoverflow.com/q/76917550
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/135637745
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/76937682
has text: Feel stupid...the full filename had even the Extension all capitalized. Changed that, and it worked fine.

http://stackoverflow.com/q/76973236
score: 1
favorite count: 0
tagged with: objective-c
has body: In Objective-C, how do I include the Framework containing DCAppAttestService so that I can do this: DCAppAttestService *attestService = [[DCAppAttestService alloc] init];
has title: How do you import DCAppAttestService?
tagged with: ios
has comment: http://stackoverflow.com/comment/135693477
has answer: http://stackoverflow.com/a/77366574
type: Question
upvote count: 1
downvote count: 0
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/q/77058213
has answer: http://stackoverflow.com/a/78112970
tagged with: webrtc
tagged with: ios
type: Question
tagged with: objective-c
type: UnansweredQuestion
score: 0
tagged with: flutter
tagged with: swift
answer count: 1
has body: i want to change the videosource from the rtccameravideocapture to remove background or add filter. and the method i do is to change the initwithdelegate to the class i create called myvideosourcefilter, so i can't use the didcapturevideoframe method , but the question is didcapturevideoframe method never goes in , what do i do wrong, the result i that i can initwithmyvideosource class, but i can't use the didcapturevideoframe method , i wonder what did i do wrong. MyVideoSourceFilter *filter = [[MyVideoSourceFilter alloc] initWithSource:videoSource]; self.videoCapturer = [[RTCCameraVideoCapturer alloc] initWithDelegate:filter]; self.videoCapturer.delegate = filter; i want to override the didcapturevideoframe method , but the didcaptureframe method never goes in , what did i do wrong or what should i add MyVideoSourceFilter *filter = [[MyVideoSourceFilter alloc] initWithSource:videoSource]; self.videoCapturer = [[RTCCameraVideoCapturer alloc] initWithDelegate:filter]; self.videoCapturer.delegate = filter; - (instancetype)initWithSource:(RTCVideoSource *)source { NSLog(@"init with source "); self = [super init]; self.videoSource = source; //if (self = [super init]) { //} return self; } - (void)capturer:(RTCVideoCapturer *)capturer didCaptureVideoFrame:(RTCVideoFrame *)frame { NSLog(@"did capture video frame "); if (self.videoSource != nil) { [self.videoSource capturer:capturer didCaptureVideoFrame:frame]; }else{ NSLog(@"self.source = nil "); } } and the method i do is to change the initwithdelegate to the class i create called myvideosourcefilter, so i can't use the didcapturevideoframe method , but the question is didcapturevideoframe method never goes in , what do i do wrong, the result i that i can initwithmyvideosource class, but i can't use the didcapturevideoframe method , i wonder what did i do wrong.
has title: ios webrtc virtual background and filter

http://stackoverflow.com/comment/135645684
type: Comment
has text: What `size` are you passing for `andPreferredSize` ?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76945838

http://stackoverflow.com/comment/135843824
type: QuestionComment
comment on: http://stackoverflow.com/q/77057514
type: Comment
has text: BTW: handlers commonly set on `UIControlEventTouchUpInside`
score: 1

localization
tag name: localization
tags question: http://stackoverflow.com/q/77045441
type: Tag
tags question: http://stackoverflow.com/q/77976314

http://stackoverflow.com/q/76919529
downvote count: 0
answer count: 1
tagged with: metro-bundler
favorite count: 0
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/76939270
has body: I'm trying to implement Code Splitting in a React Native app. Currently I managed to load multiple bundles in Android both in packager mode and in production mode. However, on iOS I'm facing the following issue: Cannot initialize hmrClient twice. I'm trying to load the additional bundles using [bridge.batchedBridge executeSourceCode] which works in production mode but throws when using the packager. When looking at the implementation of executeSourceCode I see that it indeed calls setupHMRClientWithBundleURL without checking if it was already initialized. Is there any way to overcome this issue?
tagged with: ios
upvote count: 2
tagged with: objective-c
score: 2
tagged with: code-splitting
has answer: http://stackoverflow.com/a/76939270
has title: Loading multiple JS bundles in React Native iOS
tagged with: react-native
type: Question

http://stackoverflow.com/q/76937682
has title: Custom Font for iOS Only shows if Added in IB?
type: Question
tagged with: interface-builder
upvote count: 1
tagged with: objective-c
type: UnansweredQuestion
favorite count: 0
has comment: http://stackoverflow.com/comment/135637132
tagged with: uifont
score: 0
has comment: http://stackoverflow.com/comment/135634424
has body: My font file name is "CONSELHEIRO.otf". It is located in a folder called 'fonts'. I have added this file to Xcode, and made sure that it was indeed added to the target. I added it in the "Fonts provided by application" part of Info.plist as well. I have tried to confirm this by running this in AppDelegate: for (NSString *familyName in [UIFont familyNames]){ NSLog(@"Family name: %@", familyName); for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) { NSLog(@"--Font name: %@", fontName); } } The font would not appear in the console when I did this. I then went into my storyboard, and added a UILabel to one of my views, and clicked custom, and sure enough, "CONSELHEIRO" was one of my options. I then built the app, and voila, it appeared in the console, as well as the font for the UITableView I had wanted it to appear on. So, thinking I had it solved, I went ahead and deleted the UILabel from IB, and once again, the font would not appear in console, or in the table view. I can't for the life of me figure out why this is causing any difference at all, and I'd rather NOT have this random UILabel visible in my app. Anyone have any suggestions for what may be causing this? The PostScript name is "Conselheiro", but changing capitalization across the app does not seem to make a difference. Since there's some question as to whether I'm doing everything right, in addition to the two different screenshots above where I have shown trying to do both upper or lowercase, here's more screenshots showing it is in the project bundle, and added to the target.
tagged with: storyboard
has comment: http://stackoverflow.com/comment/135637745
answer count: 0
tagged with: ios
downvote count: 1

http://stackoverflow.com/comment/135569198
type: QuestionComment
score: 0
has text: Is the end goal to simply position the text field and progress bar within the recording view or should the size of the recording view be adjusted based on the layout of the text field and the progress bar?
type: Comment
comment on: http://stackoverflow.com/q/76901088

http://stackoverflow.com/comment/135593064
score: 2
comment on: http://stackoverflow.com/q/76910618
has text: Try replacing `NSData *requestData = [NSData dataWithBytes:[jsonRequestString UTF8String] length:[jsonRequestString length]];` with `NSData *requestData = jsonRequestData`.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/76971544
type: Answer
has comment: http://stackoverflow.com/comment/135691688
has comment: http://stackoverflow.com/comment/135701795
has body: I have managed to solve my issue with the following line of code: public override CATransform3D ItemTransformForOffset(iCarousel carousel, nfloat offset, CATransform3D transform) { // How much smaller the left and right views should be relative to the center view (expressed as pixels) float viewSizeDifference = -100; // The horizontal spacing between the views (expressed as a multiple of the views width) float viewDistance = 1.17f; float transformZ = (float)(Math.Min(1.0f, Math.Abs(offset)) * viewSizeDifference); return transform.Translate(offset * carousel.ItemWidth * viewDistance, 0f, transformZ); } but for this to work you also have to change the type to custom: ViewCarousel.Type = iCarouselType.Custom;
upvote count: 1
answers question: http://stackoverflow.com/q/76970382
downvote count: 0
accepted answer of: http://stackoverflow.com/q/76970382
score: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/135690037

http://stackoverflow.com/a/78160748
score: 0
type: Answer
answers question: http://stackoverflow.com/q/76953246
has body: I found out that [AWSServiceManager defaultServiceManager].defaultServiceConfiguration was nil and added an if statement to handle the case when it is nil. AWSS3TransferManagerDownloadRequest *downloadRequest = [AWSS3TransferManagerDownloadRequest new]; downloadRequest.bucket = bucketName; downloadRequest.key = [NSString stringWithFormat:@"%@%@", keyPath, imageKey]; downloadRequest.downloadingFileURL = downloadingFileURL; if([AWSServiceManager defaultServiceManager].defaultServiceConfiguration == nil) { NSString *accessPointId = [[NSUserDefaults standardUserDefaults] stringForKey:@"ap_id_1"]; NSString *vendorId = [[NSUserDefaults standardUserDefaults] stringForKey:@"vendor_id"]; NSString *deviceId = [[NSUserDefaults standardUserDefaults] stringForKey:@"device_id"]; NSString *username = [[NSUserDefaults standardUserDefaults] stringForKey:@"username"]; NSString *message = [NSString stringWithFormat:@"AWS not connected. Image not downloaded. accesspoint: %@ vendor: %@ device: %@ user: %@", accessPointId, vendorId, deviceId, username]; [self setImageDownloadErrorDescription: message]; NSLog(@"%@",message); return downloadedImage; } This solved my problem!

http://stackoverflow.com/q/76910618
has comment: http://stackoverflow.com/comment/135593064
tagged with: objective-c
has title: Objective C POST call not executing NSURLSession
answer count: 0
has comment: http://stackoverflow.com/comment/135597403
score: 0
has comment: http://stackoverflow.com/comment/135593097
type: Question
has comment: http://stackoverflow.com/comment/135593823
type: UnansweredQuestion
has body: I would like to call a POST url and pass JSON data. For some reason my NSURLSessionDataTask is not firing at all I believe. I do not see any issues with my JSON data and api url is working fine (tested with postman). Could someone please let me know, what am I doing wrong here? Please find the code snippet bellow. TIA -(bool)CallPayPass:(PaymentConfig *)aConfig { NSData *jsonRequestData = [self GETJSONData:aConfig]; if (!jsonRequestData) { NSLog(@"Failed to create JSON data");//Handle Error Here. Later } else { NSString *jsonRequestString = [[NSString alloc] initWithData:jsonRequestData encoding:NSUTF8StringEncoding]; //Step 1: Initialize transaction and get transactionnumber NSURL *url = [NSURL URLWithString:@"https://api.sandbox.paypass.com/api/transactions/init"]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url]; NSData *requestData = [NSData dataWithBytes:[jsonRequestString UTF8String] length:[jsonRequestString length]]; [request setHTTPMethod:@"POST"]; [request setValue:@"application/json" forHTTPHeaderField:@"Accept"]; [request setValue:@"application/json; charset=UTF-8" forHTTPHeaderField:@"Content-Type"]; [request setValue:[NSString stringWithFormat:@"%lu", (unsigned long)[requestData length]] forHTTPHeaderField:@"Content-Length"]; [request setHTTPBody: requestData]; NSURLSession *session = [NSURLSession sharedSession]; NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { // do something with the data NSData *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error]; if (!json) { NSLog(@"Failed to create JSON response data: %@", [error localizedDescription]); } else { NSLog(@"%@", json); NSString *jsonResponseString = [[NSString alloc] initWithData:json encoding:NSUTF8StringEncoding]; NSLog(@"%@", jsonResponseString); } }]; [dataTask resume]; } return YES; }
tagged with: nsurlsession

http://stackoverflow.com/q/76953584
tagged with: nsoutlineview
tagged with: cocoa
has answer: http://stackoverflow.com/a/76955687
accepted answer: http://stackoverflow.com/a/76955687
answer count: 1
has comment: http://stackoverflow.com/comment/135659938
type: Question
tagged with: outline-view
has title: Changing the position of NSOutlineView disclosure triangle and setting up icons for child nodes
score: 0
type: AnsweredQuestion
has body: I am creating an OutlineView like this: And I want to achieve a view which looks like this: The 2 issues that I am facing are: I cant find a way to move the disclosure triangle between the folder icon and the name. I am unable to setup the "P" icon for the child nodes. For the 2nd issue, this is the code I tried setting up the icon with: - (void)outlineView:(NSOutlineView *)aTableView willDisplayCell:(NSCell*)aCell forTableColumn:(NSTableColumn *)aTableColumn item:(id)item { NSImage* image = nil; BOOL isLeaf = [item isLeaf]; if ([[aTableColumn identifier] isEqualToString:@"styleIcon"]) { if (aTableView == _charOutlineView) { image = [QXPGeneralInterfaces imageFor:(isLeaf ? kCharacterIconImage : kFolderIconImage)]; } else { image = [QXPGeneralInterfaces imageFor:(isLeaf ? kParagraphIconImage : kFolderIconImage)]; } if (image != nil) { [aCell setImage:image]; } } aCell does set the image but somehow it disappears in the UI.
tagged with: objective-c

http://stackoverflow.com/comment/135687971
comment on: http://stackoverflow.com/q/76970382
has text: iCarousel as in the Nick Lockwood library written in Objective-C (https://github.com/nicklockwood/iCarousel)? That was last updated in 2017, and is badly out of date at this point. I would strongly advise against using it for new development.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/135569241
type: Comment
comment on: http://stackoverflow.com/q/76901088
has text: It also is very confusing that you want the leading edge of the text field and progress view to be 5% of the view's width further in from the view's leading margin. Is that really your intent? Or do you really just want the leading edge of the text field and progress bar to be 5% of the view's width from the view's leading edge?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/135583556
comment on: http://stackoverflow.com/a/76902599
score: 0
has text: @ennell I've updated the answer to reflect that change. Glad it worked for you.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/77057514
type: Question
answer count: 1
accepted answer: http://stackoverflow.com/a/77057604
has answer: http://stackoverflow.com/a/77057604
has title: OBJC @selector doesnt work from another implementation
downvote count: 0
favorite count: 0
tagged with: ios
has body: int alert() { //Alerting UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"0%" message:nil preferredStyle:UIAlertControllerStyleAlert]; UIView *customView = [[UIView alloc] initWithFrame:CGRectMake(5, 5, 50.0F, 50.0F)]; UIButton *sampleButton = [UIButton buttonWithType:UIButtonTypeCustom]; [sampleButton setFrame:CGRectMake(0,5,60.0F, 40.0F)]; [sampleButton setBackgroundImage:[UIImage systemImageNamed:@"terminal.fill"] forState:UIControlStateNormal]; [sampleButton addTarget:[[MyObject alloc] init] action:@selector(showTerminal) forControlEvents:UIControlEventTouchDown]; [customView addSubview:sampleButton]; [alert.view addSubview:customView]; dispatch_async(dispatch_get_main_queue(), ^{ [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alert animated:YES completion:nil]; }); } @implementation MyObject -(void)showTerminal { NSLog(@"Terminal opened!"); } @end How can I make @selector work when calling function from another @implementation! I have tried this code but the function never executes "[sampleButton addTarget:[[MyObject alloc] init] action:@selector(showTerminal) forControlEvents:UIControlEventTouchDown];" Can someone help me fix it or tell me a work around that doesn't involve using the ViewController()?
type: AnsweredQuestion
upvote count: 2
tagged with: objective-c
score: 2
has comment: http://stackoverflow.com/comment/135843824

http://stackoverflow.com/q/76893657
type: Question
score: 3
linked to: http://stackoverflow.com/q/10801051
type: UnansweredQuestion
answer count: 0
has body: I'm facing a tricky issue with Cocoa's addGlobalMonitorForEventsMatchingMask leaking memory over time. In particular, with the flags provided in the example below, some events (eg. Mouse down) cause NSEvent objects to NOT being released, causing an unbounded memory growth over time. I'm not using ARC (as this example is extracted from a native library in which Objective C is not the main language, thus I need to be able to retain control over memory allocations) AppDelegate.m #import "AppDelegate.h" const unsigned long long FLAGS = NSEventMaskKeyDown | NSEventMaskKeyUp | NSEventMaskFlagsChanged | NSEventMaskLeftMouseDown | NSEventMaskLeftMouseUp | NSEventMaskRightMouseDown | NSEventMaskRightMouseUp | NSEventMaskOtherMouseDown | NSEventMaskOtherMouseUp; @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { [NSEvent addGlobalMonitorForEventsMatchingMask:FLAGS handler:^(NSEvent *event){ //NSLog(@"event"); }]; } @end AppDelegate.h #import <AppKit/AppKit.h> #import <Foundation/Foundation.h> @interface AppDelegate : NSObject <NSApplicationDelegate, NSUserNotificationCenterDelegate> { } - (void)applicationDidFinishLaunching:(NSNotification *)aNotification; @end main.m #include "AppDelegate.h" #import <AppKit/AppKit.h> #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { AppDelegate *delegate = [[AppDelegate alloc] init]; NSApplication *application = [NSApplication sharedApplication]; [application setDelegate:delegate]; [application setActivationPolicy:NSApplicationActivationPolicyAccessory]; [application run]; } return 0; } This program is compiled with: gcc -framework Cocoa -framework IOKit -o testleak main.m AppDelegate.m Any idea of what could be causing it? Or what I should do to prevent it? I've tried with multiple combinations of NSAutoreleasePools and other approaches, but none solved the issue. My findings so far: Not all events cause the leak. For example, key down events don't…
has title: Memory leak with Cocoa's `addGlobalMonitorForEventsMatchingMask`
tagged with: macos
tagged with: objective-c
tagged with: cocoa
downvote count: 0
linked to: http://stackoverflow.com/q/19122803
has comment: http://stackoverflow.com/comment/135569206
favorite count: 0
upvote count: 3

http://stackoverflow.com/comment/135645834
type: QuestionComment
comment on: http://stackoverflow.com/q/76945838
type: Comment
has text: and... is your goal to **grow** the image? or **shrink** it? and... are you expecting the output size to be in **pixels** or in **points**?
score: 0

nslayoutconstraint
type: Tag
tag name: nslayoutconstraint
tags question: http://stackoverflow.com/q/76901088
tags question: http://stackoverflow.com/q/78638545

http://stackoverflow.com/comment/135643689
type: QuestionComment
score: 0
has text: I don't see the relation with the protocol. Could you explain it?
type: Comment
comment on: http://stackoverflow.com/q/76945008

http://stackoverflow.com/comment/135804592
has text: thank you, you are right! I delete the HTML_PARSE_NOERROR and then the console output the error.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/77032687

http://stackoverflow.com/q/76989609
type: AnsweredQuestion
downvote count: 0
has title: How to convert a `id<MTLCommandQueue>` to a `MTL::CommandQueue` of Metal-Cpp?
score: 3
tagged with: ios
has answer: http://stackoverflow.com/a/77002349
accepted answer: http://stackoverflow.com/a/77002349
tagged with: metal
answer count: 2
tagged with: objective-c
upvote count: 3
tagged with: c++
has body: The situation: I'm developing an iOS Metal App in Objective-C. I need to use a 3rd-party library VkFFT that provides Metal FFTs based on Metal-Cpp. What I need: pass a id&lt;MTLCommandQueue&gt; instance from Objective-C world to C++ world as a MTL::CommandQueue object so that I can push compute commands to it. I don't want to create a seperate commmand queue in Metal-Cpp because using a single command queue can let me keep pushing all commands to it without waitUntilCompleted.
type: Question
has answer: http://stackoverflow.com/a/76994555
possible better answer: http://stackoverflow.com/a/76994555
favorite count: 0

http://stackoverflow.com/comment/135807501
has text: Why is this tagged with CoreData & MongoDB while you seem to use Realm?
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77037290

http://stackoverflow.com/comment/135570140
has text: @HangarRash The details of the layout are not really relevant. My question pertains more to how I would go about implementing viewport width/height percentages in UIKit for a modal view. If this is the incorrect way to go about positioning subviews, what is the preferred method/strategy?
comment on: http://stackoverflow.com/q/76901088
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/135644129
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76945008
has text: Too many unknowns. Show your code! What is `self.selectedUnit.name` all about? That seems to be the heart of the problem.

http://stackoverflow.com/comment/135688692
has text: Probably an improvement, but I am a bit too invested at this point to change implementations
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76970382

http://stackoverflow.com/comment/135568999
type: QuestionComment
type: Comment
has text: You are simply changing the local variable `Text`. You need to pass the updated text to the view controller. Also note that you are trying to change the text after 0.1 seconds, not 3 seconds.
score: 0
comment on: http://stackoverflow.com/q/76901393

http://stackoverflow.com/comment/135648094
has text: Consider using `UIImage imageByPreparingThumbnailOfSize:` instead writing your own method.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76945838
score: 0

http://stackoverflow.com/q/77006982
tagged with: ios
type: Question
answer count: 1
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/77032687
has body: I generate a html of an img tag is wrapped by 255 div tags. I use libxml parse the html and output the result, but the img tag is missed in the result. But if the count of the div tags is 254, the output result is right, the img tag is show in it. Why it happend and How to fix it? Is the node level too deep? The code is below: NSString* html = @" "; for (int i = 0; i < 255; i++) { html = [NSString stringWithFormat:@" %@ ", html]; } NSData* data = [html dataUsingEncoding:NSUTF8StringEncoding]; xmlDocPtr _doc = htmlReadMemory([_data bytes], (int)[_data length], "", NULL, HTML_PARSE_NOWARNING | HTML_PARSE_NOERROR); if (_doc == NULL) { NSLog(@"Unable to parse."); return; } xmlXPathContextPtr _context = xmlXPathNewContext(_doc); if(_context == NULL) { NSLog(@"Unable to create XPath context."); return; } xmlNodePtr rootNode = xmlDocGetRootElement(_doc); xmlBufferPtr buffer = xmlBufferCreate(); if (rootNode == NULL || rootNode == nil || buffer == NULL || buffer == nil) { return; } xmlNodeDump(buffer, rootNode->doc, rootNode, 0, 0); NSString *htmlContent = [NSString stringWithCString:(const char *)buffer->content encoding:NSUTF8StringEncoding]; xmlBufferFree(buffer); xmlXPathFreeContext(_context); xmlFreeDoc(_doc); NSLog(@“%@”, htmlContent); i try many different tags, but is the same way. Maybe the node level is too deep?
score: 0
type: AnsweredQuestion
tagged with: libxml2
has answer: http://stackoverflow.com/a/77032687
has title: Can’t parse too deep node by using libxml2

http://stackoverflow.com/comment/135597403
score: 0
has text: @HangarRash Thank you very much:) Don't know I was messing around with NSData!!
type: Comment
comment on: http://stackoverflow.com/q/76910618
type: QuestionComment

http://stackoverflow.com/comment/135597393
type: Comment
comment on: http://stackoverflow.com/q/76917550
has text: They are remote
type: QuestionComment
score: 0

libxml2
tags question: http://stackoverflow.com/q/77006982
tag name: libxml2
type: Tag

http://stackoverflow.com/comment/135596797
type: QuestionComment
type: Comment
has text: Please update your question with your relevant code (as text).
comment on: http://stackoverflow.com/q/76917235
score: 0

http://stackoverflow.com/comment/135688519
score: 0
has text: You should be able to implement the U you show using collection view controllers. Those are quite flexible. Look up `UICollectionViewFlowLayout` in Apple's docs.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/76970382

http://stackoverflow.com/comment/135569560
type: Comment
comment on: http://stackoverflow.com/q/76901393
has text: Update your question with relevant portions of your `HelloWorldViewFactory createWithText:` method. That will make it a lot easier to show a relevant solution.
type: QuestionComment
score: 0

http://stackoverflow.com/q/76917550
tagged with: ios
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/135597543
accepted answer: http://stackoverflow.com/a/76930388
has answer: http://stackoverflow.com/a/76930388
tagged with: objective-c
has comment: http://stackoverflow.com/comment/135597934
upvote count: 0
has comment: http://stackoverflow.com/comment/135598131
has comment: http://stackoverflow.com/comment/135597393
has body: I have a Storyboard app with a UINavigationController as its Storyboard Entry Point. Its normal main view is a ViewController called "ViewController". What I want to have happen is push the controller named "JustNotifications" when a user taps the incoming notification. However, nothing happens as of now. What am I missing? - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { NSDictionary *notificationData = response.notification.request.content.userInfo; // Extract data from the notification payload NSString *title = notificationData[@"title"]; NSString *description = notificationData[@"description"]; // Get a reference to the navigation controller UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController; // Find the currently visible view controller in the navigation stack UIViewController *currentViewController = navigationController.visibleViewController; // Perform the segue [currentViewController performSegueWithIdentifier:@"ShowJustNotificationsSegue" sender:self]; // Call the completion handler completionHandler(); }
has comment: http://stackoverflow.com/comment/135597769
has comment: http://stackoverflow.com/comment/135597739
tagged with: uinavigationcontroller
downvote count: 1
type: Question
tagged with: storyboard
answer count: 1
tagged with: push-notification
has comment: http://stackoverflow.com/comment/135597122
has comment: http://stackoverflow.com/comment/135596784
has comment: http://stackoverflow.com/comment/135597857
has comment: http://stackoverflow.com/comment/135597763
has title: Push View Controller When Notification Is Tapped
favorite count: 0
score: -1

outline-view
tag name: outline-view
type: Tag
tags question: http://stackoverflow.com/q/76953584

http://stackoverflow.com/comment/135637132
score: 0
comment on: http://stackoverflow.com/q/76937682
type: Comment
has text: @DonMag There's the picture. I also tried it with everything capitalized the way the file name is, with the same outcome.
type: QuestionComment

http://stackoverflow.com/comment/135648667
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/76947501
has text: I was suggesting that you pass the class as an object. But you could pass the string name of the class, I suppose.

http://stackoverflow.com/a/77002349
has body: With the help of both Hamid Yusifli's answer and this GitHub Issue, I solved my problem. From Objective-C code (.m), cast the id<MTLCommandQueue> into void*: id<MTLCommandQueue> objcQueue = /* Your Objective-c queue */; void* commandQueuePtr = (__bridge void*)objcQueue; Pass this opaque pointer to C++ world. In C++ code, "decode" the void* back to a MTL::CommandQueue*: void foo(void* commandQueuePtr) { MTL::CommandQueue* commandQueue = (MTL::CommandQueue*) commandQueuePtr; // submit GPU works to commandQueue... }
downvote count: 0
answers question: http://stackoverflow.com/q/76989609
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/76989609
score: 3
upvote count: 3

http://stackoverflow.com/comment/135583136
has text: Thanks. I tried that and it unfortunately causes an error `Invalid pairing of layout attributes.` This is because it is trying to constrain a `topAnchor` to a `heightAnchor`. Source: https://github.com/SnapKit/SnapKit/issues/534
comment on: http://stackoverflow.com/a/76902599
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/76953246
tagged with: crash
score: 0
has answer: http://stackoverflow.com/a/78160748
type: Question
type: UnansweredQuestion
tagged with: try-catch
has title: AWSS3TransferManager defaultS3TransferManager exception SIGABRT not caught
tagged with: ios
has body: My iOS app crashes when I execute following code: - (UIImage *)getImageAndSaveInDBWithKey:(NSString *)imageKey withKeyPath:(NSString *)keyPath inBucket:(NSString *)bucketName scanhistoryRecord:(ScanHistory *) scanHistoryRecord { [self setImageExceptionTitle:@""]; [self setImageExceptionName:@""]; [self setImageExceptionReason:@""]; [self setImageDownloadErrorCode:@""]; [self setImageDownloadErrorDomain:@""]; [self setImageDownloadErrorDescription:@""]; NSString *downloadingFilePath = [NSTemporaryDirectory()stringByAppendingPathComponent:imageKey]; NSURL *downloadingFileURL = [NSURL fileURLWithPath:downloadingFilePath]; __block UIImage *downloadedImage = nil; AWSS3TransferManagerDownloadRequest *downloadRequest = [AWSS3TransferManagerDownloadRequest new]; downloadRequest.bucket = bucketName; downloadRequest.key = [NSString stringWithFormat:@"%@%@", keyPath, imageKey]; downloadRequest.downloadingFileURL = downloadingFileURL; @try { AWSS3TransferManager *transferManager = [AWSS3TransferManager defaultS3TransferManager]; [[[transferManager download:downloadRequest] continueWithBlock:^id(AWSTask *task) { if (task.error) In the crash log I can see that the exception is thrown in this line: AWSS3TransferManager *transferManager = [AWSS3TransferManager defaultS3TransferManager]; This is the crashlog: Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: SIGNAL 6 Abort trap: 6 Terminating Process: iTracker [32153] Triggered by Thread: 6 Last Exception Backtrace: 0 CoreFoundation 0x1ba17ccb4 __exceptionPreprocess + 164 (NSException.m:202) 1 libobjc.A.dylib 0x1b32183d0 objc_exception_throw + 60 (objc-exception.mm:356) 2 AWSS3 0x1036e9b38 __48+[AWSS3TransferManager defaultS3TransferManager]_block_invoke + 440 3 libdispatch.dylib 0x1c1643eac _dispatch_client_callout + 20 (object.m:560) 4 libdispatch.dylib 0x1c16456ec _dispatch_once_callout + 32 (once.c:52) 5 AWSS3 0x1036e9978 +[AWSS3TransferManager defaultS3TransferManage…
tagged with: exception
answer count: 1
tagged with: objective-c

http://stackoverflow.com/comment/135648052
type: Comment
comment on: http://stackoverflow.com/q/76945008
has text: You still have not shown what `selectedUnit` is (what properties it has, etc.) But this, as I already suggested, is the heart of the matter.
score: 0
type: QuestionComment

http://stackoverflow.com/q/76945838
has comment: http://stackoverflow.com/comment/135645684
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/135657836
type: UnansweredQuestion
has title: Image resize crash in share extention
has body: I'm trying to implement a share extension in my ios application. I want to share photos and before the app will send them to the backend I want to resize the photos. I'm using this function: +(UIImage*) resizedImage :(UIImage*) image andPreferredSize:(CGSize) size { if(image.size.height &gt; size.height &amp;&amp; image.size.width &gt; size.width) { float ratio1 = image.size.height/size.height; float ratio2 = image.size.width/size.width; float ratio3 = ratio1 &lt; ratio2 ? ratio1 : ratio2; CGSize newSize = CGSizeMake(image.size.width/ratio3 , image.size.height/ratio3); UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0); [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); image = [[newImage retain] autorelease]; UIGraphicsEndImageContext(); } return image; } If i share multiple photos(in a serial queue) in the second photo i get this msg error and crash: Message from debugger: Terminated due to memory issue The memory usage does not exceed 20 Mb. Any idea what can be the problem?
has comment: http://stackoverflow.com/comment/135648094
has answer: http://stackoverflow.com/a/76946019
has comment: http://stackoverflow.com/comment/135645834
favorite count: 0
tagged with: ios
tagged with: objective-c
downvote count: 0
has comment: http://stackoverflow.com/comment/135649178
tagged with: uiimage
score: 1
has comment: http://stackoverflow.com/comment/135654055
has answer: http://stackoverflow.com/a/76952021
answer count: 2

http://stackoverflow.com/q/77053720
score: 0
has comment: http://stackoverflow.com/comment/135837731
tagged with: kotlin
type: Question
tagged with: swift
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136022774
answer count: 0
tagged with: kotlin-multiplatform
has title: Kotlin MPP: iOS Memory overload when using Kotlin defined function
has body: I’m creating a kotlin multiplatform application that runs on web, iOS and Android that will process images captured from the device’s video stream. The processing works fine on Android and web, but iOS has a serious memory problem that causes HUGE spikes in the application memory footprint. on iOS, I have my Camera management class that handles starting the video stream and capturing the output frames as CMSampleBuffer’s. Here is the output function: func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) { DispatchQueue.main.async { [unowned self] in guard let imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else { return } let ciImage = CIImage(cvPixelBuffer: imageBuffer) guard let cgImage = context.createCGImage(ciImage, from: ciImage.extent) else { return } let uiImage = UIImage(cgImage: cgImage, scale: 1.0, orientation: .up) // kotlin class that handles image processing self.manager.processImage(image: uiImage) } } Capturing the frames works fine, but when I pass the UIImage into the Kotlin function : “self.manager.processImage(image: UIImage)” the memory quickly overloads and creates a saw-tooth pattern that can lead to an app crash. Here is the processImage function: class ImageManager { fun processImage(image: UIImage) { println("processing image") } } I’ve only got the function printing out a simple value right now for debugging purposes. But this code causes huge spikes in the memory that reach 600Mb before the garbage collection cycles catch up. This code will eventually crash the application once the memory gets close to the 2Gb mark. If I comment out the “self.manager.processImage(image: uiImage)” the memory stays around ~40Mb and the application is stable. I’ve attached 2 images: First is the stable memory when not passing the UIImage into the Kotlin processing function. Second is with the function in use and how much memory the app accumulates in such a short amount of time. A…
tagged with: objective-c

http://stackoverflow.com/comment/135745308
type: AnswerComment
type: Comment
has text: Thank you! With your help, I solved my problem. But I wrote another answer myself which I think would be more appropriate to be the accepted answer.
score: 0
comment on: http://stackoverflow.com/a/76994555

http://stackoverflow.com/q/76987652
tagged with: ios
tagged with: jailbreak
tagged with: objective-c
has answer: http://stackoverflow.com/a/76989789
score: 0
has body: inside an iOS tweak, I have a long text and store it in a text file at the same folder level with .xm file. Let's say I have a tweak project with a Tweak.xm file at the top level of the project, and another file called myFile.txt placed at the same folder level as Tweak.xm. How do I read the content of this txt file in the xm code? I tried this Objective-C code but an error came up as the file path may not be correct. NSString *filePath = [[NSBundle mainBundle] pathForResource:@"myFile" ofType:@"txt"]; NSError *error = nil; NSString *fileContent = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&error]; if (error) { NSLog(@"Error reading file: %@", error); NSLog(@"File Path: %@", filePath); // the log error is `Error reading file: Error Domain=NSCocoaErrorDomain Code=258 "The file name is invalid."` } else { NSLog(@"File Content:\n%@", fileContent); }
type: Question
has title: How to read the content of a text file in an iOS tweak
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/comment/135579115
has text: @ennell I updated my answer with an example for that case.
type: AnswerComment
comment on: http://stackoverflow.com/a/76902599
type: Comment
score: 0

http://stackoverflow.com/q/77009569
has comment: http://stackoverflow.com/comment/135758091
answer count: 1
accepted answer: http://stackoverflow.com/a/77010258
has title: Objective-c : set attribute to property, does it preserve the default settings
type: AnsweredQuestion
has body: If I specify an attribute for a defined property, does it have any effect on the default attribute configuration? For example, the following declarations are equal since atomic, readwrite and strong are set by default @property(atomic,readwrite,strong)NSString *name; @property NSString *name; if I declare the property with assign attribute, does it keep the other attributes ? are these 2 statements equivalent ? @property (assign) NSString* name; @property (assign,atomic,readwrite,strong) NSString * name; and what happen if I change one default property, does it keep the other in their default setting ? are these 2 statements equivalent ? @property (nonatomic,weak) NSString * name; @property (nonatomic,weak,readwrite) NSString * name; I'm asking this since when I set a property with assign attribute only, it looks like the strong attribute is no longer applied, since when I set it with another variable, it doesn't retain reference.
tagged with: objective-c
type: Question
has answer: http://stackoverflow.com/a/77010258
score: 0

http://stackoverflow.com/comment/135851042
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77037290
has text: Understood. Firebase does provide offline persistence in case you need it. As far as the code in the question goes, other than the Syntax error mentioned above, I copy and pasted your exact code into a project and it works correctly. No crashes. That leads me to believe the issue lies elsewhere in the project, probably how `realm` is defined or configured.
type: QuestionComment

http://stackoverflow.com/comment/135731521
score: 1
has text: Thank you so much for your very detail code @Cryptic. I tried your code and found out that although "myFile.txt" is already placed in the same folder level as Tweak.xm file, the log print nothing on the first injection to the app and a blank "myFile.txt" file was created in the app document. Anyway it did give me an other solution, which is to manually go to the app document directory in Filza and edit the newly created blank "myFile.txt" myself. I just wondering if there are any way to directly get the text content from the tweak and not having to create and edit a text file the doc directory
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76989789

http://stackoverflow.com/a/76997608
score: 0
answers question: http://stackoverflow.com/q/76997256
type: Answer
has body: I found the answer, we need to create ignoreSSL globally that could be accessed by both class. Here we could create SSLManager.h: #import <Foundation/Foundation.h> @interface SSLManager : NSObject @property (nonatomic, assign) BOOL ignoreSSL; + (instancetype)sharedManager; @end Here we could create SSLManager.m: #import "SSLManager.h" @implementation SSLManager + (instancetype)sharedManager { static SSLManager *sharedInstance = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedInstance = [[self alloc] init]; }); return sharedInstance; } @end Then, you can set to shared instance like this: - (void)join:(JitsiMeetConferenceOptions *)options { // Access the boolean value from options._starvConferenceInfo._ignoreSSL NSString *ignoreSSL = options.starvConferenceInfo.ignoreSSL; NSLog(@"Ivan SSL Ignored: %@", ignoreSSL); // Convert the ignoreSSL value to a BOOL and set it in the SSLManager [SSLManager sharedManager].ignoreSSL = [ignoreSSL isEqualToString:@"true"]; [self setProps:options == nil ? @{} : [options asProps]]; } In RCTHTTPRequestHandler+ignoreSSL.m, you can access sharedManager like this: #import "React/RCTBridgeModule.h" #import "React/RCTHTTPRequestHandler.h" #import "SSLManager.h" @implementation RCTHTTPRequestHandler (ignoreSSL) - (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler { // Get the value of "ignoreSSL" from the SSLManager singleton BOOL ignoreSSLValue = [SSLManager sharedManager].ignoreSSL; NSLog(@"Ignore SSL: %@", @(ignoreSSLValue)); // Check if the value is set to true if (ignoreSSLValue) { NSLog(@"SSL Ignored: %@", @(ignoreSSLValue)); // Handle SSL challenge here if ignoreSSL is true completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]); } else { // Do not ignore SSL …

http://stackoverflow.com/comment/135648061
has text: FYI - It is standard practice to name classes and types starting with an uppercase letter. Method and variable names start with lowercase letters. Following such guidelines makes your code a lot easier to read.
score: 0
comment on: http://stackoverflow.com/q/76945008
type: QuestionComment
type: Comment

http://stackoverflow.com/q/76917235
upvote count: 1
has body: I am new to Objective-C. I'm trying to create a category method for arrays that doesn't use a parameter. I'm told there is a way that the method can use this array without using the array as an argument. I haven't seen much specific to this question. Can anyone tell me how to access the array calling the method from within the category method? I know using an argument works. Like this: [array reversed:array]; I'm trying to do this instead: [array reversed];
answer count: 1
score: -2
has comment: http://stackoverflow.com/comment/135596300
downvote count: 3
has comment: http://stackoverflow.com/comment/135596797
type: Question
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/76917644
accepted answer: http://stackoverflow.com/a/76917644
tagged with: methods
has title: How to access an array calling a category method within the method itself?
tagged with: objective-c

http://stackoverflow.com/comment/135689908
has text: I tried to build the iOS demos from the iCarousel package, and I'm getting a linker error that it can't find the file libarclite_iphonesimulator.a. That sounds like a pre-built file of some sort. Did you encounter that problem?
comment on: http://stackoverflow.com/q/76970382
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/135622237
score: 0
type: QuestionComment
has text: What is `NSURLBookmarkAllPropertiesKey` ? There's no such key. You seem to have a lot of made up keys in your code.
type: Comment
comment on: http://stackoverflow.com/q/76932655

http://stackoverflow.com/comment/135569310
score: 1
comment on: http://stackoverflow.com/q/76901393
has text: Can you show me an example?
type: Comment
type: QuestionComment

code-splitting
type: Tag
tags question: http://stackoverflow.com/q/76919529
tag name: code-splitting

http://stackoverflow.com/a/76955687
accepted answer of: http://stackoverflow.com/q/76953584
score: 0
has body: I cant find a way to move the disclosure triangle between the folder icon and the name. Put the folder icon in column 0 and the title in column 1. Set outlineTableColumn (or the Outline Column in IB) to column 1.
answers question: http://stackoverflow.com/q/76953584
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/135570125
score: 0
type: QuestionComment
has text: @DonMag Sorry about that. Yes `textField` is indeed a `UITextView`. And basically I want to position subviews based on viewport width/height percentages as you've described. The specific percentages are not particularly relevant.
comment on: http://stackoverflow.com/q/76901088
type: Comment

http://stackoverflow.com/comment/135569538
score: 1
type: Comment
comment on: http://stackoverflow.com/q/76901393
has text: Show me your method, I have no idea about the stuff that you are saying!
type: QuestionComment

http://stackoverflow.com/comment/135597769
comment on: http://stackoverflow.com/q/76917550
type: Comment
score: 0
has text: `UINavigationController *rootNavigationController = (UINavigationController *)self.window.rootViewController; NSLog(@"Navigate%@", rootNavigationController);` This returns NULL...Actually both that and current are returning NULL
type: QuestionComment

http://stackoverflow.com/comment/135824502
type: QuestionComment
has text: @Larme Core data was obviously incorrect but Realm is actually called MongoDB Realm. Mongo bought Realm a few years ago and integrated it into their offerings. Realm is backed by MongoDB Atlas at the server level.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77037290

http://stackoverflow.com/comment/135654055
type: Comment
comment on: http://stackoverflow.com/q/76945838
has text: @DonMag i want to resize from (width = 3024, height = 4032) to (width = 768, height = 1024)
type: QuestionComment
score: 0

http://stackoverflow.com/comment/135649178
score: 0
has text: @HangarRash - `imageByPreparingThumbnailOfSize:` *might* be a good alternative, but the sizing appears to be ***very quirky*** (unless I'm completely mis-understanding what it is supposed to be doing).
comment on: http://stackoverflow.com/q/76945838
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/135689876
type: Comment
has text: As I recall, there are settings you can adjust that alter the way items scale. You should be able to customize a linear carousel so that it looks like what you show.
comment on: http://stackoverflow.com/q/76970382
type: QuestionComment
score: 0

try-catch
tag name: try-catch
tags question: http://stackoverflow.com/q/76953246
type: Tag

http://stackoverflow.com/a/76901987
upvote count: 1
has body: As already pointed out in comments you are not assigning a new text on your view so you can not see the change on your screen. You need to have a way to update text on your view. Using a direct way you could assign a new text through your view controller. Something like this: [vc assignNewText: @"Program started"]; // Instead of Text = @"Program started"; But to do so you will need access to your view controller as your own subclass (which is not included in your question but we can assume it exists). If it is called HelloWorldViewController then: HelloWorldViewController *vc = [HelloWorldViewFactory createWithText:Text]; // Instead of UIViewController *vc = [HelloWorldViewFactory createWithText:Text]; We should also ensure that the method to create your view controller is actually defined to return this type of view. It should be: // In @interface of HelloWorldViewFactory + (HelloWorldViewController *)createWithText:(NSString *)text; // In @implementation of HelloWorldViewFactory + (HelloWorldViewController *)createWithText:(NSString *)text { And a method to assign new text should be added to your HelloWorldViewController. Again assuming a lot there could be a label referenced through textLabel which displays your text. @implementation HelloWorldViewController - (void)assignNewText:(NSString *)text { self.textLabel.text = text; } @end
answers question: http://stackoverflow.com/q/76901393
score: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/76901393
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/135823529
type: Comment
comment on: http://stackoverflow.com/q/77045441
has text: @Cy-4AH Thanks, post that as an answer and you'll get the credit.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/135691688
type: AnswerComment
comment on: http://stackoverflow.com/a/76971544
type: Comment
score: 0
has text: Be sure to accept your self-answer when the system allows you to.

http://stackoverflow.com/comment/135597739
type: Comment
comment on: http://stackoverflow.com/q/76917550
has text: @HangarRash The code runs, I added some logs in the console, and everything is there, it just isn't pushing the view controller
score: 0
type: QuestionComment

http://stackoverflow.com/comment/135569329
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76901393
type: Comment
has text: It can't be done with your current code since all you have is a `UIViewController` reference. You need a subclass of `UIViewController` that has some method or property that you can update with the new text.

http://stackoverflow.com/q/76904340
has body: I have a swift model class like this; class Test: NSObject, Codable { var property: Bool? } i want to use this bool type in swift class and objective - c at the same time. But the problem is I can't use Bool type in objective - c, if I replace bool type with NSNumber and use in objective - c than I'm having Test class codable error since NSNumber is not codable data type. What is the best way to use bool type in swift and objective - c same time.
has answer: http://stackoverflow.com/a/76904414
linked to: http://stackoverflow.com/q/30722448
has comment: http://stackoverflow.com/comment/135573989
duplicate of: http://stackoverflow.com/q/30722448
type: Question
tagged with: swift
type: UnansweredQuestion
favorite count: 0
score: -1
downvote count: 1
has title: Bool type usage for Swift class and Objective - c same time
answer count: 1
tagged with: objective-c
upvote count: 0

http://stackoverflow.com/comment/135689317
has text: Yes, linear is close to what I need with wrap options, but I can't make the left and the right views smaller. Don't know if it is possible though
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76970382
type: QuestionComment

http://stackoverflow.com/a/76904414
has comment: http://stackoverflow.com/comment/135574502
answers question: http://stackoverflow.com/q/76904340
has comment: http://stackoverflow.com/comment/135574556
type: Answer
has body: The problem is that Bool is a value type and Obj-C doesn't support optional value types. Obj-C only supports nullability for reference types, by representing null values with a null pointer. There are multiple workarounds for this problem, such as Declare property as NSNumber and implement the Codable conformance manually Make Test a pure-Swift type and create a separate Obj-C bridge type (similar to how Foundations bridges between Swift and Obj-C types, such as String and NSString or Array and NSArray). I'd suggest point 2, since Codable is only usable from Swift, so there's no point in exposing a Codable conformant type to Obj-C, because you can only encode/decode it in Swift anyways. This also means that you can use any Swift features in your type, you don't need to restrict yourself to Obj-C compatible types and language features. Moreover, if you get to the point where you can remove the access from Obj-C, you can simply delete your bridge type and won't have to modify your pure Swift type. Here's a simple example of an Obj-C bridge for Test: @objc class TestBridge: NSObject { @objc var property: NSNumber? { get { wrapped.property as NSNumber? } set { wrapped.property = newValue?.boolValue } } let wrapped: Test @objc init(property: NSNumber?) { self.wrapped = Test(property: property?.boolValue) } } And the pure-Swift Test class: class Test: Codable { var property: Bool? init(property: Bool?) { self.property = property } }
score: 0

http://stackoverflow.com/a/76946019
upvote count: 0
downvote count: 2
answers question: http://stackoverflow.com/q/76945838
type: Answer
has body: Here is the code I use to resize my images .it is in swift you can take clue from this. func resize(targetSize: CGSize) -&gt; Data { var actualHeight = Float(self.size.height) var actualWidth = Float(self.size.width) let maxHeight: Float = Float(targetSize.width) let maxWidth: Float = Float(targetSize.height) var imgRatio: Float = actualWidth / actualHeight let maxRatio: Float = maxWidth / maxHeight let compressionQuality: Float = 0.5 //50 percent compression if actualHeight &gt; maxHeight || actualWidth &gt; maxWidth { if imgRatio &lt; maxRatio { //adjust width according to maxHeight imgRatio = maxHeight / actualHeight actualWidth = imgRatio * actualWidth actualHeight = maxHeight } else if imgRatio &gt; maxRatio { //adjust height according to maxWidth imgRatio = maxWidth / actualWidth actualHeight = imgRatio * actualHeight actualWidth = maxWidth } else { actualHeight = maxHeight actualWidth = maxWidth } } let rect = CGRect(x: 0.0, y: 0.0, width: CGFloat(actualWidth), height: CGFloat(actualHeight)) UIGraphicsBeginImageContext(rect.size) self.draw(in: rect) let img = UIGraphicsGetImageFromCurrentImageContext() let imageData = img?.jpegData(compressionQuality: CGFloat(compressionQuality)) ?? Data() UIGraphicsEndImageContext() return imageData }
score: -2

http://stackoverflow.com/comment/135596784
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76917550
type: QuestionComment
has text: What class is this code in? Is this delegate being called at all? Have you used the debugger to step through this code and see what it does and where thing don't go as expected?

http://stackoverflow.com/comment/135843011
type: QuestionComment
has text: @Jay thank you so much for the info, I have to use both Firebase and Realm since the data I want to handle comes from a Firebase project that is shared by more Apps and I want the device to remember the data from Firebase whenever I log in the App. So I store it in Realm. I considered using SQLite also but the App was built with Realm initially.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77037290

http://stackoverflow.com/q/76901088
has comment: http://stackoverflow.com/comment/135570125
has comment: http://stackoverflow.com/comment/135569087
tagged with: uiviewcontroller
tagged with: uikit
has body: Problem: I am having some issues using the correct frame values to simulate viewport percentages when sizing subviews of a modal view-controller. I would rather size subviews using layout constraints instead of explicit frame values. The frame value is not correctly set for the modal view-controller up to and including viewWillAppear. The two methods that are called in sequence with the desired frame values are viewWillLayoutSubviews and viewDidAppear. Thus far, these appear to be the only "hooks" I can use with access to the correct frame values. These methods are not easily useable because: viewWillLayoutSubviews is called multiple times with what I am assuming are intermediary frame values. Setting the same constraint(s) multiple times throws an Auto Layout constraint error. // Multiple frame values return from viewWillLayoutSubviews {{0, 0}, {393, 783}} {{0, 0}, {393, 283.66666666666663}} viewDidAppear works better in that it is only called once with the final, desired frame value. However, by this point the views are added to the view hierarchy and shown on the screen. Then when setting the layout constraints, the screen brief displays the unconstrained layout before displaying the constrained layout. Workaround solution: Using viewWillLayoutSubviews and deactivating old constraints before activating new constraints to avoid constraint conflicts. This can be done by either iterating through modal.view.constraints or maintaining a state variable (strong reference) to the original constraints on the first call of viewWillLayoutSubviews. This does not seem to be that clean of a solution. // Utility function to activate constraints void setConstraints (UIView* view, NSLayoutAnchor *leading, NSLayoutAnchor *trailing, NSLayoutAnchor *top, NSLayoutAnchor *bottom, CGFloat cLeading, CGFloat cTrailing, CGFloat cTop, CGFloat cBottom, NSArray<NSLayoutConstraint*>* __strong *constraints) { NSArray *newConstraints = @[ [view.leadingAnchor constraintEqualToAnchor:leading cons…
tagged with: ios
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/135570140
answer count: 1
tagged with: objective-c
has title: Using modal view frame size in subview layout constraints
has comment: http://stackoverflow.com/comment/135569198
has answer: http://stackoverflow.com/a/76902599
favorite count: 0
has comment: http://stackoverflow.com/comment/135569241
score: 0
accepted answer: http://stackoverflow.com/a/76902599
tagged with: nslayoutconstraint
type: Question
upvote count: 1

http://stackoverflow.com/a/76917644
type: AcceptedAnswer
has body: In your example, array is not calling anything. It is the object that the reversed message is passed to. Within the -reversed method, the object being passed the method (array in this case) is called self, which is how you would access it in a category, or any method of an object. In your example, that would look something like: @interface NSArray (Reversed) - (NSArray *)reversed; @end @implementation NSArray (Reversed) - (NSArray *)reversed { NSMutableArray *result = [NSMutableArray new]; // Here is where you refer to the target as `self` for (id element in [self reverseObjectEnumerator]) { [result addObject: element]; } return result; } int main(int argc, const char * argv[]) { @autoreleasepool { NSArray *xs = @[@1, @2, @3]; NSArray *reversed = [xs reversed]; NSLog(@&quot;%@ -&gt; %@&quot;, xs, reversed); } return 0; }
answers question: http://stackoverflow.com/q/76917235
type: Answer
upvote count: 1
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/76917235

http://stackoverflow.com/comment/135824576
score: 0
has text: @MarMon. There are a number of issues with the code; first off it appears you're using Swift? If so, you really need to use the more modern Swift syntax to structure the Realm models and make calls. Secondly, that code should not even compile as this `return objetoLogin` is a syntax error and does not exist. Lastly, we don't know how your realm is formed `self.realm`. Please take a moment and review [How to ask a good question](https://stackoverflow.com/help/how-to-ask) and [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example)
type: QuestionComment
comment on: http://stackoverflow.com/q/77037290
type: Comment

http://stackoverflow.com/comment/135648615
score: 0
type: Comment
has text: Thanks Matt. That's very helpful. `selectedUnit.name` is picked from a list (set at startup) rather than typed. Your suggestion of the dictionary is a good idea and I will add the class to be created as part of the class definition that defines `selectedUnit`. The class, `THMUnit` would contain `name`, `classtocreate` and a few other fields. How do I create an instance of the class name stored in `classtocreate`?
type: AnswerComment
comment on: http://stackoverflow.com/a/76947501

http://stackoverflow.com/q/77017420
score: 0
has title: How to create NSImage from pixel array in Xcode for macOS app
type: Question
answer count: 1
type: UnansweredQuestion
tagged with: nsimage
has body: Developing apps for iOS, it is simple to extract pixels from UIImage, manipulate them, then reconstruct an UIImage from them, example: csr = CGColorSpaceCreateDeviceRGB(); ctx = CGBitmapContextCreate(pax, devlar, devalt, 8, devlar*4, csr,kCGImageAlphaNoneSkipLast); rim = CGBitmapContextCreateImage(ctx); gen = [UIImage imageWithCGImage:rim scale:1.0 orientation:UIImageOrientationUp];* But developing a macOS app, things are different, data structures and methods are different, and I don't understand how to.
tagged with: objective-c
has answer: http://stackoverflow.com/a/77017941

http://stackoverflow.com/q/76997256
tagged with: nsurlsession
type: Question
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
tagged with: react-native
has answer: http://stackoverflow.com/a/76997608
score: 0
has title: How to use URLSession to decide ignoreSSL from another class?
has body: Here I have RCTHTTPRequestHandler+ignoreSSL.m that can ignoreSSL based on value from plist.info. It works nicely when I set the value of ignoreSSL from plist.info. #import "React/RCTBridgeModule.h" #import "React/RCTHTTPRequestHandler.h" @implementation RCTHTTPRequestHandler (ignoreSSL) - (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler { // Get the main bundle NSBundle *mainBundle = [NSBundle mainBundle]; // Get the value of "IgnoreSSL" from the Info.plist NSNumber *ignoreSSLValue = [mainBundle objectForInfoDictionaryKey:@"IgnoreSSL"]; NSLog(@"Ignore SSL: %@", ignoreSSLValue); // Check if the value is a boolean and if it's set to true (1) if ([ignoreSSLValue isKindOfClass:[NSNumber class]] && [ignoreSSLValue boolValue]) { NSLog(@"SSL Ignored: %@", ignoreSSLValue); // Handle SSL challenge here if IgnoreSSL is true completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]); } else { // Do not IgnoreSSL is false NSLog(@"SSL Not Ignored: %@", ignoreSSLValue); completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); } } @end I expect to set IgnoreSSL when something happens in my code like shown below: @implementation JitsiMeetView { /** * The unique identifier of this `JitsiMeetView` within the process for the * purposes of `ExternalAPI`. The name scope was inspired by postis which we * use on Web for the similar purposes of the iframe-based external API. */ NSString *externalAPIScope; /** * React Native view where the entire content will be rendered. */ RNRootView *rootView; } - (void)join:(JitsiMeetConferenceOptions *)options { [self setProps:options == nil ? @{} : [options asProps]]; // Access the boolean value from options._starvConferenceInfo._ignoreSSL NSString *ignoreSSL = options.starvConferenceIn…

http://stackoverflow.com/comment/135838476
type: QuestionComment
has text: The code syntax is ObjC and while there's nothing wrong with it, Swift syntax may be a bit easier, require less code and provide more compatibility. For example `@objc dynamic var password : String = ""` is replaced in Swift `@Persisted var password = ""`. The [Realm Swift SDK](https://www.mongodb.com/docs/realm/sdk/swift/) guide provides numerous code examples using Swift. Getting data from Firebase and storing in Realm goes beyond the scope of SO, but it can be done (we use both). However, I would suggest either using Realm or Firebase but not both as there may not be a reason to.
comment on: http://stackoverflow.com/q/77037290
type: Comment
score: 0

http://stackoverflow.com/comment/135693477
type: Comment
comment on: http://stackoverflow.com/q/76973236
has text: It's part of [`DeviceCheck`](https://developer.apple.com/documentation/devicecheck?language=objc) so, `#import <DeviceCheck.h>` ?
type: QuestionComment
score: 0

http://stackoverflow.com/a/76994555
downvote count: 0
answers question: http://stackoverflow.com/q/76989609
has comment: http://stackoverflow.com/comment/135745308
upvote count: 4
has body: Bridged casts A bridged cast is a C-style cast annotated with one of three keywords: (__bridge T) op casts the operand to the destination type T. If T is a retainable object pointer type, then op must have a non-retainable pointer type. If T is a non-retainable pointer type, then op must have a retainable object pointer type. Otherwise the cast is ill-formed. There is no transfer of ownership, and ARC inserts no retain operations. (__bridge_retained T) op casts the operand, which must have retainable object pointer type, to the destination type, which must be a non-retainable pointer type. ARC retains the value, subject to the usual optimizations on local values, and the recipient is responsible for balancing that +1. (__bridge_transfer T) op casts the operand, which must have non-retainable pointer type, to the destination type, which must be a retainable object pointer type. ARC will release the value at the end of the enclosing full-expression, subject to the usual optimizations on local values. These casts are required in order to transfer objects in and out of ARC control; see the rationale in the section on conversion of retainable object pointers. Using a __bridge_retained or __bridge_transfer cast purely to convince ARC &gt; to emit an unbalanced retain or release, respectively, is poor form. id&lt;MTLCommandQueue&gt; objcQueue = /* Your Objective-c queue */; MTL::CommandQueue* queue = (__bridge MTL::CommandQueue*)objcQueue;
score: 4
type: Answer

http://stackoverflow.com/a/77057604
score: 3
accepted answer of: http://stackoverflow.com/q/77057514
type: AcceptedAnswer
type: Answer
upvote count: 3
downvote count: 0
has body: addTarget is not retaining, so yours object is deallocated. You can use class object and method to retrieve event [sampleButton addTarget:[MyObject class] action:@selector(showTerminal) forControlEvents:UIControlEventTouchDown]; and: + (void)showTerminal
answers question: http://stackoverflow.com/q/77057514

push-notification
tags question: http://stackoverflow.com/q/76917550
tag name: push-notification
type: Tag
tags question: http://stackoverflow.com/q/77156262
tags question: http://stackoverflow.com/q/78791941
tags question: http://stackoverflow.com/q/78957932

http://stackoverflow.com/a/77017941
score: 1
has body: The process is exactly the same except rather than UIImage convenience initializer imageWithCGImage:, you call NSImage initializer initWithCGImage:size:: NSImage *image; CGImageRef cgImage = CGBitmapContextCreateImage(context); if (cgImage) { NSSize size = NSMakeSize(width, height); image = [[NSImage alloc] initWithCGImage:cgImage size:size]; CGImageRelease(cgImage); }
type: Answer
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/77017420

http://stackoverflow.com/comment/135701795
score: 0
has text: Thanks @DuncanC, you led me to the right places. I will check out UICollection when I can
comment on: http://stackoverflow.com/a/76971544
type: AnswerComment
type: Comment

sdl
tag name: sdl
type: Tag
tags question: http://stackoverflow.com/q/76923569

http://stackoverflow.com/comment/135645557
comment on: http://stackoverflow.com/q/76945008
has text: Hopefully it is more understandable now. `self.selectedUnit.name` contains the type of squad the user wants to configure and is used to determine which class I need `self.squadToConfigure` to point to.
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/135569087
comment on: http://stackoverflow.com/q/76901088
score: 0
type: QuestionComment
has text: Very confusing... is `textField` actually a `UITextView`? And you want it to be 20% of the height of the controller's view? And `progressBar` is a `UIProgressView`? And that should be 10% of the height? And both should be 90% of the width, centered horizontally?
type: Comment

http://stackoverflow.com/comment/135574502
type: AnswerComment
type: Comment
has text: Thank you for detailed explanation. Second option is make sense but I have a lot of model class so its gonna be long process seems like :)
comment on: http://stackoverflow.com/a/76904414
score: 0

http://stackoverflow.com/comment/135569609
has text: This is a swift view!
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/76901393

http://stackoverflow.com/comment/135837731
has text: I'd try wrapping the contents of the `DispatchQueue.main.async` closure in an `autoreleasepool`.
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77053720

http://stackoverflow.com/comment/135647304
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/76945008
has text: Can't you add a factory method to `unitLoadoutDataController` for it to construct an object? like `+(id < unitLoadoutDataController)factoryMethod`? It's hard to tell.

exception
type: Tag
tag name: exception
tags question: http://stackoverflow.com/q/76953246
tags question: http://stackoverflow.com/q/78516082

http://stackoverflow.com/q/77045441
linked to: http://stackoverflow.com/q/8066583
score: 0
has body: The [NSSpellChecker availableLanguages] method returns an array of locale codes (like "de", "en_GB" etc.). Is there a way that I can get localized language names (eg. "Deutsch" for "de" on a German system) from that on OS X in Objective-C? (The spellchecker panel has a popup menu of these languages, so the OS obviously has a table.)
has comment: http://stackoverflow.com/comment/135821939
tagged with: objective-c
tagged with: cocoa
has title: Can I get a localized language name for a locale code in Cocoa?
has comment: http://stackoverflow.com/comment/135823529
type: Question
duplicate of: http://stackoverflow.com/q/8066583
type: UnansweredQuestion
answer count: 0
tagged with: localization

http://stackoverflow.com/comment/135688758
type: Comment
score: 0
has text: I worked with iCarousel back in 2015 or so, and seem to remember that it had an option for linear lists as you show. It looks like you're set up for a circular carousel. You might want to run the demo app and look through the options (If it will still build and run.)
type: QuestionComment
comment on: http://stackoverflow.com/q/76970382

http://stackoverflow.com/comment/135835993
type: Comment
score: 0
has text: @Jay Sorry, what do you mean by modern swift syntax? I am new to Swift developing and Realm also. This methods where built back in 2019. Currently I've been rewritting this app's clases. But I am stucked with Realm. I dont quite understand the database handling. I know how to handle java objects but these are completely different. What would you recommend for me to start building a simple App in Swift using UIKIT and RealmSwift for storing 5 objects that get their values from Firebase and store it in local Realm. Where can I educate myself to be able to solve this?
type: QuestionComment
comment on: http://stackoverflow.com/q/77037290

http://stackoverflow.com/comment/135634424
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/76937682
has text: *"I added it in the "Fonts provided by application" part of Info.plist as well."* ... File name is case-sensitive, and must include the extension. Show a screen-cap of of your info plist like this: https://i.sstatic.net/n8TI3.png

http://stackoverflow.com/comment/135574556
comment on: http://stackoverflow.com/a/76904414
has text: @Begbie do you actually need to access all of your model classes from Obj-C? You can extend Obj-C classes from Swift and access pure Swift methods/types from these extensions. Forward declaration is also a very valuable tool, since you can forward declare pure Swift classes in Obj-C headers and then assign values to them from a Swift extension.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/135573989
comment on: http://stackoverflow.com/q/76904340
score: 0
type: QuestionComment
type: Comment
has text: Would add an extension with a dynamic property help? Something like this `var propertyForObjc: NSNumber? { self.property }`

http://stackoverflow.com/a/76902599
answers question: http://stackoverflow.com/q/76901088
has comment: http://stackoverflow.com/comment/135583556
has comment: http://stackoverflow.com/comment/135583136
has body: Since your question is asking about a general approach, the following is just an example for setting up the constraints for the text view within its superview. [NSLayoutConstraint activateConstraints:@[ // Set the width as a percentage of the superview's width [self.textView.widthAnchor constraintEqualToAnchor:self.layoutMarginsGuide.widthAnchor multiplier:0.9], // Align in the center horizontally [self.textView.centerXAnchor constraintEqualToAnchor:self.layoutMarginsGuide.centerXAnchor], // Set the top [self.textView.topAnchor constraintEqualToAnchor:self.layoutMarginsGuide.topAnchor], // Rely on the intrinsic height of the text view or you can optionally set a specific height constraint if desired ]]; The first constraint is the one most relevant to your question. This shows how to make the text view be 90% the width of the superview's margin layout width. Adjust as needed. Maybe replace self.layoutMarginsGuide.widthAnchor with self.widthAnchor depending on your needs. Set these up once and you're done. No need to update. As the width of the superview changes, so will the width of the text view. If you want to set a topAnchor, bottomAnchor, leadingAnchor, or trailingAnchor to be a percentage of a view's height or width, then you need to use the longer form of creating the constraint. The following would set the text view's topAnchor to be 30% of the superview's bottomAnchor: NSLayoutConstraint *top = [NSLayoutConstraint constraintWithItem:self.textView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:0.3 constant:0]; Then you need to activate it as usual.
has comment: http://stackoverflow.com/comment/135583263
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/135578118
upvote count: 1
accepted answer of: http://stackoverflow.com/q/76901088
downvote count: 0
has comment: http://stackoverflow.com/comment/135579115
score: 1

methods
type: Tag
tag name: methods
tags question: http://stackoverflow.com/q/76917235

http://stackoverflow.com/a/76947501
has comment: http://stackoverflow.com/comment/135648615
accepted answer of: http://stackoverflow.com/q/76945008
has comment: http://stackoverflow.com/comment/135648667
answers question: http://stackoverflow.com/q/76945008
has body: The problem you're having is that you are keying off a literal string, which is really fragile. At the very least, you need to have on hand a dictionary that maps between your selectedUnit.name possibilities and the class you want to instantiate. This would be made more bullet-proof if the name possibilities themselves were constants rather than mere literal strings, which can be incorrectly typed, or if the units had some sort of immutable and reliable identifier. But you have not shown anything about these units and how they are used, so it's impossible to say more. But a more sophisticated approach might be to plan ahead such that selectedUnit itself has a property that is the class corresponding to this unit, so that you can just read that property directly and instantiate.
type: AcceptedAnswer
score: 0
type: Answer

uinavigationcontroller
tags question: http://stackoverflow.com/q/76917550
tag name: uinavigationcontroller
type: Tag
tags question: http://stackoverflow.com/q/79086536

webrtc
type: Tag
tag name: webrtc
tags question: http://stackoverflow.com/q/77058213
tags question: http://stackoverflow.com/q/77925270

http://stackoverflow.com/comment/135690037
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/76971544
has text: I'm glad you solve your problem, and thanks for sharing your solution with the community. (Voted)

http://stackoverflow.com/a/76932773
type: AcceptedAnswer
type: Answer
has body: The lines: // Extract properties properties = [NSURL resourceValuesForKeys:@[@"AllPropertiesKey"] fromBookmarkData:bookmark][@"AllPropertiesKey"]; if(properties == nil) { // Skip this item continue; } would be something like this: // Extract properties let allPropertiesKey = URLResourceKey("AllPropertiesKey") guard let properties = NSURL.resourceValues(forKeys: [ allPropertiesKey ], fromBookmarkData: bookmark)?[allPropertiesKey] as? [URLResourceKey: Any] else { // Skip this item continue; } I think the cast at the end is correct but it really depends on what the made-up "AllPropertiesKey" key returns. Given the rest of your code, [URLResourceKey: Any] seems likely. If that all does work, then a line like: item.name = properties[@"NSURLNameKey"]; would become: item.name = properties[.nameKey] as? String // or as! but write that defensively
answers question: http://stackoverflow.com/q/76932655
score: 0
accepted answer of: http://stackoverflow.com/q/76932655

http://stackoverflow.com/comment/135597763
type: QuestionComment
score: 0
has text: Then either `navigationController` or `currentViewController` is nil. Checking those need to be part of the debugging. Also verify the segue is setup correctly in the storyboard.
type: Comment
comment on: http://stackoverflow.com/q/76917550

metro-bundler
tags question: http://stackoverflow.com/q/76919529
tag name: metro-bundler
type: Tag

http://stackoverflow.com/comment/135598131
type: Comment
score: 0
type: QuestionComment
has text: @HangarRash Correct, window is nil
comment on: http://stackoverflow.com/q/76917550

http://stackoverflow.com/comment/136022774
type: QuestionComment
has text: https://youtrack.jetbrains.com/issue/KT-61763/Kotlin-Multiplatform-native-iOS-memory-overload-issue
comment on: http://stackoverflow.com/q/77053720
type: Comment
score: 0

realm
tag name: realm
type: Tag
tags question: http://stackoverflow.com/q/77037290
tags question: http://stackoverflow.com/q/77229933

interface-builder
tags question: http://stackoverflow.com/q/76937682
tag name: interface-builder
type: Tag
tags question: http://stackoverflow.com/q/79259549

http://stackoverflow.com/comment/135578118
type: AnswerComment
comment on: http://stackoverflow.com/a/76902599
type: Comment
score: 0
has text: This works well for the sizing of the subview. Thanks! As a follow-up, what if I want to position the subview let's say 30% of the superview height from the topAnchor as opposed to just on the topAnchor? There doesn't seem to be an adaptive layout method to do that using a similar "multiplier" argument, only "constant" which is a fixed value.

http://stackoverflow.com/comment/135583263
comment on: http://stackoverflow.com/a/76902599
has text: Try replacing `NSLayoutAttributeHeight` with `NSLayoutAttributeBottom`.
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/135821939
score: 1
has text: `-[NSLocale localizedStringForLanguageCode:]`
type: QuestionComment
comment on: http://stackoverflow.com/q/77045441
type: Comment

http://stackoverflow.com/comment/135597857
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/76917550
has text: @HangarRash When I look at IB, I see Navigation Controller Scene. The controller in that scene is UINavigationController, doesn't contain a Storyboard ID, and is check marked for "Is initial view controller". There's an arrow pointing to it from the left for "Storyboard entry point"

xamarin.ios
tags question: http://stackoverflow.com/q/76970382
tag name: xamarin.ios
type: Tag

http://stackoverflow.com/a/78112970
answers question: http://stackoverflow.com/q/77058213
has body: Because your filter variable is not kept referenced after the function has finished running, like the videoCapturer variable it is kept referenced in self. Let's do that and I think it will work. Now define the filter variable in the header file like videoCapturer and edit the code as follows: self.filter = [[MyVideoSourceFilter alloc] initWithSource:videoSource]; self.videoCapturer = [[RTCCameraVideoCapturer alloc] initWithDelegate:filter]; self.videoCapturer.delegate = self.filter;
score: 0
type: Answer

http://stackoverflow.com/a/77366574
answers question: http://stackoverflow.com/q/76973236
has body: In your Objective-C .m file, add the following import: #import &lt;DeviceCheck/DCAppAttestService.h&gt; Add the framework DeviceCheck.framework under Frameworks, Libraries, and Embedded Content in the General tab of your target. Note however that, according to the documentation, you should use the DCAppAttestService.sharedService singleton instead of creating your own.
score: 0
type: Answer

http://stackoverflow.com/q/77087169
tagged with: cifilter
has body: I have a CIImage from YUV data without alpha plane, and a gray scaled CIImage. I want to use the second image as the alpha plane. Currently, gpt tells me to use CISourceOverCompositing filter, but it seems that this filter will blend the color of the second image's color. If I convert the gray scaled image into a black mask (0, 0, 0, alpha), then this filter will use black as "background color". However, I just want to replace the color instead of blend it with another color.
accepted answer: http://stackoverflow.com/a/77087352
type: Question
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/77087352
score: 0
tagged with: ciimage
type: AnsweredQuestion
has title: How to combine the color channels and alpha channel from two CIImage?

http://stackoverflow.com/a/77221671
score: 1
has body: AppDelegate does not have a default implementation of launchOptions. In your AppDelegate class implementation you must create an instance variable and then you can assign to it. See below: @implementation AppDelegate { NSDictionary launchOptions; -(BOOL)application:(UIApplication *) application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.launchOptions = launchOptions; } }
downvote count: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/77221275
answers question: http://stackoverflow.com/q/77221275
upvote count: 1

http://stackoverflow.com/a/77577964
score: 0
type: Answer
has body: you can integrate it by using swift bridging header, let me explain , once you add live activity widget in project , you will able to see one swiftUI file for live activity's UI , now you need to create one swift file for 'ActivityAttributes' in swift , as well need to create one swift file where you will implement all needed methods and code for live activity , now crate bridging header to use your swift code in objective c project , import swift file in a obj-c view controller where you want to implement live activity and call needed functions according your feature flaw, I've implement same way in my project and it's working well .
answers question: http://stackoverflow.com/q/77064360

http://stackoverflow.com/comment/136057192
score: 0
has text: Ah yeah. I changed my approach, so I won't be needing this anymore, but I couldn't implement `multiplyByNumber` on `NSMutableArray` calls to super's `arrayByMultiplyingByNumber`: how do you "overwrite" self?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77174872

http://stackoverflow.com/q/77228239
answer count: 0
score: 1
tagged with: iphone
tagged with: ios17
has title: CGImageSourceCreateThumbnailAtIndex doesnot rotate the image on ios 17
type: Question
upvote count: 1
tagged with: objective-c
type: UnansweredQuestion
has body: I use CGImageSourceCreateThumbnailAtIndex to resize and rotate a CGIImage. It works fine on ios 16 and below, but on ios 17, rotating does not work anymore. CGImageSourceRef imageSource = CGImageSourceCreateWithData(capturedImage, nil); CFDictionaryRef options = (__bridge CFDictionaryRef) @{ (id) kCGImageSourceCreateThumbnailWithTransform: @YES, (id) kCGImageSourceCreateThumbnailFromImageAlways : @YES, (id) kCGImageSourceThumbnailMaxPixelSize : @(maxPixelSize), (id) kCGImagePropertyOrientation: @(rotationAngle) }; CGImageRef thumbnail = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, options); CFRelease(imageSource); return thumbnail; } I tried to set the rotationAngle to different constant kCGImagePropertyOrientationUp, kCGImagePropertyOrientationLeft, kCGImagePropertyOrientationDown, kCGImagePropertyOrientationRight but it all returns the same image. Anyone experiencing the same issue and have an idea what has changed on ios 17 that breaks the API. Noted: it still works fine on iPadOS 17, can only reproduce on iOS 17.
favorite count: 0
tagged with: image-rotation
downvote count: 0

http://stackoverflow.com/q/77088641
has comment: http://stackoverflow.com/comment/135909754
has comment: http://stackoverflow.com/comment/135898544
type: Question
has comment: http://stackoverflow.com/comment/135899022
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/135898759
answer count: 0
has body: Why kVK_F2 is not equivalent to constant NSF2FunctionKey for F2 key press event, What is equivalent constant of kVK_F2, since carbon framework is deprecated. When I printed the keyCode, The [Event keyCode] against NSF2FunctionKey is 63237(0xF705) whereas for kVK_F2, it prints is 120 which is 0x78. 0x78 seems to be the standard keyboard value for F2 key. Sample code : //@property (nonatomic, strong) id eventMonitor; NSEvent* (^handler)(NSEvent*) = ^(NSEvent *theEvent) { NSEvent *result = theEvent; NSUInteger flags = [theEvent modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask; if ((flags & NSEventModifierFlagFunction) && (flags & NSEventModifierFlagCommand) && ([theEvent keyCode] == NSF2FunctionKey)) { NSLog(@"Command + F2 key pressed."); } return result; }; _eventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:(NSEventModifierFlagFunction | NSEventMaskKeyDown) handler:handler]; Whenever I press F2 key, it does not read the event for NSF2FunctionKey. but reads for KVK_F2.
tagged with: macos
has title: F2 key press event on macOS
score: 0
linked to: http://stackoverflow.com/q/32992293
tagged with: keypress
tagged with: objective-c

http://stackoverflow.com/q/77199867
tagged with: finder
has title: How to open finder inside WKWebView in macOS app?
has comment: http://stackoverflow.com/comment/136200805
downvote count: 1
has comment: http://stackoverflow.com/comment/136099427
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136149329
has comment: http://stackoverflow.com/comment/136148595
answer count: 0
has comment: http://stackoverflow.com/comment/136159828
score: 0
has comment: http://stackoverflow.com/comment/136152640
has comment: http://stackoverflow.com/comment/136117419
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/136144299
has comment: http://stackoverflow.com/comment/136098737
tagged with: wkwebview
type: UnansweredQuestion
tagged with: macos
has comment: http://stackoverflow.com/comment/136098601
has comment: http://stackoverflow.com/comment/136151814
has comment: http://stackoverflow.com/comment/136098565
favorite count: 0
has comment: http://stackoverflow.com/comment/136161338
has body: In macOS, our requirement is to open a Finder when clicking Upload File from a web view. It works when I opened the same URL link in Safari but inside macOS application Open Finder its not getting triggered. I've used WKWebKit delegate function but its not triggered. - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler; Also I've tried with WKNavigationDelegate as well but no luck. webView:didStartProvisionalNavigation: webView:didCommitNavigation: webView:didFinishNavigation: webView:didFailNavigation:withError: webView:decidePolicyForNavigationAction:decisionHandler: And also with WKUIDelegate functions as well. webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler: webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler: webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler: webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures: Here is the code I have tried, @interface ViewController() <WKUIDelegate, WKNavigationDelegate> @property (nonatomic, assign) BOOL isFinderOpen; @end @implementation ViewController (IBAction)buttonClick:(id)sender { NSString *urlAddress = [NSString stringWithFormat:@"https://www.diawi.com/"]; [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlAddress]]]; } - (void)webView:(WKWebView *)webView runOpenPanelWithParameters:(WKOpenPanelParameters *)parameters initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSArray<NSURL *> * _Nullable))completionHandler{ if (!self.isFinderOpen) { self.isFinderOpen = YES; [self.webView.configuration.preferences setValue:@TRUE forKey:@"allowFileAccessFromFileURLs"]; NSOpenPanel *openPanel = [NSOpenPanel openPanel]; [openPanel setCanChooseFiles:YES]; [openPanel beginWithCompletionHandler:^(NSInteger result) { self.isFinderOpen = NO; if (resul…

http://stackoverflow.com/comment/135977884
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77128985
has text: Thanks a lot, will definetely change my implementation to this.

http://stackoverflow.com/comment/136082025
type: QuestionComment
type: Comment
has text: FYI - Easier syntax: `[self.items addObject:@(number)];`.
comment on: http://stackoverflow.com/q/77190157
score: 0

http://stackoverflow.com/comment/135899022
comment on: http://stackoverflow.com/q/77088641
has text: There is no equivalent. Maybe this helps: [Swift 2: Detect Function Key Presses](https://stackoverflow.com/questions/32992293/swift-2-detect-function-key-presses).
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136110094
score: 1
type: Comment
comment on: http://stackoverflow.com/q/77207126
has text: User defaults isn't a good choice for doing this, its ok for experimenting with a new numbers, but it your list of numbers grows to hundreds or thousands its not suitable.
type: QuestionComment

http://stackoverflow.com/q/77062432
tagged with: cocoa
score: 0
has comment: http://stackoverflow.com/comment/135854893
has body: Disclaimer: I am mostly experienced with Gtk and FLTK on Linux and Windows. I am pretty much starting my macOS / Cocoa / Objective-C development journey. While I have done much research, I am not finding adequate documentation or code examples for this issue. Also, I suffer from a developmental disability, so please take it easy. I am trying to draw the contents of a VNC library (libvncserver / libvncclient) framebuffer onto an NSView within my program at a fast rate, around 20 to 30 frames a second. While I am successful at drawing the image onto the NSView at the needed rate, it looks awful with white artifacts all over the place: In the NSView's drawRect method I first must loop through the framebuffer and set the alpha to 255, otherwise the image will be (mostly) transparent: if ([vnc bytesPerPixel] == 2 || [vnc bytesPerPixel] == 4) { for (int i = ([vnc bytesPerPixel] - 1); i &lt; [vnc buffSize]; i+= [vnc bytesPerPixel]) vnc.vncClient-&gt;frameBuffer[i] = 255; } I then make the NSBitmapImageRep: NSBitmapImageRep * rep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:&amp;vnc.vncClient-&gt;frameBuffer pixelsWide:vnc.vncClient-&gt;width pixelsHigh:vnc.vncClient-&gt;height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:vnc.vncClient-&gt;width * [vnc bytesPerPixel] bitsPerPixel:vnc.vncClient-&gt;format.bitsPerPixel ]; Then I actually do the draw: [rep drawInRect:[self bounds] fromRect:NSZeroRect operation:NSCompositingOperationCopy fraction:1.0 respectFlipped:YES hints:nil ]; Since obviously there are other Mac apps out there that can do higher frame-rates without all of the artifacts, is there a better way to do this?
type: Question
has comment: http://stackoverflow.com/comment/135856045
tagged with: graphics
type: UnansweredQuestion
answer count: 0
tagged with: macos
tagged with: objective-c
has title: How to perform artifact-free fast drawing from bitmap data in Cocoa / Objective-C?

http://stackoverflow.com/comment/135909754
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77088641
has text: To be clear, the code in the question (not the answer) [Swift 2: Detect Function Key Presses](https://stackoverflow.com/questions/32992293/swift-2-detect-function-key-presses) detects F7, F8 and F9.
type: QuestionComment

http://stackoverflow.com/a/77085156
type: Answer
has body: Solution provided by NSGod in the comments: Set becomesKeyOnlyIfNeeded to YES.
answers question: http://stackoverflow.com/q/77083967
score: 0

http://stackoverflow.com/comment/136168964
type: AnswerComment
type: Comment
score: 0
has text: I believe you missed the point of the question asked by @JoakimDanielson. Your current properties are optional, and could be nil. How are you migrating a nil (optional) property to a non-optional property. e.g. Non-optional properties CANNOT be nil, they must contain a value. So a nil value cannot remain nil as that will crash.
comment on: http://stackoverflow.com/a/77230026

http://stackoverflow.com/a/77111939
has comment: http://stackoverflow.com/comment/135969852
answers question: http://stackoverflow.com/q/77111849
upvote count: 3
downvote count: 0
score: 3
has body: Similar to the range method in NSString, Swift Strings also have a range method that finds a particular substring in a string. You can create your desired range by using the ..< operator on the lowerBound and upperBound of the found ranges of "sip:" and "@". You can then pass the range to the String subscript to get the result as a Substring. If I understand correctly, the logic you want is: func parseNameFrom(_ string: String) -> Substring? { let rangeOfSip = string.range(of: "sip:") ?? string.range(of: "sips:") if let rangeOfAt = string.range(of: "@") { if let rangeOfSip { return string[rangeOfSip.upperBound..<rangeOfAt.lowerBound] } else { return string[..<rangeOfAt.lowerBound] } } else { return nil // can't find it } } print(parseNameFrom("sip:name@xyz.com")!)
type: Answer

date
tag name: date
type: Tag
tags question: http://stackoverflow.com/q/77124741

http://stackoverflow.com/a/77124845
type: AcceptedAnswer
type: Answer
upvote count: 1
score: 1
has body: "this string is in valid ISO8601 format" - actually, no. To make it valid you need the T between the date and time. The valid string would be: NSString* timeStampValue = @"20230917T120009.289Z"; // Note the added T Even with that, you need very specific format options for the string to be recognized properly. You need the following options: NSISO8601DateFormatWithYear NSISO8601DateFormatWithMonth NSISO8601DateFormatWithDate NSISO8601DateFormatWithTime NSISO8601DateFormatWithFractionalSeconds NSISO8601DateFormatWithTimeZone If you apply all of those options to the formatOptions property of the formatter, along with adding the needed T in the string, you will then be able to convert the string to an NSDate. NSString* timeStampValue = @"20230917T120009.289Z"; NSISO8601DateFormatter* formatter = [[NSISO8601DateFormatter alloc] init]; formatter.formatOptions = NSISO8601DateFormatWithYear | NSISO8601DateFormatWithMonth | NSISO8601DateFormatWithDay | NSISO8601DateFormatWithTime | NSISO8601DateFormatWithFractionalSeconds | NSISO8601DateFormatWithTimeZone; NSDate* dateOfLastVerification = [formatter dateFromString:timeStampValue]; Note that in order to use NSISO8601DateFormatWithFullDate, the string must have the date in the format "yyyy-MM-dd". If that's the only option you specify then the string can only contain the date and nothing else. If you wanted to use the NSISO8601DateFormatter without needing to specify any format options, your string needs to be in the format "yyyy-MM-ddTHH:mm:ssZZZZZ". A helpful debugging technique when working out issues with parsing a date string is to see what output you get converting an NSDate into an NSString with your date formatter. If the resulting output doesn't match the input you are trying to parse then you know you have the wrong format options or an invalid input string.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/77124741
answers question: http://stackoverflow.com/q/77124741

http://stackoverflow.com/comment/135914870
has text: It's an internal SwiftUI class, so there is no way to subclass it, nor extend it. The only way I can access it is during runtime, so that is why I resorted to this method.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77097789
type: Comment

http://stackoverflow.com/comment/136058429
type: QuestionComment
comment on: http://stackoverflow.com/q/77174872
type: Comment
has text: `arrayByMultiplyingByNumber:` and `multiplyByNumber:` can both call the same function or private method. Or `arrayByMultiplyingByNumber:` can do `mutableCopy`, `multiplyByNumber:` and return an immutable copy.
score: 0

http://stackoverflow.com/comment/136172525
score: 0
comment on: http://stackoverflow.com/a/77230026
has text: yes. but we can handle nil and respective properties seperately. Also it works for wide cases. @Jay
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/136162979
has text: yes, It is. we are migrating each property to non-optional. Using the above function.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/77230026

http://stackoverflow.com/q/77095168
has answer: http://stackoverflow.com/a/77095337
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/77095337
has body: A window is created in a xib, and it contains two tableviews, A and B. In interface builder, both A and B have the File's owner set as the delegate, since both will use some delegate methods, e.g. for drag and drop. I would like to fill table A programmatically, i.e. using -tableView:viewForTableColumn:row:, but I would still like to fill table B using the Bindings tab in interface builder. Is this possible directly? It seems that in my case, having the delegate of both tableviews set to the file's owner will automatically mean that B is populated using delegate methods, overriding anything set in the IB.
score: 0
tagged with: cocoa
has title: Programmatically fill one tableview, use IB bindings to fill others
type: Question
answer count: 1
type: AnsweredQuestion

string
type: Tag
tag name: string
tags question: http://stackoverflow.com/q/77111849
tags question: http://stackoverflow.com/q/79333775

http://stackoverflow.com/comment/136082022
type: QuestionComment
has text: You probably never initialized your `items` property. Also, your `if` check isn't doing what you probably think it is trying to do. The only way that will ever be true is if `self.items` is nil or if there are no objects in the array.
type: Comment
comment on: http://stackoverflow.com/q/77190157
score: 1

http://stackoverflow.com/comment/135930101
type: Comment
has text: Remember, such macros are simply compile-time text replacements. You are trying to do a runtime check with macros. Just write a normal function that you call at runtime.
comment on: http://stackoverflow.com/q/77104493
score: 0
type: QuestionComment

http://stackoverflow.com/a/77095337
score: 1
has comment: http://stackoverflow.com/comment/135914830
has comment: http://stackoverflow.com/comment/135910518
has comment: http://stackoverflow.com/comment/135910878
has comment: http://stackoverflow.com/comment/135911277
has body: It seems that in my case, having the delegate of both tableviews set to the file's owner will automatically mean that B is populated using delegate methods, overriding anything set in the IB. No, tableView:viewForTableColumn:row: and bindings work well together. Just do what the documentation says: It’s recommended that the implementation of this method first call the NSTableView method makeViewWithIdentifier:owner: passing, respectively, the tableColumn parameter’s identifier and self as the owner to attempt to reuse a view that is no longer visible or automatically unarchive an associated prototype view for that identifier. When using Cocoa bindings, this method is optional if at least one identifier has been associated with the table view at design time. (Note that a view’s identifier must be the same as the identifier of its column. An easy way to achieve this is to use the Automatic identifier setting in Interface Builder.) Example: - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { if (tableView == self.tableViewA) { MyTableCellView *cellView = [tableView makeViewWithIdentifier:myIdentifier owner:self]; cellView.customView.data = myData; return cellView; } else { return [tableView makeViewWithIdentifier:tableColumn.identifier owner:self]; } }
accepted answer of: http://stackoverflow.com/q/77095168
type: AcceptedAnswer
type: Answer
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/77095168

http://stackoverflow.com/comment/136052903
comment on: http://stackoverflow.com/q/77174872
has text: You should add `-[NSArray arrayByMultiplyingByNumber:]` and `-[NSMutableArray multiplyByNumber:]`, like `arrayByAddingObject:` and `addObject:`. `NSMutableArray` inherits `arrayByMultiplyingByNumber:`.
type: Comment
score: 2
type: QuestionComment

http://stackoverflow.com/a/77187122
accepted answer of: http://stackoverflow.com/q/77184948
answers question: http://stackoverflow.com/q/77184948
score: 0
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/136085000
has body: User interaction is disabled by default for animated views. Consider adding UIViewAnimationOptionAllowUserInteraction to the list of your options. [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionAllowUserInteraction animations:^{ self.currentView2.transform = CGAffineTransformMakeTranslation(0, self.currentView2.frame.size.height); self.currentView.transform = CGAffineTransformMakeScale(1.0, 1.0); } completion:^(BOOL finished) { self.currentView2 = nil; }];

http://stackoverflow.com/comment/136102981
type: Comment
has text: Will I have to use `__bridge` somehow?
comment on: http://stackoverflow.com/a/77199400
score: 0
type: AnswerComment

http://stackoverflow.com/a/77167364
accepted answer of: http://stackoverflow.com/q/77167307
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/136038436
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/77167307
has body: You should be using outdated Cocoapods version, please consider updating to the latest one. As a temporary workaround, in your Pods-YourAppName-Frameworks.sh file you can change the following line: source=&quot;$(readlink &quot;${source}&quot;)&quot; to: source=&quot;$(readlink -f &quot;${source}&quot;)&quot;

http://stackoverflow.com/q/77167307
has comment: http://stackoverflow.com/comment/136038227
score: -1
tagged with: cocoapods
has comment: http://stackoverflow.com/comment/136038280
has title: Cocoapods (AFNetworking) issue when archiving project
has body: I am trying to build a legacy Obj-C project, it's getting around 80% of progress and fails with the following error. I tried to reinstall pods, clean Derived Data, restart Xcode/computer. `mkdir -p /Users/myusername/Library/Developer/Xcode/DerivedData/MyApp-cghzlwxuhadyvrehqungfijxixti/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/BuildProductsPath/Release-iphoneos/MyApp.app/Frameworks Symlinked... rsync --delete -av --filter P .*.?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AFNetworking.framework" "/Users/myusername/Library/Developer/Xcode/DerivedData/MyApp-cghzlwxuhadyvrehqungfijxixti/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app/Frameworks" building file list ... rsync: link_stat "/Users/myusername/myapp_ios/MyApp/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AFNetworking.framework" failed: No such file or directory (2) done sent 29 bytes received 20 bytes 98.00 bytes/sec total size is 0 speedup is 0.00 rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9] Command PhaseScriptExecution failed with a nonzero exit code`
downvote count: 1
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/63533819
has answer: http://stackoverflow.com/a/77167364
answer count: 1
tagged with: objective-c
upvote count: 0
favorite count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/136039104
type: Question
accepted answer: http://stackoverflow.com/a/77167364

http://stackoverflow.com/q/77064360
tagged with: widgetliveactivity
tagged with: xcode
has answer: http://stackoverflow.com/a/77577964
score: 0
has title: How to integrate Live Activity into Objective C projects?
type: Question
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/135858305
tagged with: ios16
answer count: 1
tagged with: objective-c
has body: I have a food delivery app similar to Uber Eat it was developed in Objective C now the requirement is to implement the Live activity for tracking the Active orders. As i tried Live activity over the Swift it is working fine on all IOS Devices but when i implement that swift code into Objective C using all the standards by Bridging between Swift and Obj C copied the same code, There is no Error or Warning i am seeing in Live activity functionality in Objective C, but Live Activity UI can't seen on Lockscreen even i have checked in settings my app is showing that it supports Live Activity but no view. Can somebody help me out in that how to integrate live activity into Objective C project? I tried Swift Code in a separate app it works Fine and showing Live Activity both in Simulator and on real Device. I copied the same code followed the same methods into my old Objective C Project but no Live activity is going to be shown. even no error no warnings. also declared the NSSupportsLiveActivities to YES in Project info.plist file. Also getting the Activity registration Token in logs. but on viewing the live activity its not showing anywhere.

http://stackoverflow.com/comment/135969852
type: Comment
score: 0
comment on: http://stackoverflow.com/a/77111939
has text: Hey Sweeper, just some minor suggestions: Some guard-lets can help unnest some of this code., 2) Once all the parsing is done, it might be best to promote back into a `String`
type: AnswerComment

http://stackoverflow.com/q/77190157
type: Question
has comment: http://stackoverflow.com/comment/136082022
tagged with: objective-c
type: UnansweredQuestion
score: 0
has title: Assign double variable to mutable array
has body: I can't figure out why variable number is not being assigned to array self.items. In the debugger it is showing value of NULL. -(void)pushItem:(double)number{ [self.items addObject:[[NSNumber alloc]initWithDouble:number]]; if (self.items.lastObject == 0) { // ** need to add variable number to self.items array** } }
answer count: 0
has comment: http://stackoverflow.com/comment/136083075
tagged with: nsmutablearray
has comment: http://stackoverflow.com/comment/136084533
has comment: http://stackoverflow.com/comment/136082025

call-directory-extension
tags question: http://stackoverflow.com/q/77207126
tag name: call-directory-extension
type: Tag

http://stackoverflow.com/comment/135915506
comment on: http://stackoverflow.com/q/77097789
type: QuestionComment
type: Comment
has text: Try to do it in Objective-C. It's native. And pass NULL for types, it's already known from selector.
score: 0

http://stackoverflow.com/comment/136038436
type: AnswerComment
type: Comment
has text: Modifying .sh file worked like a charm, thanks
comment on: http://stackoverflow.com/a/77167364
score: 0

http://stackoverflow.com/comment/135915069
score: 1
comment on: http://stackoverflow.com/q/77097789
type: QuestionComment
type: Comment
has text: Sure. Please explain how to adjust the target offset of a decelerating List view in SwiftUI without resorting back to a UIScrollView and loosing the lazy loading behaviour of List. List does use a a UIScrollView underneath anyways, which is easy to access but changing it's delegate to a custom object breaks it, so I would like to extend the original delegate with this method instead. I am open to any alternate suggestions that can achieve changing the target offset.

http://stackoverflow.com/q/77199317
score: 0
type: Question
linked to: http://stackoverflow.com/q/14854521
accepted answer: http://stackoverflow.com/a/77199400
tagged with: objective-c
tagged with: c++
tagged with: automatic-ref-counting
has title: How can I store automatic reference counted Swift/Objective-C objects in a C++ map without causing memory leaks when they are deleted from the map?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/77199400
tagged with: swift
has body: I have a C++ map which manages loaded regions. Each region has an associated MTLBuffer for the geometry generated after the region data is converted into a mesh. The idea is to store a reference to each buffer inside the C++ map so I have all of the regions and their associated data in a single data structure. I could have this Objective-C++ pseudocode: struct Region { void *buffer; // Other fields }; std::unordered_map&lt;uint64_t, Region&gt; loaded_regions; void render_region(Region *region) { float vertices[MAX_SIZE]; unsigned length; // ... // There are multiple ways I could do this. One could be: map[position].buffer = [device newBufferWithBytes: vertices length: length options: MTLStorageModeShared]; // I could also pass `vertices` to some external function defined in Swift that creates a new `MTLBuffer` and returns it. // This is then converted to a bare pointer and stored in the map. } However, when regions are deleted from the map, for example in a function like this: void delete_region(uint16_t position) { Region *region = loaded_regions[position]; // ... map.erase(position); delete position; } How can I ensure any stored Swift object references or Objective-C object references are properly released and no memory leak is caused, assuming I have ARC enabled? Is this possible, or will I just have to make a Swift Dictionary or an Objective-C NSDictionary to store these buffers independently from the C++ map that stores the actual regions? When ARC is enabled, Xcode will not allow release messages to be used directly, so I do not know how else to manually free the memory.
tagged with: memory-leaks
answer count: 1

http://stackoverflow.com/comment/136149329
score: 0
has text: Post a [mre] please. How is the web view created? Where and when do you set `UIDelegate`?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77199867

uianimation
type: Tag
tag name: uianimation
tags question: http://stackoverflow.com/q/77184948

http://stackoverflow.com/comment/136159130
type: Comment
has text: Nil values will remain nil or null. @Joakim Danielson
comment on: http://stackoverflow.com/a/77230026
score: 0
type: AnswerComment

http://stackoverflow.com/comment/136056447
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77174872
has text: Oh, and I'd just call the super and then do a mutable copy. And this is.. "safe", for lack of a better word, because the name `arrayByMultiplyingByNumber` suggests the return value is not mutable. Thank you!
type: QuestionComment

http://stackoverflow.com/comment/136057004
has text: No, `-[NSMutableArray arrayByMultiplyingByNumber :]` is not implemented, it returns a `NSArray`. `-[NSMutableArray multiplyByNumber:]` is `- (void) multiplyByNumber:(NSInteger)number`, it mutates the receiver.
type: Comment
comment on: http://stackoverflow.com/q/77174872
score: 0
type: QuestionComment

http://stackoverflow.com/q/77101452
type: UnansweredQuestion
has title: iOS 17 , when entering Chinese characters, the program crashes. The system is using UIWebView
tagged with: keyboard
tagged with: uiwebview
score: 0
has body: iOS 17 , when entering Chinese characters, the program crashes. The system is using UIWebView. This is my error message. enter image description here. I know that Apple recommends replacing UIWebView with WKWebView, but I hope to find a faster solution to this problem. i've noticed that in the iOS 17 environment, there is an underline when typing Chinese characters. Is this due to UIWebView not supporting the display of this underline Any assistance would be greatly appreciated. Thank You.
tagged with: ios17
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136168776
answer count: 0
has comment: http://stackoverflow.com/comment/135921731
type: Question

widgetliveactivity
tag name: widgetliveactivity
tags question: http://stackoverflow.com/q/77064360
type: Tag

http://stackoverflow.com/q/77104493
type: AnsweredQuestion
tagged with: macros
has comment: http://stackoverflow.com/comment/135927106
answer count: 1
accepted answer: http://stackoverflow.com/a/77112294
has body: I want a macro with the language in in. Currently the code is: #define APP_LOCALE_X @([[[NSLocale preferredLanguages] objectAtIndex:0] isEqualToString:@"nl_NL"]); #ifdef APP_LOCALE_X #define APP_LOCALE @"&locale=nl_NL" #else #define APP_LOCALE @"&locale=en_US" #endif Logically this will not work since #ifdef sees the macro defined. I can't seem to wrap my head around the Macro logic. The other option would be to have a macro with the APP_LOCALE_X and a string. Like this: Obviously this is pseudo code: #define APP_LOCALE_X @([[NSLocale preferredLanguages] objectAtIndex:0]) == "nl_NL"); #define APP_LOCALE @"&locale="APP_LOCALE_X
has comment: http://stackoverflow.com/comment/135930101
score: 0
has title: Objective-c Macro Language detection
type: Question
tagged with: objective-c
has answer: http://stackoverflow.com/a/77112294

http://stackoverflow.com/comment/136152640
score: 0
comment on: http://stackoverflow.com/q/77199867
type: QuestionComment
has text: Is `UIDelegate` set in the storyboard? I tried your code, `runOpenPanelWithParameters` is called but there are some other issues.
type: Comment

http://stackoverflow.com/q/77124741
type: Question
answer count: 1
tagged with: date
tagged with: objective-c
score: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/77124845
tagged with: format
accepted answer: http://stackoverflow.com/a/77124845
has body: For the life of me I can't understand why dateFromString is producing a nil value in the code below. NSString* timeStampValue = @"20230917120009.289Z"; NSString* dateString = [timeStampValue substringToIndex:8]; NSISO8601DateFormatter* formatter = [[NSISO8601DateFormatter alloc] init]; [formatter setFormatOptions:NSISO8601DateFormatWithFullDate]; NSDate* dateOfLastVerification = [formatter dateFromString:dateString]; First I tried converting the entire string timeStampValue and set the format options accordingly. I was expecting that to work because, as far as I'm aware, this string is in valid ISO8601 format. Technically its using GeneralizedTime syntax but it doesn't seem like that should matter. But that threw a nil pointer. Then I decided to just extract the date substring (I don't necessarily need the time and time zone data) and specify NSISO8601DateFormatWithFullDate as the only option. That should be my safest bet, right? Well, dateFromString threw nil in that scenario as well. I tried setting the format options on the formatter directly and it made no difference: formatter.formatOptions = NSISO8601DateFormatWithFullDate
has title: How do I use NSISO8601DateFormatter to parse a date from a string in iOS?
tagged with: ios

http://stackoverflow.com/a/77230026
has comment: http://stackoverflow.com/comment/136159626
has comment: http://stackoverflow.com/comment/136172525
has comment: http://stackoverflow.com/comment/136168970
answers question: http://stackoverflow.com/q/77229933
has comment: http://stackoverflow.com/comment/136162979
has body: Here is the dynamic function for realm migration, migrationBlock: { migration, oldSchemaVersion in if oldSchemaVersion &lt; 1 { for objectSchema in migration.oldSchema.objectSchema { for property in objectSchema.properties { if property.isOptional { migration.enumerateObjects(ofType: objectSchema.className) { oldObject, newObject in if let oldValue = oldObject?[property.name] as? String { newObject![property.name] = String(oldValue) } if let oldValue = oldObject?[property.name] as? Int { newObject![property.name] = Int(oldValue) } if let oldValue = oldObject?[property.name] as? Bool { newObject![property.name] = Bool(oldValue) } } } } } } }
has comment: http://stackoverflow.com/comment/136159130
upvote count: 0
has comment: http://stackoverflow.com/comment/136168964
has comment: http://stackoverflow.com/comment/136151894
type: Answer
score: -1
downvote count: 1

http://stackoverflow.com/comment/135914835
type: Comment
comment on: http://stackoverflow.com/q/77097789
score: 0
has text: And why can't you just add the method to your delegate class? Failing that, why can't you create a subclass of your delegate class with just the new method in?
type: QuestionComment

http://stackoverflow.com/comment/136168970
comment on: http://stackoverflow.com/a/77230026
type: AnswerComment
type: Comment
has text: This code, while it may work has a very limited range of use - there are about a dozen different property types - what if the property is a double, or a date or a Decimal128? Expanding on that, what if it's a Realm object and not a primitive, how will that migrate?
score: 0

http://stackoverflow.com/q/77229933
has answer: http://stackoverflow.com/a/77230026
downvote count: 3
score: -3
tagged with: objective-c
has title: Realm Objective-C to Swift Migration (Dynamic Migration)
duplicate of: http://stackoverflow.com/q/77203188
answer count: 1
tagged with: realm-migration
favorite count: 0
has body: In Local Database we moved from Realm (Obj-C) to RealmSwift. After migration we have an issue in local db like all the properties were declared as Optional in Obj-C. Whereas, we used non-optional in swift db. now, we are forced to migrate entire database to new one. we can't make manually migrate each property. like, migrationBlock: { migration, oldSchemaVersion in if (oldSchemaVersion < 1) { migration.enumerateObjects(ofType: User.className()) { oldObject, newObject in newObject!["Id"] = oldObject!["Id"] } } we need a function to do migration for each property without hardcoding. Handle respective datatypes Dynamically as required. We are trying to make dynamic function.
type: Question
tagged with: swift
tagged with: realm
has comment: http://stackoverflow.com/comment/136167665
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/77203188
upvote count: 0

http://stackoverflow.com/q/77142373
type: Question
type: UnansweredQuestion
has title: Objective C: no known instance method for selector
has answer: http://stackoverflow.com/a/77142917
answer count: 1
tagged with: objective-c
has body: Trying to call another static method in a file of static methods, although I get: Tweak.xm:324:11: error: no known instance method for selector 'test' static void rddhandler(id self2, SEL _cmd){ [self test]; // } static void test() { NSLog(@"test"); }
score: 0

http://stackoverflow.com/comment/136098601
comment on: http://stackoverflow.com/q/77199867
type: QuestionComment
type: Comment
score: 0
has text: Have you tried the [Displaying an upload panel](https://developer.apple.com/documentation/webkit/wkuidelegate#2138155_) section of `WKUIDelegate`?

realm-migration
tag name: realm-migration
type: Tag
tags question: http://stackoverflow.com/q/77229933

http://stackoverflow.com/comment/135914994
comment on: http://stackoverflow.com/q/77097789
score: 0
type: QuestionComment
has text: If it's a class internal to `SwiftUI` you shouldn't be using it at all. Your code will be brittle at best and could break with every new release of SwiftUI. There's probably an official way to achieve what you are trying to achieve, so maybe if you explain it, somebody can give you an alternate answer.
type: Comment

http://stackoverflow.com/q/77207126
tagged with: objective-c
tagged with: react-native
has comment: http://stackoverflow.com/comment/136110082
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/136110094
tagged with: call-directory-extension
type: Question
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136110112
tagged with: callkit
has comment: http://stackoverflow.com/comment/136113948
has comment: http://stackoverflow.com/comment/136113944
has body: I want to implement Callkit Call Directory Extension in my React Native App, and created a Bridge too. I've used objective-c to handle CallDirectoryHandler. I have built the extension by following this tutorial, however, I am still struggling with adding and Identifying numbers. I have tried almost every possible solution, but neither of them worked for me. Below are the codes, I am using: CallkitBridge.m #import "CallkitBridge.h" #define DATA_KEY @"CALLER_LIST" #define DATA_GROUP @"group.org.reactn.futurecodes.CallDirectory" #define EXTENSION_ID @"org.reactn.futurecodes.CallDirectory" @implementation CallkitBridge RCT_EXPORT_MODULE() -(NSError*) buildErrorFromException: (NSException*) exception withErrorCode: (NSInteger)errorCode { NSMutableDictionary* info = [NSMutableDictionary dictionary]; [info setValue:exception.name forKey:@"Name"]; [info setValue:exception.reason forKey:@"Reason"]; [info setValue:exception.callStackReturnAddresses forKey:@"CallStack"]; [info setValue:exception.callStackSymbols forKey:@"CallStackSymbols"]; [info setValue:exception.userInfo forKey:@"UserInfo"]; NSError *error = [[NSError alloc] initWithDomain:EXTENSION_ID code:errorCode userInfo:info]; return error; } - (NSArray*)getCallerList { @try { NSUserDefaults* userDefaults = [[NSUserDefaults alloc] initWithSuiteName:DATA_GROUP]; NSArray* callerList = [userDefaults arrayForKey:DATA_KEY]; if (callerList) { return callerList; } return [[NSArray alloc] init]; } @catch(NSException* e) { NSLog(@"CallerId: Failed to getCallerList: %@", e.description); } } RCT_EXPORT_METHOD(getCallerList: (RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { @try { NSArray* callerList = [NSArray arrayWithArray:[self getCallerList]]; resolve(callerList); } @catch (NSException* e) { NSError* error = [self buildErrorFromException:e withErrorCode: 100]; reject(@"getCallerList", @"Failed to getCallerList bridge:", error); } } RCT_EXPORT_METHOD(setCallerList: (NSArray*) callerList withResolver: (…
has comment: http://stackoverflow.com/comment/136110395
tagged with: ios
has title: Callkit Call Directory Extension not working with React Native

http://stackoverflow.com/q/77083967
score: 0
tagged with: window-management
type: Question
has comment: http://stackoverflow.com/comment/135892791
has title: How to make a window level active when opening a utility panel
tagged with: nswindow
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/77085156
has comment: http://stackoverflow.com/comment/135890723
tagged with: nswindowcontroller
has body: My app consists of several windows that all exist at the NSNormalWindowLevel. I recently added a new window that opens as a utility panel (and, hence, NSFloatingWindowLevel). This utility panel correctly opens as a floating window and stays on top of the other windows, and I can change focus by clicking in any of the "normal" windows, or clicking again on the utility panel when I want interactions to take place there. The problem I'm having, though, is that I don't want the utility panel to always grab focus when it is opened; I'd like focus to remain with the top window at the NSNormalWindowLevel so the user does not have to click on the top "normal" window in order to continue working there. The basic code looks like this: storyBoard = [NSStoryboard storyboardWithName:@"UtilityPanel" bundle:nil]; utilityPanelController = [storyBoard instantiateControllerWithIdentifier:@"Utility Panel"]; [utilityPanelController showWindow:sender]; I've tried to force the top normal window to the front by getting a reference to the top window and calling orderFront: NSWindow *topWindow = [[NSApplication sharedApplication] keyWindow]; [topWindow orderFront:nil]; But the utility panel still has the focus, requiring a click in the top window to return focus where it was. I've also tried using orderFrontRegardless with the same result. It occurs to be that both orderFront and orderFrontRegardless only operate on windows at the same window level, and here the windows are at different levels. I've looked through the Window manager, but have yet to find a way to change the focus to a particular window level (say, NSNormalWindowLevel) in code at the time that I open the utility panel. Have I missed something obvious? Thanks!
answer count: 1
tagged with: objective-c

http://stackoverflow.com/a/77157994
type: Answer
answers question: http://stackoverflow.com/q/77156262
has body: You can't do that with a user-directed push nor an app directed push. You need to implement a notification service extension, then the user directed push will get delivered to that. The notification service extension can extract the payload and update the database. You have probably created the database in the app's file sandbox, therefore you will need to add the app group capability to the app and to the notification extension and create the database in the shared group file sandbox so it can be accessed by both the extension and the app. I don't know if QSLLite can handle simultaneous updates/accesses from multiple threads (or in this case it would be multiple processes), if it can then you are good to go. If it cannot then when the notification extension receives the push, it may need to determine if the app is running or not (that's possible for the extension to do using MMWormmhole), if it is running you will need to add some co-ordination between them to ensure they're not both simultaneously accessing the db.
score: 0

http://stackoverflow.com/comment/135854893
type: QuestionComment
has text: This is far from an answer because I have no direct experience with it, but is it possible to feed your framebuffer directly to Metal for display? (That would be my first avenue of exploration: avoiding the manual processing required to take the framebuffer, copy it into a bitmap representation, then re-draw it onto the screen; anything that'll let you blit it directly to the GPU will be an order of magnitude faster, if I had to guess.)
score: 1
type: Comment
comment on: http://stackoverflow.com/q/77062432

http://stackoverflow.com/comment/136039104
type: Comment
has text: Does this answer your question? [rsync error: some files could not be transferred (code 23) Command PhaseScriptExecution failed with a nonzero exit code](https://stackoverflow.com/questions/63533819/rsync-error-some-files-could-not-be-transferred-code-23-command-phasescriptex)
type: QuestionComment
comment on: http://stackoverflow.com/q/77167307
score: 0

http://stackoverflow.com/q/77085172
tagged with: swift-playground
type: Question
tagged with: objective-c
type: UnansweredQuestion
upvote count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/135894967
linked to: http://stackoverflow.com/q/24045245
has body: Question about Objective-C and Swift interoperability. I have some Objective-C headers and implementation files which I am using in a Swift playground for a bridging project. However the Playground does not show any of my Objective-C class properties or methods of the instances of the class in the preview. I can however see properties of instances of URL, CIImage, and NSImage just fine. What step/s am I missing? let image = CIImage(contentsOf: myUrl!) // With a url location to the image file on my disk. The Swift Playground shows w, h beside this line. However for my Objective-C properties of my @interface SampleRect : NSObject /** NSRect contains region of output pixels to render **/ @property CGRect dimensions; -(id) init; @end The properties after setting the preview shows no information on the SampleRect instance. What keyword or steps am I missing?
has answer: http://stackoverflow.com/a/77085574
tagged with: interop
has title: Objective-C class properties not viewable on Swift playground
tagged with: swift
tagged with: bridging-header
score: 1
answer count: 1

http://stackoverflow.com/q/77156262
has body: In my project Pushy used to handle Push notification. I want to update my local Sqlite data when I got a specific type of Push Notification. I am able to handle this when application is in foreground. Using this Delegate method. func notificationWillPresent(userInfo: [String: Any], completionHandler: ((UNNotificationPresentationOptions) -&gt; Void)?) { let remoteNotification = RemoteNotificationModel(userInfo) completionHandler?([.sound]) } But I want this same local data updating when app is in background or in killed state. Could you please suggest me how I can Achieve this. I did a lot of R &amp; D and found that no method calls when app is in killed state or in background state to handle this.
type: Question
tagged with: swift
upvote count: 1
downvote count: 0
answer count: 1
tagged with: push-notification
type: UnansweredQuestion
score: 1
has title: How to update local sqlite data from custom data of Push notification payload when application is in Killed state or in background state
has answer: http://stackoverflow.com/a/77157994
favorite count: 0
tagged with: ios
tagged with: pushy
tagged with: objective-c

http://stackoverflow.com/comment/136135815
comment on: http://stackoverflow.com/q/77221275
type: QuestionComment
has text: If you want your app delegate to have a `launchOptions` property you need to declare it.
type: Comment
score: 1

http://stackoverflow.com/comment/136200805
has text: @Willeke, I have set the delegate `[self.webview setUIDelegate:self];`
type: Comment
comment on: http://stackoverflow.com/q/77199867
type: QuestionComment
score: 0

http://stackoverflow.com/comment/135910878
comment on: http://stackoverflow.com/a/77095337
type: AnswerComment
type: Comment
has text: So, in IB the column only contained an NSTextFieldCell - I changed that, and now your solution works for table A. For table B, however, it does not seem possible to set the values in IB, so I will resort to just setting them programmatically as well, meh.
score: 0

http://stackoverflow.com/comment/135898759
score: 0
comment on: http://stackoverflow.com/q/77088641
has text: @Willeke, it prints @"?" What is the equivalent key code for kVK_F2 then?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136083075
type: Comment
has text: Did you initialize self.items? Self.items = [NSMutableArray new]; Additionally if you want to check for a number value you should call doubleValue or integerValue on the stored object
score: 0
comment on: http://stackoverflow.com/q/77190157
type: QuestionComment

http://stackoverflow.com/comment/135915571
type: Comment
comment on: http://stackoverflow.com/q/77097789
has text: Why do you need to change the target offset. Won't that make the scroll view feel weird to the user?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136137889
type: Comment
has text: @Paulw11 Thanks a lot, solved my problem! was very new to it
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77221275

http://stackoverflow.com/comment/136098737
has text: @Willeke we have tried using upload panel as well and it didn't work. I couldn't open the panel when button is tapped inside the webview.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77199867
type: QuestionComment

http://stackoverflow.com/comment/135982463
has text: @BalázsVincze You should upvote answers if they helped you :) (including the other answer from Cy-4AH)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77128985

swift-playground
type: Tag
tag name: swift-playground
tags question: http://stackoverflow.com/q/77085172

http://stackoverflow.com/comment/135927106
comment on: http://stackoverflow.com/q/77104493
has text: what exactly are you trying to achieve? what is your ultimate goal? show an example of hypothetic usage
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136159828
has text: you are asking about whether webView is set to UIDelegate in storyboard, right?
comment on: http://stackoverflow.com/q/77199867
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/a/77128985
has body: Rather than generating your own IMP and type encoding, I'd suggest you let the compiler do it for you, by creating a method normally, and transplanting it over: import Foundation import ObjectiveC @objc class ScrollViewPatch: NSObject { @objc func scrollViewWillEndDragging( _ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint> ) { targetContentOffset.pointee = .zero } } func extendDelegate(scrollViewDelegte: UIScrollViewDelegate) { let patchedMethod = class_getInstanceMethod( ScrollViewPatch.self, #selector(ScrollViewPatch.scrollViewWillEndDragging(_:withVelocity:targetContentOffset:)) )! class_addMethod( type(of: scrollViewDelegte), #selector(UIScrollViewDelegate.scrollViewWillEndDragging(_:withVelocity:targetContentOffset:)), method_getImplementation(patchedMethod), method_getTypeEncoding(patchedMethod) // Much more reliable than hard-coding "v@:@{CGPoint=dd}^{CGPoint=dd}" ) } Here's a simpler standalone proof-of-concept: import Foundation import ObjectiveC @objc class MethodSource: NSObject { @objc func myMethod(_ arg: NSString) { print("Called \(#function) on \(self) with \"\(arg)\"") } } @objc class TargetClass: NSObject { // Doens't natively respond to `-myMethod` } let targetObject = TargetClass() // The target object doesn't initially respond to `-myMethod` print(targetObject.responds(to: #selector(MethodSource.myMethod))) // false let patchedMethod = class_getInstanceMethod( MethodSource.self, #selector(MethodSource.myMethod) )! class_addMethod( type(of: targetObject), #selector(MethodSource.myMethod), method_getImplementation(patchedMethod), method_getTypeEncoding(patchedMethod) ) // Now it's true print(targetObject.responds(to: #selector(MethodSource.myMethod))) // Called myMethod(_:) on <main.TargetClass: 0x6000016b0040> with "some string" targetObject.perform(#selector(MethodSource.myMethod), with: "some string")
has comment: http://stackoverflow.com/comment/135977884
type: Answer
answers question: http://stackoverflow.com/q/77097789
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/135982463
score: 1

http://stackoverflow.com/q/77221275
has comment: http://stackoverflow.com/comment/136135815
answer count: 1
accepted answer: http://stackoverflow.com/a/77221671
tagged with: ios
score: 0
type: Question
has comment: http://stackoverflow.com/comment/136137889
tagged with: objective-c
tagged with: react-native
has answer: http://stackoverflow.com/a/77221671
has body: I'm trying to assign launchOption from didFinishLaunchingWithOptions to self so I can use it in another function but it doesn't seem to work. I keep getting the error: "Property 'launchOptions' not found on object of type 'AppDelegate *'" . It seems like I'm having problems when I try to access self.launchOptions.
has title: Assigning launchOption to self in AppDelegate
type: AnsweredQuestion

http://stackoverflow.com/comment/135914830
comment on: http://stackoverflow.com/a/77095337
score: 0
has text: It's both data source and delegate, for both of the tables. But I (we) figured it out now: The content bindings of the tables must be set to their respective arraycontroller (rather, their arrangedObjects). This was not necessary before, when both tables were populated from the xib
type: AnswerComment
type: Comment

http://stackoverflow.com/a/77087352
answers question: http://stackoverflow.com/q/77087169
accepted answer of: http://stackoverflow.com/q/77087169
has body: You can blend your color image with a transparent image, using the grayscale image as a mask: CIImage* clearBackground = [[CIImage clearImage] imageByCroppingToRect:colorImage.extent]; CIFilter* blendFilter = [CIFilter filterWithName:@"CIBlendWithMask"]; [blendFilter setValue:colorImage forKey:kCIInputImageKey]; [blendFilter setValue:clearBackground forKey:kCIInputBackgroundImageKey]; [blendFilter setValue:grayscaleImage forKey:kCIInputMaskImageKey]; CIImage* output = [blendFilter outputImage];
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/comment/135915992
type: AnswerComment
type: Comment
score: 0
has text: This actually solved it. I have no clue how are the two related but thank you so much!
comment on: http://stackoverflow.com/a/77098336

http://stackoverflow.com/comment/136098565
comment on: http://stackoverflow.com/q/77199867
type: QuestionComment
type: Comment
score: 0
has text: Finder is an app. Do you mean an Open panel?

http://stackoverflow.com/comment/136110395
type: Comment
score: 0
has text: Take into consideration where you're from in the first place and are you going to keep it after it gets added to the extension and how much of it there could be. Also does the data need to accessible to the RN side and the native side? You could store them in a database for example - if the database is located in the group location then it can be accessed by both the app and the extension, or you could just write the data as plain text to a file which again is in the group directory. Which database would depend on your needs and requirements.
type: QuestionComment
comment on: http://stackoverflow.com/q/77207126

http://stackoverflow.com/q/77174872
has comment: http://stackoverflow.com/comment/136057209
tagged with: arrays
type: Question
type: UnansweredQuestion
tagged with: nsmutablearray
has body: In Python, the expression 2*[a,b,c] (with a,b,c variables) is meaningful, and returns [a,b,c,a,b,c]. Also, in Python, lists (or arrays) are mutable by design. It is easy enough to write a category on e.g. NSArray that implements an instance method -(NSArray*) multiplyByNumber:(NSInteger)number; which copies Python's behavior. But the mutability is not given in Objective-C: NSArrays are immutable by design, but they have a mutable subclass NSMutableArray, which can not really inherit the multiplyByNumber method. Is there a way to avoid reimplementation of the method for NSMutableArray? Or do I really have to do it for the mutable subclasses as well?
has comment: http://stackoverflow.com/comment/136058429
has title: Array multiplication in Objective-C, for NSArray and NSMutableArray
score: 0
has comment: http://stackoverflow.com/comment/136052903
has comment: http://stackoverflow.com/comment/136057192
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136057004
has comment: http://stackoverflow.com/comment/136056447
answer count: 0

nsrange
type: Tag
tag name: nsrange
tags question: http://stackoverflow.com/q/77111849

http://stackoverflow.com/a/77199400
upvote count: 1
has comment: http://stackoverflow.com/comment/136102981
accepted answer of: http://stackoverflow.com/q/77199317
answers question: http://stackoverflow.com/q/77199317
has body: It's quite easy with smart pointers. See the sketch below. struct Deleter { void operator()(void *buffer) const nothrow { CFRelease(buffer); } }; struct Region { std::unique_ptr&lt;void, Deleter&gt; buffer; // Other fields }; map[positon].buffer.reset([device newBufferWithBytes:vertices length:length options:MTLStorageModeShared]);
downvote count: 0
has comment: http://stackoverflow.com/comment/136103334
score: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/135939315
type: Comment
comment on: http://stackoverflow.com/q/77111849
has text: A *free translation* of the code can take advantage of Swift Regex in a String extension: `let name = self.firstMatch(of: /(?:sips?:)?([^@]+)@/)?.output.1`. The result is of type `Substring?`
score: 0
type: QuestionComment

http://stackoverflow.com/a/77112294
type: AcceptedAnswer
upvote count: 1
has body: You can use ternary operator inside macro for condition instead of #ifdef: #define APP_LOCALE ([[[NSLocale preferredLanguages] objectAtIndex:0] isEqualToString:@"nl_NL"] ? @"&locale=nl_NL" : @"&locale=en_US") If you want to have boolean value extracted to a separate variable you can do it the following way: #define APP_LOCALE_X [[[NSLocale preferredLanguages] objectAtIndex:0] isEqualToString:@"nl_NL"] #define APP_LOCALE (APP_LOCALE_X ? @"&locale=nl_NL" : @"&locale=en_US") Please note that in your example you placed semicolon ; after #define statement, you should not place it there, as it will be inserted when expanding macro.
score: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/77104493
answers question: http://stackoverflow.com/q/77104493
downvote count: 0

http://stackoverflow.com/comment/136110082
has text: "I am unable to debug the Call Directory Extension in Xcode" In Xcode's bar at the top your app will be selected, change it to the extension and then hit run, it'll prompt you to choose an app to run, select your app. When your app calls the extension the extension code will run and you can add debug it just like your app
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77207126

http://stackoverflow.com/comment/136057209
has text: The obvious approach would be a completely separate implementation from what super offers (adding the array to itself number-1 times), but I would have liked to do it differently
score: 1
type: Comment
comment on: http://stackoverflow.com/q/77174872
type: QuestionComment

http://stackoverflow.com/comment/136117419
type: Comment
has text: @Willeke I have edited the question and shared the code, please refer that.
comment on: http://stackoverflow.com/q/77199867
type: QuestionComment
score: 0

http://stackoverflow.com/comment/136085000
score: 0
has text: It actually worked. Thanks a lot @Mykyta iOS
comment on: http://stackoverflow.com/a/77187122
type: AnswerComment
type: Comment

http://stackoverflow.com/a/77142917
has body: test() is not a method. It's a function. The syntax to call it is test().
score: 0
type: Answer
answers question: http://stackoverflow.com/q/77142373

http://stackoverflow.com/comment/136168776
type: QuestionComment
score: 0
type: Comment
has text: I have a similar issue. Have you found a faster solution without replacing UIWebView? Thanks.
comment on: http://stackoverflow.com/q/77101452

http://stackoverflow.com/comment/135921731
type: Comment
has text: `WKWebView` has been around since iOS 8. There's no reason to keep using the very outdated `UIWebView` (which was deprecated in iOS 12). It will be much quicker to switch to `WKWebView` than to try to work around issues with an unsupported and out-of-date `UIWebView`.
comment on: http://stackoverflow.com/q/77101452
score: 1
type: QuestionComment

http://stackoverflow.com/q/77097789
has answer: http://stackoverflow.com/a/77128985
has comment: http://stackoverflow.com/comment/135915571
has title: Assigning to a pointer causes EXC_BAD_ACCESS through class_addMethod
accepted answer: http://stackoverflow.com/a/77098336
has comment: http://stackoverflow.com/comment/135914994
type: Question
tagged with: swift
upvote count: 1
downvote count: 0
possible better answer: http://stackoverflow.com/a/77128985
has comment: http://stackoverflow.com/comment/135914835
score: 1
tagged with: method-swizzling
favorite count: 0
has body: I have an internal class that adoptsUIScrollViewDelegate, but does not implement scrollViewWillEndDragging(_:withVelocity:targetContentOffset:). I want to add this method to the class using class_addMethod, but unfortunately run into a EXC_BAD_ACCESS error when trying to assign a new value to targetContentOffset. Here is my code: func extendDelegate(scrollViewDelegte: UIScrollViewDelegate) { let block : @convention(block) (UIScrollView, CGPoint, UnsafeMutablePointer<CGPoint>) -> Void = { scrollView, velocity, targetContentOffset in // EXC_BAD_ACCESS here. // I can read the pointee and it does contain a valid CGPoint value, // however assigning to it gives a crash. targetContentOffset.pointee = .zero } class_addMethod( type(of: scrollViewDelegte), #selector(UIScrollViewDelegate.scrollViewWillEndDragging(_:withVelocity:targetContentOffset:)), imp_implementationWithBlock(block), "v@:@{CGPoint=dd}^{CGPoint=dd}" ) } Any helps is greatly appreciated!
has comment: http://stackoverflow.com/comment/135915506
has answer: http://stackoverflow.com/a/77098336
tagged with: ios
has comment: http://stackoverflow.com/comment/135915069
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/135914870
answer count: 2
tagged with: objective-c

http://stackoverflow.com/comment/136038280
type: Comment
score: 0
has text: @koen thanks but this will require updating the project significantly, would prefer to avoid.
comment on: http://stackoverflow.com/q/77167307
type: QuestionComment

uiwebview
type: Tag
tags question: http://stackoverflow.com/q/77101452
tag name: uiwebview

http://stackoverflow.com/comment/135894967
type: Comment
score: 0
type: QuestionComment
has text: Does this answer your question? [How to import own classes from your own project into a Playground](https://stackoverflow.com/questions/24045245/how-to-import-own-classes-from-your-own-project-into-a-playground)
comment on: http://stackoverflow.com/q/77085172

http://stackoverflow.com/comment/135856045
type: Comment
comment on: http://stackoverflow.com/q/77062432
has text: @ItaiFerber Thanks! I will check that out and see if it's an option. Apple's API documentation often has major holes that make it challenging to learn, but the Metal suggestion sounds interesting.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/136110112
type: QuestionComment
has text: Thanks a lot, I have now debugged the app, and fixed the issue. Can you please provide me a solution better than User defaults?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77207126

http://stackoverflow.com/a/77085574
type: Answer
upvote count: 1
has body: See the documentation for CustomPlaygroundDisplayConvertible. Playgrounds only supports specialised displays for a limited number of types. That includes CIImage, URL etc. For other types, only a "structured description" is displayed, which is probably what you are seeing. Luckily, your SampleRect is just a wrapper around a CGRect, so you can easily conform to CustomPlaygroundDisplayConvertible and use the wrapped CGRect as the playground display. extension SampleRect: CustomPlaygroundDisplayConvertible { var playgroundDescription: Any { dimensions } }
answers question: http://stackoverflow.com/q/77085172
score: 1
downvote count: 0

ios17
tags question: http://stackoverflow.com/q/77228239
type: Tag
tags question: http://stackoverflow.com/q/77101452
tag name: ios17
tags question: http://stackoverflow.com/q/77323221
tags question: http://stackoverflow.com/q/77391385
tags question: http://stackoverflow.com/q/78112507

http://stackoverflow.com/q/77140267
upvote count: 1
score: 1
has body: I am using WKWebView in objective c to load my html string that i wrote for my project. it actually worked and i managed to save the image in my image path BUT it didnt work if the height exceeds 4100. Case A: html height < 4100 Case B: html height > 4100 i put my view off screen so people dont actually see it but its rendering in the "background", i got my height from the WKWebView using the javascript to capture my image. this is my example code below, getWKWebViewConfiguration --> settings loadWebView --> a button to run my html string into wkWebview + (WKWebViewConfiguration *) getWKWebViewConfiguration { NSString *jScript = @"var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', initial-scale=1.0, shrink-to-fit=yes'); document.getElementsByTagName('head')[0].appendChild(meta);"; WKUserScript *wkUScript = [[WKUserScript alloc] initWithSource:jScript injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES]; WKUserContentController *wkUController = [[WKUserContentController alloc] init]; [wkUController addUserScript:wkUScript]; WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init]; if ([self deviceIsIOS10]) { //these 2 only available since iOS10. config.dataDetectorTypes = NO; config.ignoresViewportScaleLimits = NO; } config.userContentController = wkUController; return config; } - (void) loadWebView { //x origin = 2000, to render off screen. view = [[WKWebView alloc] initWithFrame:CGRectMake(2000, 0, webviewWidth, webviewHeight) configuration:[self getWKWebViewConfiguration]]; view.UIDelegate = self; view.navigationDelegate = self; [view loadHTMLString:reportString baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]]; } - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { [webView evaluateJavaScript:@"document.body.offsetHeight" completionHandler:^(id result, NSError *error) { if (error == nil) { float height = [result floatV…
has title: WKWebView snapshot not working after certain size
tagged with: http://stackoverflow.com/tag/html
type: Question
tagged with: objective-c
type: UnansweredQuestion
downvote count: 0
favorite count: 0
tagged with: wkwebview
answer count: 0

http://stackoverflow.com/comment/136084533
has text: Is `self.items` nil? `self.items.lastObject == 0` doesn't seems to be the correct way too. Did you meant `if ([self.items.lastObject equalsTo:@(0.0)])` or `if (self.items.lastObject == nil)`? ... ?
comment on: http://stackoverflow.com/q/77190157
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/135942494
type: QuestionComment
type: Comment
has text: Don't convert old legacy Objective-C code. Ask how to extract the name in Swift.
score: 2
comment on: http://stackoverflow.com/q/77111849

http://stackoverflow.com/q/77184948
has title: Pan Gesture is not recognized for the view while it is being transformed with scale animation? Why this is happening?
tagged with: ios
tagged with: uipangesturerecognizer
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/77187122
tagged with: objective-c
type: Question
answer count: 1
score: 0
tagged with: uianimation
accepted answer: http://stackoverflow.com/a/77187122
has body: [self.currentView addGestureRecognizer:self.pangr]; // added somewhere above in the code [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ self.currentView2.transform = CGAffineTransformMakeTranslation(0, self.currentView2.frame.size.height); self.currentView.transform = CGAffineTransformMakeScale(1.0, 1.0); } completion:^(BOOL finished) { self.currentView2 = nil; }]; Here the currentView does have a pan gesture recognizer and it has a handling function. Inside the handler in the onEnded case i have written the above animation where the currentView2 is dummy one and it is out of concern. the main problem here is after releasing the gesture on the currenView and it is tranforming and during that time the gesture on that view is not recognizing. It is recognizing only after that tranform animation in completed. Why is this happening? Any explanation will be appriciated. Thank you. I tried to transform a view and at the same time i want to make the gesture on the view to be recognized. But that is not happening.

http://stackoverflow.com/comment/135911277
score: 0
comment on: http://stackoverflow.com/a/77095337
type: AnswerComment
has text: Is the file's owner also the data source? Should work just as well. Bindings are difficult to debug, data source and delegate are easier.
type: Comment

http://stackoverflow.com/comment/136038227
type: Comment
has text: Have you tried adding AFNetworking directly as code instead of via CocoaPods? I have an older Obj-C project with AFNetworking and it still builds fine with Xcode 14.
score: 0
comment on: http://stackoverflow.com/q/77167307
type: QuestionComment

http://stackoverflow.com/tag/html
tag name: html
tags question: http://stackoverflow.com/q/77140267
type: Tag
tags question: http://stackoverflow.com/q/77419925

http://stackoverflow.com/comment/136161338
score: 0
type: QuestionComment
has text: Yes, if you don't set `UIDelegate` in code then it must be set in the storyboard. You can check `self.webView. UIDelegate` in `buttonClick:`, is it set to the same object as `self`?
comment on: http://stackoverflow.com/q/77199867
type: Comment

cifilter
tags question: http://stackoverflow.com/q/77087169
type: Tag
tag name: cifilter
tags question: http://stackoverflow.com/q/78282950
tags question: http://stackoverflow.com/q/78283285
tags question: http://stackoverflow.com/q/78822765

image-rotation
tags question: http://stackoverflow.com/q/77228239
type: Tag
tag name: image-rotation

http://stackoverflow.com/comment/136113944
type: QuestionComment
comment on: http://stackoverflow.com/q/77207126
has text: I suggest using a simple shared text file. It can be JSON encoded, or just a CSV. The phone number is represented as an integer in E.164 format, so the US phone number +1-408-555-1234 would be represented by the integer `14085551234`. The Australian phone number 02 8424 1244 (which is +61-2-8424-1244) would be the integer `61284241244`. Your extension must present the phone numbers in increasing order, so sort I suggest you sort your text file before saving it. Also the extension has a limited memory quota. See https://github.com/paulw11/CallKitTutorial for an example extension in Swift
score: 1
type: Comment

memory-leaks
tags question: http://stackoverflow.com/q/77199317
type: Tag
tag name: memory-leaks
tags question: http://stackoverflow.com/q/79151429

http://stackoverflow.com/comment/135910518
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77095337
has text: Hm, I implemented `numberOfRowsInTableView` and the method you provided (with appropriate changes), and now table B is populated but the rows display empty strings (clicking the row still selects the correct data, as logging shows) - so, not as configured in IB. And table A is not populated at all. I guess my problem might be more specific/somewhere else.
score: 0

http://stackoverflow.com/comment/136113948
comment on: http://stackoverflow.com/q/77207126
type: QuestionComment
score: 0
type: Comment
has text: My example uses Core Data, but that can run into memory issues if you have a lot of numbers.

http://stackoverflow.com/comment/136148595
score: 0
type: Comment
has text: @Willeke, no it didn't get called but i have set the UIDelegate
comment on: http://stackoverflow.com/q/77199867
type: QuestionComment

nswindowcontroller
type: Tag
tags question: http://stackoverflow.com/q/77083967
tag name: nswindowcontroller

arrays
tag name: arrays
type: Tag
tags question: http://stackoverflow.com/q/77174872
tags question: http://stackoverflow.com/q/78038240
tags question: http://stackoverflow.com/q/78356799
tags question: http://stackoverflow.com/q/78559718

http://stackoverflow.com/comment/135890723
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/77083967
has text: Try setting `NSPanel`'s `becomesKeyOnlyIfNeeded` to YES?

http://stackoverflow.com/q/77111849
downvote count: 1
type: Question
answer count: 1
tagged with: objective-c
has body: I am trying the find some alternative to NSRange.location and NSRange.length in Swift. I have a string for example sip:name@xyz.com I am trying to extract name from it. I can do it using componentsSeperatedBy method from String. But I was wondering whether it can be done using range similar to Objective C. I already have old legacy Objective C code which I am trying to convert to Swift. // Extract name from sip:name@xyz.com..... NSString *name = nil; NSRange rangeForSip; NSRange rangeFor@; rangeForSip = [self rangeOfString: @"sip:"]; if (rangeForSip.location == NSNotFound) { //Look for sips rangeForSip = [self rangeOfString: @"sips:"]; } match2 = [self rangeOfString: @"@"]; if ((rangeForSip.location != NSNotFound) && (rangeFor@.location != NSNotFound)) { name = [self substringWithRange:NSMakeRange(rangeForSip.location + rangeForSip.length, rangeFor@.location - (rangeForSip.location + rangeForSip.length))]; } else if (rangeFor@.location != NSNotFound) { // Extract name from sip:name@xyz.com..... name = [self substringWithRange:NSMakeRange(0, rangeFor@.location)]; }
tagged with: nsrange
has comment: http://stackoverflow.com/comment/135942494
favorite count: 0
score: 0
has title: What is Swift alternative to NSRange.location and NSRange.length?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/77111939
upvote count: 1
tagged with: swift
tagged with: string
has comment: http://stackoverflow.com/comment/135939315

http://stackoverflow.com/comment/136099427
type: QuestionComment
score: 1
type: Comment
comment on: http://stackoverflow.com/q/77199867
has text: Post the code you tried please.

http://stackoverflow.com/comment/136144299
type: Comment
has text: Is `webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:` called? Do you set `UIDelegate`? Any exceptions?
comment on: http://stackoverflow.com/q/77199867
score: 0
type: QuestionComment

finder
tags question: http://stackoverflow.com/q/77199867
tag name: finder
type: Tag

http://stackoverflow.com/comment/136103334
comment on: http://stackoverflow.com/a/77199400
type: AnswerComment
score: 1
type: Comment
has text: [Where and how to __bridge](https://stackoverflow.com/questions/14854521/where-and-how-to-bridge). You don't need `__bridge` for `CFRelease()`.

format
tags question: http://stackoverflow.com/q/77124741
type: Tag
tag name: format

http://stackoverflow.com/comment/136159626
type: AnswerComment
type: Comment
score: 0
has text: But you said the new db will hold only non-optional properties so it’s hard to understand the logic behind this code.
comment on: http://stackoverflow.com/a/77230026

keypress
tag name: keypress
tags question: http://stackoverflow.com/q/77088641
type: Tag

pushy
type: Tag
tags question: http://stackoverflow.com/q/77156262
tag name: pushy

http://stackoverflow.com/comment/135858305
type: Comment
score: 0
type: QuestionComment
has text: Please provide enough code so others can better understand or reproduce the problem.
comment on: http://stackoverflow.com/q/77064360

keyboard
type: Tag
tags question: http://stackoverflow.com/q/77101452
tag name: keyboard
tags question: http://stackoverflow.com/q/77418597
tags question: http://stackoverflow.com/q/78373566

http://stackoverflow.com/a/77098336
type: AcceptedAnswer
type: Answer
has body: From imp_implementationWithBlock's documentation: The signature of block should be method_return_type ^(id self, method_args ...) I think you are missing self in parameters.
accepted answer of: http://stackoverflow.com/q/77097789
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/77097789
has comment: http://stackoverflow.com/comment/135915992
score: 1

http://stackoverflow.com/comment/136167665
type: QuestionComment
comment on: http://stackoverflow.com/q/77229933
score: 1
type: Comment
has text: Please don't post duplicate questions. It's better to update your existing question with additional info or edits and post the answer to *that* question if you have one.

http://stackoverflow.com/comment/135892791
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77083967
has text: That's all I needed; thank you!
type: QuestionComment

window-management
tags question: http://stackoverflow.com/q/77083967
tag name: window-management
type: Tag

nsmutablearray
type: Tag
tags question: http://stackoverflow.com/q/77190157
tags question: http://stackoverflow.com/q/77174872
tag name: nsmutablearray

ciimage
tags question: http://stackoverflow.com/q/77087169
type: Tag
tag name: ciimage

uipangesturerecognizer
tags question: http://stackoverflow.com/q/77184948
tag name: uipangesturerecognizer
type: Tag

http://stackoverflow.com/comment/136151894
comment on: http://stackoverflow.com/a/77230026
type: AnswerComment
type: Comment
has text: How do you migrate nil values?
score: 0

http://stackoverflow.com/comment/136151814
score: 0
comment on: http://stackoverflow.com/q/77199867
type: QuestionComment
has text: @Willeke, i have shared the code in question please refer that. I have created webView in storyboard.
type: Comment

http://stackoverflow.com/comment/135898544
type: Comment
has text: The documentation of `NSF2FunctionKey` is "Constants for reserved keyboard function keys that correspond to unicode characters.". What is the value of `[theEvent characters]`?
score: 0
comment on: http://stackoverflow.com/q/77088641
type: QuestionComment

macros
type: Tag
tags question: http://stackoverflow.com/q/77104493
tag name: macros
tags question: http://stackoverflow.com/q/78167503

method-swizzling
tags question: http://stackoverflow.com/q/77097789
type: Tag
tag name: method-swizzling
tags question: http://stackoverflow.com/q/78422435

http://stackoverflow.com/a/77375359
type: Answer
has body: I suspect there is another implementation of a method named -imageWithShadow: somewhere (a private TelephonyUI framework from the looks of it), and it takes an object argument instead of an int (maybe an NSShadow argument). And you are calling that method, not the one you think you are, and that method attempts to retain the object argument, but you are passing an int value of 8, so it dereferences 0x8 as a pointer to retain the argument, and crashes. Change your imageWithShadow: method name to something more project-specific, maybe with a myapp_ prefix (always a good idea when adding category methods to standard Apple classes). It's possible that TelephonyUI changed their method name in iOS17, or that your method "wins" there and TelephonyUI would crash it ever was needed.
answers question: http://stackoverflow.com/q/77370266
score: 0
accepted answer of: http://stackoverflow.com/q/77370266
type: AcceptedAnswer

http://stackoverflow.com/a/77334582
type: Answer
has comment: http://stackoverflow.com/comment/136337545
downvote count: 0
has comment: http://stackoverflow.com/comment/136337559
upvote count: 4
has comment: http://stackoverflow.com/comment/136337534
has body: When decompiling code from arm64, how can one know if an unconditional branch instruction b is a branch to a label in the same function and not to some other function? You can't really know. You can at best make an educated guess. In my experience, even state-of-the-art decompilers are quite bad at that. The good ones allow the user to manually override such detection. The core problem is that there is no concept of a "function" at the assembly level. Labels that are exported to higher-level languages like C are expected to conform to a certain ABI, but for anything else, all bets are off. And even with exported things, if you're up against a malicious author (consider: malware), then they may choose to break this contract as well, in order to obscure how the binary works. But even with non-malicious binaries, if someone uses -O3 -flto -moutline that Apple supports for arm64 targets, you'll be in a world of hurt. Some heuristics that you can use though: Has x30 been saved somewhere? Usually this will happen by an stp x29, x30, [sp, ...] instruction, and go along with decreasing sp. If this is the case, then with b you're likely looking at a branch within the same function. If this is not the case, then you don't know whether this is a tail call or a jump within the same function. Assumption: x30 is used as link register. An obfuscator could use something else, e.g. by means of adr x17, ...; b _func for the function call, and then x17 would be the link register. This could also be randomised per-function. Are there any functions in between the current address and the jump target? Maybe your binary has symbols, maybe LC_FUNCTION_STARTS, maybe your decompilation has already identified function units, etc. Assumptions: functions have all their basic blocks next to each other, and aren't fragmented and spread out. Usually this is the case, but again, this assumption could be broken as part of an obfuscation technique. Is the jump target jumped to from any other function?…
accepted answer of: http://stackoverflow.com/q/77334043
has comment: http://stackoverflow.com/comment/136337556
answers question: http://stackoverflow.com/q/77334043
score: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/136341935
has comment: http://stackoverflow.com/comment/136341953

http://stackoverflow.com/a/77411968
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/136483750
downvote count: 0
has comment: http://stackoverflow.com/comment/136482516
score: 1
answers question: http://stackoverflow.com/q/77411527
has body: Is the Objective-C equivalent of a Swift opaque type just id? No. id is equivalent to AnyObject. There is no equivalent to Swift opaque types in ObjC. You could squint really hard and say that both some ThisProtocol and any ThisProtocol are equivalent to id <ThisProtocol>, but they're not. They're fundamentally different (for example, they have different memory layouts in a way that deeply matters), but they have some vague similarities in how they're used. What's the equivalent of a boxed type? I assume you mean an existential type here (such as any SomeProtocol). There is no equivalent. In ObjC, everything (except primitives...) is an object. Even classes are objects. Objects can be passed messages. Protocols define a set of methods that can be passed to an object. That's pretty much the entirety of Objective-C. Even things like "lightweight generics" aren't really part of the ObjC language so much as compiler hints that help bridging to Swift. ObjC "properties" are mostly syntactic sugar to create ivars and methods. It's a really simple language. Many things in Swift have no equivalent in ObjC. But something like id <ThisProtocol> would again be the closest kind of equivalency. It's really more like AnyObject & ThisProtocol than a "boxed type" in Swift. That would be a weird thing to write in Swift and possibly isn't even legal, but is what id <ThisProtocol> is closest to. There is a "boxed type" in ObjC, but I doubt it's what you mean. It's NSValue, and it's used to box up primitive types into an object. In technical ways it works exactly like any types in Swift. But in how it's used, it's conversely nothing like an any type. The languages are just very different.

http://stackoverflow.com/q/77323221
score: 2
tagged with: rpsystembroadcastpickerview
downvote count: 0
tagged with: ios17
answer count: 0
upvote count: 2
has body: My existing code is working properly in iOS < 17 devices it records the iPhone screen and records audio as well simultaneously, but in iOS 17 devices the screen recording video is captured for only 2 seconds and then stops automatically, As its an extension, i don't have logs to debug the issue. I have tested the same code in other iPhones and OS less than 17, its working fine but in iOS 17 devices this issue is coming. @try { NSLog(@“initAssesWriter”); NSError *error = nil; CGRect screenRect = [[UIScreen mainScreen] bounds]; _videoWriter = [[AVAssetWriter alloc] initWithURL: _filePath fileType:AVFileTypeMPEG4 error:&error]; NSParameterAssert(_videoWriter); //Configure video NSDictionary* videoCompressionProps = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithDouble:2048*1024.0], AVVideoAverageBitRateKey, nil ]; NSDictionary* videoSettings = [NSDictionary dictionaryWithObjectsAndKeys: AVVideoCodecTypeH264, AVVideoCodecKey, [NSNumber numberWithInt:screenRect.size.width * 4], AVVideoWidthKey, [NSNumber numberWithInt:screenRect.size.height * 4], AVVideoHeightKey, videoCompressionProps, AVVideoCompressionPropertiesKey, nil]; _writerInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:videoSettings] ; _writerInput.expectsMediaDataInRealTime = YES; NSParameterAssert(_writerInput); NSParameterAssert([_videoWriter canAddInput:_writerInput]); [_videoWriter addInput:_writerInput]; AudioChannelLayout acl; bzero( &acl, sizeof(acl)); acl.mChannelLayoutTag = kAudioChannelLayoutTag_Mono; NSDictionary* audioOutputSettings = [NSDictionary dictionaryWithObjectsAndKeys: [ NSNumber numberWithInt: kAudioFormatMPEG4AAC], AVFormatIDKey, [ NSNumber numberWithInt: 1 ], AVNumberOfChannelsKey, [ NSNumber numberWithFloat: 44100.0 ], AVSampleRateKey, [ NSData dataWithBytes: &acl length: sizeof( AudioChannelLayout ) ], AVChannelLayoutKey, [ NSNumber numberWithInt: 64000 ], AVEncoderBitRateKey, nil]; _audioWriterInput = [AVAssetWriterInput asse…
type: Question
tagged with: objective-c
type: UnansweredQuestion
has title: iOS 17 RPSystemBroadcastPickerView not working
favorite count: 0

http://stackoverflow.com/comment/136482516
comment on: http://stackoverflow.com/a/77411968
has text: I originally typed id<protocol> but the editor only displayed id. Not sure why.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/a/77477657
score: 0
type: Answer
has body: The only thing you can really do would be to swizzle the method (and I can't be 100% certain that you won't run into class cluster weirdness that might prevent doing that). At a high level, you'd do something like this: Create a method implementation (IMP) using imp_implementationWithBlock. IIRC, its parameters should be: The object that is being operated on The method parameters in order Look up the method with class_getInstanceMethod. Replace the implementation of that method using method_setImplementation. Store the result of that method (the previous IMP) in a static global variable. Cast the IMP to a function pointer. IIRC, the arguments the function pointer should be: The object that is being operated on The selector for the method (@selector(defaultSessionConfiguration)) The method parameters in order Call that function pointer from the custom implementation block, then modify the results before returning them. Be sure to do all of this in a dispatch_once block, e.g. - (void)load { static dispatch_once_t once; static id sharedInstance; dispatch_once(&amp;once, ^{ // Code goes here... }); } to ensure that you cannot do this more than once. Note, however, that this is fairly risky to do in a production app. It is better, whenever possible, to ask the framework developer to provide hooks for passing in a session of your own creation (or a configuration of your own creation). Documentation links: https://developer.apple.com/documentation/objectivec/1418587-imp_implementationwithblock?language=objc https://petersteinberger.com/blog/2014/a-story-about-swizzling-the-right-way-and-touch-forwarding/
answers question: http://stackoverflow.com/q/77330943

http://stackoverflow.com/q/77383224
has comment: http://stackoverflow.com/comment/136421415
tagged with: objective-c
tagged with: enums
type: Question
upvote count: 1
tagged with: swift
downvote count: 0
has body: I am new to swift and I am trying to solve the following problem. I have a framework, that I use in my application. The framework has multiple enums defined in Objective-C like this: typedef NS_ENUM(NSUInteger, AdvertType) { AdvertTypeLoading, AdvertTypeFinished ... }; I have a variable eventState with a string like "finished" and need to get the correct ENUM reference automatically. For this I have tried the following code, but I keep getting an error, that AdvertType has no member allCases. for type in AdvertType.allCases { if type.state.caseInsensitiveCompare(eventState) == .orderedSame { return type; } } Why does my ENUM not have allCases and is there any other way, how I can translate my string into the actual enum value, that I can used in a AdvertType typed method? Is there maybe an easier way like? let eventState = 'loading'; let enumState = AdvertType[eventState]; // should return AdvertType.loading
answer count: 1
has answer: http://stackoverflow.com/a/77383300
type: UnansweredQuestion
score: 1
favorite count: 0
has title: Get Objective-C enum value in swift

http://stackoverflow.com/comment/136398624
has text: I have posted that method now - appreciate it's old code, but strange how it crashes with iOS 16, and not 17?!
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77370266
type: Comment

http://stackoverflow.com/comment/136202824
has text: Migrate to the SPM version of the library
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77256529
type: Comment

http://stackoverflow.com/comment/136484924
has text: It makes no sense to add a `UIAlertController` as a child. Just present it normally. That's how it is designed to be used.
comment on: http://stackoverflow.com/q/77417519
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/77288680
score: 1
type: Answer
upvote count: 1
has body: Not sure what might have changed, or when... and, maybe you were "getting lucky" with your layouts so you didn't notice it... but... We want to set the .preferredContentSize based on the size of the controller's view - not your popupView subview. Also, we want to make sure the content is constrained to the safe-area. So, if I setup a MenuUnavailableViewController like this: With "Unavailable" and "Reason:" labels Content Hugging and Compression Resistance Priorities all set to Required ... Unavailable Lbl label will determine the Width "Reason Lbl` label will determine the Height In the calling controller, set string properties for the labels. Then, MenuUnavailableViewController class looks like this: @implementation MenuUnavailableViewController - (void)viewDidLoad { [super viewDidLoad]; self.unavailableLbl.text = _unavailableString; self.reasonLbl.text = _reasonString; self.preferredContentSize = [self.view systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]; } @end No need to do anything in viewWillAppear. Here's how it looks (cycling through 3 sets of strings): and if we clear the colors and border: and, just to show it works for different "arrow" directions:
downvote count: 0
answers question: http://stackoverflow.com/q/77284768

http://stackoverflow.com/q/77270424
has comment: http://stackoverflow.com/comment/136222998
has comment: http://stackoverflow.com/comment/136224320
tagged with: objective-c
tagged with: frameworks
type: Question
tagged with: swift
upvote count: 1
type: UnansweredQuestion
answer count: 0
favorite count: 0
tagged with: cocoapods
downvote count: 1
has body: I saw many tutorials by the developers which are not proved to be very helpful for me to in this area. Some of them are old a few are now like year old but when I follow them them the same thing is not happening on my end, Please help me regarding this situation. I successfully make the framework and it was successfully invoke by my app and works fine but when I install pod files it build without error in the framework and when I tried to run it in the app it shows error and build is failing. Pods like Alamofire and charts suppose the name of my framework is X , When I use "Import X" to import the frame in app and pods are install in it it shows Alamofire not found and Algorithm not found and sometime this Multiple commands produce '/Users/ground1/Library/Developer/Xcode/DerivedData/DemoFrameworkApp-brctkulvbepfgafuygquzhveljkr/Build/Products/Debug-iphonesimulator/DemoApp.app/CHANGELOG.md'
has comment: http://stackoverflow.com/comment/136225643
has title: How can I create a framework with pod dependencies in it?
tagged with: ios
score: 0

http://stackoverflow.com/comment/136468994
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77410043
type: Comment
has text: Did you request on a real device? According to Apple document, the ratings and review popup only show up maximum of 3 times a year.

http://stackoverflow.com/comment/136405363
type: Comment
comment on: http://stackoverflow.com/q/77370266
score: 0
type: QuestionComment
has text: As suggested, did you add `[super viewWillAppear:animated];` ? Did you check if some values are `nil` too?

http://stackoverflow.com/q/77297692
has title: Successfully using KVC with Swift Structs
linked to: http://stackoverflow.com/q/23216673
type: AnsweredQuestion
has body: I'm facing a very niche problem but hope someone can help me. I'm using KVC in my project to set values in a class. This class contains properties including some that are structs. I was able to make these structs @objc compatible using the _ObjectiveCBridgeable protocol (I know it's not ideal but that's the best method I found for this). Now when I try to use setValue(_:forKeyPath:) on the parent class to set a value for one of the properties in the struct, it doesn't work. After some debugging I understand that it's bridging the struct to its Objective-C equivalent class and setting the value on that Objective-C equivalent class, but it's not converting the Objective-C class back to the struct and updating the struct on the parent class. I think it should be possible as can be seen in https://stackoverflow.com/questions/23216673/how-can-i-animate-the-height-of-a-calayer-with-the-origin-coming-from-the-bottom#:~:text=Then%20for%20the%20animation%2C%20you%20simply%20animate%20the%20bounds%20(or%20even%20better%2C%20you%20can%20animate%20%22bounds.size.height%22%2C%20since%20only%20the%20height%20is%20changing)%3A where it is stated that you can animate you can animate bounds.size.height using its keyPath in a CABasicAnimation Here's my code (which can run in a Swift playground): @available(iOS 2.0, *) @objc public class TestClass: NSObject { @objc public var x: Int @objc public var y: Int @objc public var testStruct = TestStruct(z: 0) init(x:Int, y: Int) { self.x = x self.y = y } } @available(iOS 2.0, *) public struct TestStruct: _ObjectiveCBridgeable { public typealias _ObjectiveCType = NSTestStruct public var z: Int public init(z: Int) { self.z = z } public func _bridgeToObjectiveC() -> NSTestStruct { return NSTestStruct(z: z) } public static func _forceBridgeFromObjectiveC(_ source: NSTestStruct, result: inout TestStruct?) { result = TestStruct(z: source.z) } public static func _unconditionallyBridgeFromObjectiveC(_ source: NSTestStruct?) -> TestStruct { return Te…
has comment: http://stackoverflow.com/comment/136271808
score: 1
has comment: http://stackoverflow.com/comment/136271237
has comment: http://stackoverflow.com/comment/136271625
has answer: http://stackoverflow.com/a/77298446
linked to: http://stackoverflow.com/q/48964282
tagged with: objective-c
tagged with: struct
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/136271345
upvote count: 1
downvote count: 0
tagged with: kvc
answer count: 1
has comment: http://stackoverflow.com/comment/136271143
linked to: http://stackoverflow.com/q/52635302
favorite count: 0
accepted answer: http://stackoverflow.com/a/77298446

http://stackoverflow.com/comment/136168673
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77239112
type: Comment
has text: i'm making it 2 points tall. it's not too noticeable but you can tell

google-maps-sdk-ios
type: Tag
tags question: http://stackoverflow.com/q/77256529
tag name: google-maps-sdk-ios
tags question: http://stackoverflow.com/q/77686138
tags question: http://stackoverflow.com/q/78186819

uivisualeffectview
type: Tag
tag name: uivisualeffectview
tags question: http://stackoverflow.com/q/77239112

http://stackoverflow.com/a/77279766
has body: I have successfully resolved the issue! Although I couldn't initially pinpoint the exact problem, it turned out that the overridden function "setDataSource" in my code was making a call to an "init" function, which belonged to a different interface. This unexpected call to the "init" function was preventing the execution of "writeItems:toPasteBoard." The solution was to remove the call to the "init" function, and now everything works as expected.
answers question: http://stackoverflow.com/q/77256493
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/77256493
score: 0

http://stackoverflow.com/q/77351837
answer count: 1
type: UnansweredQuestion
score: 0
tagged with: ios12
tagged with: ios
has comment: http://stackoverflow.com/comment/136366568
has title: Crash on start on iOS 12
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136365920
tagged with: xcode
has body: Since compiling our app for iOS 17, Devices running iOS 12 crash on start. The debugger doesn't even call didFinishLaunchingWithOptions before the crash. Seems to point to ImageLoaderMachO:: error Did I miss a memo on something new we have to do now when supporting images for iOS 12 and below?
has answer: http://stackoverflow.com/a/77352296
type: Question

http://stackoverflow.com/comment/136487090
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77417519
has text: could you share AlertHelper?
type: QuestionComment

http://stackoverflow.com/a/77321474
has body: You do not need to reference the symbol. Use hardcoded value DAMediaEncrypted within the macro block and see if it helps. (lldb) po kDADiskDescriptionMediaEncryptionDetailKey DAMediaEncryptionDetail (lldb) po kDADiskDescriptionMediaEncryptedKey DAMediaEncrypted
answers question: http://stackoverflow.com/q/77319718
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/136313644

http://stackoverflow.com/q/77411527
favorite count: 0
has answer: http://stackoverflow.com/a/77411968
has body: Is the Objective-C equivalent of a Swift opaque type just id&lt;protocol&gt;? What's the equivalent of a boxed type?
type: Question
upvote count: 1
tagged with: swift
downvote count: 0
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/136471756
has comment: http://stackoverflow.com/comment/136480552
answer count: 1
tagged with: objective-c
has title: Objective-C equivalents of Swift opaque object and boxed type?

http://stackoverflow.com/comment/136469183
has text: It mentioned: When your app calls this method while it’s in development mode, StoreKit always displays the rating and review request view, so you can test the user interface and experience.
comment on: http://stackoverflow.com/q/77410043
type: QuestionComment
type: Comment
score: 0

audiokit
tag name: audiokit
type: Tag
tags question: http://stackoverflow.com/q/77259548

storekit
tags question: http://stackoverflow.com/q/77410043
tag name: storekit
type: Tag
tags question: http://stackoverflow.com/q/78664431
tags question: http://stackoverflow.com/q/78867719

http://stackoverflow.com/comment/136843040
has text: Having exactly the same issue in Xcode 15.0.1 on macOS 13.6.1. When running my MacOS app in debug from Xcode the review prompt never shows. Tried @Environmen(.\requestReview) and SKStoreReviewController.requestReview(). Again, developing and testing on real Mac. Both debug builds from Xcode and development test from archive. According to the documentation, in development / debug builds it should always present the rating prompt. Making development around this very difficult.
type: Comment
comment on: http://stackoverflow.com/q/77410043
score: 1
type: QuestionComment

http://stackoverflow.com/comment/136419518
type: QuestionComment
comment on: http://stackoverflow.com/q/77381636
type: Comment
has text: On the Xcode menu select View -> Inspectors -> File. Then select the m4v file. Look at the "Target Membership" section of the file inspector and make sure the checkbox for your target is checked.
score: 0

http://stackoverflow.com/comment/136312974
comment on: http://stackoverflow.com/q/77319718
type: Comment
has text: Is it crashing on app launch or at certain point?
score: 0
type: QuestionComment

http://stackoverflow.com/a/77499628
score: 0
type: Answer
has body: I fixed it by modifying the project settings. In the target -> build settings of .xcodeproj file of the project, I made the following changes: add $(inherited) in framework search paths add $(inherited) in header search paths add ${PODS_ROOT} and ${PODS_ROOT}/BuildHeaders in user header search paths In the build settings of Pods.xcodeproj I had to set "Build Active Architecture Only" to "No".
answers question: http://stackoverflow.com/q/77272011

struct
tag name: struct
type: Tag
tags question: http://stackoverflow.com/q/77297692
tags question: http://stackoverflow.com/q/77589293
tags question: http://stackoverflow.com/q/77670057
tags question: http://stackoverflow.com/q/77789337

http://stackoverflow.com/a/77298446
answers question: http://stackoverflow.com/q/77297692
score: 1
accepted answer of: http://stackoverflow.com/q/77297692
downvote count: 0
has body: As Martin R mentioned, CABasicAnimation has a custom setValue(_:forKeyPath:) which allows you to set nested properties. I coded a custom setValue(_:forKeyPath:) which does the same thing for a general keyPath containing structs who's types are directly convertible to Objective-C (same property names and types). Here's my solution: public extension NSObject { func setValueRecursively(_ value: Any?, forKeyPath keyPath: String) { var currentKeyPath = keyPath var currentValue: Any? = value while true { guard let lastPeriodIndex = currentKeyPath.lastIndex(of: ".") else { self.setValue(currentValue, forKey: currentKeyPath) return } let parentKeyPath = String(currentKeyPath[currentKeyPath.startIndex ..< lastPeriodIndex]) guard let parentValue = self.value(forKeyPath: parentKeyPath) as? NSObject else { return } parentValue.setValue(currentValue, forKey: String(currentKeyPath.suffix(currentKeyPath.count-parentKeyPath.count-1))) currentValue = parentValue currentKeyPath = parentKeyPath } } } With the same code as the Question, testClass.setValueRecursively(12, forKeyPath: "testStruct.z") works as expected :) Note: This will not work with CGSize, CGRect, and all other properties that are represented as NSValue
type: AcceptedAnswer
type: Answer
upvote count: 1

http://stackoverflow.com/comment/136316582
score: 0
has text: BTW, IMO, The bot shouldn't have closed this question, I didn't mean to close it on my own.
type: Comment
comment on: http://stackoverflow.com/q/77322281
type: QuestionComment

http://stackoverflow.com/q/77334043
downvote count: 0
tagged with: decompiling
has title: Decompiling ARM64 and understanding branch targets bounderies
score: 1
has answer: http://stackoverflow.com/a/77334582
tagged with: arm64
type: Question
upvote count: 1
has body: When decompiling code from arm64, how can one know if an unconditional branch instruction b is a branch to a label in the same function and not to some other function? How do state of the art decompilers recognize if a branch target is still in the function or is it a new function? Do they rely on the branch target's value and see if it lands on a different section in the TEXT segment? What about branch targets that are in the same sections but are still considered new functions? Is there a rule of thumb for ARM64 saying that if a branch target is too far by some threshold from the current address it's considered a new boundary thus a new function? Like in x86 where you have different encodings for far jump and short jump, where short jump may be considered a label in a function and far jump probably not. I might add that my target binaries I'm inspecting right now are Machos written in Objective-C, and I try to validate my findings using Ghidra, so it might be using some more heuristics like seeing if a jump target is in the __stubs section or the __objc_stubs section, or even analyzing block structures to identify more procedures (Although from Ghidra decompilation the last point seems like it doesn't identify these structures)?
answer count: 1
tagged with: objective-c
favorite count: 0
tagged with: mach-o
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/77334582

http://stackoverflow.com/comment/136308736
type: Comment
has text: @Jorayen Happy to have helped! I'd meant to comment and say thanks for adding detail to your question, because it prompted me to go digging in the runtime to see what was going on. I feel like I've learned some valuable stuff!
comment on: http://stackoverflow.com/a/77318630
score: 1
type: AnswerComment

http://stackoverflow.com/q/77239112
score: 0
has title: UIVisualEffectView glitches
has body: I'm trying to create a super thin UIVisualEffectView (2 pixels tall) with a blur effect. I'm attaching it to the bottom of a collection view cell. The issue on scrolling the effect view flickers between a black color and the blur (sometimes it will remain black when I stop scrolling). When I increase the height to 3 pixels, it behaves normally. Is there a limitation on how small I can make a UIVisualEffectView before it behaves unpredictably? If so, is there a workaround?
tagged with: uiblureffect
has answer: http://stackoverflow.com/a/77250198
type: Question
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136183047
tagged with: uiscrollview
has comment: http://stackoverflow.com/comment/136187035
tagged with: ios
has comment: http://stackoverflow.com/comment/136168673
tagged with: objective-c
tagged with: uivisualeffectview
has comment: http://stackoverflow.com/comment/136168110
has comment: http://stackoverflow.com/comment/136168802

http://stackoverflow.com/q/77322281
score: 0
answer count: 0
tagged with: variadic-functions
has comment: http://stackoverflow.com/comment/136347055
has comment: http://stackoverflow.com/comment/136315505
linked to: http://stackoverflow.com/q/4305160
duplicate of: http://stackoverflow.com/q/4305160
type: Question
has comment: http://stackoverflow.com/comment/136316582
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136317014
type: UnansweredQuestion
has title: How to hande premature nils in variadic objective-c functions?
has body: Say I have the following, very contrived, set up: @interface SomeClass : NSObject + (void) doSomethingToVariableArguments:(SomeClass*) someObject, ... NS_REQUIRES_NIL_TERMINATION; - (void) doSomething; @end @implementation SomeClass + (void) doSomethingToVariableArguments:(SomeClass*) someObject, ... NS_REQUIRES_NIL_TERMINATION { [someObject doSomething]; va_list args; va_start(args, someObject); SomeClass* next; while ((next = va_arg(args, SomeClass*))) { [next doSomething]; } va_end(args); return; } - (void) doSomething { // do something return; } Now we assume that somewhere, there is a call [SomeClass doSomethingToVariableArguments:obj1, obj2, obj3, nil];. What happens if, for some reason, obj2 is nil? Well, - doSomething is only called for obj1, since we encounter a nil and assume the argument-list has terminated. obj3 is completely ignored, and e.g. fails to update. Is there any way, besides checking if the arguments are nil, to catch this and maybe issue a warning, or even raise an error?

react-native-native-module
tags question: http://stackoverflow.com/q/77281077
type: Tag
tag name: react-native-native-module

rpsystembroadcastpickerview
tag name: rpsystembroadcastpickerview
type: Tag
tags question: http://stackoverflow.com/q/77323221

http://stackoverflow.com/comment/136398577
score: 0
has text: Apologies, the code was wrong - I have corrected it and edited original question to better suit the stack trace error.
comment on: http://stackoverflow.com/q/77370266
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136435497
comment on: http://stackoverflow.com/q/77391385
score: 1
type: QuestionComment
has text: Use `NSURLComponents` to build the URLs instead of using`stringByAddingPercentEncodingWithAllowedCharacters`.
type: Comment

http://stackoverflow.com/q/77319718
has comment: http://stackoverflow.com/comment/136313731
tagged with: objective-c
has body: There is exactly one occurrence of symbol kDADiskDescriptionMediaEncryptedKey in my Objective-C project. It is surrounded by an @available block: if (@available(macOS 10.14.4, *)) { CFStringRef x = kDADiskDescriptionMediaEncryptedKey; } Yet the program crashes on macOS 10.13: Date/Time: 2023-10-18 19:37:34.273 +0200 OS Version: Mac OS X 10.13.6 (17G65) Report Version: 12 Anonymous UUID: C780E8BB-9F5C-A7EC-2846-AD51F8D2912C Time Awake Since Boot: 2700 seconds System Integrity Protection: enabled Crashed Thread: 0 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: DYLD, [0x4] Symbol missing Application Specific Information: dyld: launch, loading dependent libraries Dyld Error Message: Symbol not found: _kDADiskDescriptionMediaEncryptedKey Referenced from: /Users/USER/Desktop/AvailableCrash.app/Contents/MacOS/AvailableCrash Expected in: /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration in /Users/USER/Desktop/AvailableCrash.app/Contents/MacOS/AvailableCrash I'm running Xcode 15.0 (15A240d) on macOS 13.6 (22G120). The program runs as expected on this development machine. What am I doing wrong?
has comment: http://stackoverflow.com/comment/136527368
tagged with: cocoa
possible better answer: http://stackoverflow.com/a/77321474
upvote count: 1
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/77321474
type: Question
has comment: http://stackoverflow.com/comment/136320330
accepted answer: http://stackoverflow.com/a/77326173
has title: App crashes on macOS 10.13 with "DYLD, [0x4] Symbol missing" despite symbol being wrapped in @available(macOS 10.14.4, *)
tagged with: macos
has comment: http://stackoverflow.com/comment/136316502
answer count: 2
has comment: http://stackoverflow.com/comment/136312974
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/77326173

http://stackoverflow.com/a/77423150
has body: UIAlertController is a specialized controller that makes use of UIAlertAction. Worth noting from Apple's docs: Important The UIAlertController class is intended to be used as-is and doesn’t support subclassing. The view hierarchy for this class is private and must not be modified. While you may not be subclassing it (you didn't provide your AlertHelper code), you're clearly not using it "as-is." Instead, you probably want to design your own "simulated" alert controller. Here's a quick example... AlertHelper.h #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface AlertHelper : NSObject + (UIAlertController *)createAlertWithTitle:(NSString *)title message:(NSString *)message cancelButton:(NSString *)cancel continueButtonText:(NSString *)ok continueAction:(UIAction *)continueAction cancelAction:(UIAction *)cancelAction; @end NS_ASSUME_NONNULL_END AlertHelper.m #import "AlertHelper.h" @implementation AlertHelper + (UIViewController *)createAlertWithTitle:(NSString *)title message:(NSString *)message cancelButton:(NSString *)cancel continueButtonText:(NSString *)ok continueAction:(UIAction *)continueAction cancelAction:(UIAction *)cancelAction; { UIViewController *vc = [UIViewController new]; vc.view.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.25]; UIView *bkg = [UIView new]; bkg.clipsToBounds = YES; bkg.backgroundColor = [UIColor systemBackgroundColor]; bkg.layer.cornerRadius = 12.0; UILabel *titleLabel = [UILabel new]; titleLabel.font = [UIFont systemFontOfSize:17.0 weight:UIFontWeightSemibold]; titleLabel.numberOfLines = 0; titleLabel.textAlignment = NSTextAlignmentCenter; titleLabel.text = title; UILabel *msgLabel = [UILabel new]; msgLabel.font = [UIFont systemFontOfSize:13.0 weight:UIFontWeightRegular]; msgLabel.numberOfLines = 0; msgLabel.textAlignment = NSTextAlignmentCenter; msgLabel.text = message; UIButton *cancelButton = [UIButton systemButtonWithPrimaryAction:cancelAction]; UIButton *okButton = [UIButton systemButtonWithPrimaryAction:continueAc…
downvote count: 0
answers question: http://stackoverflow.com/q/77417519
score: 1
type: Answer
upvote count: 1

http://stackoverflow.com/q/77281077
has body: I have a project on React Native that has a bunch of Native Modules and UI Components. The code is mostly written on Swift but it also has Objective-C code for exporting my swift's native classes and methods to React Native because Swift doesn't support C macros, e.g.: // Calendar.m #import &lt;React/RCTBridgeModule.h&gt; @interface RCT_EXTERN_MODULE(Calendar, NSObject) RCT_EXTERN_METHOD(createEvent:(NSString *)title location:(NSString* )location) @end // Calendar.swift @objc(Calendar) class Calendar: NSObject { @objc func createEvent(_ title: String, location: String) { print(title, location) } } It's inconvenient to manage both Objective-C and Swift method interfaces each time of any modification so is there any approach to eliminate Objective-C code?
tagged with: react-native-native-module
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/77281078
upvote count: 2
tagged with: react-native-ui-components
answer count: 2
tagged with: objective-c
has answer: http://stackoverflow.com/a/77281537
tagged with: react-native
has title: How to create React Native Module in pure Swift
possible better answer: http://stackoverflow.com/a/77281537
favorite count: 0
has answer: http://stackoverflow.com/a/77281078
score: 2
type: Question
tagged with: swift
downvote count: 0

uiscrollview
type: Tag
tag name: uiscrollview
tags question: http://stackoverflow.com/q/77239112

http://stackoverflow.com/q/77330943
has answer: http://stackoverflow.com/a/77477657
score: 0
has comment: http://stackoverflow.com/comment/136332219
type: Question
has body: I have an ios app. I want to modify defaultSessionConfiguration so that every time later in the code when I call [NSURLSessionConfiguration defaultSessionConfiguration] I will get my modified defaultSessionConfiguration I tried something like this but it didn't work NSURLSessionConfiguration *configuration = NSURLSessionConfiguration.defaultSessionConfiguration; // Set the proxy configuration options in the connectionProxyDictionary property NSDictionary *proxyDict = @{ @"HTTPSEnable": [NSNumber numberWithInt:1], @"HTTPSProxy": @"localhost", @"HTTPSPort": [NSNumber numberWithInt:1234] }; configuration.connectionProxyDictionary = proxyDict; This one gives me a configuration with an empty connectionProxyDictionary NSURLSessionConfiguration *configuration2 = [NSURLSessionConfiguration defaultSessionConfiguration]; There is a lib in my app that makes requests to some host. I know that this lib uses NSURLSessionConfiguration defaultSessionConfiguration. I want to modify the "global" defaultSessionConfiguration so that the lib would start sending requests through my proxy.
answer count: 1
type: UnansweredQuestion
tagged with: ios
tagged with: proxy
has title: Is it possible to change defaultSessionConfiguration of NSURLSessionConfiguration?
tagged with: nsurlsession
tagged with: objective-c

http://stackoverflow.com/comment/136210890
comment on: http://stackoverflow.com/q/77256493
type: Comment
score: 0
type: QuestionComment
has text: Post a [mre] please.

http://stackoverflow.com/comment/136313731
type: QuestionComment
comment on: http://stackoverflow.com/q/77319718
type: Comment
has text: It crashes on startup while loading the symbols. main() is never reached.
score: 0

http://stackoverflow.com/a/77352296
has body: Thanks to Larme's comment and link. The issue appears to be with linking. Adding -Wl,-ld_classic in OTHER_LDFLAGS in the target Build Settings is the fix.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/77351837

http://stackoverflow.com/comment/136399070
type: Comment
has text: If you remove the `:(BOOL)animated` part then you have invented your own method called `viewWillAppear` that is never called (compared to the standard `viewWillAppear:` method of `UIViewController`).
score: 1
comment on: http://stackoverflow.com/q/77370266
type: QuestionComment

http://stackoverflow.com/q/77364438
favorite count: 0
has body: I have one View in react native, Now to I want to pass that View into native iOS, but I don’t know is it possible or not And if possible how to implement that I have Implemented some code, Here I shared the code ViewController.h code // ViewController.h #import <React/RCTViewManager.h> @interface CustomComponentManager : RCTViewManager @end ViewController.m code // ViewController.m #import "ViewController.h" #import <React/RCTRootView.h> @interface CustomViewController () - (void)addReactNativeComponent:(NSString *)componentName; @end @implementation CustomViewController RCT_EXPORT_MODULE(CustomComponent) - (UIView *)view { // Return a custom UIView to host the React Native component return [[UIView alloc] init]; } - (void)addReactNativeComponent:(NSString *)componentName{ // Initialize the React Native bridge RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil]; // Create a React Native component using the componentName RCTRootView *reactNativeView = [[RCTRootView alloc] initWithBridge:bridge moduleName:componentName initialProperties:nil]; // Add the React Native component to your custom UIView [self.view addSubview:reactNativeView]; } @end App.tsx code //App.tsx import React, {useEffect, useRef, useState} from 'react'; import type {PropsWithChildren} from 'react'; import { LogBox, SafeAreaView, StyleSheet, Text, View, NativeModules, AppState, requireNativeComponent, } from 'react-native'; LogBox.ignoreLogs(['new NativeEventEmitter']); // Ignore log notification by message LogBox.ignoreAllLogs(); const CustomComponent = requireNativeComponent('CustomComponent'); const App = () => { console.log(NativeModules, 'native>>>>>>>>>>>>>>>>.'); const {ViewController} = NativeModules; console.log('ViewController>>>>>>>>>>>>.', ViewController); const appState = useRef(AppState.currentState); const [appStateVisible, setAppStateVisible] = useState(appState.current); useEffect(() => { console.log('App state>>>>>>', appStateVisible); NativeModules.Cust…
has title: How to Pass React native components(like View,Button,Text) to native iOS(Objective-c)
tagged with: react-native-component
type: UnansweredQuestion
score: 1
tagged with: ios
linked to: http://stackoverflow.com/q/34149169
tagged with: objective-c
tagged with: react-native
type: Question
upvote count: 1
downvote count: 0
answer count: 0

http://stackoverflow.com/q/77259548
type: UnansweredQuestion
score: 1
favorite count: 0
has body: Hello everyone I am new in Swift and really need any help. I am working on the music application therefore is crucial to reduce as much as possible a delay between a tap on a button and playing of sound. that is why I try to integrate my React-Native app with AudioKit using Native-Modules. I used following example: AudioKit Drums Here is my swift code: import AudioKit import AudioKitEX import AudioKitUI import AVFoundation import Combine import SwiftUI struct DrumSample { var name: String var fileName: String var midiNote: Int var audioFile: AVAudioFile? var color = UIColor.red init(_ prettyName: String, file: String, note: Int) { name = prettyName fileName = file midiNote = note guard let url = Bundle.main.url( forResource: "closed_hi_hat_F#1", withExtension: "wav" ) else { return } do { print("URL", url) audioFile = try AVAudioFile(forReading: url) } catch { Log("Could not load: \(fileName)") } } } @objc(DrumsConductor) class DrumsConductor: NSObject, ObservableObject, HasAudioEngine { // Mark Published so View updates label on changes @Published private(set) var lastPlayed: String = "None" let engine = AudioEngine() let drumSamples: [DrumSample] = [ DrumSample("HI HAT", file: "closed_hi_hat_F#1.wav", note: 30), ] let drums = AppleSampler() @objc func playPad() { drums.play(noteNumber: MIDINoteNumber(drumSamples[0].midiNote)) let fileName = drumSamples[0].fileName print("fileName:", fileName) lastPlayed = fileName.components(separatedBy: "/").last! } override init() { engine.output = drums do { let files = drumSamples.map { $0.audioFile! } try drums.loadAudioFiles(files) } catch { Log("Files Didn't Load") } } } here is my Objective-C bridge: @interface RCT_EXTERN_MODULE(DrumsConductor, NSObject) RCT_EXTERN_METHOD(playPad) @end but when I call my DrumsConductor.playPad() from my JS code I don't hear any sound File closed_hi_hat_F#1.wav is added to Resources folder. I have tried to use library react-native-sound but it gives a significant delay between tap and playi…
answer count: 0
tagged with: objective-c
has title: React native doesn't play sound using Audiokit
tagged with: audiokit
tagged with: react-native
upvote count: 1
type: Question
tagged with: swift
downvote count: 0

http://stackoverflow.com/q/77256493
type: AnsweredQuestion
has title: The methods for Drag and Drop in NSOutlineView are not getting called
accepted answer: http://stackoverflow.com/a/77279766
has comment: http://stackoverflow.com/comment/136202971
tagged with: drag-and-drop
answer count: 1
has comment: http://stackoverflow.com/comment/136210890
has comment: http://stackoverflow.com/comment/136199080
has answer: http://stackoverflow.com/a/77279766
has comment: http://stackoverflow.com/comment/136198844
type: Question
tagged with: objective-c
tagged with: nsoutlineview
tagged with: cocoa
has comment: http://stackoverflow.com/comment/136210163
has body: I'm trying to enable drag and drop functionality for NSOutlineView in my MacOS app. I want to drag a child from a folder to another folder within the outline view. I want test asset 1 to be dragged and dropped in Group 2 I have myOutlineView and a controller which is a data source and a delegate of my outline view. In my outline view controller I have these three methods: -(BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pboard -(NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id < NSDraggingInfo >)info proposedItem:(id)item proposedChildIndex:(NSInteger)index -(BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id < NSDraggingInfo >)info item:(id)item childIndex:(NSInteger)index None of them is being called. My nib is setup properly, my outline view is getting filled and all of the functionality is working except the drag and drop feature. I have also registered the drag type in awake from nib: [_paraOutlineView registerForDraggedTypes:[NSArray arrayWithObject:@"QStyleSheetModel"]]; I also wrote this: [_paraOutlineView setDraggingSourceOperationMask:NSDragOperationMove forLocal:YES]; What could be the reason?
score: 0

http://stackoverflow.com/q/77417519
has comment: http://stackoverflow.com/comment/136485373
has comment: http://stackoverflow.com/comment/136482902
has comment: http://stackoverflow.com/comment/136487090
tagged with: view
has answer: http://stackoverflow.com/a/77423150
has comment: http://stackoverflow.com/comment/136487794
tagged with: viewcontroller
tagged with: ios
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/136484924
tagged with: objective-c
type: UnansweredQuestion
has body: So I have a UIAlertController which needs to be presented on top of another view controller, so a child view controller. I can get the child view controller to display on top of the parent no problem, but I can't get the alert buttons to respond when I bring this child view controller to the front. UIAlertController* alert = [AlertHelper createAlertWithTitle:title message:message cancelButton:nil continueButtonText:Ok continueAction:nil cancelAction:nil]; alert.view.translatesAutoresizingMaskIntoConstraints = false; [self addChildViewController:alert]; alert.view.frame = self.view.bounds; [self.view addSubview:alert.view]; [alert didMoveToParentViewController:self]; [alert.view.centerXAnchor constraintEqualToAnchor:self.view.centerXAnchor].active = YES; [alert.view.centerYAnchor constraintEqualToAnchor:self.view.centerYAnchor].active = YES;
has comment: http://stackoverflow.com/comment/136491685
has title: UIAlertController as child view controller not responding to tap
score: 0

http://stackoverflow.com/q/77391385
favorite count: 0
tagged with: ios17
has comment: http://stackoverflow.com/comment/136452903
has body: in iOS 17 NSURL parsing changed to use RFC 3986 from RFC 1738/1808 (https://developer.apple.com/documentation/foundation/nsurl/1572047-urlwithstring). Based on RFC 3986 guidance , the reserved character contains the gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" and sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" in which gen-delims are required to be encoded and sub-delims are optional based on applications . iOS 17 seems to only encode gen-delims but our application requires sub-delims to be encoded as well in our Macro expansion logic. This is not a problem before iOS 17 since we rely on our own encoding logic for Macro value [str stringByAddingPercentEncodingWithAllowedCharacters:[[NSCharacterSet characterSetWithCharactersInString:@" !*'\"();:@&=+$,/?%#[]^|{}\\`"] invertedSet]]; But somehow it's causing issues now that all percentage gets double encoded . For example the following url we want to expand the Macro [PARTNER] to abc/dev http://google.com/ad/1?asseturl=[ASSETURI]&partner=[PARTNER] //Macro expansion only for PARTNER because don't have value for ASSETURI http://google.com/ad/1?asseturl=[ASSETURI]&partner=abc/dev //encode the Macro value with above method http://google.com/ad/1?asseturl=[ASSETURI]&partner=abc%2Fdev //String to NSURL [NSURL URLWithString:url]; http://google.com/ad/1?asseturl=%5BASSETURI%5D&partner=abc%25%2Fdev You can see there's an additional %25 in the url because percentage got double encoded in IOS 17 , it doesn't exist before iOS 17. so why will NSURL encode the percentage (Although it seems like NSURL only do this when there's an invalid character)? Is this a bug because there doesn't seem to be a requirement from RFC 3986 to encode percentage
type: UnansweredQuestion
has title: iOS 17 NSURL percentage gets double encoded
has comment: http://stackoverflow.com/comment/136435497
tagged with: ios
has comment: http://stackoverflow.com/comment/136436393
upvote count: 2
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136435793
score: 2
has comment: http://stackoverflow.com/comment/136436459
type: Question
downvote count: 0
answer count: 1
tagged with: nsurl
has answer: http://stackoverflow.com/a/77392211

http://stackoverflow.com/q/77370266
has comment: http://stackoverflow.com/comment/136398696
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/136398520
has body: I have an app that allows you to take a photo using the device camera - once taken, it proceeds to the next screen, to edit - however, on iOS 16 devices, it crashes as soon as I press the 'Use photo' button from the camera view - it does not happen on iOS 17 devices for some reason, it works fine on them. I tried to debug with no success. #define IMAGE_FRAME_SIZE 5 #define FRAME_COLOR_R 1.0 #define FRAME_COLOR_G 1.0 #define FRAME_COLOR_B 1.0 #define FRAME_COLOR_ALPHA 1 //#define VIEW_AREA_WIDTH 320 //#define VIEW_AREA_HEIGHT 368 //#define IMAGEVIEW_MARGIN 20 #define VIEW_AREA_WIDTH ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? 768 : 320) #define VIEW_AREA_HEIGHT ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? 800 : 368) #define IMAGEVIEW_MARGIN ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? 40 : 20) #define SHADOW_WIDTH ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? 16 : 8) @interface PhotoSelectViewController () @end @implementation PhotoSelectViewController @synthesize popoverController; @synthesize cameraPicker; @synthesize backgroundImageView; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. if ([UIScreen mainScreen].bounds.size.height == 568) self.view.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @"background-568h@2x.png"]]; else self.view.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @"background.png"]]; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)viewWillAppear:(BOOL)animated { [[UIApplication sharedApplication] setStatusBarHidden:YES]; [self.view setBounds:self.view.frame]; backgroundImageView.image = [[[GlobalData…
has comment: http://stackoverflow.com/comment/136398507
has comment: http://stackoverflow.com/comment/136405363
upvote count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/136398595
has comment: http://stackoverflow.com/comment/136399070
score: -2
tagged with: objective-c
has answer: http://stackoverflow.com/a/77375359
type: Question
has comment: http://stackoverflow.com/comment/136398640
answer count: 1
has comment: http://stackoverflow.com/comment/136398624
accepted answer: http://stackoverflow.com/a/77375359
downvote count: 2
has comment: http://stackoverflow.com/comment/136398577
favorite count: 0
has comment: http://stackoverflow.com/comment/136398578
has title: App crashing on iOS 16, but not iOS 17. -
has comment: http://stackoverflow.com/comment/136398585

http://stackoverflow.com/comment/136491685
comment on: http://stackoverflow.com/q/77417519
has text: @SimonMcNeil - nope, that's not how a `UIAlertController` works... you cannot simply grab the view and add it to your view hierarchy.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/77293682
has comment: http://stackoverflow.com/comment/136272709
has title: Objective-C ISA pointer on disk vs when object being instantiated
tagged with: objective-c-runtime
downvote count: 0
favorite count: 0
has body: The Objective-C runtime ISA pointer is defined as such: union isa_t { isa_t() { } isa_t(uintptr_t value) : bits(value) { } uintptr_t bits; private: // Accessing the class requires custom ptrauth operations, so // force clients to go through setClass/getClass by making this // private. Class cls; public: #if defined(ISA_BITFIELD) struct { ISA_BITFIELD; // defined in isa.h }; bool isDeallocating() { return extra_rc == 0 && has_sidetable_rc == 0; } void setDeallocating() { extra_rc = 0; has_sidetable_rc = 0; } #endif void setClass(Class cls, objc_object *obj); Class getClass(bool authenticated); Class getDecodedClass(bool authenticated); }; The bits fields can be read by the definitions here. When I read a macho from disk and go to the _objc_classlist section and follow a objc_class which is defined as such: struct objc_class : objc_object { objc_class(const objc_class&) = delete; objc_class(objc_class&&) = delete; void operator=(const objc_class&) = delete; void operator=(objc_class&&) = delete; // Class ISA; Class superclass; cache_t cache; // formerly cache pointer and vtable class_data_bits_t bits; // class_rw_t * plus custom rr/alloc flags ... and objc_object is defined as such: struct objc_object { private: isa_t isa; public: ... meaning that I should be able to interpret the first 8 bytes of objc_class as the bits field of an isa, but when I do this and try to interpret the bits I get random and false information, on the other hand if I interpret the first 8 bytes as a pointer, it leads me to another objc_class instance on disk, which is usually the metaclass of the class. I wonder then why is the definition of the isa union from the Objective-C runtime and its bits field. Is this only right to interpret this as isa union with bits when we instantiate an object of a some kind and when reading from disk it's just a pointer to a meta class definition? EDIT: The way I read the objc_class struct from file is with python: ISA_MASK = 0x0000000ffffffff8 @dataclass clas…
tagged with: ios
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/136266491
tagged with: objective-c
score: 3
answer count: 1
has answer: http://stackoverflow.com/a/77318630
accepted answer: http://stackoverflow.com/a/77318630
has comment: http://stackoverflow.com/comment/136297211
tagged with: objective-c-2.0
upvote count: 3
has comment: http://stackoverflow.com/comment/136271084
type: Question

http://stackoverflow.com/comment/136398520
comment on: http://stackoverflow.com/q/77370266
score: 0
type: QuestionComment
has text: Just added stack trace now
type: Comment

http://stackoverflow.com/comment/136266491
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/77293682
has text: Can you share the code you're using to read and interpret these bits? There might be something specific in the access that's leading to unexpected behavior.
type: Comment

http://stackoverflow.com/a/77384346
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/77381636
answers question: http://stackoverflow.com/q/77381636
score: 0
has body: It seems like the file you are trying to find (koi swimming.m4v) is not added to the target Bundle (which is mainBundle here). The bundle is the runtime resources of your app and it's different from the build time resources. So make sure to add runtime-needed files to the desired targets when you are adding them: Also, You can add/remove any file from the target from the file inspector like:

enums
type: Tag
tags question: http://stackoverflow.com/q/77383224
tag name: enums
tags question: http://stackoverflow.com/q/77504380
tags question: http://stackoverflow.com/q/78333515
tags question: http://stackoverflow.com/q/78504557

http://stackoverflow.com/comment/136467758
score: 0
has text: CWInterface for macOS only...
comment on: http://stackoverflow.com/q/77344981
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136271808
score: 2
type: Comment
comment on: http://stackoverflow.com/q/77297692
type: QuestionComment
has text: @CentrumGuy: That works because CALayer has a special implementation of `setValue(forKeyPath:)`, see https://stackoverflow.com/q/48964282/1187415

http://stackoverflow.com/comment/136347055
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77322281
has text: If nil is the only sentinel, then no. If you want to add an argument before the varargs which is a count which could be iterated instead of looking for nil, it could work. You could try to pass NSNulls on the caller to stand in for nil (```[SomeClass doSomethingToVariableArguments:obj1 ?: NSNull.null, obj2 ?: NSNull.null, obj3 ?: NSNull.null, nil]```), and the called method could then check for NSNull and avoid calling doSomething in that case.
type: Comment

http://stackoverflow.com/comment/136480552
type: Comment
comment on: http://stackoverflow.com/q/77411527
type: QuestionComment
has text: Objective-C doesn't have associated types in the protocols, so there is no opaque types.
score: 0

http://stackoverflow.com/q/77340014
accepted answer: http://stackoverflow.com/a/77343095
type: AnsweredQuestion
answer count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136346920
has answer: http://stackoverflow.com/a/77343095
has comment: http://stackoverflow.com/comment/136344737
has body: I'd like to document an Objective C project with Doxygen. The intent is to document for the developers. The whole project is open source so viewable by anyone anyway. I created a Doxyfile and after a Doxygen 1.9.5 run I can see some (generic) output. So far so good. Now I want to enhance the documentation. When writing comments, I am not sure whether they should be in the .h (header) file or the .m (module) file. Where should they go? What is the difference? What might happen if I document on both sides?
score: 0
type: Question
has title: Doxygen comments - in header or implementation?
tagged with: doxygen

http://stackoverflow.com/comment/136315505
type: Comment
score: 0
type: QuestionComment
has text: @Willeke: Could be. Using a sentinel different from nil would solve this. But it's of course not as pretty
comment on: http://stackoverflow.com/q/77322281

http://stackoverflow.com/q/77284768
tagged with: objective-c
has body: I've written code to present a popover from a UICollectionView cell if the cell is selected but is unavailable for whatever reason. It works fine, except the content is never correctly positioned within the popup bubble. Note from the two examples shown, that the content is always shifted toward the caret by about half the thickness of the caret. It's clear that the size is being computed properly, but it just seems like the popover controller is simply calculating the position of the popupView incorrectly. Since the direction of shift is out of my control, I can't just shift everything over by a few pixels as a workaround. The storyboard simply has a popupView with constraints to center it horizontally and vertically within the scene view: And here's my code... Note I've turned on the border around the view just to accentuate the shift. // Inside collectionView:didSelectItemAtIndexPath: UIStoryboard* mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; MenuUnavailableViewController* muc = [mainStoryboard instantiateViewControllerWithIdentifier:@"MenuOptionUnavailable"]; muc.modalPresentationStyle = UIModalPresentationPopover; [self presentViewController:muc animated:NO completion:nil]; MenuCollectionViewCell* menuCell = (MenuCollectionViewCell*) [menuCollection cellForItemAtIndexPath:indexPath]; muc.popoverPresentationController.sourceView = menuCollection; muc.popoverPresentationController.sourceRect = menuCell.frame; muc.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny; @implementation MenuUnavailableViewController - (void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.view layoutSubviews]; self.preferredContentSize = self.popupView.bounds.size; self.popupView.layer.borderColor = [UIColor blackColor].CGColor; self.popupView.layer.borderWidth = 2; self.popupView.layer.cornerRadius = 12; } I've been doing popovers successfully using this formula for quite a while, and then one day some iO…
has answer: http://stackoverflow.com/a/77288680
score: 0
type: Question
answer count: 1
has title: How to get iOS popover view to position correctly within the bubble
type: UnansweredQuestion
tagged with: uipopovercontroller
tagged with: ios

http://stackoverflow.com/comment/136332219
type: Comment
has text: The documentation for `defaultSessionConfiguration` states: *"Modifying the returned session configuration object does not affect any configuration objects returned by future calls to this method, and does not change the default behavior for existing sessions. It is therefore always safe to use the returned object as a starting point for additional customization."*.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77330943

http://stackoverflow.com/q/77381636
has title: Why is path to movie file in app bundle nil?
tagged with: objective-c
tagged with: avplayer
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/136419043
upvote count: 1
tagged with: xcode
accepted answer: http://stackoverflow.com/a/77384346
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/136419518
score: 0
has answer: http://stackoverflow.com/a/77384346
has comment: http://stackoverflow.com/comment/136419469
has body: I am trying to play a local movie in my app when a button is pressed. However when I press the button I get the following error and the app crashes. 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter' Here is the code I use to play the movie. NSString *path=[[NSBundle mainBundle]pathForResource:@"koi swimming" ofType:@"m4v"]; NSURL *url = [NSURL fileURLWithPath:path]; AVPlayer *player = [AVPlayer playerWithURL:url]; AVPlayerViewController *controller = [[AVPlayerViewController alloc]init]; controller.view.frame = self.view.bounds; [self.view addSubview:controller.view]; [controller.player play]; and I am attaching an image of my bundle file structure. Could someone help be with getting this to play please? Expanded images file.
tagged with: ios
type: AnsweredQuestion

http://stackoverflow.com/q/77410043
upvote count: 2
score: 2
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136469023
has comment: http://stackoverflow.com/comment/136469001
answer count: 0
tagged with: xcode
has body: [SKStoreReviewController requestReview] doesn't show the review prompt when debugging on Xcode 14.3.1, macOS 13.6. Why is that? Is it a known bug?
has title: SKStoreReviewController requestReview doesn't show the review prompt when debugging on Xcode 14.3.1, macOS 13.6
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/136468994
type: UnansweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/136843040
tagged with: macos
favorite count: 0
has comment: http://stackoverflow.com/comment/136469183
tagged with: storekit

http://stackoverflow.com/comment/136207353
type: Comment
has text: Thank you, HangarRash, for the reply, but I don't see how that would help me. I added a few words to the question, in case it wasn't clear before.
comment on: http://stackoverflow.com/q/77238284
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136365920
score: 1
type: Comment
comment on: http://stackoverflow.com/q/77351837
has text: https://github.com/realm/realm-swift/issues/8369 ?
type: QuestionComment

http://stackoverflow.com/comment/136168802
comment on: http://stackoverflow.com/q/77239112
type: QuestionComment
score: 2
type: Comment
has text: Without testing, I'd say it's very possible that 2-point tall `UIVisualEffectView` might not work well. Try using a larger view and masking it to your desired height.

http://stackoverflow.com/a/77281078
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/77281077
answers question: http://stackoverflow.com/q/77281077
has body: If you look into React Native macros RCT_EXTERN_MODULE, RCT_EXTERN_METHOD etc. you can find that they produce additional static methods for React Native to register your module and expose your methods: #define RCT_EXPORT_MODULE_NO_LOAD(js_name, objc_name) \ RCT_EXTERN void RCTRegisterModule(Class); \ +(NSString *)moduleName \ { \ return @ #js_name; \ } \ __attribute__((constructor)) static void RCT_CONCAT(initialize_, objc_name)() \ { \ RCTRegisterModule([objc_name class]); \ } #define _RCT_EXTERN_REMAP_METHOD(js_name, method, is_blocking_synchronous_method) \ +(const RCTMethodInfo *)RCT_CONCAT(__rct_export__, RCT_CONCAT(js_name, RCT_CONCAT(__LINE__, __COUNTER__))) \ { \ static RCTMethodInfo config = {#js_name, #method, is_blocking_synchronous_method}; \ return &config; \ } You can implement these methods in your Swift code: import React class Calendar: NSObject, RCTBridgeModule { @objc func createEvent(_ title: String, location: String) { print(title, location) } @objc static func __rct_export__createEvent() -> UnsafePointer<RCTMethodInfo>? { struct Static { static let jsName = strdup("createEvent") static let objcName = strdup("createEvent:(NSString * _Nonnull)title location:(NSString * _Nonnull)location") static var methodInfo = RCTMethodInfo(jsName: jsName, objcName: objcName, isSync: false) } return withUnsafePointer(to: &Static.methodInfo) { $0 } } @objc class func moduleName() -> String! { "\(self)" } } Also you need to register your class manually on app startup to be operable: RCTRegisterModule(Calendar.self) Swift Macro As you can see it's possible to write a React Native Module manually in pure Swift but it is not convenient at all. But macro has been started supporting from Swift 5.9 (XCode 15) and you can use ReactBridge swift macro library for React Native Modules and UI Components. And with this library your code simply becomes to: import React import ReactBridge @ReactModule class Calendar: NSObject, RCTBridgeModule { @ReactMethod @objc func createEv…
type: AcceptedAnswer
upvote count: 2
type: Answer

http://stackoverflow.com/comment/136398640
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77370266
has text: Try moving all of the `CGXXXRelease` calls to just before the `return`. And call the releases in the opposite order of the creates.
type: QuestionComment

http://stackoverflow.com/comment/136337556
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/77334582
score: 0
has text: need to determine if the 2 callsites are different functions or just labels in our original function `A`, so for the first branch it's probably local branch in the function, but for the second branch, since it jumps to another location that then later branch to `B` it'll be hard to determine if this second jump prior jumping to `B` is a function by itself, counting towards 2 different callsites for `B`. I feel like looking at the binaries I'm working on that most unconditional jumps that Ghidra identify their jump target as new functions, the jump target resides in some stub section

http://stackoverflow.com/q/77344981
has answer: http://stackoverflow.com/a/77403684
tagged with: ios
type: Question
answer count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136453121
tagged with: iosdeployment
score: 0
has title: WiFi Security type in iOS 11/12/13/14?
has comment: http://stackoverflow.com/comment/136467758
has body: In iOS 15 we have following method to check WiFi security type: @available(iOS 15.0, *) open var securityType: NEHotspotNetworkSecurityType { get } Do we have anything in iOS 11 to 14 to know WiFi Security type?
type: UnansweredQuestion
tagged with: swift

http://stackoverflow.com/comment/136421415
has text: What is `type.state`? I assume this is a property you declared for `AdvertType` but didn't show in the question?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77383224
type: Comment

view
type: Tag
tags question: http://stackoverflow.com/q/77417519
tag name: view

kvc
tag name: kvc
tags question: http://stackoverflow.com/q/77297692
type: Tag

http://stackoverflow.com/q/77256529
has answer: http://stackoverflow.com/a/77265238
tagged with: ios
tagged with: google-maps-sdk-ios
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/77265238
has comment: http://stackoverflow.com/comment/136202824
answer count: 1
tagged with: objective-c
linked to: http://stackoverflow.com/q/77272011
score: 0
has body: I'm working on an old iOS project in Objective-C that had Google Maps with version 6.2.1. The app was working correctly. But after using pod update I can't build my project. In the line #import <GoogleMaps/GoogleMaps.h> I'm getting the error 'GoogleMaps/GoogleMaps.h' file not found. The current Google Maps version of my project is 8.2.0. Here's my Podfile: #platform :ios, '13.0' source 'https://github.com/CocoaPods/Specs.git' platform :ios, '14.0' target '<project name>' do use_frameworks! project '<project name>.xcodeproj' pod 'GoogleMaps' pod 'SDWebImage' pod "MWPhotoBrowser" pod 'MBProgressHUD' end I cleaned the build folder, cleaned the pod cache, installed them again, and restarted Xcode, but none worked. What am I missing here? What should I do to run my project?
has title: 'GoogleMaps/GoogleMaps.h' file not found after updating GoogleMaps using pod update
tagged with: google-maps
tagged with: cocoapods
type: Question

http://stackoverflow.com/comment/136187035
comment on: http://stackoverflow.com/q/77239112
type: Comment
score: 0
type: QuestionComment
has text: Glad it worked... I went ahead and posted it as an answer, for other folks who may come across this.

http://stackoverflow.com/comment/136341935
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77334582
score: 0
has text: Do you mean import stubs? In that case you can be sure it's a different function, but in any other case, all code is gonna be in the same section (usually `__TEXT.__text`). And yes, quite a bunch of heuristics require you to already have some information, but on the flip side, you will gain a lot of information as decompilation progresses - that is the whole point, after all. What this means is that decompilation should be an iterative process, because expecting to have all the information that you need beforehand is... very unrealistic, to put it mildly.

http://stackoverflow.com/q/77238284
tagged with: objective-c
tagged with: ios
has comment: http://stackoverflow.com/comment/136167584
has comment: http://stackoverflow.com/comment/136207353
score: 0
tagged with: screen-rotation
type: Question
type: UnansweredQuestion
answer count: 0
has body: I have an Objective C app that includes an 'orientation lock' switch, that allows users to switch off response to device orientation changes during some functions, so that rotating the device doesn't affect the screen, while allowing normal rotation during other functions. This has worked fine for 10 years; it still works on iOS 15. However, I've just found that it doesn't work on current iPhones with iOS 16.7 or iPhone simulator with iOS 17: instead, the screen orientation rotates to match the device orientation, when it should be locked. When users have set the app's orientation lock switch, at the start of a lockable function the app calls [[UIDevice currentDevice]endGeneratingDeviceOrientationNotifications]; It does it repeatedly until [UIDevice currentDevice].generatesDeviceOrientationNotifications == NO I'd expect that there would then be no device orientation notifications, and up to iOS 15 the app's MainViewController viewWillTransitionToSize method and related layout methods are not called when the device rotates. But they are being called in iOS 16 and 17. Is it a bug in iOS? Or has Apple changed something, so I need to change the app code (I've checked Apple developer documentation)?
has title: endGeneratingDeviceOrientationNotifications not working in iOS 16.7?

http://stackoverflow.com/comment/136271625
has text: I feel dumb cuz you're right... It doesn't work with CGRect (updated my question). My earlier code for making it "work" was wrong. However, a similar thing can be accomplished in animations as seen in https://stackoverflow.com/questions/23216673/how-can-i-animate-the-height-of-a-calayer-with-the-origin-coming-from-the-bottom#:~:text=Then%20for%20the%20animation%2C%20you%20simply%20animate%20the%20bounds%20(or%20even%20better%2C%20you%20can%20animate%20%22bounds.size.height%22%2C%20since%20only%20the%20height%20is%20changing)%3A
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77297692

http://stackoverflow.com/a/77343095
has body: So I found out some significant difference. If I overlooked something essential, please let me know. When I created a topic (using \defgroup and \ingroup) I was wondering why some of my comments just would not show up in the group. Well, the comments were in the .m file. After copying them to the .h file (and adding a hint it comes from the header) the group did contain the expected reference but both comments were visible. Then I removed the hint to make both comments the same. The duplication in the doxygen output vanished. Then I removed the one from the .m file and am good to go. It seems the comments in the header get better spread where they need to go. Edit: I found some classes that have their header in .m files. Maybe not the best practice, but here it also turned out to better have the documentation in the declaration (header) than in the implementation.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/77340014
type: Answer
accepted answer of: http://stackoverflow.com/q/77340014
score: 0

arm64
tag name: arm64
tags question: http://stackoverflow.com/q/77334043
type: Tag

http://stackoverflow.com/comment/136313644
comment on: http://stackoverflow.com/a/77321474
type: AnswerComment
type: Comment
has text: Yes, this is true. I chose this example for brevity, to construct a minimal example which reproduces the problem. Actually I am using a different functionality.
score: 0

http://stackoverflow.com/a/77270762
downvote count: 0
accepted answer of: http://stackoverflow.com/q/77270347
answers question: http://stackoverflow.com/q/77270347
score: 1
type: AcceptedAnswer
type: Answer
upvote count: 1
has body: You need to add the UNNotificationPresentationOptionList option for iOS 14+ to allow the notification to show up while the app is in the foreground. if (@available(iOS 14.0, *)) { completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionBanner | UNNotificationPresentationOptionList | UNNotificationPresentationOptionBadge); } else { completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge); }

http://stackoverflow.com/comment/136271084
score: 0
type: Comment
type: QuestionComment
has text: @ItaiFerber it's not just something I can share on stackoverflow, it's too big. But its basically walking the load commands of a macho, fixing chained fixups finding the `__objc_classlist` section and getting to the `objc_class` structures defined in the file and reading them according to the definition in the runtime. The only quirk I found is that the ISA field is basically just another pointer to `objc_class` usually a metaclass of the current class, and all this bit field mean nothing atleast when I read the `objc_class` from disk
comment on: http://stackoverflow.com/q/77293682

http://stackoverflow.com/q/77270347
accepted answer: http://stackoverflow.com/a/77270762
type: Question
tagged with: ios
has answer: http://stackoverflow.com/a/77270762
type: AnsweredQuestion
score: 0
answer count: 1
tagged with: objective-c
has title: iOS 14+ UNUserNotificationCenter not presenting foreground notifications as expected
has body: I'm working on an iOS app and trying to handle foreground notifications using the UNUserNotificationCenter in iOS 14 and later. However, the notifications are not being presented as expected when the app is in the foreground. Here's my code: -(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler { NSLog(@"Foreground notification - appdelegate: %@", notification); NSDictionary *userInfo = notification.request.content.userInfo; // Foreground NSLog(@"APP_PUSH from foreground %@", userInfo); if (@available(iOS 14.0, *)) { completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionBanner | UNNotificationPresentationOptionBadge); } else { completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge); } } The problem is that the notifications are not showing up as expected when the app is in the foreground but it works when it is in background. Any ideas on how to fix this issue and get the notifications to display properly in the foreground?

http://stackoverflow.com/comment/136271345
comment on: http://stackoverflow.com/q/77297692
type: Comment
has text: Can you show an example how you *“do the same thing on a CGRect”* ?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136487794
has text: @SimonMcNeil You should post the relevant code showing how everything is being presented/dismissed so we can see why you think the only solution is to attempt to add the alert as a child instead of presenting it normally. Better to ask about the actual problem than to ask about one specific possible solution to that problem.
comment on: http://stackoverflow.com/q/77417519
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136320330
comment on: http://stackoverflow.com/q/77319718
type: Comment
has text: You have keen eyes! Alas, this was only a copy/paste error. I have modified the question. Thank you very much for pointing this out!
type: QuestionComment
score: 0

http://stackoverflow.com/a/77403684
upvote count: 0
score: -3
type: Answer
downvote count: 3
has body: In iOS 11 through iOS 14, there is no direct built-in method or property provided by Apple's Network Extension framework or CoreWLAN framework to determine the security type of a Wi-Fi network. These versions of iOS did not offer a native API to retrieve the specific security type (e.g., WPA, WPA2, WEP) of a Wi-Fi network. To determine the security type of a Wi-Fi network in those iOS versions, you would typically need to analyze the network's SSID and possibly try to infer the security type based on naming conventions or other available information. However, this method is not guaranteed to be accurate because network names can vary widely and may not provide a clear indication of the security type. Starting from iOS 15 and later, as you mentioned, the NEHotspotNetwork class includes the securityType property, which allows you to directly check the security type of a Wi-Fi network, making it more straightforward to determine the security type programmatically.
answers question: http://stackoverflow.com/q/77344981

http://stackoverflow.com/q/77344092
has comment: http://stackoverflow.com/comment/136364119
tagged with: urlsession
type: Question
tagged with: objective-c
type: UnansweredQuestion
has title: Single URLSession for all requests versus per request, performance
has comment: http://stackoverflow.com/comment/136693095
score: 0
has comment: http://stackoverflow.com/comment/136693853
has body: In a legacy project which has both ObjC and Swift Code I noticed that for each request a new session was created: -(void)sendRequest { // Some configuration // New session is created for every request NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:nil delegateQueue:[NSOperationQueue mainQueue]]; [session dataTaskWithRequest:self.request completionHandler:^(NSData * _Nullable data, NSURLResponse *_Nullable response, NSError * _Nullable error) { // Doing something with response } } As per the information shared in past WWDC videos and answer over here: New NSURLSession for every DataTask overkill?, I noticed that this is an anti-pattern and should be avoided. In it's place we should use a single URLSession for all requests: -(void)sendRequest:(NSURLReqest *)request { // Some configuration // [self.session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse *_Nullable response, NSError * _Nullable error) { // Doing something with response } } Please note that at server HTTP 1.1 is configured for the rest APIs. As per my understanding whenever we create a new session it is equivalent to creating a new TCP connection, since there is a handshake involved at the beginning for each new TCP connection that will add latency so ideally we should use same URLSession for each request. In order to validate it I started profiling both the implementations using Instruments for a scenario where after login we are invoking 50 APIs most of which are returning json in response, 10 returning image data. Here is my observation: There is slight improvement in time taken by each request Whenever we use one session per request, internally OS creates parallel connections so it achieves identical results when compared to the single session used for all requests If we are directly serializing image using URLSessionDataTask it takes less time versus using URLSessionDownloadTask Ba…
answer count: 0
tagged with: performance

http://stackoverflow.com/comment/136419469
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77381636
has text: Not sure I understand file is selected for your target.
score: 0

http://stackoverflow.com/comment/136341953
type: AnswerComment
type: Comment
has text: To provide an example of this that I commonly see in C++ code: member variables that can be re-initialised. Usually the code will check whether the pointer is null and if not, call some virtual destructor on it, then go on to allocate a new object and initialise it. The initialisation of the new object is what provides the required type information, but you won't get to that until you've skipped over the virtual destructor call. Once you have the type information, you can "go back" and populate the virtual destructor call with the necessary information that you didn't have before.
comment on: http://stackoverflow.com/a/77334582
score: 0

http://stackoverflow.com/comment/136693095
comment on: http://stackoverflow.com/q/77344092
type: Comment
score: 0
has text: @Larme unfortunately it is difficult to convince stakeholders unless it is a performance win.
type: QuestionComment

http://stackoverflow.com/comment/136485373
type: Comment
score: 0
has text: trust me I agree, but this is some legacy code that Im dealing with and in the background there is a modal view that gets dismissed inside a dispatch async after, and then after its dismissed they want to present this alert. The only way I've found adding it without putting a dispatch queue delay is adding it as a container view controller
comment on: http://stackoverflow.com/q/77417519
type: QuestionComment

http://stackoverflow.com/comment/136482902
score: 0
type: QuestionComment
has text: Why did you do it this way instead of presenting it on the child view controller directly?Btw, I think the alert is not tappable because of frame, with clipToBound = false, you still see the alert.
type: Comment
comment on: http://stackoverflow.com/q/77417519

http://stackoverflow.com/comment/136419043
comment on: http://stackoverflow.com/q/77381636
has text: Update the screenshot from Xcode with that "images" folder expanded so we can see the m4v file in the tree. Make sure the filename exactly matches, including case. Be sure the file is selected for your target.
type: Comment
score: 0
type: QuestionComment

uipopovercontroller
type: Tag
tags question: http://stackoverflow.com/q/77284768
tag name: uipopovercontroller

http://stackoverflow.com/a/77392211
downvote count: 0
type: Answer
upvote count: 4
score: 4
has body: The biggest misconception about URL encoding is that it encodes URLs. It does not. It's for path components and query parameters only. Encoding an entire URL cannot work. If it is already an URL, it needs no encoding. If it's not an URL, then how should it be treated? Which parts are to be treated as the hostname, path and query parameters? That's why the behavior of NSURL URLWithString: is problematic. According to the documentation: NSURL automatically percent- and IDNA-encodes invalid characters to help create a valid URL. So it tries to fix an invalid URL. But since the URL is invalid, this cannot reliably work. For your case, it does not work. You feed it this invalid URL: http://google.com/ad/1?asseturl=[ASSETURI]&partner=abc%2Fdev The query parameter asseturl has an invalid value (square brackets need encoding) while partner has a value that could be valid or invalid. It's basically a guess if the value of partner needs to be URL encoded or not. This is were Apple's implementation has changed. It's the invalid asseturl parameter triggering the double encoding. Without the invalid parameter, the value of partner is not encoded a second time. The proper way in any programming language and with any framework or library is to encode each path component and each query value separately. Using this approach, a valid URL is built in the first place and then passed to NSURL URLWithString:. And it won't be double encoded. NSString* partner = [@"abc/dev" stringByAddingPercentEncodingWithAllowedCharacters:[[NSCharacterSet characterSetWithCharactersInString:@" !*'\"();:@&=+$,/?%#[]^|{}\\`"] invertedSet]]; NSString* asseturi = [@"[ASSETURI]" stringByAddingPercentEncodingWithAllowedCharacters:[[NSCharacterSet characterSetWithCharactersInString:@" !*'\"();:@&=+$,/?%#[]^|{}\\`"] invertedSet]]; NSURL* url = [NSURL URLWithString: [NSString stringWithFormat:@"http://google.com/ad/1?asseturl=%@&partner=%@", asseturi, partner]]; The result is: http://google.com/ad/1?asseturl=%5BAS…
answers question: http://stackoverflow.com/q/77391385

http://stackoverflow.com/comment/136398507
comment on: http://stackoverflow.com/q/77370266
score: 0
type: QuestionComment
type: Comment
has text: Can you include a stack trace of the error/crash you’re experiencing?

http://stackoverflow.com/comment/136483750
score: 1
has text: ah; SO does that because it interprets it as HTML. You have to be careful to put backticks around it to mark it as literal (or use backslash quoting as you did)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77411968

http://stackoverflow.com/comment/136168110
type: Comment
has text: Are you making it 2 **pixels** or 2 **points** tall? At that size, do you really notice a difference between using a translucent view vs a "blur" view?
comment on: http://stackoverflow.com/q/77239112
type: QuestionComment
score: 0

http://stackoverflow.com/comment/136527368
comment on: http://stackoverflow.com/q/77319718
type: QuestionComment
type: Comment
has text: Just adding a reference to this issue https://github.com/apple/swift/issues/68163#issuecomment-1728212881 (should have been solved with xcode 15.1)
score: 0

http://stackoverflow.com/comment/136199080
comment on: http://stackoverflow.com/q/77256493
type: Comment
score: 0
type: QuestionComment
has text: @Willeke yes I did. But it still does not work.

http://stackoverflow.com/comment/136436459
type: Comment
comment on: http://stackoverflow.com/q/77391385
score: 0
type: QuestionComment
has text: You should use (NS)URLComponents, with NSURLQueryItem etc., or if you want to encode yourself, you should do it piece by piece: host (usually not needed), parameter per parameter (usually the value of the parameter), and then append.

http://stackoverflow.com/comment/136316502
has text: In yours surrounded block mentioned `kDADiskDescriptionMediaEncryptionDetailKey`, but system is arguing for `kDADiskDescriptionMediaEncryptedKey`
type: QuestionComment
comment on: http://stackoverflow.com/q/77319718
score: 1
type: Comment

http://stackoverflow.com/comment/136364119
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77344092
has text: If you launch too many calls in parallels, you might overuse your resources, as there might be creating too many threads. While using a single URLSession, you can limit the parallel calls (with `httpMaximumConnectionsPerHost` for instance).

http://stackoverflow.com/comment/136469023
comment on: http://stackoverflow.com/q/77410043
score: 0
has text: Check this [Document](https://developer.apple.com/documentation/storekit/skstorereviewcontroller/3566727-requestreview), on Discussion section
type: QuestionComment
type: Comment

variadic-functions
tag name: variadic-functions
type: Tag
tags question: http://stackoverflow.com/q/77322281

ios12
tags question: http://stackoverflow.com/q/77351837
type: Tag
tag name: ios12

http://stackoverflow.com/comment/136347100
comment on: http://stackoverflow.com/a/77326173
type: AnswerComment
has text: There is a flag, -ld_classic, (add ```-Wl,-ld_classic``` to OTHER_LDFLAGS) which can force use of the old linker with Xcode 15, which may let you use Xcode 15. Not sure that will work if going back to Xcode 14; you can conditionally add for just sdk=iphoneos17* or sdk-iphonesimulator17* if you need to flip between Xcodes.
score: 1
type: Comment

http://stackoverflow.com/comment/136398696
type: Comment
has text: No Joy with that - ok, if i remove the `:(BOOL)animated` from the `viewWillAppear` the app no longer crashes...However the selected image does not appear initially - but does AFTER the camera picture is taken.
comment on: http://stackoverflow.com/q/77370266
type: QuestionComment
score: 0

doxygen
type: Tag
tag name: doxygen
tags question: http://stackoverflow.com/q/77340014
tags question: http://stackoverflow.com/q/77760404

http://stackoverflow.com/comment/136337534
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77334582
score: 0
has text: Thanks for the insight. So right now I'm using the symbol table, and prolouge analysis to find a set of entry points. I don't mind obfuscation techniques as the binaries I'm working on are system binaries and are not of malware nature. After that I take all these entries and pass them to a branch analyzer to find more functions that we branch and link to (`bl`). So as for your second heuristic point, I feel I can do that check but unless I already know all the functions prior I can't tell if a data between the current address and the jump target is another function, it might be and it might

http://stackoverflow.com/comment/136254324
comment on: http://stackoverflow.com/a/77274719
type: AnswerComment
score: 1
type: Comment
has text: You definitely should not change Pods.xcodedproj. The pod you reference has instructions that call for `#import "MWPhotoBrowser.h"`. Beyond that, I'd probably have to look at the project itself to tell you what to do (which is unfortunately not well suited to SO). I would recommend starting from scratch in a blank project, and just add this one pod, and see if it works there, and then find what is different between the two.

http://stackoverflow.com/comment/136693853
type: Comment
comment on: http://stackoverflow.com/q/77344092
has text: Do a test with more than 10 requests, like 100 and on real device. On "old" ones too if possible. You might see then the differences.
score: 0
type: QuestionComment

http://stackoverflow.com/a/77274719
answers question: http://stackoverflow.com/q/77272011
has comment: http://stackoverflow.com/comment/136254324
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/136253401
has body: You almost certainly want to replace this: #import "MWCommon.h" with this: #import <MWPhotoBrowser/MWCommon.h> You may need to apply similar changes to any other Pods. They're part of modules, so you want to use the <...> syntax and <module/file.h>. You may also be able to use the following syntax in some case if it's convenient: @import MWPhotoBrowser;

http://stackoverflow.com/comment/136224320
type: Comment
comment on: http://stackoverflow.com/q/77270424
score: 0
type: QuestionComment
has text: @sahilsaini please [edit] your question with additional info, don’t put it in the comments. See also [ask].

http://stackoverflow.com/comment/136398578
type: Comment
has text: The crash is coming from code you haven't posted yet. Post the `imageWithShadow` method.
comment on: http://stackoverflow.com/q/77370266
type: QuestionComment
score: 0

http://stackoverflow.com/comment/136183047
comment on: http://stackoverflow.com/q/77239112
type: Comment
has text: masking didn't even cross my mind. this worked. thanks for the feedback
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136272709
comment on: http://stackoverflow.com/q/77293682
type: QuestionComment
score: 0
type: Comment
has text: I don't necessarily mean for you to share the whole code, just a snippet showing off exactly how you're reading and interpreting the isa; without some minimal reproducible code, it'll be hard to help much more... And when you say that the "bit field mean[s] nothing", what are the bits that you expect vs. the bits you're getting? Given that the field is a union, the bits should represent exactly the integer value of the pointer...

http://stackoverflow.com/q/77272011
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/77499628
tagged with: cocoapods
type: Question
type: UnansweredQuestion
has body: I am working on an old project written in Objective-C and its minimum deployment version is iOS 13.0. Recently I've updated the libraries using pod and now the project is showing the error 'MWCommon.h' file not found in the line #import "MWCommon.h" Here's my pod-file: #platform :ios, '13.0' target '<project-name>' do use_frameworks! project '<project-name>.xcodeproj' pod 'GoogleMaps', '~> 6.2.1' pod 'SDWebImage' pod "MWPhotoBrowser" pod 'MBProgressHUD' end I've also executed the following commands and cleaned the build folder to solve this issue but it didn't work. pod deintegrate pod cache clean --all pod install Also, as you can see in the following screenshot, MWCommon.h exists in app -> pods -> MWPhotoBrowser. What can I do to make the project run again?
has answer: http://stackoverflow.com/a/77274719
tagged with: ios
tagged with: mwphotobrowser
has title: 'MWCommon.h' file not found
tagged with: objective-c

urlsession
tag name: urlsession
tags question: http://stackoverflow.com/q/77344092
type: Tag

http://stackoverflow.com/comment/136344737
type: QuestionComment
has text: Which version of doxygen? - "Where should they go?" this is opinion based and not really allowed here, it depends on what you want to provide to the users of the different files, i.e. do they get the `.h` or `.m` files or both? - What is the difference? might result in some different documentation ant different places. What might happen if I document on both sides? Depends on whether the or not the texts are different or identical, identical texts should be filtered out. Double documenting is a bad idea, in my opinion, might lead to inconsistent documentation.
comment on: http://stackoverflow.com/q/77340014
type: Comment
score: 0

http://stackoverflow.com/comment/136337559
score: 0
has text: and so I wonder if this is a good assumption to make to check if a jump target is in different section or more specifically a stub section altogether?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77334582

http://stackoverflow.com/comment/136436393
has text: @Codo sry I just add more on my example thx
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77391385

http://stackoverflow.com/comment/136210163
has text: Yes, I have a custom view that derives from NSOutlineView. But none of the functions in the custom view gets called due to dragging and there are no overrides of these functions.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77256493
type: Comment

http://stackoverflow.com/comment/136297211
comment on: http://stackoverflow.com/q/77293682
type: Comment
has text: @ItaiFerber I've provided additional information on how I parse the structs and what I see compared to what I expect to see and what I actually see that contradicts other data I extract like the method_list of a class.
score: 0
type: QuestionComment

uiblureffect
tags question: http://stackoverflow.com/q/77239112
tag name: uiblureffect
type: Tag

http://stackoverflow.com/comment/136435793
type: QuestionComment
type: Comment
score: 0
has text: Please show your code so we can see how your own encoding code is combined with calling `NSURL` methods. This isn't obvious from the current description.
comment on: http://stackoverflow.com/q/77391385

iosdeployment
type: Tag
tag name: iosdeployment
tags question: http://stackoverflow.com/q/77344981

http://stackoverflow.com/a/77383300
has comment: http://stackoverflow.com/comment/136431034
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/77383224
has comment: http://stackoverflow.com/comment/136427694
has comment: http://stackoverflow.com/comment/136423156
upvote count: 2
has body: CaseIterable is a protocol from Swift that allows you to use allCases property to access all types in the enum as a collection, so there is no way to Objective-c enum can conform it. You have to work around with this. Approach 1, define a swift enum which mapping 1-1 with AdvertType. Then declare a property to return same type as in Objective-C or write an extension from Swift to manually implement allCases property. Thanks @Alex for pointing out to me: enum Advert: String, CaseIterable { case loading case finished var enumAdapter: AdvertType { switch self { case .loading: return AdvertType.loading case .finished: return AdvertType.finished } } } if let loadingState = Advert(rawValue: "loading") { //TODO: } extension AdvertType { public static var allCases: [AdvertType] = [ .loading, ... ] } Approach 2, every time you want to get Objective-C AdvertType run a for loop to get the value with condition like you did above type.state... However, changing rawValue from String to UInt ("loading" -> 0) because the enum is defined NSUInteger. Edited for approach 2: my mistake was that I didn't look at type.state condition, it's also inside AdvertType. So, with String input parameter and UInt as initialization enum parameter, there is no way to convert such a easy way like you did in example above. If I were you, I would create a helper function to convert between them (I prefer approach 1). However, be aware of TYPO and return type in unexpected cases: static func getAdvertType(from state: String) -> AdvertType? { switch state { case "loading": return .loading case "finished": return .finished default: return nil } }

http://stackoverflow.com/a/77250198
type: Answer
has body: Based on the OP's comment... UIVisualEffectView with blur effect uses adjacent pixels to generate the blur ... using a very small (in this case, 2-points-tall) view apparently causes the issue. To avoid that, use a slightly larger UIVisualEffectView and mask it to the desired 2-points height.
score: 0
answers question: http://stackoverflow.com/q/77239112

http://stackoverflow.com/comment/136431034
comment on: http://stackoverflow.com/a/77383300
has text: You can add an extension to CaseIterable manually in an extension: `extension AdvertType: CaseIterable { static var allCases: [AdvertType] = [...] }`
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/comment/136308245
has text: So it was as I thought that it's runtime information only, thanks Itai for the wonderful explanation!
score: 0
comment on: http://stackoverflow.com/a/77318630
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/136337545
score: 0
has text: not unless I finish finding all functions it might give me false positives. Same for the third point, I feel as if I don't find all functions first I can't determine if more than 2 callsites call the same jump target. For example If I have a function `A` that we know for certain it's a function, and it has a branch to target `B` which might be a new function and might be not, and later we have another branch which gets us to *another* the same target 'B' can you say for certain that `B` is a function and not a label in the same function just because it has 2 callsites? I feel like we first
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77334582

http://stackoverflow.com/comment/136471756
has text: It would be helpful if you posted, as text, some example Swift code you are trying to translate. Also show your attempted Objective-C code.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77411527
score: 1

http://stackoverflow.com/comment/136225643
score: 0
type: QuestionComment
has text: You can’t, frameworks can’t include frameworks
comment on: http://stackoverflow.com/q/77270424
type: Comment

http://stackoverflow.com/comment/136398585
type: QuestionComment
score: 0
type: Comment
has text: @HangarRash I just corrected the code - my apologies.
comment on: http://stackoverflow.com/q/77370266

http://stackoverflow.com/comment/136317014
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77322281
type: Comment
has text: Bot didn't close the question, I accepted it as a suitable answer (I honestly don't believe there is a way of doing this while keeping nil as the sentinel)

performance
tags question: http://stackoverflow.com/q/77344092
type: Tag
tag name: performance

http://stackoverflow.com/comment/136253401
score: 0
comment on: http://stackoverflow.com/a/77274719
has text: I followed these steps but it didn't work. What I found out later that the problem exist for every libraries except for google maps. This old project was running fine. But after updating Mac to Sonoma, Xcode to its latest version, updating CocoaPod and using ```pod update``` this problem happened. Can you please give me an idea where this problem could be? Should I change anything in the Pods.xcodeproj?
type: AnswerComment
type: Comment

viewcontroller
type: Tag
tags question: http://stackoverflow.com/q/77417519
tag name: viewcontroller
tags question: http://stackoverflow.com/q/78607223

http://stackoverflow.com/a/77326173
has body: Xcode 15.0 has some bugs related to weak-linking (i.e. symbols not being weak-linked when they should), here is one I found in PyObjC. Try Xcode15.1b1, if that doesn't fix the issue then file a feedback with Apple. And in the meantime, keep building your shipping application with Xcode 14.
accepted answer of: http://stackoverflow.com/q/77319718
answers question: http://stackoverflow.com/q/77319718
upvote count: 2
has comment: http://stackoverflow.com/comment/136322192
has comment: http://stackoverflow.com/comment/136347100
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/136453121
type: Comment
has text: can you please check this import CoreWiFi // Check the current Wi-Fi network's security type func getWiFiSecurityType() { let wifiInterface = CWInterface() if let ssid = wifiInterface.ssid() { if let network = CWNetwork(interface: wifiInterface, bssid: nil as String?) { if let security = network.security() { print("Connected to Wi-Fi SSID: \(ssid)") print("Security Type: \(security)") } else { print("Connected to Wi-Fi SSID: \(ssid)") print("Security Type: Unknown")}}}else {print("Not connected to a Wi-Fi network.")}}
comment on: http://stackoverflow.com/q/77344981
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136167584
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77238284
has text: I'm surprised that ever worked. The proper way is to make use of [`supportedInterfaceOrientations`](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621435-supportedinterfaceorientations?language=objc) and [`setNeedsUpdateOfSupportedInterfaceOrientations`](https://developer.apple.com/documentation/uikit/uiviewcontroller/4047535-setneedsupdateofsupportedinterfa?language=objc).
score: 0

http://stackoverflow.com/comment/136202971
has text: Implementing and calling the mentioned methods should do it. Any overrides or custom views in the cells?
comment on: http://stackoverflow.com/q/77256493
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136469001
comment on: http://stackoverflow.com/q/77410043
score: 0
type: QuestionComment
has text: Yes, I did testing on real Mac
type: Comment

decompiling
tag name: decompiling
tags question: http://stackoverflow.com/q/77334043
type: Tag

http://stackoverflow.com/a/77265238
has comment: http://stackoverflow.com/comment/136225719
accepted answer of: http://stackoverflow.com/q/77256529
type: AcceptedAnswer
has body: change pod 'GoogleMaps' to pod 'GoogleMaps', '~&gt; 6.2.1' and then run pod install everything will be fine
type: Answer
upvote count: 1
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/77256529

http://stackoverflow.com/comment/136271143
has text: Do you really need all of this Objective-C baggage? Swift has its own equivalent of KVC without the need to extend NSObject and it works with both classes and structs with none of the Objective-C stuff. See https://stackoverflow.com/a/52635420/20287183 and look at option #2 in that answer for an example.
comment on: http://stackoverflow.com/q/77297692
score: 0
type: QuestionComment
type: Comment

react-native-ui-components
type: Tag
tag name: react-native-ui-components
tags question: http://stackoverflow.com/q/77281077

objective-c-2.0
tags question: http://stackoverflow.com/q/77293682
tag name: objective-c-2.0
type: Tag

http://stackoverflow.com/a/77281537
upvote count: 1
answers question: http://stackoverflow.com/q/77281077
type: Answer
downvote count: 0
has body: If you are open to using expo I have used Expo Modules API for native modules before they handle all the nasty objc stuff. They expect you to write your modules in Kotlin and Swift but I believe under the hood they are still just generating all the objc code that you need. Expo Modules API was a great experience especially if you are wanting to write swift code. I wrote a native module without it and felt the objc stuff was hard to keep in sync with the swift code. https://docs.expo.dev/modules/overview/
score: 1

google-maps
tags question: http://stackoverflow.com/q/77256529
tag name: google-maps
type: Tag

http://stackoverflow.com/comment/136198844
score: 0
type: QuestionComment
type: Comment
has text: Do you call [`setDraggingSourceOperationMask:forLocal:`](https://developer.apple.com/documentation/appkit/nstableview/1527199-setdraggingsourceoperationmask?language=objc)?
comment on: http://stackoverflow.com/q/77256493

http://stackoverflow.com/comment/136398595
has text: You only posted `viewWillAppear`, not `imageWithShadow`. You are also missing the call to `[super viewWillAppear:animated];`. And yes, this is an old project. You still have the extremely out-of-date `viewDidUnload`.
type: QuestionComment
score: 1
type: Comment
comment on: http://stackoverflow.com/q/77370266

http://stackoverflow.com/comment/136322192
comment on: http://stackoverflow.com/a/77326173
has text: Thank you so much! Xcode 15.1beta (15C5028h) fixes this issue. There are other issues with weak linking, though. I have filed a bug report (FB13289462).
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/136346920
comment on: http://stackoverflow.com/q/77340014
type: Comment
has text: The intent is to document for the developers. From your comment I get that the answer might be opinionated - that means there is no feature gain one one vs the other side?
score: 0
type: QuestionComment

http://stackoverflow.com/a/77318630
answers question: http://stackoverflow.com/q/77293682
score: 2
downvote count: 0
has body: After digging a bit through the runtime, it appears that non-pointer isas are a runtime-only concept, and that all on-disk isas will always be regular pointers. The loading process of Obj-C classes in an object file: dyld calls _objc_map_images (objc-internal.h/objc-runtime-new.mm), passing in the object headers to read and load classes from _objc_map_images does a bit of setup before calling map_images (objc-private.h/objc-runtime-new.mm) map_images takes the runtime lock, then calls map_images_nolock (objc-private.h/objc-os.mm) map_images_nolock iterates over the mach headers, searching for Obj-C info and performing some validation. It passes all of the headers which contain Obj-C classes to _read_images (objc-private.h/objc-runtime-new.mm) _read_images is where we actually get to the interesting parts. It first sets up support for non-pointer isas as relevant for the runtime target, and sets up some tables for storing class information. After reading and fixing up selectors, it starts reading class info (OBJC_RUNTIME_DISCOVER_CLASSES_START()) For each header, it iterates over the raw classlist stored in the header, receiving direct pointers to each of the classes in the image For each class read this way, it calls readClass (objc-runtime-new.mm), which resolves mangled class names, Swift classes, and more — but at the end of the day, the read classref_t (raw pointer to dyld class) is either cast to Class (the class object), or replaced by an allocated Class instance So, where do non-pointer isas come into play? Only when setting objects' class at runtime: When you create an object via either objc_constructInstance or class_createInstance (runtime.h), or set an object's class via object_setClass, the object has either objc_object::initInstanceIsa or objc_object::initIsa (objc-object.h) called on it (and initInstanceIsa just calls through to initIsa anyway) objc_object::initIsa has two implementations (one for SUPPORT_NONPOINTER_ISA and the other for non-supported)…
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/77293682
type: Answer
has comment: http://stackoverflow.com/comment/136308736
upvote count: 2
has comment: http://stackoverflow.com/comment/136308245

http://stackoverflow.com/comment/136225719
score: 0
type: AnswerComment
has text: I'm having the same problem with MWPhotoBrowser. Can you please check this question and answer? https://stackoverflow.com/q/77272011/8192914
type: Comment
comment on: http://stackoverflow.com/a/77265238

http://stackoverflow.com/comment/136271237
type: Comment
comment on: http://stackoverflow.com/q/77297692
score: 0
has text: The swift KVC only works with literal keyPaths while I need to be able to use String keyPaths
type: QuestionComment

http://stackoverflow.com/comment/136366568
type: QuestionComment
has text: Nailed it! thank you so much for that link.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77351837

http://stackoverflow.com/comment/136427694
comment on: http://stackoverflow.com/a/77383300
has text: @SimonEritsch I edited the answer, there was a mistake here. Unfortunately, there is no such a way to convert them directly.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/136423156
type: AnswerComment
type: Comment
score: 0
has text: thanks for your comment. Would you mind providing a bit more details for example 2? Unfortunately number 1 will not work, because the enum in the lib might change and I need our Code to still work dynamically with changes without having to change it in my enum-copy every time.
comment on: http://stackoverflow.com/a/77383300

http://stackoverflow.com/comment/136222998
comment on: http://stackoverflow.com/q/77270424
score: 0
type: QuestionComment
has text: Please post the error that you are getting
type: Comment

mwphotobrowser
tag name: mwphotobrowser
type: Tag
tags question: http://stackoverflow.com/q/77272011

http://stackoverflow.com/comment/136452903
type: Comment
comment on: http://stackoverflow.com/q/77391385
score: 0
has text: I think `URLWithString` just becomes smarter: `[` needs encoding - yes, then passed string is not encoded and entire path is encoded. Please retry by encoding `[` and `]`
type: QuestionComment

proxy
tag name: proxy
type: Tag
tags question: http://stackoverflow.com/q/77330943

screen-rotation
type: Tag
tag name: screen-rotation
tags question: http://stackoverflow.com/q/77238284

react-native-component
tag name: react-native-component
tags question: http://stackoverflow.com/q/77364438
type: Tag

http://stackoverflow.com/q/77542065
has comment: http://stackoverflow.com/comment/136710851
upvote count: 1
downvote count: 0
has body: Doesn't Apple simd module have a standard function for outer product of two vectors? I see it only has dot_product and cross_product for vectors. Using matrix representation of vectors for implementing outer product via matrix multiplication doesn't seem possible also since Apple simd doesn't support 1-dimensional matricies afaik. So the only way is to implement outer product themself? Not that it's hard, I just find it amusing that specialized vector library doesn't have outer product as a standard function. I use this implementation for now: func outer_product(_ a: float2, _ b: float2) -&gt; simd_float2x2 { simd_float2x2(a*b.x, a*b.y) }
tagged with: accelerate-framework
tagged with: simd
type: Question
tagged with: swift
has title: Apple simd: outer product of two vectors
type: UnansweredQuestion
answer count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/136705943
tagged with: ios
tagged with: objective-c

http://stackoverflow.com/comment/136602277
comment on: http://stackoverflow.com/q/77477713
has text: Indeed, but it's rather a bandaid fix than a real fix.
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/136696191
comment on: http://stackoverflow.com/q/77535525
score: 1
type: Comment
has text: Can you provide some details about why you need to change the implementation of the readonly property for only a single instance of the class? Knowing what you are really trying to do can help you get better answers.
type: QuestionComment

http://stackoverflow.com/q/77446440
has comment: http://stackoverflow.com/comment/136537126
tagged with: base64
has body: I have an objective-c project with an image file that I want to convert to base64 string, i don't want to convert it first to NSData and then use base64EncodedStringWithOptions, I want to read the file chunk by chunk. So I create this method: -(NSString*) base64EncodeFileAtPath:(NSURL*)url with:(NSUInteger)chunkSize { NSMutableString *base64EncodedString = [[NSMutableString alloc] init]; NSString * t = [url.absoluteString stringByReplacingOccurrencesOfString:@"encrypted-file://" withString:@""]; NSInputStream *inputStream = [NSInputStream inputStreamWithFileAtPath:t]; if (!inputStream) { NSLog(@"Unable to create input stream from file"); return nil; } [inputStream open]; @try { uint8_t *buffer = (uint8_t *)malloc(sizeof(uint8_t) * chunkSize); while ([inputStream hasBytesAvailable]) { @autoreleasepool { NSInteger bytesRead = [inputStream read:buffer maxLength:chunkSize]; if (bytesRead < 0) { NSError *readError = [inputStream streamError]; if (readError) { NSLog(@"Stream read error: %@", readError); } break; } NSData *dataBuffer = [NSData dataWithBytes:buffer length:bytesRead]; NSString *base64Chunk = [dataBuffer base64EncodedStringWithOptions:0]; [base64EncodedString appendString:base64Chunk]; } } free(buffer); } @finally { [inputStream close]; } return base64EncodedString; } This is how i call the method: [self base64EncodeFileAtPath:fileURL with:10 * 3600]; The problem is that when I want to decode the file back to the image I get an empty image, so I think that the encoding is broken, because when I use: NSData* data = [[NSData alloc] initWithContentsOfURL:fileURL]; NSString * value = [data base64EncodedStringWithOptions:0]; everything is ok, any idea what can be the problem? EDIT The fileUrl is linked to a file that was encrypted and maybe this is the problem
favorite count: 0
has title: Convert image file to base64 string in chunks Objective-c
score: -1
has answer: http://stackoverflow.com/a/77472643
has comment: http://stackoverflow.com/comment/136543913
upvote count: 0
answer count: 1
downvote count: 1
type: Question
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136534833
type: UnansweredQuestion

http://stackoverflow.com/comment/136543913
type: QuestionComment
has text: How do you decode? As with base64 encoding, there could be new lines inserted (depending on the size), padding, etc. If you compare the content, piece by piece, where does it start to differ?
type: Comment
comment on: http://stackoverflow.com/q/77446440
score: 1

http://stackoverflow.com/q/77466483
has title: Notification Center - cannot be used on instance of nested type
has comment: http://stackoverflow.com/comment/136569857
type: Question
tagged with: swift
has body: I am trying to set up my Swift text and labels to work with notification center so what is displayed can be changed using an objective C file. My UpdateConnectionTypeText and UpdateStatusText works but I am getting the following errors for UpdateGreySubText, Text("Uploading memory model to controller"): "Instance member 'publisher5' of type 'ViewController.ContentView' cannot be used on instance of nested type 'ViewController.ContentView.ProgressBar'" My Objective C code: { UploadViewController* myView = [[UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil] instantiateViewControllerWithIdentifier:@"ID_VIEWV2_VIEW"]; // myView.delegate = self; [self presentViewController:myView animated:YES completion:^{ [myView UpdateUploadProgressWithProgressValue:0.7]; [myView UpdateInitialTextWithInitialTextParameter:@"Initial text here"]; [myView UpdateAddressTextWithAddressTextParameter:@"Address text here"]; [myView UpdateOrangeTextWithOrangeTextParameter:@"Orange text here"]; [myView UpdateGreySubTextWithGreySubTextParameter:@"Grey sub text here"]; [myView UpdateControllerTypeTextWithControllerTypeTextParameter:@"Controller text here"]; [myView UpdateConnectionTypeTextWithConnectionTypeTextParameter:@"Connection text here"]; [myView UpdateStatusTextWithStatusTextParameter:@"Status text here"]; }]; } My Swift code: import Foundation import SwiftUI @objc public protocol ViewDelegate: NSObjectProtocol { @objc func ButtonPushed() } @objc class ViewController: UIViewController { @IBOutlet var ProgressBarView: UIView! // embed SwiftUI into the UIKit storyboard view controller override func viewDidLoad() { super.viewDidLoad() let childView = UIHostingController(rootView: ContentView()) addChild(childView) childView.view.frame = ProgressBarView.bounds ProgressBarView.addSubview(childView.view) childView.didMove(toParent: self) } @objc weak var delegate: ViewDelegate? //creating function for dictionary to store changes and create notification //This takes a value betw…
tagged with: notificationcenter
favorite count: 0
has answer: http://stackoverflow.com/a/77466915
upvote count: 0
score: -1
tagged with: swiftui
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/77466915
answer count: 1
tagged with: objective-c

http://stackoverflow.com/comment/136736432
has text: I don't think there will be a solution for this. Kind of an opposite problem would also be a command that produces more than one chunk of output data (like `cat largeTextFile`). As is you'd never know when that command is done running either.
comment on: http://stackoverflow.com/q/77556761
type: QuestionComment
type: Comment
score: 0

xamarin.forms
tag name: xamarin.forms
type: Tag
tags question: http://stackoverflow.com/q/77431878

http://stackoverflow.com/q/77494930
has answer: http://stackoverflow.com/a/77601255
downvote count: 0
answer count: 1
has title: Does XCTest methods generated dynamically by testInvocations work with xcodebuild's -only-testing?
favorite count: 0
tagged with: ios
type: AnsweredQuestion
upvote count: 4
has body: I have an app which needs to dynamically generate test methods in its XCTestCase subclass. I'm using +(NSArray<NSInvocation*>*)testInvocations to dynamically generate test methods at runtime with the following (dummy) names: example_test, permissions_location_test and permissions_many_test. Below is a simplified, ready-to-be-pasted-into-Xcode code. @import XCTest; @import ObjectiveC.runtime; @interface ParametrizedTests : XCTestCase @end @implementation ParametrizedTests + (NSArray<NSInvocation *> *)testInvocations { NSLog(@"testInvocations() called"); /* Prepare dummy input */ __block NSMutableArray<NSString *> *dartTestFiles = [[NSMutableArray alloc] init]; [dartTestFiles addObject:@"example_test"]; [dartTestFiles addObject:@"permissions_location_test"]; [dartTestFiles addObject:@"permissions_many_test"]; NSMutableArray<NSInvocation *> *invocations = [[NSMutableArray alloc] init]; NSLog(@"Before the loop, %lu elements in the array", (unsigned long)dartTestFiles.count); for (int i = 0; i < dartTestFiles.count; i++) { /* Step 1 */ NSString *name = dartTestFiles[i]; void (^anonymousFunc)(ParametrizedTests *) = ^(ParametrizedTests *instance) { NSLog(@"anonymousFunc called!"); }; IMP implementation = imp_implementationWithBlock(anonymousFunc); NSString *selectorStr = [NSString stringWithFormat:@"%@", name]; SEL selector = NSSelectorFromString(selectorStr); class_addMethod(self, selector, implementation, "v@:"); /* Step 2 */ NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector]; NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; invocation.selector = selector; NSLog(@"RunnerUITests.testInvocations(): selectorStr = %@", selectorStr); [invocations addObject:invocation]; } NSLog(@"After the loop"); return invocations; } @end I can run all these tests at once using: xcodebuild test \ -scheme Landmarks \ -destination 'platform=iOS Simulator,name=iPhone 15' Excerpt from above command's stdout: Test Suite 'Selected te…
tagged with: objective-c
score: 4
tagged with: xcuitest
tagged with: xctest
type: Question
accepted answer: http://stackoverflow.com/a/77601255

http://stackoverflow.com/comment/136511061
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77418597
score: 0
has text: I'm working with a string (i.e. "a"), how do I get a key code from the string? I have logic to do this using kTISPropertyUnicodeKeyLayoutData, but that isn't available for languages like Japanese.

http://stackoverflow.com/q/77518160
tagged with: lipo
type: Question
answer count: 1
score: 0
has answer: http://stackoverflow.com/a/77880283
type: UnansweredQuestion
has body: I am relatively new to iOS and have been trying really hard to diagnose and find a way to start generating XCFramework instead of .Framework that was being built earlier until xCode 10. I have went through many different blogs and answers on SO as well but could not find a solution to my issue. I need to build XCFramework with support for both iOS device as well as iOS Simulator on M1 architecture. I have pasted below, the old as well as the new build scripts that I have been experimenting with. OLD SCRIPT: set -e # If we're already inside this script then abort `if [ -n "$RW_MULTIPLATFORM_BUILD_IN_PROGRESS" ]; then exit 0 fi export RW_MULTIPLATFORM_BUILD_IN_PROGRESS=1 RW_FRAMEWORK_NAME=${PROJECT_NAME} RW_INPUT_STATIC_LIB="lib${PROJECT_NAME}.a" RW_FRAMEWORK_LOCATION="${BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}.framework" function build_static_library { # Will rebuild the static library as specified # build_static_library sdk xcrun xcodebuild -project "${PROJECT_FILE_PATH}" \ -target "${TARGET_NAME}" \ -configuration "${CONFIGURATION}" \ -sdk "${1}" \ ONLY_ACTIVE_ARCH=NO \ BUILD_DIR="${BUILD_DIR}" \ OBJROOT="${OBJROOT}/DependentBuilds" \ BUILD_ROOT="${BUILD_ROOT}" \ SYMROOT="${SYMROOT}" $ACTION }` `function make_fat_library { # Will smash 2 static libs together # make_fat_library in1 in2 out xcrun lipo -create "${1}" "${2}" -output "${3}" }` # 1 - Extract the platform (iphoneos/iphonesimulator) from the SDK name `if [[ "$SDK_NAME" =~ ([A-Za-z]+) ]]; then RW_SDK_PLATFORM=${BASH_REMATCH[1]} else echo "Could not find platform name from SDK_NAME: $SDK_NAME" exit 1 fi` # 2 - Extract the version from the SDK `if [[ "$SDK_NAME" =~ ([0-9]+.*$) ]]; then RW_SDK_VERSION=${BASH_REMATCH[1]} else echo "Could not find sdk version from SDK_NAME: $SDK_NAME" exit 1 fi` # 3 - Determine the other platform `if [ "$RW_SDK_PLATFORM" == "iphoneos" ]; then RW_OTHER_PLATFORM=iphonesimulator else RW_OTHER_PLATFORM=iphoneos fi` # 4 - Find the build directory `if [[ "$BUILT_PRODUCTS_DIR" =~ (.*)$…
tagged with: xcframework
has title: Unable to build XCFramework for my existing project that was building .Framework file from Static Library
tagged with: ios
tagged with: objective-c

http://stackoverflow.com/q/77431878
type: Question
answer count: 1
tagged with: xamarin.forms
score: 0
has title: Can NSUserDefaults work across different code bases?
has comment: http://stackoverflow.com/comment/136589910
tagged with: nsuserdefaults
has comment: http://stackoverflow.com/comment/136509451
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136508360
tagged with: objective-c
has body: I am trying to share data between an objective c iOS appliation and a c# xamarin forms application using app groups. I am setting up the initial data in the objective c project and passing the data using the shared data "clipboard" available for app groups. This is my objective c code that initializes and posts the string. NSString *appGroupId = @"group.sample"; NSUserDefaults *groupUserDefaults = [[NSUserDefaults alloc] initWithSuiteName:appGroupId]; [groupUserDefaults setValue:offlineMsg forKey:@"RunwayRequest"]; [groupUserDefaults synchronize]; This is my c# code in a Xamarin.Forms application. string groupName = "group.sample"; NSUserDefaults shared = new NSUserDefaults(); shared.AddSuite(groupName); var test = shared.ValueForKey((NSString)"RunwayRequest"); It is always returning a null values but I think I am adding the string to the shared folder, but I am unable to retrieve the data in the other project. I have added the app group identifier to both provisioning profiles. I don't think I have to add anything to the plist file but I am not positive.
has answer: http://stackoverflow.com/a/77450299
tagged with: c#

http://stackoverflow.com/q/77518382
has comment: http://stackoverflow.com/comment/136663781
has comment: http://stackoverflow.com/comment/136661491
answer count: 0
has comment: http://stackoverflow.com/comment/136661108
tagged with: ios
has comment: http://stackoverflow.com/comment/136686271
has comment: http://stackoverflow.com/comment/136660921
has comment: http://stackoverflow.com/comment/136661281
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136661522
has title: [<UICollectionViewCell 0x14fd06a80> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
has comment: http://stackoverflow.com/comment/136663775
tagged with: uicollectionview
has comment: http://stackoverflow.com/comment/136660894
has comment: http://stackoverflow.com/comment/136664009
has body: I've been getting the error message "[<UICollectionViewCell 0x14fd06a80> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key" for an image attached to a custom cell in a UICollectionView. The cell's IBoutlets are correctly linked up in the interface editor. There are no warning icons next to them. I'm not quite sure whats going on. Here's the code for the custom cell: #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface CollectionViewCell : UICollectionViewCell @property (nonatomic, weak) IBOutlet UILabel *maskName3; @property (nonatomic, weak) IBOutlet UIImageView *maskImage; @end NS_ASSUME_NONNULL_END Here's what I've got in the interface builder:
score: 0
has comment: http://stackoverflow.com/comment/136663019
has comment: http://stackoverflow.com/comment/136666093
type: Question
type: UnansweredQuestion

http://stackoverflow.com/comment/136661108
comment on: http://stackoverflow.com/q/77518382
score: 0
has text: It isn't. The crash message tells you that.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/77477713
has comment: http://stackoverflow.com/comment/136602539
has comment: http://stackoverflow.com/comment/136600942
answer count: 0
tagged with: keywindow
has body: Since the upgrade from iOS 15 to iOS 17, my iPad app has been crashing when I try to display modal popovers with the following error and I am unable to resolve the issue: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modal view controller on itself. Presenting controller is <VolumeVC: 0x7fc81882c520>.' For context, I've been using the following utility class throughout my app to first get the top most view controller in the window so that I can then display a modal popover with a view controller in it. Utility.m + (UIViewController*)topViewController { UIViewController *topVC = [[UIApplication sharedApplication] keyWindow].rootViewController; NSLog(@"Utility::topViewController(): topVC is: %@", topVC); int countLoops = 0; while (topVC.presentedViewController != nil) { topVC = topVC.presentedViewController; NSLog(@"Utility::topViewController(): In loop, topVC is: %@, countLoops is: %i", topVC, countLoops); countLoops++; if (countLoops > 25) { break; } } return topVC; } + (void)showDialogiPad:(UIViewController *)contentVC fromPresentingVC:(UIViewController *)presentingVC inView:(UIView *)view atFrame:(CGRect)frame withDirection:(UIPopoverArrowDirection)direction { // Choose the presentation style in which the content is displayed in a popover view contentVC.modalPresentationStyle = UIModalPresentationPopover; // Set the popover size, anchor location and direction contentVC.popoverPresentationController.sourceRect = frame; contentVC.popoverPresentationController.sourceView = view; contentVC.popoverPresentationController.permittedArrowDirections = direction; // Set the arrow direction for the popover popoverVC.permittedArrowDirections = direction; // Present the popover presentation controller [presentingVC presentViewController:contentVC animated:YES completion:nil]; } An example of how this gets called from elsewhere in the code is the following: // Show the volume view controller in a popover [Utilit…
tagged with: uipopoverpresentationcontroller
has comment: http://stackoverflow.com/comment/136601373
tagged with: ios
has title: iOS 17 crash with presenting modal view controller on itself using deprecated keyWindow
has comment: http://stackoverflow.com/comment/136602277
has comment: http://stackoverflow.com/comment/136589492
has comment: http://stackoverflow.com/comment/136601854
type: Question
has comment: http://stackoverflow.com/comment/136589630
has comment: http://stackoverflow.com/comment/136601414
tagged with: objective-c
type: UnansweredQuestion
tagged with: crash
score: 0

http://stackoverflow.com/comment/136615066
type: QuestionComment
type: Comment
has text: ok, worked out the problem. I couldn't attach the collectionview as an outlet because I had attached a search bar to the controller and whenever I tried to attach it it kept trying to attach to the search bar and so wouldn't show up the collection view. solved that bug. However now I'm getting this: 'NSInternalInconsistencyException', reason: 'could not dequeue a view of kind: UICollectionElementKindCell with identifier cell1 - must register a nib or a class for the identifier or connect a prototype cell in a storyboard' but my storyboard does contain a prototype cell
comment on: http://stackoverflow.com/q/77490512
score: 0

http://stackoverflow.com/a/77472643
type: Answer
answers question: http://stackoverflow.com/q/77446440
downvote count: 0
has body: What is chunkSize? Base64 increases original size at 4/3 rounded up. So if yours chunkSize is not divided at 3, result will have dummy characters. To avoid dummy characters in the result you should use chunkSize dividable to 3.
score: 1
upvote count: 1

http://stackoverflow.com/q/77535525
type: Question
has comment: http://stackoverflow.com/comment/136706235
answer count: 1
type: UnansweredQuestion
tagged with: objective-c-runtime
tagged with: getter
has title: How to dynamically set a getter for an Objective-C object property?
has answer: http://stackoverflow.com/a/77538466
tagged with: objective-c
has body: FooClass has a property called foo. It's declared as @property (nullable, nonatomic, readonly, strong) id foo and it has NO underlying storage, it's not synthesized. It's just a getter that by default returns nil. I would like to change the implementation of this getter. I would like to create a new block/function and inject it into an object so that it replaces the original implementation. IMPORTANT: subclassing is NOT an option. I need to take the object as is. ALSO: I need to do it for only one, single instance, not the whole class! How can I do it?
has comment: http://stackoverflow.com/comment/136700943
score: 0
has comment: http://stackoverflow.com/comment/136696191
tagged with: properties

http://stackoverflow.com/comment/136744221
type: QuestionComment
type: Comment
has text: As mentioned in the previous command terminationHandler doesn't get called. I have tried it. I will be happy if you could show me a sample code with terminationHandler working for cd command along with above the code.
score: 0
comment on: http://stackoverflow.com/q/77556761

http://stackoverflow.com/a/77486926
has body: I managed to solve it with NSDataAsset. When i pass it the name of the file i get it back and then can either save it with FileManager in Swift or send the bytes to flutter. if let asset = NSDataAsset(name:"audio1") { print(asset) result(asset.data) } else { print("Resource not found for tag: \(tag)") result(FlutterError(code: "RESOURCE_NOT_FOUND", message: "Resource not found for tag: \(tag)", details: nil)) } or with if let asset = NSDataAsset(name:"audio1") { // Get the directory to save the file let dir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! // Specify the file name and type let fileURL = dir.appendingPathComponent("audio1.mp3") // Write the NSDataAsset to the file do { try asset.data.write(to: fileURL) print("File saved to \(fileURL.absoluteString)") result(fileURL.absoluteString) } catch { print("Error saving file: \(error)") result(FlutterError(code: "ERROR_SAVING_FILE", message: "Error saving file: \(error)", details: nil)) } } else { print("Resource not found for tag: \(tag)") result(FlutterError(code: "RESOURCE_NOT_FOUND", message: "Resource not found for tag: \(tag)", details: nil))
answers question: http://stackoverflow.com/q/77479986
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/77479986
score: 0

http://stackoverflow.com/q/77490512
has comment: http://stackoverflow.com/comment/136613359
favorite count: 0
has comment: http://stackoverflow.com/comment/136614991
score: -1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/77497283
has comment: http://stackoverflow.com/comment/136615066
linked to: http://stackoverflow.com/q/40633613
has body: I've been trying to get a collection view working properly in iOS. I've been following this question: how to create custom UICollectionViewCell I think I have most of it correct, I'm using the tutorials custom cell class exactly (see the link for the code for that) but I keep running into an error when I access the view controller with the collection view. Here is my code: #import "BackPackController.h" #import "UICollectionViewCell+CollectionViewCell.h" @interface BackPackController () <UICollectionViewDelegate, UICollectionViewDataSource> @end @implementation BackPackController NSArray *itemArray; //our item array - (void)viewDidLoad { [super viewDidLoad]; itemArray = [[NSUserDefaults standardUserDefaults] objectForKey:@"PlayerItems"]; //get the players items from the user defaults and make an array of them _itemGrid.delegate = self; _itemGrid.dataSource = self; //[_itemGrid setDataSource:self]; //[_itemGrid registerClass:CollectionViewCell.self forCellWithReuseIdentifier:@"cell1"]; } - (nonnull __kindof UICollectionViewCell *)collectionView:(nonnull UICollectionView *)collectionView cellForItemAtIndexPath:(nonnull NSIndexPath *)indexPath { NSLog(@"Got this far"); CollectionViewCell *cell1 = [_itemGrid dequeueReusableCellWithReuseIdentifier:@"cell1" forIndexPath:indexPath]; [cell1.customLabel setText:itemArray[indexPath.row]]; return cell1; } - (NSInteger)collectionView:(nonnull UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return itemArray.count; } - (CGSize)collectionView:(UICollectionView *)collectionView layout: (UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ return CGSizeMake(100, 100); } I have correctly attached the controller as delegate and data source as far as I know. the NSLog in the code above does print its message so I know that cellForItemAtIndexPath method is being called. However as soon as it is called I am getting this error back and I am struggling to understand exa…
accepted answer: http://stackoverflow.com/a/77509263
has answer: http://stackoverflow.com/a/77509263
upvote count: 0
tagged with: ios
tagged with: uicollectionview
has comment: http://stackoverflow.com/comment/136611807
answer count: 2
has comment: http://stackoverflow.com/comment/136611848
tagged with: objective-c
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/136614650
has title: Correctly create uicollection view in iOS using Objective C
possible better answer: http://stackoverflow.com/a/77497283

http://stackoverflow.com/comment/136663349
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/77513073
type: Comment
has text: @Jobalisk Create a custom UICollectionViewCell and put it on this cell, you decide whether to do it programmatically or with an IBOutlet. [UIImage imageNamed] takes a string as an input parameter, so you can use it directly instead of wrapping it again with "%@". `stringWithFormat` is used for kind of string interpolation

http://stackoverflow.com/a/77880283
downvote count: 0
answers question: http://stackoverflow.com/q/77518160
upvote count: 2
has body: I had a similar problem. In my case the problem was, when searching the .xcarchive file I noticed that the .framework file was not in /.xcarchive/Products/Library/Frameworks/ but in /.xcarchive/Products/@rpath/ You can either change this in your script for it to find your .framework file or change it in Xcode under Build Settings -&gt; Installation Directory
type: Answer
score: 2

http://stackoverflow.com/q/77509555
type: UnansweredQuestion
has body: Problem After recently upgrading my Xcode and Swift installs to Xcode 15, when I compile and launch one of my applications, I get the following error: dyld[84548]: Symbol not found: _OBJC_CLASS_$_NSError Referenced from: <DB944C1D-1AD6-3A8B-8BEC-D8454DC07A6A> /Users/alex/Library/Developer/Xcode/DerivedData/AJRFoundationLinkTest-gypsogziwzwysmepcqeawntjqomo/Build/Products/Debug/AJRInterface.framework/Versions/A/AJRInterface Expected in: <94BC2179-161F-39BD-BFB8-D55BBBD3B8DB> /Users/alex/Library/Developer/Xcode/DerivedData/AJRFoundationLinkTest-gypsogziwzwysmepcqeawntjqomo/Build/Products/Debug/AJRFoundation.framework/Versions/A/AJRFoundation So what's weird here is that AJRInterface seems to be expecting to find NSError in AJRFoundation rather than Foundation. This code all worked fine on the previous version of Xcode. Note that I did have some other changes, but I reverted to a clean copy with git, and the error still reproduced, so the only "change" here is the compiler and linker versions. Does anyone have any idea of how to possibly diagnose this? Attempted Diagnostics I'm a bit at a loss as to how to diagnose this one. I did played around with otool using various options trying to see if some piece of code in AJRInterface was somehow referencing something in AJRFoundation rather than Foundation, but I couldn't find anything obvious. Likewise, I tried otool on AJRFoundation to see if I was somehow defining a class called NSError, but I also couldn't find anything. Note that otool and Swift don't play completely nice with each, especially because otool doesn't de-mangle Swift names, which makes reading the output a little awkward. Hack of a Workaround For the moment, I've managed to work around this by adding the following code to AJRFoundation: #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wobjc-property-implementation" #pragma clang diagnostic push #pragma clang diagn…
has title: Xcode linker is confusing symbols that should exist in Foundation as existing in another framework
answer count: 0
tagged with: compilation
tagged with: objective-c
type: Question
tagged with: xcode
has comment: http://stackoverflow.com/comment/136646794
score: 0
tagged with: linker
tagged with: swift
has comment: http://stackoverflow.com/comment/136650863

http://stackoverflow.com/comment/136743240
comment on: http://stackoverflow.com/a/77565515
score: 0
type: AnswerComment
type: Comment
has text: @SAHM – Well, no offense was intended. We’ve all been there. (Literally.) I’m glad you took it in the spirit intended.

http://stackoverflow.com/a/77574107
has body: It is annoying. The problem is that when you choose to build the macOS version of the app by selecting a Mac as the build target, then the definitions of TARGET_OS_MACCATALYST and TARGET_OS_IPHONE are both set to 1. When you select an iOS device or iOS simulator as the build target, then TARGET_OS_MACCATALYST is set to 0 while TARGET_OS_IPHONE is set to 1. I suspect Apple did it this way because a Mac Catalyst app is basically an iOS app, just built with a compatibility layer for macOS. In my own iOS app that also supports Mac Catalyst, I use #if TARGET_OS_MACCATALYST around code that is only for the macOS version, and I use #if !TARGET_OS_MACCATALYST around code that is only for the iOS version. You can see these definitions easily enough. Right-click on TARGET_OS_MACCATALYST and choose "Jump to Definition". You will be taken to the TargetConditionals.h file. Depending on your build target, you will be taken to different parts of that header file where several TARGET_OS_XXX macros are set to 0 or 1 based on the target. Try it for a Mac target then try it for an iOS target and you will see the appropriate definitions.
has comment: http://stackoverflow.com/comment/136759237
upvote count: 1
has comment: http://stackoverflow.com/comment/136759315
accepted answer of: http://stackoverflow.com/q/77573776
downvote count: 0
has comment: http://stackoverflow.com/comment/136758995
score: 1
answers question: http://stackoverflow.com/q/77573776
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/136663775
comment on: http://stackoverflow.com/q/77518382
type: Comment
score: 0
has text: I've checked that. That doesnt seem to be the issue either. Here's my code for the dequeing:- (nonnull __kindof Celler1 *)collectionView:(nonnull UICollectionView *)collectionView cellForItemAtIndexPath:(nonnull NSIndexPath *)indexPath { //NSLog(@"Got this far"); Celler1 *cell3 = [_maskGrid dequeueReusableCellWithReuseIdentifier:@"Celler1" forIndexPath:indexPath];
type: QuestionComment

http://stackoverflow.com/comment/139522088
type: AnswerComment
comment on: http://stackoverflow.com/a/78296386
type: Comment
has text: Hi, no i am not using this lib... The problem was -> I had to move RNSplashScreen.show() into the SceneDelegate file, usually this call is in AppDelegate, but with implemented scenes it blocks the main thread and carplay scene delegate cannot connect
score: 0

http://stackoverflow.com/comment/136604766
score: 0
type: QuestionComment
has text: I tried to reproduce the issue and I get "Unknown type name 'Extern'; did you mean 'extern'?"
type: Comment
comment on: http://stackoverflow.com/q/77484919

http://stackoverflow.com/comment/136614650
type: Comment
score: 0
has text: when I don't have it commented out it fails with a symbols error
comment on: http://stackoverflow.com/q/77490512
type: QuestionComment

facebook
tag name: facebook
tags question: http://stackoverflow.com/q/77518834
type: Tag
tags question: http://stackoverflow.com/q/78811488

http://stackoverflow.com/comment/136604210
type: QuestionComment
has text: I think for this basic questions can answer Stackoverlow's AI: https://stackoverflow.com/ai/search
type: Comment
comment on: http://stackoverflow.com/q/77484919
score: 0

http://stackoverflow.com/comment/136601373
comment on: http://stackoverflow.com/q/77477713
type: Comment
has text: @Larme I think you are correct about the race condition. It looks like the view controller ("volumeVC") has not been dismissed completely by the time I try to present it again - so "volumeVC" incorrectly becomes the top most view controller as I am trying to present it again. Are there ways to wait for the view controller to be completely dismissed in the completion block?
score: 0
type: QuestionComment

http://stackoverflow.com/a/77507016
has body: I was able to use the rawValue property on the NSEnum. My Autocomplete didn't suggest this to me. UInt32(type.rawValue)
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/77504380
answers question: http://stackoverflow.com/q/77504380
score: 0
has comment: http://stackoverflow.com/comment/136642782

http://stackoverflow.com/comment/139310129
type: QuestionComment
score: 0
type: Comment
has text: in my implementation I have added next and prev button and it work on CarPlay simulator and also some cars ... but on a BMW (and I suppose in some other car) it show Seek buttons even if I don't added that buttons !!! Do you have found some workaround about that ?
comment on: http://stackoverflow.com/q/77506853

http://stackoverflow.com/comment/136686271
score: 0
type: QuestionComment
has text: maybe, its all working now at least.
comment on: http://stackoverflow.com/q/77518382
type: Comment

http://stackoverflow.com/q/77502487
has body: I have a layer-hosting NSView subclass that draws itself using a CALayer object set as its layer. Since it's not a layer-backed view, it doesn't redraw during drawRect: nor during updateLayer, but during drawLayer:inContext: after I call setNeedsDisplay on its layer. The problem is that the layer must adapt to the application appearance (it uses system NSColor objects), and appkit doesn't seem to manage this situation. Apple says that one needs to set the layer's content during drawRect: or updateLayer, otherwise the colors don't adapt to the appearance. Indeed, they don't update in drawLayer:inContext: The current (ugly) solution I use is to call -display directly on the layer (which Apple says I should not do) within the updateLayer method (of another view since the view hosting the layer isn't send updateLayer, given that it's not a layer-backed view). Calling setNeedsDisplay on the layer rather than display does not work, as the layer would not redraw its content within the updateLayer call, but after. Is there another solution?
tagged with: objective-c
type: UnansweredQuestion
tagged with: nsview
has title: How to make CALayer adapt to the application appearance using drawlayer:inContext:?
favorite count: 0
answer count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/136758756
score: 2
tagged with: calayer
downvote count: 0
has comment: http://stackoverflow.com/comment/136755013
type: Question

http://stackoverflow.com/comment/136660894
comment on: http://stackoverflow.com/q/77518382
type: Comment
has text: It seems that the cell is of class `UICollectionViewCell` and not of the subclass `CollectionViewCell`
type: QuestionComment
score: 0

http://stackoverflow.com/q/77551705
score: 2
type: Question
downvote count: 0
has body: I usually use [NSNull new] if I want a NSNull object, but today I noticed that NSNull class provided a class method [NSNull null] to create a NSNull object. I wonder what is the difference between [NSNull new] and [NSNull null]? is it a wrong way to use [NSNull new] to create an NSNull object?
has title: What is the difference between [NSNull new] and [NSNull null]?
accepted answer: http://stackoverflow.com/a/77551882
linked to: http://stackoverflow.com/q/16600350
favorite count: 0
has answer: http://stackoverflow.com/a/77552118
upvote count: 2
type: AnsweredQuestion
tagged with: objective-c
has answer: http://stackoverflow.com/a/77551882
possible better answer: http://stackoverflow.com/a/77552118
tagged with: nsnull
answer count: 2

http://stackoverflow.com/comment/136743161
score: 1
type: Comment
has text: Other than making the code look more complex, what is the downside of using the `weakSelf` pattern when it isn't needed?
comment on: http://stackoverflow.com/a/77565515
type: AnswerComment

http://stackoverflow.com/comment/136673769
comment on: http://stackoverflow.com/q/77518826
score: 0
has text: Yes that is true and I know that. This question is about something non-related, it's how my PCH file is no longer applied to my ojective-c file.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/136509451
type: Comment
has text: I defined using suite name for both do you see any issues with the code?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77431878

http://stackoverflow.com/q/77513052
has answer: http://stackoverflow.com/a/77513073
answer count: 1
tagged with: uicollectionview
accepted answer: http://stackoverflow.com/a/77513073
favorite count: 0
score: -1
type: Question
has comment: http://stackoverflow.com/comment/136655095
downvote count: 1
tagged with: uicollectionviewcell
has body: I've been working on a collection game using apple maps in Objective C. Each item you collect appears in a uicollectionview. it works perfectly fine until you get around 15 or so and have to start scrolling down the view, then I get this weird stacking effect seen in the picture. The kanohi found variable is working correctly and there are 21 cells there for 21 items. Here is my code (or at least the important bits): // // wallOfMasksController.m // Matoran Quest // // Created by Job Dyer on 12/11/23. // #import "wallOfMasksController.h" #import "UICollectionViewCell+CollectionViewCell.h" @interface wallOfMasksController ()<UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout> @end @implementation wallOfMasksController NSArray *maskArray; //our mask array NSArray *selectedMaskArray; //the mask we want to know more about UIImage *maskImage2; //the colourized mask image UIImage *outPutMask; //the mask we take to the individual mask viewer NSMutableArray *imagesInCollection; //an array of all the images NSMutableArray *collectedMasks2; //a list of the kinds of masks the player has collected. 1 entry for each unique kind of mask (colour as well as type) - (void)viewDidLoad { [super viewDidLoad]; maskArray = [[NSUserDefaults standardUserDefaults] objectForKey:@"PlayerMasks"]; //get the players masks from the user defaults and make an array of them //NSLog(@"monkey: %@", [[NSUserDefaults standardUserDefaults] objectForKey:@"PlayerMasks"]); _maskGrid.delegate = self; _maskGrid.dataSource = self; //NSLog(@"%@", maskArray); [_maskCount setText:[NSString stringWithFormat:@"Kanohi found: %d", (int)maskArray.count]]; // how many masks do we have? imagesInCollection = [[NSMutableArray alloc] init]; collectedMasks2 = [[NSUserDefaults standardUserDefaults] objectForKey:@"PlayerMaskCollectionList"]; if(collectedMasks2 == NULL){ //if there is no player masks collection key yet collectedMasks2 = [[NSMutableArray alloc] init]; //NSLog(@"refreshing2"…
upvote count: 0
has comment: http://stackoverflow.com/comment/136651529
has comment: http://stackoverflow.com/comment/136651412
tagged with: ios
type: AnsweredQuestion
tagged with: objective-c
has title: prevent cell stacking in UIcollectionView

http://stackoverflow.com/q/77499394
has title: unsupported Swift architecture in Objective-C
tagged with: ios-frameworks
answer count: 0
tagged with: ios
upvote count: 2
tagged with: ios-library
tagged with: objective-c
score: 2
has body: I've been working with a static library in iOS written in Swift. Below is the script I've been using to build the library into a fat framework (universal). # Type a script or drag a script file from your workspace to insert its path. #1. After then, make a fresh directory directory UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal # make sure the output directory exists mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" # 2. Copy Device (arm64) Framework to a fresh universal folder location cp -a "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/" #3. Copy Sim (x86_64) Frameworks's "MyFramework.swiftmodule" folder content and paste it in Fat (x86_64 + arm64) Frameworks's "MyFramework.swiftmodule" folder. SIMULATOR_SWIFT_MODULES_DIR="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule/." if [ -d "${SIMULATOR_SWIFT_MODULES_DIR}" ]; then cp -R "${SIMULATOR_SWIFT_MODULES_DIR}" "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule" fi # Step 4: Create universal binary file using lipo and place the combined executable in the copied framework directory lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}" # Step 5: Copy output to the project directory. cp -R "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}" # Step 6: Open Project Directory open "${PROJECT_DIR}"#1. After then, make a fresh directory directory UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal # make sure the output directory exists mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" # 2. Copy Device (arm64) Framework to a fresh universal folder location cp -a "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/…
type: Question
tagged with: swift
downvote count: 0
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/136575304
has text: I moved let publisher5 = NotificationCenter.default.publisher(for: NSNotification.Name("COM.CMW.UpdateGreySubText")) to the ProgressBar struct and am still getting the same error. I also tried moving the @Objc func and var GreySubText to the ProgressBar struct but still the same error messages. What am I doing wrong?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77466915

http://stackoverflow.com/q/77456242
favorite count: 0
tagged with: uitabbar
type: Question
upvote count: 1
downvote count: 0
type: UnansweredQuestion
answer count: 0
tagged with: uitabbarcontroller
score: 1
has title: iOS - UITabBarItem long titles overlap using UITabBarAppearance
tagged with: ios
has body: Ever since iOS 15+, developers have had to explicitly set the UITabBar Appearance. Before this, longer titles on tabs would dynamically resize a bit to make sure they didn't overlap. Now, they just overlap. We've been handling it by truncating too-long-titles but I want to make sure there's not some way to do this that I've missed. Our ApplicationDelegate class is in Objective-C so the code for the UITabBar Appearance is here: UITabBarAppearance *tabBarAppearance = [[UITabBarAppearance alloc] init]; [[UITabBar appearance] performSelector:@selector(setScrollEdgeAppearance:) withObject:tabBarAppearance]; In these pictures you can see tab bar items with the same titles. Before iOS 15, the title text was resized to prevent overlap. But clearly after iOS 15, the third title overlaps. Is there any possible way to reproduce the pre-iOS 15 behavior in terms of tab bar titles, or do we tell our customers "too bad?" Tab bar items before iOS 15: Tab bar items after iOS 15:
tagged with: objective-c
tagged with: uitabbaritem

http://stackoverflow.com/a/77450299
answers question: http://stackoverflow.com/q/77431878
score: 0
type: Answer
has body: Yeah, you don't have to add anything into info.plist. But there are also some details. First, you should enable App Group Capabilities for both iOS apps on Apple Developer portal. To sum up, Create a App Group, suppose the Identifier is group.sample. Create an App ID for each app separately, enable App Group Capabilities and add each App ID in the App Group. Generate a Provisioning Profiles for each app separately. Don't forget to include the correct Certificate and physical devices you want to deploy in Profiles. Second, add a key value for Entitlements.plist for each app. For more info, you could refer to App Groups. After the above steps, you could deploy the each app on your iOS device and share the data with app group now. Hope it helps!

http://stackoverflow.com/comment/136660225
type: Comment
has text: didn't know that was a thing. Always hated having to use NSStringWithFomat
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/77513073

http://stackoverflow.com/comment/136759315
type: Comment
has text: Ah, I understand the issue now. Basically, the value is different for native macOS as compared to Catalyst macOS. Thanks.
comment on: http://stackoverflow.com/a/77574107
score: 0
type: AnswerComment

uint32-t
type: Tag
tag name: uint32-t
tags question: http://stackoverflow.com/q/77504380

http://stackoverflow.com/a/78296386
has comment: http://stackoverflow.com/comment/139522088
has body: Are you using react-native-carplay for your implementation? I was struggling with this topic for some time and added an example with documentation on standalone CarPlay launch of react native apps as a pull request to that repo when I finally figured it out. Maybe it helps.
has comment: http://stackoverflow.com/comment/138047515
type: Answer
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/77579967

http://stackoverflow.com/q/77425911
score: 0
has title: Objective-C error message: Multiple methods named 'setBounds:' found with mismatched result, parameter type or attributes
has comment: http://stackoverflow.com/comment/136549793
type: UnansweredQuestion
has body: @implementation Circle - (void) setFillColor: (ShapeColor) c { fillColor = c; } - (void) setBounds: (ShapeRect) b { bounds = b; } - (void) draw { NSLog (@"drawing a circle at (%d %d %d %d) in %@", bounds.x, bounds.y, bounds.width, bounds.height, colorName(fillColor)); } @end // Circle void drawShapes (id shapes[], int count) { int i; for (i = 0; i < count; i++) { id shape = shapes[i]; [shape draw]; } } int main (int argc, const char * argv[]) { id shapes[1]; ShapeRect rect0 = { 0, 0, 10, 30 }; shapes[0] = [Circle new]; [shapes[0] setBounds: rect0]; [shapes[0] setFillColor: kRedColor]; drawShapes (shapes, 1); return (0); } I wrote this code block from the book called "Learn Objective-C on the mac and I got the error message from the title and this error "Passing '__strong id *' to parameter of type '__unsafe_unretained id *' changes retain/release properties of pointer" As a warning, I got this "Expression which evaluates to zero treated as a null pointer constant of type 'CGColorRef _Nullable' (aka 'struct CGColor *')" I would like to know how can I solve that. Here is the "@interface" @interface Circle : NSObject { ShapeColor fillColor; ShapeRect bounds; } - (void) setFillColor: (ShapeColor) fillColor; - (void) setBounds: (ShapeRect) bounds; - (void) draw; @end // Circle
answer count: 0
type: Question
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136513672
tagged with: xcode

http://stackoverflow.com/comment/136651529
comment on: http://stackoverflow.com/q/77513052
type: QuestionComment
has text: 99% of the code that you have in `cellForItemAtIndexPath` should be in your custom cell class. The only code in `cellForItemAtIndexPath` should be giving data to the cell.
type: Comment
score: 0

http://stackoverflow.com/a/77487543
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/77484919
upvote count: 1
has body: extern modifier means the value is assigned to variable in some other file, so you should not perform it in-place. There are two options to solve your issue. Option 1: Declare your variable in global.h as static instead of extern. static int ue = 1; Option 2: Create an Obj-C class with global.h and global.m files. Remove all contents (interface/implementation) from both files (you should only keep the #import directive in .m file). In your .h file declare an extern variable. extern int ue; In your .m file assign the value: int ue = 1;
score: 1
answers question: http://stackoverflow.com/q/77484919
downvote count: 0

http://stackoverflow.com/comment/136743313
has text: @adamjansch – The downside is really negligible (hence my hesitancy to engage in the code change unless it was important). The performance change would be unobservable and we’re only talking about three extra lines of code. Sure, if I was doing a code review and saw this, I might tend to be extra cautious looking at the rest of the code. But that’s it. It’s not a “problem,” but rather just an unnecessary bit of code suggesting a conceptual misunderstanding on the part of the author.
score: 2
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77565515

http://stackoverflow.com/comment/136743664
has text: @SAHM – It’s hard to say in the abstract whether you’d want one or two `strongSelf` references. It depends entirely upon the purpose of each of the two separate `strongSelf` references. But you could use two. (I can’t recall a practical, real-world case where I needed two; I frequently didn’t even need one.) But you could often get away with one. And you often don’t need any. (And if you were using it for nullability purposes, there were would be tests that it wasn’t null, too.)
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/77565515

memory-management
tag name: memory-management
tags question: http://stackoverflow.com/q/77589293
type: Tag
tags question: http://stackoverflow.com/q/78126489
tags question: http://stackoverflow.com/q/78757372

http://stackoverflow.com/comment/136660921
has text: It is, I've included another image
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77518382

http://stackoverflow.com/a/77423851
answers question: http://stackoverflow.com/q/77419925
type: AcceptedAnswer
score: 0
has body: Definitively this looks like a bug, some fonts exhibit the buggy behavior some don't. For example non-existing fonts, or maybe fonts with typos in names, work just file, the system falls back to the Times New Roman font. Printing a problematic attributed string outputs this: > po attributedString Text with bold or italics maybe. { NSFont = "\"LastResort 14.00 pt. P [] (0x7ff575f14980) fobj=0x7ff575f14980, spc=16.06\""; NSKern = 0; NSParagraphStyle = "Alignment Natural, LineSpacing 0, ParagraphSpacing 14, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode WordWrapping, Tabs (\n), DefaultTabInterval 36, Blocks (\n), Lists (\n), BaseWritingDirection LeftToRight, HyphenationFactor 0, TighteningForTruncation YES, HeaderLevel 0 LineBreakStrategy 0 PresentationIntents (\n) ListIntentOrdinal 0 CodeBlockIntentLanguageHint ''"; NSStrokeColor = "sRGB IEC61966-2.1 colorspace 0 0 0 1"; NSStrokeWidth = 0; } For some fonts (or perhaps some string values), macOS falls back to Apple's Last Resort font font. This is clearly the incorrect behaviour for some of the existing fonts, and this is why you see those odd glyphs, as macOS incorrectly maps the font to the LastResort one, instead to the specified font, or at least to the second font specified in the CSS rule.
accepted answer of: http://stackoverflow.com/q/77419925
type: Answer

http://stackoverflow.com/comment/136485351
type: Comment
score: 1
comment on: http://stackoverflow.com/q/77418597
type: QuestionComment
has text: Post your code please.

http://stackoverflow.com/q/77420684
tagged with: uikit
type: Question
tagged with: swift
answer count: 1
score: 3
has body: I'm trying to use a Swift class in a mostly Objective-C project. This revolves around UIContentConfiguration for use with UITableViewCell. Here's my Swift code: @objc class MyCellConfiguration: NSObject, UIContentConfiguration { let label: String @objc init(label: String) { self.label = label } func makeContentView() -> UIView & UIContentView { return MyCellContent(self) } func updated(for state: UIConfigurationState) -> Self { return self } } class MyCellContent: UIView, UIContentView { // Implementation of this class is not relevant to the question } When I try to setup the cell in some Objective-C code, I get a compiler warning. If I ignore the warning, the app hangs at runtime when the code is reached. Here's the Objective-C code: #import "MyApp-Swift.h" // The bridging header is being imported UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:key forIndexPath:indexPath]; MyCellConfiguration *config = [[MyCellConfiguration alloc] initWithLabel:@"Some Label"]; cell.contentConfiguration = config; // warning here The compiler warning I receive is: Assigning to 'id<UIContentConfiguration> _Nullable' from incompatible type 'MyCellConfiguration *__strong' Why doesn't the compiler recognize that MyCellConfiguration conforms to the UIContentConfiguration protocol in the Objective-C code? Swift code recognizes the conformance just fine. For example, the following compiles without issue: let cell = UITableViewCell(style: .default, reuseIdentifier: "foo") cell.contentConfiguration = MyCellConfiguration(label: "foo") I'm using Xcode 15.0 on macOS 13.6.1.
downvote count: 0
has answer: http://stackoverflow.com/a/77420852
accepted answer: http://stackoverflow.com/a/77420852
favorite count: 0
has title: Can't assign instance of a Swift class conforming to a protocol to an Objective-C property expecting that protocol
tagged with: protocols
type: AnsweredQuestion
tagged with: objective-c
upvote count: 3

http://stackoverflow.com/comment/136731166
has text: Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/256071/discussion-between-rob-and-user717452).
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77554378

http://stackoverflow.com/comment/136710851
score: 0
has text: @Alexander, no. Outer product of two vectors does form a matrix and it supports multiplication of vectors of different sizes. It's not much harder to implement then "point-wise multiplication", but it's not the same.
type: Comment
comment on: http://stackoverflow.com/q/77542065
type: QuestionComment

http://stackoverflow.com/comment/136642782
has text: No need to initialize another object from it. It is redundant.`type.rawValue` would suffice. It returns an `UInt32` object aleeady.
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/77507016

http://stackoverflow.com/q/77518826
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136691986
tagged with: swift
tagged with: xcode
answer count: 0
has comment: http://stackoverflow.com/comment/136673853
linked to: http://stackoverflow.com/q/26408612
has title: My Framework's PCH file isn't applied after adding a Swift file to the project, Podfile
tagged with: cocoapods
tagged with: pch
has comment: http://stackoverflow.com/comment/136673687
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136673769
has body: I have a Workspace with 2 projects, where one is a "common" project with code to share between projects and targets and the other is my main IOS app. So, I have a podspec for it, and use that in my "main" projects podfile. This has worked well for years. Now, my "common" project has only contained objective-c files, and both it and my main project have PCH files where I have common imports. I am about to migrate to Swift (long overdue) so, I tried to just add a Test.swift to my common project. When I tried to do pod install, I got this error: The Swift pod X depends upon JSONModel, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies. So, I did that, but what happens now is that the project doesn't compile. More specifically, the #import's in my PCH files don't seem to be applied for some reason. PCH extract: #ifdef __OBJC__ #import "MyConstants.h" #endif Error example: projects/iphone/Pods/Headers/Public/MyCommons/Status.h:47:30: Unknown type name 'Role' , which is an enum, defined in MyConstants.h The weird thing is that I put a #warning inside the #ifdef and it IS logged when every file is compiled, including Status.h that I mention above. This is definitely not my expertise, so if someone knows more than me, pointers are appreciated. Optimally, I would like to be able to mix Swift and Objective-C in my commons module but still have the PCH file applied to the Objective-C files, until I have moved on 100%.
score: 0
linked to: http://stackoverflow.com/q/44672419
type: Question

http://stackoverflow.com/q/77506853
tagged with: objective-c
has comment: http://stackoverflow.com/comment/139365785
has body: I want to show skip forward, skip backward, previous track, next track on the locked screen. But seems skip forward/backward will just override previous/next track. That is only skip forward and skip backward controls will appear on the locked screen. I tried reordering and it is the same effect. - (void)setupRemoteTransportControls { // Get the shared MPRemoteCommandCenter [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; MPRemoteCommandCenter* commandCenter = [MPRemoteCommandCenter sharedCommandCenter]; // Add handler for Play Command [commandCenter.playCommand setEnabled:YES]; [commandCenter.playCommand addTarget:self action:@selector(playVideo)]; // [commandCenter.pauseCommand setEnabled:YES]; [commandCenter.pauseCommand addTarget:self action:@selector(pauseVideo)]; //try put skip first //[commandCenter.skipBackwardCommand setEnabled:YES]; //[commandCenter.skipBackwardCommand addTarget:self action:@selector(skipBackward)]; //[commandCenter.skipForwardCommand setEnabled:YES]; //[commandCenter.skipForwardCommand addTarget:self action:@selector(skipForward)]; [commandCenter.previousTrackCommand setEnabled:YES]; [commandCenter.previousTrackCommand addTarget:self action:@selector(prevTrack)]; [commandCenter.nextTrackCommand setEnabled:YES]; [commandCenter.nextTrackCommand addTarget:self action:@selector(nextTrack)]; [commandCenter.skipBackwardCommand setEnabled:YES]; [commandCenter.skipBackwardCommand addTarget:self action:@selector(skipBackward)]; [commandCenter.skipForwardCommand setEnabled:YES]; [commandCenter.skipForwardCommand addTarget:self action:@selector(skipForward)]; [commandCenter.changePlaybackPositionCommand setEnabled:true]; [commandCenter.changePlaybackPositionCommand addTarget:self action:@selector(changedThumbSliderOnLockScreen:)]; [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; }
tagged with: mpremotecommandcenter
has comment: http://stackoverflow.com/comment/139365767
has comment: http://stackoverflow.com/comment/139364906
has comment: http://stackoverflow.com/comment/139310129
type: Question
upvote count: 1
downvote count: 0
has title: MPRemoteCommandCenter how to show all controls/commands
type: UnansweredQuestion
answer count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/139365105
tagged with: ios

http://stackoverflow.com/comment/139365105
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77506853
type: QuestionComment
has text: Update: I have explicit disabled seek button like commandCenter.skipBackwardCommand setEnabled:NO and now track buttons are shown correctly

http://stackoverflow.com/comment/136661281
comment on: http://stackoverflow.com/q/77518382
type: Comment
has text: then why does it show up as collectionviewcell in the navigator in the 2nd picture? And why do the outlets connect to it?
score: 0
type: QuestionComment

http://stackoverflow.com/q/77589293
tagged with: objective-c
type: Question
has title: Store or copy AXUIElementRef from callback
tagged with: axuielement
has answer: http://stackoverflow.com/a/77590107
has body: I'm trying to store an AXUIElementRef provided by an AXObserverCallback callback. When the callback scope ends, I believe the struct gets freed and I'm no longer able to use it elsewhere. Is there a way to retain or copy this ref into my own data structure? Here is the relevant code: AXObserverCreate(..., &amp;observer_callback, ...); AXObserverAddNotification(..., ..., kAXWindowCreatedNotification, this); ... void observer_callback(AXObserverRef observer, AXUIElementRef windowRef, CFStringRef notificationName, void* inUserData) { applications* apps = (applications*)inUserData; if (CFEqual(notificationName, kAXWindowCreatedNotification)) { // memory error when trying to use windowRef outside of callback apps-&gt;add_window_ref(windowRef); } else if (CFEqual(notificationName, kAXUIElementDestroyedNotification)) { apps-&gt;remove_window_ref(windowRef); } } I know this is easily possible in Swift since this project does it.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/77590107
answer count: 1
tagged with: struct
tagged with: memory-management
score: 0

http://stackoverflow.com/comment/136758995
comment on: http://stackoverflow.com/a/77574107
type: AnswerComment
type: Comment
has text: Does this mean that answers on questions such as below are incorrect when they say "...for macOS: #define TARGET_OS_IPHONE 0" https://stackoverflow.com/a/39442872/1634905
score: 0

simd
tags question: http://stackoverflow.com/q/77542065
type: Tag
tag name: simd

http://stackoverflow.com/q/77504380
tagged with: uint32
has comment: http://stackoverflow.com/comment/136636212
answer count: 1
has comment: http://stackoverflow.com/comment/136638304
has title: Convert to UInt32 in Swift from NS_ENUM uint32_t in Objective-C
has answer: http://stackoverflow.com/a/77507016
accepted answer: http://stackoverflow.com/a/77507016
score: 0
type: Question
tagged with: swift
has body: I have this code... Objective-c: typedef NS_ENUM(uint32_t, EXType) { EXTypeBad = 0, EXTypeOK, EXTypeGood }; EXType type = EXTypeOK; Swift UInt32(type) But I get: initializer 'init(_:radix:)' requires that 'EXType' conform to 'StringProtocol' type: UInt32(type) What am I doing wrong? Thanks.
tagged with: uint32-t
type: AnsweredQuestion
tagged with: enums
tagged with: objective-c

http://stackoverflow.com/comment/136700920
has text: As I said, subclassing is not an option, and because of it, overriding a property getter via the means of the language is not an option. And swizzling here is the only solution it seems.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77538466
score: 0

http://stackoverflow.com/q/77573776
type: Question
tagged with: swift
downvote count: 0
has body: I am using the Texture/AsyncDisplayKit library in an app for iOS and macOS Catalyst. It has this known issue on macOS: https://github.com/TextureGroup/Texture/issues/1549 It basically throws the error Use of undeclared identifier 'CAEAGLLayer' when building for macOS Catalyst. Error comes from this block of code: // CAEAGLLayer if([[view.layer class] isSubclassOfClass:[CAEAGLLayer class]]){ _flags.canClearContentsOfLayer = NO; } If I comment this code out, then it builds successfully on macOS Catalyst. So, I figured that I could use the TARGET_OS_IPHONE macro to exclude this code when building for Catalyst: #if TARGET_OS_IPHONE // CAEAGLLayer if([[view.layer class] isSubclassOfClass:[CAEAGLLayer class]]){ _flags.canClearContentsOfLayer = NO; } #endif However, Xcode still continues to attempt to build this code and then fails. Why is #if TARGET_OS_IPHONE not excluding this code on macOS Catalyst? EDIT: While I did find a workaround solution from this link: https://github.com/nickaroot/Texture/commit/05a486e3275de53f2b0dfb24925fa528e2b610e6 by using #if !TARGET_OS_MACCATALYST instead of #if TARGET_OS_IPHONE, I still want to know why my original way doesn't work? The ! (not) way seems weird.
has title: Why is TARGET_OS_IPHONE not skipping over the code when building for Mac Catalyst?
score: 1
answer count: 1
tagged with: macos
favorite count: 0
linked to: http://stackoverflow.com/q/12132933
has answer: http://stackoverflow.com/a/77574107
type: AnsweredQuestion
tagged with: mac-catalyst
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/77574107
has comment: http://stackoverflow.com/comment/136758377
upvote count: 1
tagged with: xcode

http://stackoverflow.com/comment/136673687
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77518826
type: QuestionComment
has text: Tu call swift from Objective-C you need to include the project-Swift.h file in Objective-C code that use swift. You must also create a bridging header to enable swift to know about Objective-C classes.

http://stackoverflow.com/comment/136651521
score: 0
has text: Thanks @HangarRash I copied their code. I edited.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77513073

http://stackoverflow.com/comment/136719951
comment on: http://stackoverflow.com/a/77552118
score: 0
type: AnswerComment
type: Comment
has text: To add to your last point about `==` vs `isEqual:`, isn't the default implementation of `isEqual:` from `NSObject` a simple pointer equality (`==`) check?

http://stackoverflow.com/comment/136636212
comment on: http://stackoverflow.com/q/77504380
type: QuestionComment
has text: Have you tried `type.rawValue`?
score: 2
type: Comment

http://stackoverflow.com/comment/136660853
score: 0
type: AnswerComment
type: Comment
has text: Ok, so where then should I go about creating the imageview and label variables?
comment on: http://stackoverflow.com/a/77513073

http://stackoverflow.com/q/77479986
has body: I have a flutter application which is an audio guide. But i have the audio files in many languages so i want to use on demand resources on the IOS side. I opened the Runner from the ios folder in Xcode and added the assets and gave them tags. The audio files are of the type wav. But when requesting the images with the tag german i get no results. private func getDownloadRessources(tag: String, result: @escaping FlutterResult) { let resourceRequest = NSBundleResourceRequest(tags: [tag]) resourceRequest.beginAccessingResources { (error: Error?) in if let error = error { // Handle the error. print("Error accessing resources: \(error)") result(FlutterError(code: "RESOURCE_ERROR", message: "\(error) tag:\(tag)", details: error.localizedDescription)) } else { guard let resourceURL = resourceRequest.bundle.url(forResource: nil, withExtension: "wav") else { print("Resource not found for tag: \(tag)") result(FlutterError(code: "RESOURCE_NOT_FOUND", message: "Resource not found for tag: \(tag)", details: nil)) return } print("Resource URL: \(resourceURL.absoluteString)") result(resourceURL.absoluteString) } resourceRequest.endAccessingResources() } } In the code i have the tag german which is given, but the resourceRequest.bundle.url does still not find the ressource audio. I tried to get the path of Bundle.main and looked there for the audio but that didn't work. I gave the name to the method and it did still not find it. I looked inside the path of the resourcerequest bundle but did still not find the audio files. I tried with the Bundle.main method but still no luck in finding the images.
tagged with: on-demand-resources
has title: How to find the Ressource Path/Ressource itself in swift with on demand resources
type: AnsweredQuestion
tagged with: objective-c
tagged with: xcode
answer count: 1
score: 0
tagged with: flutter
type: Question
tagged with: swift
has answer: http://stackoverflow.com/a/77486926
accepted answer: http://stackoverflow.com/a/77486926

http://stackoverflow.com/comment/136601414
score: 1
type: QuestionComment
has text: You can always test `[Utility topViewController] == volumeVC` before calling the method. For the rest, it's hard to tell I guess... You get the error by spamming the button to show the volume VC. Avoid spamming the button? Disable it if needed, or skip its action? Make a `completion` on your method to match the `completion:` of `presentViewController:animated:completion:`?
type: Comment
comment on: http://stackoverflow.com/q/77477713

on-demand-resources
type: Tag
tag name: on-demand-resources
tags question: http://stackoverflow.com/q/77479986

http://stackoverflow.com/q/77504084
favorite count: 0
type: UnansweredQuestion
score: 1
answer count: 0
has body: I have an iPhone 12 Pro and I wrote code to access two cameras at same time. But it is only possible with the widecamera and frontcamera. Widecamera and ultrawide cameras at same time do not work. Do you know if it is possible with an iPhone 15 Pro? I use the functions with AVCaptureMultiCamSession. I have tried it with AVCaptureMultiCamSession on iPhone 12 Pro.
tagged with: ios
has title: Access to two Back Cameras on iphone 15 with AVCaptureMultiCamSession
tagged with: objective-c
tagged with: avfoundation
type: Question
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/136602539
has text: I agree @Larme I'm continuing to research a way to wait for completion of dismissal of the popover view controller.
score: 0
comment on: http://stackoverflow.com/q/77477713
type: QuestionComment
type: Comment

http://stackoverflow.com/q/77554378
tagged with: objective-c
answer count: 0
tagged with: xcode
has body: My app simply displays a phone number in a UITextView. I have made sure that the text view is enabled to detect phone numbers. And, indeed, when the user long presses on it, it will give the option to call or Send Message. If I click either one of these, the app simply crashes. As there is no code to handle anything and is just relying on built-in functionality, I get no error messages when the app crashes. The only thing remotely close I get is this: Updating selectors after delegate removal failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 99 named com.apple.commcenter.coretelephony.xpc was invalidated from this process." UserInfo={NSDebugDescription=The connection to service with pid 99 named com.apple.commcenter.coretelephony.xpc was invalidated from this process.} "Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question." Desired behavior is after I click the checkmark in inspector for it to detect phone numbers, a user can long press the number, choose send message, and have it open messages. The specific problem is this crashes it. The shortest code necessary to reproduce the problem is to add a Textview, click it, and in inspector, tel it to detect phone numbers. There, does that help others answer the question? cell.text = @"555-867-5309";
has comment: http://stackoverflow.com/comment/136724066
score: 0
type: Question
has comment: http://stackoverflow.com/comment/136729624
has comment: http://stackoverflow.com/comment/136728473
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136730234
has comment: http://stackoverflow.com/comment/136730162
has comment: http://stackoverflow.com/comment/136731166
has title: iOS UITextView Not Properly Handling Phone Number in Field
tagged with: ios

nsuserdefaults
tag name: nsuserdefaults
tags question: http://stackoverflow.com/q/77431878
type: Tag

http://stackoverflow.com/comment/136724066
comment on: http://stackoverflow.com/q/77554378
has text: There’s not enough here for us to reproduce the problem. I use `UITextView` with `dataDetectors` set to `.all` and it detects/calls phone numbers fine. Perhaps you can try doing this in a blank app and see if you can reproduce the problem there. Slowly add stuff to your new, blank project until you are able to reproduce the crash. And perhaps share details about the physical phone on which you are testing this (iOS version, model, etc.). But at this point, you do not appear to have shared any more information than you have in your [prior question](https://stackoverflow.com/q/77553442/1271826).
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/77513073
has body: You're re-adding maskImage and maskNameLabel again and again when cells are reused. Try to make it as sub-views of collection cell then reassign frame, color, image, text, etc. i.e: - (void)viewDidLoad { ... //Register custom cell with nib [_maskGrid registerNib:[UINib nibWithNibName:NSStringFromClass([MaskCollectionViewCell class]) bundle:nil] forCellWithReuseIdentifier:@"MaskCollectionViewCell"]; } - (nonnull __kindof UICollectionViewCell *)collectionView:(nonnull UICollectionView *)collectionView cellForItemAtIndexPath:(nonnull NSIndexPath *)indexPath { //Dequeu custom cell MaskCollectionViewCell *maskCell = [_maskGrid dequeueReusableCellWithReuseIdentifier:@"MaskCollectionViewCell" forIndexPath:indexPath]; if (noColourFlag == 0) { ... maskCell.maskImage.image = maskImage2; } else { [maskCell.maskImage setImage:[UIImage imageNamed:maskName]]; } //The same with maskNameLabel } Notice: always handle else condition. This might be the cell layout:
has comment: http://stackoverflow.com/comment/136660225
has comment: http://stackoverflow.com/comment/136663349
score: 0
has comment: http://stackoverflow.com/comment/136660853
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/136663666
answers question: http://stackoverflow.com/q/77513052
has comment: http://stackoverflow.com/comment/136651501
has comment: http://stackoverflow.com/comment/136651521
accepted answer of: http://stackoverflow.com/q/77513052

http://stackoverflow.com/comment/136509442
score: 0
type: QuestionComment
type: Comment
has text: My test app posts a keydown event with key code `kVK_ANSI_A`. If the input method is Dutch then "a" is inserted, if the input method is Japanse-Kana then "ち" is inserted. Japanese-Romaji: "あ", Greek: "α", Arabic: "ش"، I didn't test them all. The language setting doesn't matter.
comment on: http://stackoverflow.com/q/77418597

http://stackoverflow.com/comment/136743481
type: AnswerComment
comment on: http://stackoverflow.com/a/77565515
type: Comment
has text: @Rob out of curiosity, if I did need each of the strongSelf cases (i.e. if the code were different and the need was actually there), would it be proper to simply use the original strongSelf inside the second level of the nested block? I think this shows my understanding is still... weak. But I am trying.
score: 0

http://stackoverflow.com/comment/136614991
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77490512
has text: I couldn't attach the grid to iboutlet as it wouldn't let me. I've now gone and made it just a regular variable. Can you please answer this question with how you would set it out programmatically Mykyta iOS?

http://stackoverflow.com/comment/136487389
has text: An event without `CGEventKeyboardSetUnicodeString` works for me.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77418597
type: Comment

http://stackoverflow.com/comment/136615095
score: 0
type: QuestionComment
has text: Does this answer your question? [3 questions about extern used in an Objective-C project](https://stackoverflow.com/questions/7330048/3-questions-about-extern-used-in-an-objective-c-project)
type: Comment
comment on: http://stackoverflow.com/q/77484919

http://stackoverflow.com/comment/139364906
type: QuestionComment
comment on: http://stackoverflow.com/q/77506853
score: 1
type: Comment
has text: @LucaRocchi No. In my app, most of the time it shows Prev and Next for the locked screen. But sometimes it automatically changes to Seek buttons. I am not sure why it happens as I specifically use the Prev and Next button in my code.

linker
type: Tag
tags question: http://stackoverflow.com/q/77509555
tag name: linker

lipo
type: Tag
tag name: lipo
tags question: http://stackoverflow.com/q/77518160

http://stackoverflow.com/comment/136488819
score: 0
comment on: http://stackoverflow.com/a/77420852
type: AnswerComment
type: Comment
has text: Nice! I had noticed the weird documentation links between Swift and ObjC for `UIContentConfiguration` but I hadn't noticed the significance nor the lack of `NSObjectProtocol` conformance for the Swift version. Very interesting even if I need to study these details a bit more to fully understand. I just tried your work around and it works perfectly. And just 10 minutes ago I finished testing my reimplementation of `MyCellConfiguration` in Objective-C to avoid the issue. I should have been more patient.

http://stackoverflow.com/comment/136663781
comment on: http://stackoverflow.com/q/77518382
type: Comment
has text: I've changed my custom cell class to be called Celler1, I've associated it with the cell I'm using. I've reconstructed the entire view controller and all its subviews and I'm still getting the same issue
type: QuestionComment
score: 0

http://stackoverflow.com/q/77418597
type: Question
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1918841
has comment: http://stackoverflow.com/comment/136486578
tagged with: macos
has title: Creating keyboard events that interact with different language input methods
has comment: http://stackoverflow.com/comment/136511767
tagged with: keyboard
has comment: http://stackoverflow.com/comment/136487389
tagged with: keyboard-events
has comment: http://stackoverflow.com/comment/136485351
tagged with: internationalization
has comment: http://stackoverflow.com/comment/136508918
has body: I have a Mac app which needs to generate keystrokes and am doing this with CGEventCreateKeyboardEvent(), CGEventKeyboardSetUnicodeString() and CGEventPost(). This works fine with English, however if I change the keyboard input method to a non-English language, the keystrokes I am creating show up as English instead of going through the language I have set. For example, when I put in a "a" keystroke, if I set Japanese I am expecting to see a "あ", but instead I see a "a". Is it possible to get these APIs to pass through whatever input method is currently enabled? Or do I need a different API for that? Here is the relevant code. The variable 's' is a string that contains the character in question. In the example above, it is simply "a". NSRange composedRange = [s rangeOfComposedCharacterSequencesForRange:NSMakeRange(0, s.length)]; unichar *characters = malloc(sizeof(unichar) * composedRange.length); [s getCharacters:characters range:composedRange]; CGEventRef eventRef = CGEventCreateKeyboardEvent( nil, 0, true ); CGEventKeyboardSetUnicodeString(eventRef, composedRange.length, characters); CGEventPost(kCGSessionEventTap, eventRef);
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136486297
has comment: http://stackoverflow.com/comment/136512444
has comment: http://stackoverflow.com/comment/136511061
answer count: 0
has comment: http://stackoverflow.com/comment/136486245
has comment: http://stackoverflow.com/comment/136509442
score: 0

http://stackoverflow.com/a/77601255
has body: After some digging, I found out that XCTest calls tests differently when -only-testing MyTarget/MyClass/myTest is passed. More specifically, the XCTestCase.defaultTestSuite is not called when a single test is specified in -only-testing. XCTest framework checks if it can run the test passed in -only-testing by sending a message to NSObject.instancesRespondToSelector:aSelector: (XCTestCase of course inherits from NSObject) and checking what it returns. This seemed like a good hook point to call defaultTestSuite manually, which in turn calls testInvocations, which generates and swizzles-in test methods to the ParametrizedTests class. My LandmarksTests class was missing override of that selector. After I added it to my ParametrizedTests class: + (BOOL)instancesRespondToSelector:(SEL)aSelector { [self defaultTestSuite]; // calls testInvocations BOOL result = [super instancesRespondToSelector:aSelector]; return true; } it started working fine! Here's the final file that can be copy-pasted into a file ParametrizedTests.m that is inside the LandmarksUITests UI Test Target and it works fine! @import XCTest; @import ObjectiveC.runtime; @interface ParametrizedTests : XCTestCase @end @implementation ParametrizedTests + (BOOL)instancesRespondToSelector:(SEL)aSelector { [self defaultTestSuite]; // calls testInvocations BOOL result = [super instancesRespondToSelector:aSelector]; return true; } + (NSArray<NSInvocation *> *)testInvocations { NSLog(@"testInvocations() called"); /* Prepare dummy input */ __block NSMutableArray<NSString *> *dartTestFiles = [[NSMutableArray alloc] init]; [dartTestFiles addObject:@"example_test"]; [dartTestFiles addObject:@"permissions_location_test"]; [dartTestFiles addObject:@"permissions_many_test"]; NSMutableArray<NSInvocation *> *invocations = [[NSMutableArray alloc] init]; NSLog(@"Before the loop, %lu elements in the array", (unsigned long)dartTestFiles.count); for (int i = 0; i < dartTestFiles.count; i++) { /* Step 1 */ NSString *name = dartTestFi…
answers question: http://stackoverflow.com/q/77494930
upvote count: 2
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/77494930
downvote count: 0
score: 2

http://stackoverflow.com/comment/136706235
score: 1
has text: Did you try using `setValue(_:forKey:)`? I don't know if that will work in this case but it's easy to try. And please update your question with the details you put in that comment. It makes the information easier to find in your question.
type: QuestionComment
comment on: http://stackoverflow.com/q/77535525
type: Comment

http://stackoverflow.com/a/77420852
accepted answer of: http://stackoverflow.com/q/77420684
answers question: http://stackoverflow.com/q/77420684
type: AcceptedAnswer
upvote count: 5
type: Answer
downvote count: 0
has body: Some observations: The documentation page for UIContentConfiguration doesn't have an Objective-C version that you can choose using the "Language: Swift" selector. The Objective-C version is here. UIContentConfiguration doesn't inherit NSObjectProtocol, like other Objective-C protocols do, when they are imported into Swift. The Swift version of UIContentConfiguration has a makeContentView method that returns an intersection type, which cannot be represented in Objective-C. (The Objective-C version returns __kindof UIView<UIContentView> *) These all suggest that UIContentConfiguration in Swift is an entirely different protocol from its Objective-C version. Just conforming to it in Swift doesn't mean you conformed to it in Objective-C. You can also see a similar pattern in other related types like UIContentView and UIConfigurationState. In fact, try setting contentConfiguration to an instance of MyCellConfiguration in Swift and see what happens on the Objective-C's side. Try printing out [cell.contentConfiguration class] in Objective-C. The output is not MyCellConfiguration! All of that is to say, you have to re-implement the Objective-C version of UIContentConfiguration in Objective-C, or you can just add a method like this in Swift: @objc func addToCell(_ cell: UITableViewCell) { cell.contentConfiguration = self } UITableViewCell *cell = ...; MyCellConfiguration *config = [[MyCellConfiguration alloc] initWithLabel:@"Some Label"]; [config addToCell:cell];
has comment: http://stackoverflow.com/comment/136488819
score: 5

http://stackoverflow.com/a/77565515
has body: This code is a bit curious, possibly written by someone who did not entirely understand the purpose of the weakSelf pattern, much less the more complicated weakSelf/strongSelf pattern. Admittedly, these can be daunting to new programmers, and when Objective-C programmers first encounter blocks and strong reference cycles, they often start sprinkling weak references everywhere in their code. This looks suspiciously like that. So, let’s step back: We use weakSelf pattern in one of two scenarios: It is possible that self (the view controller) might be dismissed before the dispatch_after fires in 0.1 seconds; or The use of the non-weak self might result in a strong reference cycle. In this case, the first seems exceedingly unlikely (but we’d need to know more about the UI to be positive) and the second doesn’t seem applicable at all, as there is no apparent strong reference cycle risk here. Setting that aside, let’s discuss those scenarios where you would further complicate that weakSelf pattern with an additional strongSelf inside it (or two, in this case). We do either when: We need to use that “weak self” reference in some context where a null value would cause an error; or You want to protect yourself against race conditions where you are doing steps A and B and “self” might conceivably become null in the intervening period, but that it is important that if you do A that you also do B. Again, I am not sure if either of those scenarios apply here. It feels appears that the original programmer was reflexively inserting weakSelf/strongSelf pattern in their asynchronous patterns, possibly not understanding whether it was actually needed or not. Bottom line, when dealing with a large legacy codebase, I am not sure I would waste any time on this particular code snippet. To my eye, the entire usage of weakSelf looks completely unnecessary, but before you excise all of these weakSelf, strongSelf, and strongSelf2 references, you would want to make sure that (a) there are no …
has comment: http://stackoverflow.com/comment/136743240
accepted answer of: http://stackoverflow.com/q/77564862
score: 2
has comment: http://stackoverflow.com/comment/136743664
answers question: http://stackoverflow.com/q/77564862
downvote count: 0
has comment: http://stackoverflow.com/comment/136743313
type: AcceptedAnswer
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/136743481
has comment: http://stackoverflow.com/comment/136743253
has comment: http://stackoverflow.com/comment/136743221
has comment: http://stackoverflow.com/comment/136743161

http://stackoverflow.com/comment/136742662
type: QuestionComment
score: 0
type: Comment
has text: Your posted code is not using a [terminationHandler](https://developer.apple.com/documentation/foundation/nstask/1408746-terminationhandler?language=objc) - you must set the property.
comment on: http://stackoverflow.com/q/77556761

http://stackoverflow.com/comment/136651412
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77513052
has text: Cells that have scrolled out of view are reused so you are constantly re-adding the image views to cells that already have an image view in them.
type: Comment

http://stackoverflow.com/q/77579967
tagged with: ios
answer count: 1
tagged with: objective-c
has title: React Native App with implemented Carplay doesnt show content on carplay screen if IPhone App is terminated
tagged with: react-native
score: 0
has body: Apps like Spotify, Tidal etc show content if the phone apps are terminated and i click on the App Icon in Carplay Simulator. My App doesnt so, it shows an empty screen. If the phone app is in background or active, everything is working well. I have no idea what i am doing wrong. Please help! Thanks in advance! Some code: import Foundation import CarPlay class SceneDelegateCarPlay: UIResponder, CPTemplateApplicationSceneDelegate { ... func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController) { print("SceneDelegateCarPlay.templateApplicationScene(), didConnect") // start render content ... } "templateApplicationScene is called and render content when: Carplay App is closed & Iphone App is active or in background -> Click on Carplay App Icon Carplay App is open (no content visible) & Iphone App is terminated -> Start Iphone App I wonder how i can render content outside of a case like these
type: Question
tagged with: swift
has answer: http://stackoverflow.com/a/78296386
type: UnansweredQuestion
tagged with: carplay

http://stackoverflow.com/q/77556761
has comment: http://stackoverflow.com/comment/136736304
type: Question
has body: I am trying to use NSTask to execute terminal commands using the standardInput and standardOutput. Everything works for commands like ls, pwd, etc. But When I try to run cd command, Standard output doesn't write any output. I understand that standardOutput won't write any data since cd command doesn't have any response to display. But Is there anyway to check if the command has run successfully? I need this as I am waiting for a response to update the UI. Below is my code. I am using NSFileHandleDataAvailableNotification to read the output as this helps with commands like ping -(void)setupTask { @autoreleasepool { // Commands are read from standard input: NSFileHandle *input = [NSFileHandle fileHandleWithStandardInput]; NSPipe *inPipe = [NSPipe new]; // pipe for shell input NSPipe *outPipe = [NSPipe new]; // pipe for shell output NSPipe *errorPipe = [NSPipe new]; task = [NSTask new]; [task setLaunchPath:@"/bin/sh"]; [task setStandardInput:inPipe]; [task setStandardOutput:outPipe]; [task setStandardError:errorPipe]; [task launch]; // Wait for standard input ... [input waitForDataInBackgroundAndNotify]; // ... and wait for shell output. [[outPipe fileHandleForReading] waitForDataInBackgroundAndNotify]; [[errorPipe fileHandleForReading] waitForDataInBackgroundAndNotify]; // Wait asynchronously for standard input. // The block is executed as soon as some data is available on standard input. [[NSNotificationCenter defaultCenter] addObserverForName:NSFileHandleDataAvailableNotification object:input queue: [NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { NSData *inData = [input availableData]; if ([inData length] == 0) { // EOF on standard input. [[inPipe fileHandleForWriting] closeFile]; } else { // Read from standard input and write to shell input pipe. [[inPipe fileHandleForWriting] writeData:inData]; // Continue waiting for standard input. [input waitForDataInBackgroundAndNotify]; } }]; // Wait asynchronously for shell output. // The block is executed …
tagged with: filehandle
tagged with: nstask
tagged with: objective-c
tagged with: cocoa
tagged with: terminal
has comment: http://stackoverflow.com/comment/136731913
score: 0
type: UnansweredQuestion
has title: NSTask standardOutput for "cd" command - Cocoa Objective C
has comment: http://stackoverflow.com/comment/136729009
has comment: http://stackoverflow.com/comment/136744221
answer count: 0
has comment: http://stackoverflow.com/comment/136732735
has comment: http://stackoverflow.com/comment/136742662
has comment: http://stackoverflow.com/comment/136736432

axuielement
tag name: axuielement
type: Tag
tags question: http://stackoverflow.com/q/77589293

http://stackoverflow.com/q/77419925
tagged with: macos-sonoma
score: 0
has body: I let my user choose a font from their installed fonts, then use that font in three different contexts in my macOS app. The list of fonts itself uses NSFontDescriptor to create an attributed string, then displays that in the list of choices: NSFontDescriptor *fontDescriptor = [NSFontDescriptor fontDescriptorWithName:@"Candara" size:14]; NSDictionary *attributes = @{NSFontAttributeName: [NSFont fontWithDescriptor:fontDescriptor size:14]}; attributedString = [[NSAttributedString alloc] initWithString:@"New Attributed String" attributes:attributes]; In some places I have a very small HTML document where I set the body font to the selected font, convert to an attributed string, and display in an NSTextField. NSString *htmlString = @" " " " " " " " " " " " " Text with bold or italics maybe. " " " " "; NSData *htmlData = [htmlString dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary *options = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: @(NSUTF8StringEncoding)}; NSError *error; NSAttributedString *attributedString = [[NSAttributedString alloc] initWithData:htmlData options:options documentAttributes:nil error:&error]; Finally, I have places where I have longer HTML documents with the same font used as the body font and displayed in a WKWebView. This was all working well for years. When macOS 14 came along, what I find is that option 1 (initializing an NSAttributedString with some text using the Candara font) works fine, as does option 3 (displaying a lot of HTML that uses the Candara font in a WKWebView). But option 2 doesn't work at all. The output is all the "undefined character" glyph — a box containing a question mark, one for each character in the string. I'm seeing this behavior when the user selects Calibri or Candara, which are both Microsoft fonts. I'm also seeing it with SF Pro, which is an Apple font. Any other font is fine. (At least from what I've seen so far.) Providing a fallback font (as shown above w…
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/77423851
has title: Why am I seeing different behavior in macOS 14 when creating NSAttributedString from HTML vs doing the same thing with initWithString:attributes:?
type: Question
tagged with: fonts
answer count: 1
tagged with: objective-c
tagged with: nsattributedstring
has comment: http://stackoverflow.com/comment/136493630
accepted answer: http://stackoverflow.com/a/77423851

http://stackoverflow.com/comment/136600942
comment on: http://stackoverflow.com/q/77477713
score: 1
has text: So the error is that in `+showDialogiPad: fromPresentingVC:...` `contentVC` == `presentingVC`. It's hard to tell why, but since showing/dimissing (especially with `animated` true) takes "times", and unless you reach `completion` the next line of code might be called before the completion ends. I think that's your issue issue. A race condition
type: Comment
type: QuestionComment

http://stackoverflow.com/a/77551882
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/77551705
upvote count: 3
has body: By the documentation, [... new] equals [[... alloc] init] and creates and returns a new instance for any class that inherits from the NSObject. [NSNull null] is a singleton instance that always returns the same instance which is the kCFNull. but if you see the documentation of the NSNull, you can see: NSNull (itself) is a singleton object used to represent null values in collection objects that don’t allow nil values. So because of the nature of the NSNull, all of them are the same by the instance: NSNull* null = [NSNull null]; NSNull* init = [[NSNull alloc] init]; NSNull* new = [NSNull new]; NSNull* kcf = kCFNull; Note how all of them are pointing to the exact same location
downvote count: 0
has comment: http://stackoverflow.com/comment/136719089
score: 3
answers question: http://stackoverflow.com/q/77551705

http://stackoverflow.com/comment/136729845
type: AnswerComment
type: Comment
has text: Historically the integers from [-1 to 12 have been cached values](https://github.com/stevestreza/CoreFoundation/blob/38a055167790581012eabc29972f60f801efcd1a/CFNumber.c#L1014-L1017). (Which led to really mind-bending bug when working on a code-base that over-released "the number 4" so that the next time 4 showed up elsewhere in the system, it would crash...) Today they're often tagged pointers, so == will happen to work. https://alwaysprocessing.blog/2023/03/19/objc-tagged-ptr "@" literals (`@42`) are stored directly in the binary. So `@1` does not `==` `[NSNumber numberWithInt:1]`.
score: 0
comment on: http://stackoverflow.com/a/77552118

http://stackoverflow.com/comment/136732735
type: Comment
comment on: http://stackoverflow.com/q/77556761
has text: The terminationHandler is just a completion block that gets called when the task terminates. You can use that or maybe check if the task is still running and see if it terminated normally.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/136691986
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77518826
type: Comment
has text: Those are related to Swift. As I just mentioned, I am talking about applying PCH to Objective-C files.

http://stackoverflow.com/q/77560321
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/77560468
answer count: 1
tagged with: ios
has body: In the below BNREmployee.m implementation file I am trying to override the default description and would like to be able to access the object name john assigned at instantiation in the main.m file. Is there a way to do this WITHOUT creating a separate "name" property or instance variable, and WITHOUT creating a separate init method where that name would be passed in? main.m file: #import <Foundation/Foundation.h> #import "BNRPerson.h" #import "BNREmployee.h" #import "BNREmployer.h" int main(int argc, const char * argv[]) { @autoreleasepool { BNREmployee *john = [BNREmployee new]; BNREmployer *costco = [BNREmployer new]; [john setEmployer:costco]; [costco setEmployeesList:[NSMutableSet setWithObject:john]]; NSLog(@"employee: \n%@", john); } return 0; } BNREmployee.m file: #import "BNREmployee.h" @implementation BNREmployee -(NSString*) description { return [NSString stringWithFormat:@"<Employee %@ with id: %d and employer: %@", [self ???***???], self.employeeId, self.employer]; } @end
has answer: http://stackoverflow.com/a/77560468
score: 0
type: Question
has title: Access name of instantiated object without additional property nor init method
tagged with: objective-c

http://stackoverflow.com/a/77560468
has body: No, it's not possible for a class to know the name of a variable it's been assigned to. Keep in mind that you can assign one instance of BNREmployee (or any other class) to more than one variable. BNREmployee *bob = [BNREmployee new]; BNREmployee *john = bob; NSLog(@"employee = %@", bob); NSLog(@"employee = %@", john); In this case, how would the description method know the name? The one instance of the class has been assigned to two different variables. Relying on the variable name makes little sense. If you want the BNREmployee class to keep track of a name then you must add a name property to the class. That's the whole point of a class - to keep track of state/data. tl;dr - you can't do what you want. You must add a name property and optionally a custom init that lets you assign a name on creation.
type: AcceptedAnswer
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/77560321
answers question: http://stackoverflow.com/q/77560321
score: 1
downvote count: 0

http://stackoverflow.com/comment/136486578
type: QuestionComment
has text: Yes, I have tried without CGEventKeyboardSetUnicodeString (By just putting in "a" in the previous API), that had no effect. Replacing s with あ works, but that is not what I am trying to do. I want to simulate keystrokes, so I want "a" to act as if that key was pressed, going through whatever language is configured (could be Chinese, Korean, etc.) To phrase it another way, I want my app to just do exactly what pressing "a" on a keyboard does.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77418597

http://stackoverflow.com/comment/136759237
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77574107
has text: That answer is not saying to define `TARGET_OS_IPHONE` as `0`. That answer is pointing out than when you build a native macOS app (not using Mac Catalyst), that `TARGET_OS_IPHONE` will be defined as `0` for you in TargetConditionals.h. I didn't mention that case because your question was about Mac Catalyst, not a pure native macOS app.
score: 0

compilation
type: Tag
tags question: http://stackoverflow.com/q/77509555
tag name: compilation

http://stackoverflow.com/comment/139365767
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77506853
has text: @LucaRocchiThat is great thinking. Will try it. Thx!

http://stackoverflow.com/q/77564862
tagged with: ios
type: Question
tagged with: objective-c
downvote count: 0
favorite count: 0
has title: Proper use of strongSelf / weakSelf in nested dispatch_after blocks
upvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/77565515
score: 2
tagged with: grand-central-dispatch
has body: I have a complicated launch and I need to present and dismiss multiple view controllers. I have this bit of code where I need to use delays in presentation; I was wondering if my use of strongSelf / weakSelf was proper in the following code with these dispatch_after blocks, or if there are improvements that I should make to the code. I know it's outdated Objective-C, I am working with an old, large code base. __weak typeof(self) weakSelf = self; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{//CURRENT __strong typeof(self) strongSelf = weakSelf; [strongSelf presentViewController:strongSelf.coverVC animated:NO completion:^{ [strongSelf showWindowWithImage:NO]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ __strong typeof(self) strongSelf2 = weakSelf; [strongSelf2 dismissViewControllerAnimated:YES completion:^{ strongSelf2.coverVC = nil; [strongSelf2 hideWindow]; }]; }); }]; });
accepted answer: http://stackoverflow.com/a/77565515
answer count: 1

http://stackoverflow.com/comment/136512444
score: 0
has text: Thanks, got it working! Feel free to put in a formal answer if you want credit. Technically the problem here was that I wasn't using the keycode. It turns out CGEventKeyboardSetUnicodeString doesn't really matter here (I am still using that).
type: QuestionComment
comment on: http://stackoverflow.com/q/77418597
type: Comment

http://stackoverflow.com/comment/136729624
has text: Yes, I understand that is your problem. But it works fine for us. We can make calls or send the messages via the text view data detector. So we need more details about your configuration and/or show us the precise steps where we can reproduce your crash on our devices. It is hard to help you if we cannot reproduce it (or at least understand how your configuration differs from ours). Please edit the question to include more info. E.g., physical iPhone or simulator? What Xcode version? What macOS version? What iOS version? Etc.
comment on: http://stackoverflow.com/q/77554378
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/136730234
comment on: http://stackoverflow.com/q/77554378
has text: @Rob added code and image, happens on physical device
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/q/77484919
type: Question
has comment: http://stackoverflow.com/comment/136615095
has body: I declare the variable ue in my global.h file as Extern int ue;. I have #include "global.h" on all view controllers where I want to use the variable. If I don't assign a value to ue my project builds and runs. If I assign a value to ue I get the following errors and the build fails; undefined symbol: _ue Linker command failed with exit code 1 (use -v to see invocation) I have searched for the resolution and tried some suggestions, but I keep getting the same errors. I have declared multiple variables in "global.h" previously and had no issues.
has comment: http://stackoverflow.com/comment/136604766
accepted answer: http://stackoverflow.com/a/77487543
favorite count: 0
downvote count: 1
linked to: http://stackoverflow.com/q/7330048
type: AnsweredQuestion
tagged with: undefined-symbol
tagged with: objective-c
has answer: http://stackoverflow.com/a/77487543
has title: How to remove "undefined symbol" error in Objective-C?
upvote count: 1
has comment: http://stackoverflow.com/comment/136604210
answer count: 1
score: 0

http://stackoverflow.com/comment/136513672
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/77425911
score: 0
has text: The book is a bit old. If you switch off "Objective-C Automatic Reference Counting" in the build settings, the error will go away.

keyboard-events
tags question: http://stackoverflow.com/q/77418597
tag name: keyboard-events
type: Tag

http://stackoverflow.com/comment/136569857
score: 1
has text: FYI - It is standard practice to name classes, structs, and enums to start with uppercase letters and to name variables, functions, and cases to start with lowercase letters. Following those standards makes your code much easier to read.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77466483

http://stackoverflow.com/comment/136650863
comment on: http://stackoverflow.com/q/77509555
type: QuestionComment
score: 0
has text: I tried that. Both full project cleans as well as removing the entire ~/Library/Developer/Xcode folder. Same problem persisted. I'm suspicious that some Swift "glue" code for the Obj-C bridging maybe at fault, but I can't verify that. I'll also note that I've had the same issue on Catalina and now Sonoma.
type: Comment

http://stackoverflow.com/comment/136663019
type: QuestionComment
has text: The exception message says that you are associating your nib file with an instance of `UICollectionViewCell`not `CollectionViewCell`. You have probably messed up your "files owner" or something.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77518382

http://stackoverflow.com/comment/136534833
score: 0
has text: If you compare `value` & `base64EncodedString`, how much do they differ? Try by outputting only the n first characters, and go one?
comment on: http://stackoverflow.com/q/77446440
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136731913
comment on: http://stackoverflow.com/q/77556761
type: QuestionComment
type: Comment
has text: I won't be terminating the NSTask as I would like to keep it for consecutive executions
score: 0

http://stackoverflow.com/a/77590107
type: AcceptedAnswer
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/77589293
has body: Navigate one level up in the documentation to AXUIElement.h where it says: Each accessible user interface element in an application is represented by an AXUIElementRef, which is a CFTypeRef. AXUIElementRefs (like all CFTypeRefs) can be used with all the Core Foundation polymorphic functions, such as CFRetain, CFRelease, and CFEqual.&quot;
accepted answer of: http://stackoverflow.com/q/77589293
score: 2
downvote count: 0

http://stackoverflow.com/comment/136705943
type: QuestionComment
score: 0
type: Comment
has text: If I read the wikipedia page correctly, isn't the outer product just the same as "point-wise multiplication"? That is, every cell in the output matrix is just the multiplication of the same positioned elements from the two input matrices. Is that right?
comment on: http://stackoverflow.com/q/77542065

http://stackoverflow.com/comment/136589630
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77477713
has text: You may wish to rethink your setup then. Only a view controller should present other view controllers. Something derived from NSObject should not do anything related to the UI. At most it should pass a message (probably via delegate or NotificationCenter), that it has a message or an event took place. Let the view controller decide how to handle that (such as presenting an alert).
type: Comment

http://stackoverflow.com/comment/136736304
type: Comment
comment on: http://stackoverflow.com/q/77556761
score: 0
type: QuestionComment
has text: terminationHandler never gets called for the above code. It might work when we run the task with arguments. But since I am using standard input and output and never close the files as well, I am not receiving terminated notification. Correct me if I'm wrong.

http://stackoverflow.com/comment/136611848
has text: Is _itemGrid attached to its IBOutlet? I've noticed that you're dequeuing a cell using ivar: CollectionViewCell *cell1 = [_itemGrid dequeueReusableCellWithReuseIdentifier:@"cell1" forIndexPath:indexPath]; , and usually it is done by referring the collectionView param from delegate method like: CollectionViewCell *cell1 = [collectionView dequeueReusableCellWith... If your collection has dataSource set in NIB, but it's not attached to itemGrid outlet, your "number of cells" will return correct count, but dequeuing from nil collection will result to nil cell
score: 1
type: Comment
comment on: http://stackoverflow.com/q/77490512
type: QuestionComment

http://stackoverflow.com/comment/136486245
comment on: http://stackoverflow.com/q/77418597
has text: Updated with some code.
type: QuestionComment
score: 0
type: Comment

uicollectionviewcell
tags question: http://stackoverflow.com/q/77513052
type: Tag
tag name: uicollectionviewcell
tags question: http://stackoverflow.com/q/78214804

nstask
tags question: http://stackoverflow.com/q/77556761
tag name: nstask
type: Tag
tags question: http://stackoverflow.com/q/77644430

http://stackoverflow.com/comment/136508360
comment on: http://stackoverflow.com/q/77431878
type: Comment
has text: You don't need to do anything with plist file, the AppGroup ID is unique already. Define UserDefault with suiteName (not standard) and get/set normally.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136758756
comment on: http://stackoverflow.com/q/77502487
type: Comment
score: 0
type: QuestionComment
has text: No I don't think it would since it's not a problem with my code. I'm looking for a solution to make a CALayer that draws its contents adapt to the application appearance. What I do in drawLayer:inContext is irrelevant.

http://stackoverflow.com/comment/136755013
type: QuestionComment
has text: It would be easier to get help on this if you provide a [mre].
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77502487

undefined-symbol
tag name: undefined-symbol
tags question: http://stackoverflow.com/q/77484919
type: Tag

http://stackoverflow.com/comment/136729009
score: 1
type: QuestionComment
has text: Perhaps check for the task `terminationStatus` in its `terminationHandler`?
type: Comment
comment on: http://stackoverflow.com/q/77556761

http://stackoverflow.com/comment/136575364
score: 0
type: AnswerComment
has text: If you moved the declaration of `publisher5` inside the `ProgressBar` struct then you can't be getting the same error. Update your question showing your updated `ProgressBar` struct and the exact complete new error message.
type: Comment
comment on: http://stackoverflow.com/a/77466915

http://stackoverflow.com/comment/136700943
has text: @HangarRash `WKContentView` is a private `UIView` subclass that has a getter `inputAccessoryView`. This getter is only implemented in the superclass `UIResponder`. I need, however, to change this implementation, but not for the entire `WKContentView` class, but merely for a single instance of it. I can not subclass this class directly since it's not exported from UIKit.
score: 0
comment on: http://stackoverflow.com/q/77535525
type: QuestionComment
type: Comment

http://stackoverflow.com/a/77466915
has comment: http://stackoverflow.com/comment/136575364
downvote count: 0
has body: Your ProgressBar struct does not have any access to any instance members of ContentView or CMWSTUploadViewV2Controller. Just as ContentView does not have any access to any instance members of CMWSTUploadViewV2Controller. CMWSTUploadViewV2Controller.ContentView should only declare the publisherX properties that it needs. Your CMWSTUploadViewV2Controller.ContentView.ProgressBar struct should declare its own publisherX properties as needed. In other words, move the declarations for publisher5, publisher6, and publisher7 to be inside the ProgressBar struct instead of the ContentView struct. On a separate note, you should avoid hardcoding each of your notification names multiple times. It's too easy to make a typo for one of the names which will lead to a hard-to-find bug in your code. Define a constant for each notification name and use that constant in each place that it is needed.
score: 1
has comment: http://stackoverflow.com/comment/136575304
type: AcceptedAnswer
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/77466483
has comment: http://stackoverflow.com/comment/136575479
answers question: http://stackoverflow.com/q/77466483

http://stackoverflow.com/comment/139365785
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77506853
type: Comment
has text: @LucaRocchiActually I already did that: [commandCenter.previousTrackCommand setEnabled:YES]; [commandCenter.nextTrackCommand setEnabled:YES]; [commandCenter.skipBackwardCommand setEnabled:NO]; [commandCenter.skipForwardCommand setEnabled:NO]; So not sure why it still sometimes shows Skip buttons.

http://stackoverflow.com/comment/136655095
type: Comment
comment on: http://stackoverflow.com/q/77513052
score: 0
has text: Find solution without calling `addSubview` in `cellForItemAtIndexPath`
type: QuestionComment

http://stackoverflow.com/comment/136537126
has text: @Larme good idea! there is a difference between the two, the new function is 76568 size and the base64EncodedStringWithOptions is 76544. Any idea what can cause it?
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77446440

filehandle
tags question: http://stackoverflow.com/q/77556761
tag name: filehandle
type: Tag

nsattributedstring
tag name: nsattributedstring
tags question: http://stackoverflow.com/q/77419925
type: Tag

macos-sonoma
type: Tag
tag name: macos-sonoma
tags question: http://stackoverflow.com/q/77419925
tags question: http://stackoverflow.com/q/78109418
tags question: http://stackoverflow.com/q/77976279
tags question: http://stackoverflow.com/q/78586575

http://stackoverflow.com/comment/136666093
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/77518382
type: Comment
has text: You were probably getting a warning in the runtime console that `CollectionViewCell` wasn't found. In that case `UICollectionViewCell` is used.

http://stackoverflow.com/q/77518834
type: UnansweredQuestion
has title: <React/RCTBridgeModule.h> file not found in Xcode 15
favorite count: 0
tagged with: ios
tagged with: facebook
upvote count: 2
has body: I am trying to create a Custom Module for my React Native app, and I've followed the guide However, when I create the header file and import **&lt;React/RCTBridgeModule.h&gt; ** I am getting error as 'React/RCTBridgeModule.h' file not found. I Googled and tried various solution from SO, however, none of them works. One thing I've noticed is that I am able to import the &lt;React/{any-header-file.h}&gt; file in the AppDelegate.mm, but when I try it in my Custom Module I can't get the completition suggestions too. Any help is really appreciated. Info: I am using react-native 0.72.7. and Xcode 15. Solutions I tried: Clean Pods and Cache. Re-installed node modules. Configured Header Search Paths. Edits Schemes. Expected behaviour Will able to import RCTBridgeModule header file.
tagged with: objective-c
score: 2
tagged with: react-native
type: Question
downvote count: 0
answer count: 0

http://stackoverflow.com/a/77509263
answers question: http://stackoverflow.com/q/77490512
has body: Ok, worked out why this was happening and its kind of dumb. I had a search bar attached to my collection view and I couldn't correctly allocate the view as an outlet because whenever I dragged my viewcontroller to my collectionview it kept trying to attach to the search bar instead of the collection view. of course I didn't have an outlet for the search bar so it kept showing up at nothing to attach and as a result because it wasn't attached the code wasn't working properly. I removed the search bar and attached it correctly then it worked fine. Thanks for the help though guys.
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/77490512
score: 0

http://stackoverflow.com/comment/136601854
has text: @Larme Adding a check to see if the presentingViewController == contentViewController seems to prevent the race condition and thus prevents the crash.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77477713
score: 0

http://stackoverflow.com/a/77552118
has comment: http://stackoverflow.com/comment/136719951
score: 2
has comment: http://stackoverflow.com/comment/136720113
downvote count: 0
has comment: http://stackoverflow.com/comment/136720219
upvote count: 2
has body: As Mojtaba notes, every NSNull is the same object. It's implemented this way: CoreFoundation`+[NSNull allocWithZone:]: 0x18cf7aeb8 <+0>: adrp x8, 368436 -> 0x18cf7aebc <+4>: add x8, x8, #0x210 ; kCFNull 0x18cf7aec0 <+8>: ldr x0, [x8] 0x18cf7aec4 <+12>: ret When you call +[NSNull alloc] (which is called by +new), it just returns the singleton kCFNull. That is a toll-free bridged object, so can be used identically in CoreFoundation and Foundation. It's defined in CFBase as an empty CoreFoundation object: static struct __CFNull __kCFNull = { INIT_CFRUNTIME_BASE() }; const CFNullRef kCFNull = &__kCFNull; All memory management calls are ignored: -[NSNull autorelease]: 0000000180506ec8 ret -[NSNull retain]: 0000000180506ecc ret -[NSNull release]: 0000000180506ed0 ret -[NSNull retainCount]: 0000000180635104 mov x0, #0xffffffffffffffff 0000000180635108 ret -[NSNull dealloc]: 000000018063510c ret It's based on the "strict singleton" pattern in Cocoa. (Most of the time you don't want strict singletons, and we just create shared instances, but when you need there to be precisely one instance, this is how it's done.) +[NSNull null] is implemented identically (it just returns kCFNull): +[NSNull null]: 0000000180501558 adrp x8, #0x1da43a000 ; 0x1da43a210@PAGE 000000018050155c add x8, x8, #0x210 ; 0x1da43a210@PAGEOFF, _kCFNull 0000000180501560 ldr x0, [x8] ; _kCFNull,___kCFNull 0000000180501564 ret So +[NSNull null] is ever-so-slightly faster to call, since it skips some intermediate calls and (ignored) memory management. More importantly, it is better style to use +null rather than +new to make it clear that it's a singleton and you are using it that way. In fact, the common way to check for NSNull is using == (pointer equality) rather than isEqual: (object equality), which is unusual in Cocoa.
type: Answer
has comment: http://stackoverflow.com/comment/136729845
answers question: http://stackoverflow.com/q/77551705

http://stackoverflow.com/comment/138047515
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78296386
has text: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
score: 0

http://stackoverflow.com/comment/136758377
type: QuestionComment
has text: FYI - Not directly related to your issue but `CAEAGLLayer` was deprecated back in iOS 12.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/77573776

http://stackoverflow.com/comment/136575479
comment on: http://stackoverflow.com/a/77466915
has text: I found I had a typo for Text("Uploading memory model to controller") connectionTypeText = GreySubTextVal! and changed it to GreySubText = GreySubTextVal! and also implemented your suggestions of moving publisher5, publisher6 and publisher7 to be in the ProgressBar struct instead which proved to be the answer.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/136743221
type: AnswerComment
type: Comment
has text: @Rob thank you so much. That makes perfect sense. Unfortunately, the "new programmer" is me, I am self-taught and do this barely even part time, have one very old, large app, and haven't been able to even look at code in 4 plus years because I was caring for someone who was ill. But I really learned from what you said. I think I can do it with just self. I was actually looking at an answer of yours to another question on this just a few minutes ago. You have a great wealth of knowledge and quite a way of explaining things. I really appreciate you taking the time to answer my question.
score: 0
comment on: http://stackoverflow.com/a/77565515

ios-library
tag name: ios-library
type: Tag
tags question: http://stackoverflow.com/q/77499394

http://stackoverflow.com/comment/136663666
comment on: http://stackoverflow.com/a/77513073
type: AnswerComment
type: Comment
score: 0
has text: I edited the answer and included the cell, you may want to take a look.

http://stackoverflow.com/a/77497283
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/77490512
has body: Start simple... Use the following code: UICollectionViewCell+CollectionViewCell.h - *note: not sure why you named your file like that... generally, a "Class+Name" is used for a Category ... but, assuming the code in the class looks like this: #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface CollectionViewCell : UICollectionViewCell @property (strong, nonatomic) IBOutlet UILabel *customLabel; @end NS_ASSUME_NONNULL_END UICollectionViewCell+CollectionViewCell.m #import "UICollectionViewCell+CollectionViewCell.h" @implementation CollectionViewCell @end BackPackController.h #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface BackPackController : UIViewController @property (strong, nonatomic) IBOutlet UICollectionView *itemGrid; @end NS_ASSUME_NONNULL_END BackPackController.m #import "BackPackController.h" #import "UICollectionViewCell+CollectionViewCell.h" @interface BackPackController () <UICollectionViewDelegate, UICollectionViewDataSource> @end @implementation BackPackController NSMutableArray *itemArray; - (void)viewDidLoad { [super viewDidLoad]; itemArray = [NSMutableArray new]; // let's generate a simple string array for (int i = 0; i < 40; i++) { NSString *s = [NSString stringWithFormat:@"%i", i]; [itemArray addObject:s]; } _itemGrid.dataSource = self; _itemGrid.delegate = self; } - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return itemArray.count; } - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { CollectionViewCell *c = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell1" forIndexPath:indexPath]; [c.customLabel setText:itemArray[indexPath.item]]; return c; } @end Now, in your Storyboard, add a UIViewController and assign its class to BackPackController Assign the class of the cell Prototype to CollectionViewCell, and set its Identifier to "cell1" (without the quotes). Add a UICollectionVi…
upvote count: 2

http://stackoverflow.com/comment/136728473
type: QuestionComment
has text: @Rob the problem isn’t that it doesn’t detect. It detects them fine. The system menu that gives options to call or send message pops up fine as well. The problem is that the whole thing crashes with no error given in console at all for why it crashed when selecting send message.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77554378

uitabbaritem
type: Tag
tag name: uitabbaritem
tags question: http://stackoverflow.com/q/77456242
tags question: http://stackoverflow.com/q/78354823

http://stackoverflow.com/comment/136589492
type: QuestionComment
comment on: http://stackoverflow.com/q/77477713
score: 1
type: Comment
has text: The proper way to get the correct root view controller from some view controller is `self.view.window.rootViewController`. No need to access anything via the App Delegate, keyWindow, window scene, or shared UIApplication. This gets the correct root view even if your app has multiple scenes on display at the same time. Then you can walk up the chain of `presentedViewController` to find the top-most view controller.

http://stackoverflow.com/comment/136730162
has text: @Rob Xcode 15.0.1, macOS 14.1.1, iOS 17, minimum deployment iOS 15.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77554378
type: Comment

keywindow
type: Tag
tags question: http://stackoverflow.com/q/77477713
tag name: keywindow

http://stackoverflow.com/comment/136720113
score: 0
type: AnswerComment
type: Comment
has text: Yep, it is, so using `isEqual:` is equivalent, which is good. But generally you wouldn't use `==` with a immutable value object. `==` is generally only used for mutable objects, where you want to check that it's the specific one you mean (rather than just having the same property values). For example, you can't use `==` on NSNumber, even though it "works" in a surprising number of cases. But for NSNull, it's pretty common to use `==` since it's guaranteed to be a singleton.
comment on: http://stackoverflow.com/a/77552118

http://stackoverflow.com/comment/136661522
score: 0
has text: cell dequeuing works fine. the cell functions fine without the label and image with programatically generated labels, but it has an issue when I add the labels and image to the NIB
comment on: http://stackoverflow.com/q/77518382
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/136646794
comment on: http://stackoverflow.com/q/77509555
score: 0
type: QuestionComment
type: Comment
has text: I can only confirm having this issue seen in our code elsewhere, more precisely in SwiftUI previews. Maybe there is a corrupt module in the cache. In all helplessness, you may deleting the DerivedData folder and hope for the best. In any case, please file a bug report.

base64
tag name: base64
type: Tag
tags question: http://stackoverflow.com/q/77446440

http://stackoverflow.com/comment/136511767
score: 0
type: QuestionComment
has text: See [How to convert ASCII character to CGKeyCode?](https://stackoverflow.com/questions/1918841/how-to-convert-ascii-character-to-cgkeycode)
comment on: http://stackoverflow.com/q/77418597
type: Comment

fonts
tag name: fonts
type: Tag
tags question: http://stackoverflow.com/q/77419925
tags question: http://stackoverflow.com/q/78328208

http://stackoverflow.com/comment/136611807
score: 0
comment on: http://stackoverflow.com/q/77490512
has text: did you check if `cell1` is null in the cellForItem method ?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136638304
comment on: http://stackoverflow.com/q/77504380
score: 0
type: QuestionComment
has text: hah yeah it worked. I swear I tried that. My dang autocomplete doesn't work
type: Comment

http://stackoverflow.com/comment/136589910
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77431878
has text: Though there is no need to add anything to info.plist, you should add the key into Entitlements.plist.
type: Comment

http://stackoverflow.com/comment/136651501
has text: May I suggest using modern Objective-C syntax. `cell.maskImage.image = maskImage2;` and no need for `NSStringWithFormat`. Just use `[UIImage imageNamed:maskName]`.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/77513073
type: Comment

http://stackoverflow.com/comment/136508918
has text: Can you clarify what you mean by "works"? If you do the character "a" do you see characters in other languages come up? If so, which languages have you tested with?
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77418597

http://stackoverflow.com/comment/136720219
comment on: http://stackoverflow.com/a/77552118
has text: Agreed. You certainly should use `isEqual:` in general and only use `==` when you specifically want to compare pointers. It's odd that using `==` is common for `NSNull`. I found a post about `==` vs `isEqual:` for `NSNull` at [Testing equality to NSNull](https://stackoverflow.com/questions/16600350/testing-equality-to-nsnull). BTW - `NSNumber`, as I recall, returns constants for the numbers 0 - 9, possibly others. I guess it's an optimization.
type: AnswerComment
type: Comment
score: 0

terminal
tag name: terminal
tags question: http://stackoverflow.com/q/77556761
type: Tag

http://stackoverflow.com/comment/136493630
type: Comment
has text: Other fonts seem to behave in a similar manner, `Proxima Nova` doesn't work either, at least not on my side.
comment on: http://stackoverflow.com/q/77419925
score: 0
type: QuestionComment

http://stackoverflow.com/a/77538466
type: Answer
answers question: http://stackoverflow.com/q/77535525
has comment: http://stackoverflow.com/comment/136700920
score: 0
has body: This is a generic response why not using the delegate pattern ? Add a delegate object for your class Override Property getter - (id)foo { if (delegate) { [self performSelector:@Selector(someMethod) withObject:nil]; } return nil; } When you want to change the method purpose set the delegate and provide your custom method impl... Hardcore (not rec) You can achieve this by using method swizzling in Objective-C. Swizzling involves swapping the implementation of methods at runtime

uint32
type: Tag
tags question: http://stackoverflow.com/q/77504380
tag name: uint32

http://stackoverflow.com/comment/136613359
comment on: http://stackoverflow.com/q/77490512
type: QuestionComment
has text: You commented out the line for registering the cell class with the collection view. You need that line.
score: 0
type: Comment

http://stackoverflow.com/comment/136743253
score: 0
comment on: http://stackoverflow.com/a/77565515
has text: Oh gosh, none taken. I really should be further along for how long I've been doing this. I'm just happy for the help. GCD has always been a little confusing to me.
type: AnswerComment
type: Comment

mpremotecommandcenter
tag name: mpremotecommandcenter
type: Tag
tags question: http://stackoverflow.com/q/77506853

uitabbarcontroller
tag name: uitabbarcontroller
tags question: http://stackoverflow.com/q/77456242
type: Tag
tags question: http://stackoverflow.com/q/79086536

http://stackoverflow.com/comment/136664009
type: QuestionComment
score: 0
has text: Ok, finally worked out what was wrong. For some reason, telling the cell that it inherited its module from its target was causing it to crash. I unticked that and now it works fine. Weird.
comment on: http://stackoverflow.com/q/77518382
type: Comment

nsnull
type: Tag
tag name: nsnull
tags question: http://stackoverflow.com/q/77551705

internationalization
type: Tag
tags question: http://stackoverflow.com/q/77418597
tag name: internationalization

uitabbar
tag name: uitabbar
type: Tag
tags question: http://stackoverflow.com/q/77456242

getter
tags question: http://stackoverflow.com/q/77535525
tag name: getter
type: Tag

http://stackoverflow.com/comment/136661491
has text: Because the cell you are dequeuing isn't what you think it is.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77518382
type: Comment

http://stackoverflow.com/comment/136486297
comment on: http://stackoverflow.com/q/77418597
type: Comment
score: 0
has text: Have you tried with `s` is `あ`? Or have you tried without `CGEventKeyboardSetUnicodeString`?
type: QuestionComment

http://stackoverflow.com/comment/136719089
comment on: http://stackoverflow.com/a/77551882
type: AnswerComment
type: Comment
score: 0
has text: No, the `NSNull` itself is *a singleton object used to represent null values in collection objects that don’t allow nil values*. `new` is from the `NSObject` class, and the `NSNull` inherited it.

notificationcenter
tag name: notificationcenter
tags question: http://stackoverflow.com/q/77466483
type: Tag

http://stackoverflow.com/comment/136673853
type: Comment
has text: Have you checked [this](https://stackoverflow.com/questions/44672419/how-to-import-existing-objective-c-pch-file-in-swift-class) and [this](https://stackoverflow.com/questions/26408612/implicitly-import-specific-swift-module) ?
score: 0
comment on: http://stackoverflow.com/q/77518826
type: QuestionComment

http://stackoverflow.com/comment/136549793
type: QuestionComment
comment on: http://stackoverflow.com/q/77425911
score: 0
has text: Do you recommend any book for Objective-C?
type: Comment

http://stackoverflow.com/q/77734537
tagged with: objective-c
has title: Why is currentRenderPassDescriptor taking 8ms in my Metal draw routine?
has body: I have a simple draw routine to draw a rotating triangle. And have diagnosed that most of the time getting the current MTLRenderPassDescriptor from the MTKView is taking 8ms. My code is in Objective-C and using manual reference counting. This is so I can communicate with my C++ game loop. I'm calling this draw routine in an external while loop in C++ and there are no wait functions, so the loop restarts as soon as the last one is finished. At the end of my C++ loop, I manually poll all Cocoa events similar to GLFW. Here is my code for the draw routine: - (void)commitWithMTKView:(nonnull MTKView *)mtk_view CommandQueue:(nonnull id<MTLCommandQueue>)command_queue { NSLog(@"Begin Frame"); [self updateState]; NSLog(@"Updated State"); @autoreleasepool { NSLog(@"Probe 1"); MTLRenderPassDescriptor* render_pass_descriptor = mtk_view.currentRenderPassDescriptor; NSLog(@"Probe 2"); if (render_pass_descriptor != nil) { id<MTLCommandBuffer> command_buffer = [command_queue commandBuffer]; // Command Encoding id<MTLRenderCommandEncoder> render_encoder = [command_buffer renderCommandEncoderWithDescriptor:render_pass_descriptor]; [render_encoder setRenderPipelineState:_render_pipeline_state]; // [render_encoder setVertexBuffer:_vertex_buffers[_current_buffer] offset:0 atIndex:ParallelTriangleRotate_vertexIndexVertices]; [render_encoder setVertexBytes:&_aspect_ratio length:sizeof(_aspect_ratio) atIndex:ParallelTriangleRotate_vertexIndexAspectRatio]; [render_encoder drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:0 vertexCount:3]; // [render_encoder endEncoding]; NSLog(@"Finished Encoded"); // // Commit in Drawable [command_buffer presentDrawable:mtk_view.currentDrawable]; NSLog(@"Before Commit"); [command_buffer commit]; NSLog(@"After Commit"); [command_buffer waitUntilScheduled]; NSLog(@"Just Scheduled"); [command_buffer waitUntilCompleted]; NSLog(@"Completed Scheduled"); } } NSLog(@"End Frame"); } By visual inspection I found two bottlenecks. The primary one is between "Probe 1…
answer count: 1
has comment: http://stackoverflow.com/comment/137043308
score: 0
has comment: http://stackoverflow.com/comment/137042473
has comment: http://stackoverflow.com/comment/137042612
has answer: http://stackoverflow.com/a/77738334
type: Question
has comment: http://stackoverflow.com/comment/137042504
has comment: http://stackoverflow.com/comment/137042485
has comment: http://stackoverflow.com/comment/137042654
tagged with: metal
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/77738334
tagged with: optimization

core-image
tag name: core-image
type: Tag
tags question: http://stackoverflow.com/q/77712292
tags question: http://stackoverflow.com/q/78824958
tags question: http://stackoverflow.com/q/79508792

http://stackoverflow.com/q/77644430
has body: I am using a NSTask to execute shell command like terminal. I want to run the command in root level so I am switching the sh to root user. This works fine until I want to interrupt a running process like ping command. Below is my code, #import "ViewController.h" @interface ViewController() { NSTask* task; } @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; [self setupTask]; [self executeCommand:@"sudo -S -i"]; [self executeCommand:@"password"]; [self executeCommand:@"ping www.google.com"]; [self performSelector:@selector(terminateTask) withObject:nil afterDelay:3]; } -(void)setupTask { @autoreleasepool { NSPipe *inPipe = [NSPipe new]; // pipe for shell input NSPipe *outPipe = [NSPipe new]; // pipe for shell output NSPipe* errorPipe = [NSPipe new]; task = [NSTask new]; [task setLaunchPath:@"/bin/sh"]; // [task setStandardInput:inPipe]; [task setStandardOutput:outPipe]; [task setStandardError:errorPipe]; [task launch]; // ... and wait for shell output. [[outPipe fileHandleForReading] waitForDataInBackgroundAndNotify]; [[errorPipe fileHandleForReading] waitForDataInBackgroundAndNotify]; // Wait asynchronously for shell output. // The block is executed as soon as some data is available on the shell output pipe. [[NSNotificationCenter defaultCenter] addObserverForName:NSFileHandleDataAvailableNotification object:[outPipe fileHandleForReading] queue:nil usingBlock:^(NSNotification *note) { // Read from shell output NSData *outData = [[outPipe fileHandleForReading] availableData]; if ([outData length] > 0) { NSString *outStr = [[NSString alloc] initWithData:outData encoding:NSUTF8StringEncoding]; if ([outStr isEqualToString:@"Password:"]) { NSLog(@"Password asked"); [[outPipe fileHandleForReading] waitForDataInBackgroundAndNotify]; } else { NSLog(@"output: %@", outStr); } // Continue waiting for shell output. } [[outPipe fileHandleForReading] waitForDataInBackgroundAndNotify]; }]; } } -(void)executeCommand:(NSString*)command { [task resume]; NS…
tagged with: cocoa
has answer: http://stackoverflow.com/a/77691170
has comment: http://stackoverflow.com/comment/136884777
score: 0
tagged with: sh
has comment: http://stackoverflow.com/comment/136897098
linked to: http://stackoverflow.com/q/37586811
has title: NSTask interrupt not working - Cocoa Objective C
type: Question
has comment: http://stackoverflow.com/comment/136886359
has comment: http://stackoverflow.com/comment/136886368
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136886356
tagged with: nstask
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136884776
tagged with: interrupt

ionic-framework
tags question: http://stackoverflow.com/q/77627573
tag name: ionic-framework
type: Tag
tags question: http://stackoverflow.com/q/78270748
tags question: http://stackoverflow.com/q/79331889

http://stackoverflow.com/comment/137103697
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77762066
has text: To solve this, I just kept a counter on each `MTLBuffer` that track how many frames in flight read from that buffer. Then I set a handler on the end of each frame draw command that check if a resize (edit) has occurred and if there are zero frames referencing the old buffer. If that number is zero, the old sized buffer is finally purged to save space.

http://stackoverflow.com/comment/136873172
type: QuestionComment
has text: Thanks, I've added more info and questions as an update to my question above.
comment on: http://stackoverflow.com/q/77629081
type: Comment
score: 0

http://stackoverflow.com/comment/136998478
type: QuestionComment
comment on: http://stackoverflow.com/q/77705575
type: Comment
score: 0
has text: Yes. I tried. It was throwing an exception and freezing the table. Not sure why. I solved it by unhooking the binding and adding code for value, object, and keyPath in awakeFromNib. Now it all works? I'm not exactly sure whey the binding in IB was problematic.

http://stackoverflow.com/q/77598216
tagged with: swift
type: UnansweredQuestion
score: 0
has body: The SCWindow class has all its initializers marked as unavailable. In Objective-C, I can get around it using class extensions: #import <ScreenCaptureKit/ScreenCaptureKit.h> @interface SCWindow (InitWithId) @property CGWindowID windowID; - (instancetype _Nonnull)initWithId:(CGWindowID)windowID; @end @implementation SCWindow (InitWithId) @dynamic windowID; - (instancetype _Nonnull)initWithId:(CGWindowID)windowID { self = [super init]; if (self) { [self setValue:[NSNumber numberWithInteger:windowID] forKey:@"windowID"]; } return self; } @end Is there a technique to do this in Swift? I believe Swift extensions only allow convenience initializers, not designated ones like Objective-C.
has comment: http://stackoverflow.com/comment/136815285
has comment: http://stackoverflow.com/comment/136809977
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136803782
has comment: http://stackoverflow.com/comment/136814903
answer count: 0
tagged with: screencapturekit
has title: Forcefully initialize class with unavailable init in Swift
has comment: http://stackoverflow.com/comment/136809965
has comment: http://stackoverflow.com/comment/136803691
type: Question

http://stackoverflow.com/q/77641465
tagged with: objective-c
has title: No member in framework target: Swift class as forward class in ObjC, accessed in Swift through ObjC class
type: Question
upvote count: 1
score: 1
favorite count: 0
tagged with: swift
type: UnansweredQuestion
has body: So I am creating an ObjC framework which has mix of ObjC and Swift code: UtilitiesFramework. Here is my StringUtilities class in Swift: @objc public class StringUtilities: NSObject { } I am accessing StringUtilities class in Utilities which is an ObjC class. Here is Utilities.h which is returning StringUtilities and has a forward class declaration for same: @class StringUtilities; // Forward Declaration @interface Utilities: NSObject - (StringUtilities *)stringUtilities; @end Here is Utilities.m which imports generated swift header file: #import <UtilitiesFramework/UtilitiesFramework-Swift.h> // This should provide concrete implementation of StringUtilities @implementation Utilities - (StringUtilities *)stringUtilities { return [StringUtilities new]; } @end I am exposing Utilites.h file to Swift through module.modulemap: module PrivateObjC { header "Utilities.h" } I have set the import path accurately in build settings as: $(SRCROOT)/$(PRODUCT_NAME) Now when I try to access Utilities class in some other swift class it just compiles fine: import PrivateObjC class SomeOperations { func doSomething() { _ = Utilities() // This compiles fine } However when I try to access the StringUtilities through its method, it gives compilation error: import PrivateObjC class SomeOperations { func doSomething() { _ = Utilities().stringUtilities() // This gives compilation error } Here are the errors: value of type Utilities has no member stringUtilities: _ = Utilities().stringUtilities() note: method stringUtilities not imported - (StringUtilities *)stringUtilities ^ note: return type not imported - (StringUtilities *)stringUtilities ^ note: interface StringUtilities is incomplete - (StringUtilities *)stringUtilities ^ note: interface StringUtilites forward declared here @class StringUtilities I thought this scenario is fixed as part of proposal: # 0384-importing-forward-declared-objc-interfaces-and-protocols.md However it is not working for me. May be it is due to it being approved …
downvote count: 0
tagged with: dynamic-frameworks
answer count: 0

http://stackoverflow.com/comment/137042473
comment on: http://stackoverflow.com/q/77734537
score: 1
type: QuestionComment
type: Comment
has text: Without digging too deeply into this, be very careful about profiling with NSLog. It is extremely slow itself, and has a synchronization lock that can significantly throw off these kinds of measurements. I doubt this is your full problem; but it can throw you onto the wrong path quite easily, especially since the synchronization is non-deterministic . See `os_signpost` for a much more accurate way to measure this kind of profiling information. `os_log` is also quite low-latency. https://developer.apple.com/documentation/os/logging/recording_performance_data?language=objc

http://stackoverflow.com/q/77760644
tagged with: ios
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/77797810
has answer: http://stackoverflow.com/a/77764735
tagged with: objective-c
tagged with: xcode
has body: I have a react native sdk inside which all of the code is written in objective C, now we are migrating it to swift, i followed the official react native guide on how to migrate to swift, did everything as suggested there but it's not working, i will explain where the main problem is happening - so inside my objective c file my code is written like this - #import <React/RCTBridgeModule.h> #import <SCDoorway/SCDoorway.h> #import <SCDoorway/SCDoorway-Swift.h> #import <Loans/Loans.h> #import <React/RCTBridge.h> @interface RCT_EXTERN_MODULE(BigTreeDoorway, NSObject) //MARK: SDK version helpers //MARK: SDK setup RCT_REMAP_METHOD(setConfigEnvironment, envName:(NSString *)envName gateway:(NSString *)gateway isLeprechaunActive: (BOOL *)isLeprechaunActive isAmoEnabled: (BOOL *)isAmoEnabled preProvidedBrokers: (NSArray *)preProvidedBrokers setConfigEnvironmentWithResolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { NSInteger environment = EnvironmentProduction; if([envName isEqualToString:@"production"]) { environment = EnvironmentProduction; } else if([envName isEqualToString:@"development"]) { environment = EnvironmentDevelopment; } else { environment = EnvironmentStaging; } GatewayConfig *config = [[GatewayConfig alloc] initWithGatewayName:gateway brokerConfig:preProvidedBrokers apiEnvironment:environment isLeprechaunActive:isLeprechaunActive isAmoEnabled:isAmoEnabled]; [SCDoorway.shared setupWithConfig: config completion:^(BOOL success,NSError * error) { if(success) { resolve(@(YES)); } else { NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init]; [responseDict setValue:[NSNumber numberWithInteger:error.code] forKey:@"errorCode"]; [responseDict setValue:error.domain forKey:@"errorMessage"]; NSError *err = [[NSError alloc] initWithDomain:error.domain code:error.code userInfo:responseDict]; reject(@"setConfigEnvironment", @"Env setup failed", err); } }]; } //and many more functions ... now even in my objective-C file when i open…
possible better answer: http://stackoverflow.com/a/77764735
upvote count: 5
accepted answer: http://stackoverflow.com/a/77797810
score: 5
tagged with: react-native
type: Question
tagged with: swift
downvote count: 0
favorite count: 0
has title: Error SwiftCompile normal arm64 Compiling .. in target '' from project pods while migrating from objective C to Swift in my react native app
answer count: 2

http://stackoverflow.com/comment/136886359
comment on: http://stackoverflow.com/q/77644430
has text: Tip: don't ignore return values.
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/77703429
type: Question
tagged with: objective-c
favorite count: 0
has body: I'm using React Native with the react-native-webview library. My code is like this: &lt;SafeAreaView style={backgroundStyle}&gt; &lt;WebView useWebKit={true} scrollEnabled={false} hideKeyboardAccessoryView={true} keyboardDisplayRequiresUserAction={false} nestedScrollEnabled={!useContainer} style={[styles.webview, style]} {...rest} menuItems={[{ key: 'test0001', label: 'Bold Test' }]} onCustomMenuSelection={(event) =&gt; { console.log('hehehe'); }} /&gt; &lt;/SafeAreaView&gt; It's work well with iOS &lt;= 15, but cannot run on iOS &gt;= 16. I figured out the reason is UIMenuController has been deprecated and we should use UIEditMenuInteraction instead. Any suggestion or document/links for me? Please help me, thank you so much. P/s: I tried to edit the library native code but it seems Objective-C is so strange to me :(((
type: UnansweredQuestion
score: 2
tagged with: react-native
downvote count: 0
answer count: 0
upvote count: 2
has title: React Native Webview menuItems prop cannot use on iOS >= 16
tagged with: uikit

http://stackoverflow.com/q/77672746
has comment: http://stackoverflow.com/comment/136936288
tagged with: alpha
tagged with: background
has body: How do I get the text in my cells to show as solid text while still fading the cell background so I can see the image behind? I have the following in my ViewController: ` - (void)viewDidLoad { // Used to see the background image self.tableView.backgroundColor = [UIColor clearColor]; self.tableView.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"background.png"]]; self.tableView.backgroundView.contentMode = UIViewContentModeScaleAspectFill; } -(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *) cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.alpha=0.5; cell.textLabel.alpha=1.0; } The result is shown in the image where the background image can be seen through the text and cell background. I only want to see the image through the cell background and have the text solid. Is there a way to set the text to have an alpha of 1.0 while the background is 0.5? app screenshot
tagged with: ios
score: 0
has answer: http://stackoverflow.com/a/77674440
linked to: http://stackoverflow.com/q/18901394
has title: iOS Solid text over a background image and low alpha cell background
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136934847
type: Question
answer count: 1
tagged with: uitableview
type: UnansweredQuestion

http://stackoverflow.com/comment/136833403
comment on: http://stackoverflow.com/q/77616167
score: 1
type: Comment
has text: Are you designing cells in Storyboard or through code? If code, show us your cell class code. If you're using Storyboard Prototype cells, show us how you've configured the constraints.
type: QuestionComment

optimization
type: Tag
tag name: optimization
tags question: http://stackoverflow.com/q/77734537

http://stackoverflow.com/comment/136893311
score: 0
type: QuestionComment
has text: Is this within your debugger, or on a release build? A debugger should be able to drop you into the actual call-site, regardless of whatever is being reported here.
type: Comment
comment on: http://stackoverflow.com/q/77649167

http://stackoverflow.com/comment/136930511
comment on: http://stackoverflow.com/a/77670245
score: 0
has text: I faced this issue before, and I researched it. That's it, haha. Btw, if you're interested in ARC, you may want to take a look at this old [documentation](https://developer.apple.com/library/archive/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html). And I think briding always has issues, and you have to find a way to work around them.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/77641579
has body: I tried to delete entries from an NSMutableOrderedSet. The behavior is inconsistent, sometimes it works and sometimes it does not. NSMutableOrderedSet* detailPlaylist; [detailPlaylist removeObjectAtIndex:indexPath.row]; before the removal: (lldb) po [detailPlaylist objectAtIndex:0] { videoDuration = "5:15"; videoId = "i-bu47QpWWc"; videoSelected = n; videoThumbnailData = {length = 10595, bytes = 0xffd8ffe0 00104a46 49460001 01000001 ... 84200421 0801ffd9 }; videoThumbnailUrl = "https://i.ytimg.com/vi/i-bu47QpWWc/hqdefault.jpg?sqp=-oaymwEiCKgBEF5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ==&rs=AOn4CLDbkeqgCWR4RSyTpUhI9IM2Gd2poA"; videoTitle = "\U5f35\U60e0\U59b9 A-Mei - \U7ad9\U5728\U9ad8\U5d17\U4e0a \U5b98\U65b9MV (Official Music Video)"; } (lldb) po detailPlaylist.count 1 /////// after the removal: (lldb) po detailPlaylist.count 1 (lldb) po [detailPlaylist objectAtIndex:0] error: warning: couldn't get cmd pointer (substituting NULL): no variable named '_cmd' found in this frame error: Execution was interrupted, reason: internal ObjC exception breakpoint(-7).. The process has been returned to the state before expression evaluation.
tagged with: nsmutableorderedset
tagged with: ios
has comment: http://stackoverflow.com/comment/136903368
has comment: http://stackoverflow.com/comment/136902270
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136935650
score: 0
has title: NSMutableOrderedSet removeObjectAtIndex not working consistently
has comment: http://stackoverflow.com/comment/136975047
type: Question
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/136880874

http://stackoverflow.com/comment/136858301
score: 1
type: QuestionComment
has text: Try `NSLog(@"%@", @(123456))` or `NSLog(@"%@", [[NSString alloc] initWithFormat:@"%d", 123456])`.
comment on: http://stackoverflow.com/q/77617207
type: Comment

http://stackoverflow.com/q/77735215
downvote count: 0
tagged with: photokit
answer count: 0
score: 1
has body: PHAuthorizationStatus authorizationStatus = [PHPhotoLibrary authorizationStatusForAccessLevel:PHAccessLevelReadWrite]; if (authorizationStatus != PHAuthorizationStatusAuthorized) { return; } PHFetchOptions *fetchOptions = [[PHFetchOptions alloc] init]; fetchOptions.predicate = [NSPredicate predicateWithFormat:@"title == %@", "MyAlbum"]; PHFetchResult *collections = [PHAssetCollection fetchAssetCollectionsWithType: PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAny options:fetchOptions]; The above code crashed when fetchAssetCollectionsWithType is called on iOS 17, and the error is "Access to the photo library is not allowed until the photo library is obtainable." What's wrong with my code? I thought the reason is that I called the function too early, because the system printed the log, "Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)" when I called the function before the UIViewController#viewDidLoad is called on my own device which is iOS 17.0.2. So I called the function after UIViewController#viewDidLoad is called, and I got the above error, "Access to the photo library is not allowed until the photo library is obtainable"
has comment: http://stackoverflow.com/comment/137051223
tagged with: ios
type: Question
upvote count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/137047587
has comment: http://stackoverflow.com/comment/137072717
type: UnansweredQuestion
has title: iOS Access to the photo library is not allowed until the photo library is obtainable
favorite count: 0

http://stackoverflow.com/q/77767261
has comment: http://stackoverflow.com/comment/137103369
tagged with: deep-linking
has body: I need open the native camera app when a function was called. I just need redirect to native camera app. I don't want to get any image. I am trying with this code: NSURL *url = [NSURL URLWithString:@"some-camera-deep-link://"]; if ([[UIApplication sharedApplication] canOpenURL:url]) { [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; } else { NSLog(@"some error"); } However, I don't know the exact URL I need to set and how configure this in my Info.plist. Is possible do this kind of navigation? Can you show some example? I don't want to use UIImagePickerController.
has title: How can I open native camera from my app on iOS?
accepted answer: http://stackoverflow.com/a/77767909
type: AnsweredQuestion
tagged with: objective-c
tagged with: ios
has answer: http://stackoverflow.com/a/77767909
type: Question
upvote count: 1
downvote count: 0
answer count: 1
tagged with: camera
score: 1
favorite count: 0

rendering
tag name: rendering
tags question: http://stackoverflow.com/q/77762066
type: Tag

http://stackoverflow.com/q/77783407
type: UnansweredQuestion
has title: Extract the 3D stereo images from a 3D video in MV-HEVC format
favorite count: 0
has body: I would like extract the both 3D stereo images (left/right) from a 3D spatial video in MV-HEVC format. I use code, iOS, Objective-C. Here is my code to read a 2D video: NSURL *inputVideoURL = [NSURL fileURLWithPath:inputVideoPath]; AVURLAsset *inputAsset = [AVURLAsset URLAssetWithURL:inputVideoURL options:nil]; AVAssetImageGenerator *imageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:inputAsset]; for (int i=1;i&lt;=maxx;i++) { CMTime time = CMTimeMake(i, (int32_t)frameRate); CGImageRef imageRef = [imageGenerator copyCGImageAtTime:time actualTime:NULL error:&amp;error]; UIImage *image=nil; image = [UIImage imageWithCGImage:imageRef]; }
tagged with: avfoundation
downvote count: 0
has comment: http://stackoverflow.com/comment/137538488
answer count: 0
score: 1
tagged with: ios
type: Question
upvote count: 1
tagged with: 3d
tagged with: objective-c

http://stackoverflow.com/comment/136903368
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77641579
has text: @DonMag No worries. I think I found what caused the issue. The detailPlaylist is not an independent object.

http://stackoverflow.com/q/77688658
score: 0
tagged with: cocoa
type: Question
type: UnansweredQuestion
has title: stringByAddingPercentEncodingWithAllowedCharacters encodes colons
has comment: http://stackoverflow.com/comment/136981329
tagged with: url
linked to: http://stackoverflow.com/q/44381108
has body: I wrote the following test code in objective-c: NSCharacterSet *pathAllowedCharacterSet = [NSCharacterSet URLPathAllowedCharacterSet]; // Check if colon is a member of URLPathAllowedCharacterSet if ([pathAllowedCharacterSet characterIsMember:':']) { NSLog(@"Colon is allowed in URL path"); } else { NSLog(@"Colon is not allowed in URL path"); } NSString* test = [@":" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLPathAllowedCharacterSet]]; NSLog(@"%@", test); What gets logged is Colon is allowed in URL path %3A The documentation for stringByAddingPercentEncodingWithAllowedCharacters states: Returns a new string made from the receiver by replacing all characters not in the specified set with percent-encoded characters. That implies to me that if a character is in the specified set, it will not be percent-encoded. Why is the colon being percent-encoded? Is there a way for it not to be?
has comment: http://stackoverflow.com/comment/136963159
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136973561
answer count: 0

http://stackoverflow.com/comment/136843574
type: QuestionComment
comment on: http://stackoverflow.com/q/77617207
type: Comment
has text: Willeke, thanks! Cy, I also log strings of comma-separated numbers, so commas within numbers are visually confusing.
score: 0

http://stackoverflow.com/comment/136907358
comment on: http://stackoverflow.com/q/77655283
score: 0
type: QuestionComment
has text: @TomHarrington Paulw11 As I mentioned in the post, I know that I can hardcode some exceptions to swap certain characters for other certain characters, but I'm not excited about a potentially growing list of exceptions. The underlying iOS code obviously has some way of treating them the same because that's what happens when the NSFetchRequest does it's work. But the NSFetchedResultsController does NOT treat them the same way which is what causes the crash. I would like to know how to have both of them do the same thing; either both treat them the same or neither treat them the same.
type: Comment

http://stackoverflow.com/q/77637622
tagged with: macos
tagged with: accessibility
has comment: http://stackoverflow.com/comment/136884195
has comment: http://stackoverflow.com/comment/136872114
type: Question
upvote count: 1
answer count: 1
tagged with: objective-c
tagged with: cocoa
has body: My requirement is to launch a third-party application from my application and auto-fill the username into a specified text box. Currently, I am able to launch the application and have tried using the Cocoa framework but I can only get the window information, not the elements inside. I’ve also attempted using the Accessibility API, and when I analyzed with Accessibility Inspector, I found that the parent role of the element I needed was Window, but this element didn’t appear in the Window’s children. I don’t know how to proceed. Is there any other method that could help me accomplish this? I’ve tried using the Cocoa framework but can only obtain the information of the window, without knowing how to grab the elements inside. I’ve also attempted to use the Accessibility API to retrieve them.
has title: How can I access text box elements in a specific third-party application window?
favorite count: 0
has comment: http://stackoverflow.com/comment/136873806
has comment: http://stackoverflow.com/comment/136885151
has comment: http://stackoverflow.com/comment/136882282
type: UnansweredQuestion
tagged with: swift
downvote count: 0
has answer: http://stackoverflow.com/a/77655171
score: 1

http://stackoverflow.com/q/77600508
answer count: 1
has comment: http://stackoverflow.com/comment/136805785
tagged with: uitableview
has title: Reuse a tableview cell with CALayer
has answer: http://stackoverflow.com/a/77616852
type: AnsweredQuestion
has body: I have a tableview cell with a reuse-identifier set in storyboard. After checking some conditions I want to draw different things on the contentView of the cell. My problem is when the tableview re-uses the cell, the CAShapeLayer from another cell persists, so it's showing the new drawing over the (re-used) drawing. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"StatusCell"]; NSManagedObject *object = [self.fetchedResultsController objectAtIndexPath:indexPath]; if ([[object valueForKey:@"status"] isEqualToString:@"sending"]) { CAShapeLayer *progressLayer; //...Configure and draw Layer with UIBezierPath [cell.contentView.layer addSublayer:progressLayer]; } else if ([[object valueForKey:@"status"] isEqualToString:@"sent"]) { CAShapeLayer *sentLayer; //...Configure and draw Layer with UIBezierPath [cell.contentView.layer addSublayer:sentLayer]; } return cell; } So I tried to give the CAShapeLayer a name and delete the layer from the re-used cell before creating a new CAShapeLayer. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"StatusCell"]; NSManagedObject *object = [self.fetchedResultsController objectAtIndexPath:indexPath]; for (CALayer *layer in cell.contentView.layer.sublayers) { if ([layer.name isEqualToString:@"sending"] || [layer.name isEqualToString:@"sent"]) { [layer removeFromSuperlayer]; } } if ([[object valueForKey:@"status"] isEqualToString:@"sending"]) { CAShapeLayer *progressLayer; progressLayer.name = @"sending"; //...Configure and draw Layer with UIBezierPath [cell.contentView.layer addSublayer:progressLayer]; } else if ([[object valueForKey:@"status"] isEqualToString:@"sent"]) { CAShapeLayer *sentLayer; sentLayer.name = @"sent"; //...Configure and draw Layer with UIBezierPath [cell.contentView.laye…
accepted answer: http://stackoverflow.com/a/77616852
tagged with: objective-c
score: 0
type: Question

http://stackoverflow.com/comment/136954242
comment on: http://stackoverflow.com/a/77683918
type: AnswerComment
type: Comment
score: 0
has text: `Targets -> Info` is not present when creating cli app project.

http://stackoverflow.com/a/77674440
answers question: http://stackoverflow.com/q/77672746
has body: You can put this either in cellForRowAtIndexPath or willDisplayCell: cell.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5]; Output: Set the label text color as you normally would (in cellForRowAtIndexPath), and adjust the colorWithAlphaComponent:0.5 to suit your needs.
has comment: http://stackoverflow.com/comment/136940547
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/136939543
has comment: http://stackoverflow.com/comment/136938946

http://stackoverflow.com/comment/137103369
score: 0
has text: As you can see from [these search results](https://stackoverflow.com/search?q=%5Bios%5D+open+camera+app), it is not possible.
type: QuestionComment
comment on: http://stackoverflow.com/q/77767261
type: Comment

http://stackoverflow.com/comment/137009883
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77712292
type: Comment
has text: No, I mean you should try to create a serial queue, then enqueue the setup code to this queue, running also need to dequeue on this queue.

http://stackoverflow.com/comment/136811482
comment on: http://stackoverflow.com/q/77599602
has text: @timbretimbre The first thing is when you remove **use framework!** in Podfile pod can't install. Specifically **pod 'FacebookShare'**
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/136818154
comment on: http://stackoverflow.com/q/77603588
score: 0
has text: I just realized this could be a byte ordering issue. If you expect a 16-bit (2-byte) value to only have values in the range 0-255 then that means one byte will always be zero and the other will be 0-255. If you are getting 29440 then that's the bytes 0 and 114 in the wrong order. 29696 is 0 and 115 in the wrong order.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136994896
has text: Bind to the array controller, arrangedObjects, `@sum.modelKey`?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/77705575
type: Comment

http://stackoverflow.com/comment/137001903
has text: @Willeke I use `CGEventTapCreate` with the `NSEventMaskMouseMoved` mask to listen the mouse movement event. And after the callback called, my mouse pointer doesn't get inverted
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/77709979
type: Comment

http://stackoverflow.com/comment/136806652
type: QuestionComment
type: Comment
has text: @TejaNandamuri Fine, but it's confusing. After invoke setAttributedText:, property textColor also changes to red color, Why did it turn back to blue in the end?
comment on: http://stackoverflow.com/q/77600151
score: 0

http://stackoverflow.com/comment/136811487
type: Comment
comment on: http://stackoverflow.com/q/77599602
has text: Please don't post pictures of text. You should edit your question and replace the pictures with the actual text, copied and pasted. Text in pictures can't be searched or referenced and the text is much harder to read. It's also more work to post.
type: QuestionComment
score: 1

http://stackoverflow.com/comment/136934847
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/77672746
type: Comment
has text: Does this answer your question? [UITableView / UITableViewCell challenge with transparent background on iPad with iOS7](https://stackoverflow.com/questions/18901394/uitableview-uitableviewcell-challenge-with-transparent-background-on-ipad-with)

http://stackoverflow.com/comment/137042504
has text: @RobNapier Thank you I will look through that. Do you see Edit 2? Why might that be the case? Or is that spooky behavior just odd because I am doing it the wrong way?
type: QuestionComment
comment on: http://stackoverflow.com/q/77734537
type: Comment
score: 0

http://stackoverflow.com/comment/136963159
comment on: http://stackoverflow.com/q/77688658
type: Comment
has text: FYI - consider using `NSURLComponents` to more easily and safely build URLs.
type: QuestionComment
score: 2

metalkit
tag name: metalkit
type: Tag
tags question: http://stackoverflow.com/q/77762066

http://stackoverflow.com/comment/136882550
type: Comment
comment on: http://stackoverflow.com/q/77627573
score: 0
type: QuestionComment
has text: Any possible solutions??

http://stackoverflow.com/q/77705575
has title: Calculate/Display NSTableView column sum
tagged with: nstableview
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/77710378
answer count: 1
tagged with: objective-c
tagged with: cocoa
score: 0
type: Question
has comment: http://stackoverflow.com/comment/136998478
accepted answer: http://stackoverflow.com/a/77710378
has comment: http://stackoverflow.com/comment/136994837
has comment: http://stackoverflow.com/comment/136994748
has comment: http://stackoverflow.com/comment/136994896
has body: I’m updating an Objective-C app. I have an NSTableView w/ 2 columns. Column 2 binding: set to arrayController, arrangedObjects, and the Model Key is set to a defined Entity Attribute. I have Attribute type set to “Float.” I added a numberFormatter to the column with its format set to “Currency.” Everything (Add, Delete, Save, etc.) works as expected. What I would like to do is update an independent textField below the table column to display the running sum of the currency values populating the column. The updating in the sum textField doesn’t need to update dynamically. I can set up a separate action to manually initialize a calculation of the existing column values. How can I get this done?

http://stackoverflow.com/q/77666355
has comment: http://stackoverflow.com/comment/136924326
has title: UIButton visible but cannot be pressed
has comment: http://stackoverflow.com/comment/136923943
linked to: http://stackoverflow.com/q/72427842
score: 0
has comment: http://stackoverflow.com/comment/136927094
type: Question
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136927540
answer count: 0
tagged with: ios
tagged with: uibutton
has body: My buttons can’t be pressed. When I press them there is no animation or highlight, and the onPressed method never gets called either. I strongly suspect there’s something wrong with the way I’m adding subviews. My buttons are in a UIView called QuickMove. My objects are like this: BoardView contains EvilEndgame instance, EvilEndgame instance contains QuickMove instance. EvilEndgame UIView init’s QuickMove and adds it to the subview: EvilEndgame.m -(void) initializeChessBoard: (UIView*) boardView boardDict: (NSMutableDictionary*) board { // Properties self.engine = [[NSMutableDictionary alloc] init]; // ScoresLayer self.scoresLayer = [ScoresLayer sharedInstance]; self.scoresLayer.boardView = boardView; self.scoresLayer.board = board; // // QuickMove self.quickMove = [QuickMove sharedInstance]; [self.quickMove startNewGame]; [boardView addSubview: self.quickMove]; self.quickMove.delegate = self; } QuickMove creates multiple buttons and adds them via [self addSubview: button]: QuickMove.m + (instancetype)sharedInstance { static QuickMove *sharedInstance = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedInstance = [[QuickMove alloc] init]; // Set the bounds to match the screen bounds sharedInstance.bounds = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height); // Set the center to adjust the position sharedInstance.center = CGPointMake([UIScreen mainScreen].bounds.size.width / 2, 415 + [UIScreen mainScreen].bounds.size.height / 2); }); return sharedInstance; } - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [UIColor grayColor]; } return self; } - (void)startNewGame { for (UIButton *button in self.buttons) { [button removeFromSuperview]; } for (UIButton *button in self.smartMoveButtons) { [button removeFromSuperview]; } [self.buttons removeAllObjects]; [self.smartMoveButtons removeAllObjects]; [self createButtons]; } - (void)create…
tagged with: objective-c

http://stackoverflow.com/comment/137047587
type: QuestionComment
type: Comment
has text: Have you called `PHPhotoLibrary requestAuthorization:`? Have you added the needed `NSPhotoLibraryUsageDescription` key to your Info.plist?
score: 0
comment on: http://stackoverflow.com/q/77735215

http://stackoverflow.com/q/77600151
has body: The text color starts out as red and changes to blue after clearing the text. @interface ViewController () @property (nonatomic, strong) UITextField *textField; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; self.textField = [[UITextField alloc] initWithFrame:CGRectMake(100, 100, 100, 30)]; self.textField.textColor = UIColor.blueColor; self.textField.text = @"hello world"; NSAttributedString *attributedText = self.textField.attributedText; NSMutableAttributedString *mAttributedText = attributedText.mutableCopy; [attributedText enumerateAttribute:NSForegroundColorAttributeName inRange:NSMakeRange(0, attributedText.length) options:NSAttributedStringEnumerationLongestEffectiveRangeNotRequired usingBlock:^(id _Nullable value, NSRange range, BOOL * _Nonnull stop) { [mAttributedText addAttribute:NSForegroundColorAttributeName value:UIColor.redColor range:range]; }]; self.textField.attributedText = mAttributedText; [self.view addSubview:self.textField]; } @end The expectation is that the text should always remain red. Why does UITextField textColor changed after clearing the text?
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/136806487
tagged with: textcolor
has comment: http://stackoverflow.com/comment/136806652
has comment: http://stackoverflow.com/comment/136807479
favorite count: 0
has comment: http://stackoverflow.com/comment/136805041
tagged with: uikit
has comment: http://stackoverflow.com/comment/136806329
tagged with: uitextfield
type: UnansweredQuestion
has title: UITextField textColor changed after clearing the text
score: 1
downvote count: 0
answer count: 0
tagged with: ios
tagged with: objective-c

http://stackoverflow.com/comment/136975047
has text: @CarlLindberg This one is totally my overlook. I forgot the set was part of another data structure.
comment on: http://stackoverflow.com/q/77641579
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/136954462
type: AnswerComment
score: 1
type: Comment
has text: command line tool Mac app. 1、new plist file with Info.plist. 2、setting CFBundleIdentifier com.mycorp.myapp CFBundleName My App NSContactsUsageDescription record from the camera . 3、Build Setting - Create Info.plist Section in Binary with YES. 4、Build Setting - Info.plist file set your file path. 5、Build Phases - Copy Files - Destination to Products Directory, and add your info file with `add`
comment on: http://stackoverflow.com/a/77683918

http://stackoverflow.com/comment/137072972
has text: Use SPM and forget about user header search paths
comment on: http://stackoverflow.com/q/77727458
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/77712292
type: Question
has comment: http://stackoverflow.com/comment/137008194
has body: I have a problem with captureOutput method not being called during the session. I tried adding NSLog to it but it seems that method is never called. Moreover, I tried searching for the solution, but didn't find any. #import <AVFoundation/AVFoundation.h> #import <UIKit/UIImage.h> @interface Cam : NSObject <AVCaptureVideoDataOutputSampleBufferDelegate> -(void)captureOutput:(AVCaptureOutput *)output didOutputSampleBuffer:(CMSampleBufferRef)buffer fromConnection:(AVCaptureConnection *)connection; @end @interface Cam () { } -(BOOL)start: (int)deviceIndex; -(void)stop; -(NSData *)getFrame; @end @implementation Cam Cam *cam; CVImageBufferRef head; AVCaptureSession *session; int count; -(id)init { self = [super init]; head = nil; count = 0; return self; } -(void)dealloc { @synchronized (self) { if (head != nil) { CFRelease(head); } } } -(BOOL)start:(int)deviceIndex { int index; NSArray *devices; AVCaptureDeviceDiscoverySession *discoverySession; AVCaptureDevice *device; AVCaptureDeviceInput *input; AVCaptureVideoDataOutput *output; NSError *error; dispatch_queue_t queue; session = [[AVCaptureSession alloc] init]; session.sessionPreset = AVCaptureSessionPresetMedium; discoverySession = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera] mediaType:AVMediaTypeVideo position:AVCaptureDevicePositionUnspecified]; devices = discoverySession.devices; index = deviceIndex; if (index < 0 || index >= [devices count]) { log_debug("* Failed to open device (%d)\n", index); return NO; } device = devices[index]; input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error]; if (!input) { log_debug("* Failed to capture input (%s)\n", [error.localizedDescription UTF8String]); return NO; } [session addInput:input]; output = [[AVCaptureVideoDataOutput alloc] init]; [session addOutput:output]; queue = dispatch_queue_create("cam_queue", NULL); [output setAlwaysDiscardsLateVideoFrames:YES]; [output setVideoSettings:@{(NSString *)…
tagged with: avfoundation
tagged with: core-video
has comment: http://stackoverflow.com/comment/137005433
type: UnansweredQuestion
tagged with: core-image
has comment: http://stackoverflow.com/comment/137009992
answer count: 0
tagged with: ios
score: 0
has comment: http://stackoverflow.com/comment/137009883
has title: AVFoundation (Objective-C, iOS 16): captureOutput not called
tagged with: objective-c

http://stackoverflow.com/comment/136806818
comment on: http://stackoverflow.com/q/77599602
score: 1
type: Comment
has text: I can't help with the question itself, but FYI macOS lets you take screenshots of individual windows. It makes them perfectly cropped, without needing to spend the effort to crop a full-screen screenshot yourself. See "How to capture a window or menu " on https://support.apple.com/en-us/102646
type: QuestionComment

audioqueueservices
type: Tag
tags question: http://stackoverflow.com/q/77709334
tag name: audioqueueservices

http://stackoverflow.com/q/77649167
has body: I have a crash in some code from an XCFramework binary that I have embedded in my app. When I symobilicate the the code, the name of the methods in the call stack of the crash are replaced with the name of a C function in an objective-C class. e.g. 7 &lt;redacted&gt; 0x335988 &lt;redacted&gt;_PINRemoteImageManagerSubclassOverridesSelector + 1729336 For different crashes it seems to pick a random C Function from the code and uses it for the name of the method in the call stack. I have no idea why this would be happening. Any thoughts or suggestions would be welcome. Thanks Crashed: com.apple.main-thread 0 libsystem_kernel.dylib 0xa01c __pthread_kill + 8 1 libsystem_pthread.dylib 0x5680 pthread_kill + 268 2 libsystem_c.dylib 0x75b90 abort + 180 3 libswiftCore.dylib 0x3a24d8 swift::fatalError(unsigned int, char const*, ...) + 126 4 libswiftCore.dylib 0x3a24f8 swift::warningv(unsigned int, char const*, char*) + 30 5 libswiftCore.dylib 0x3a26b4 swift::swift_abortRetainUnowned(void const*) + 32 6 libswiftCore.dylib 0x3ff018 swift_unknownObjectUnownedTakeStrong + 74 7 &lt;redacted&gt; 0x335988 &lt;redacted&gt;_PINRemoteImageManagerSubclassOverridesSelector + 1729336 8 &lt;redacted&gt; 0x280f40 &lt;redacted&gt;_PINRemoteImageManagerSubclassOverridesSelector + 989424 9 &lt;redacted&gt; 0x298024 &lt;redacted&gt;_PINRemoteImageManagerSubclassOverridesSelector + 1083860 10 &lt;redacted&gt; 0x297b68 &lt;redacted&gt;_PINRemoteImageManagerSubclassOverridesSelector + 1082648 11 libdispatch.dylib 0x26a8 _dispatch_call_block_and_release + 32 12 libdispatch.dylib 0x4300 _dispatch_client_callout + 20 13 libdispatch.dylib 0x12998 _dispatch_main_queue_drain + 984 14 libdispatch.dylib 0x125b0 _dispatch_main_queue_callback_4CF + 44 15 CoreFoundation 0x3720c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 16 CoreFoundation 0x33f18 __CFRunLoopRun + 1996 17 CoreFoundation 0x33668 CFRunLoopRunSpecific + 608 18 GraphicsServices 0x35ec GSEventRunModal + 164 19 UIKitCore 0x22c2b4 -[UIAppl…
tagged with: xcode
has comment: http://stackoverflow.com/comment/136898063
score: 0
has comment: http://stackoverflow.com/comment/136935638
answer count: 0
has title: Xcode Crash Log - Call Stack replaced with C Function name
tagged with: http://stackoverflow.com/tag/c
has comment: http://stackoverflow.com/comment/136898012
has comment: http://stackoverflow.com/comment/136893311
tagged with: ios
has comment: http://stackoverflow.com/comment/136896932
type: Question
has comment: http://stackoverflow.com/comment/136898030
tagged with: crash-log
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/comment/136930477
type: Comment
has text: It works! Thanks for answer. How did you come to the answer? Can you tell me what I needs to study to understand more about this?
comment on: http://stackoverflow.com/a/77670245
score: 1
type: AnswerComment

http://stackoverflow.com/q/77599602
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136811487
has body: Report What did I do? I tried to run the pod install or arch -x86_64 pod install command What did you expect to happen? I want to pod install Facebook with use framework!. Currently, I am using a static library. What happened instead? [!] The following Swift pods cannot yet be integrated as static libraries: The Swift pod FacebookCore depends upon FBSDKCoreKit, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies. The Swift pod FacebookLogin depends upon FBSDKCoreKit and FBSDKLoginKit, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies. The Swift pod FacebookShare depends upon FBSDKCoreKit and FBSDKShareKit, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies. CocoaPods Environment CocoaPods : 1.15.1 Podfile # Uncomment the next line to define a global platform for your project platform :ios, '11.0' def facebook_pods # pod 'Bolts' # pod 'FBSDKLoginKit', :modular_headers => true # pod 'FBSDKShareKit', :modular_headers => true pod 'FacebookLogin' pod 'FacebookShare' end def all_pods pod 'Firebase', :modular_headers => true pod 'FirebaseCoreInternal', :modular_headers => true pod 'GoogleUtilities', :modular_headers => true pod 'FirebaseCore', :modular_headers => true pod 'GoogleMaps' pod 'GooglePlaces' pod 'GoogleSignIn' pod 'FirebaseCoreInternal' pod 'Firebase/Analytics' pod 'Firebase/D…
has comment: http://stackoverflow.com/comment/136811482
tagged with: xcode
favorite count: 0
has comment: http://stackoverflow.com/comment/136806818
has comment: http://stackoverflow.com/comment/136807654
tagged with: cocoapods
upvote count: 1
has comment: http://stackoverflow.com/comment/136811577
tagged with: swift
downvote count: 0
answer count: 0
score: 1
has title: The following Swift pods cannot yet be integrated as static libraries in iOS Project Objective C Language
has comment: http://stackoverflow.com/comment/136816986
tagged with: ios
type: Question

http://stackoverflow.com/comment/136838429
has text: @DonMag I’m writing. This code and this is the whole code
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/77616167
type: Comment

http://stackoverflow.com/comment/137235229
type: Comment
comment on: http://stackoverflow.com/q/77727458
score: 0
type: QuestionComment
has text: Not sure Profile-swift.h exists . May be you can try to add the swift header file in the prefix pch file

http://stackoverflow.com/a/77639437
has body: I was now able to solve the problem by creating a strong reference from the FunSDKWrapper and the CompletionHandler. var funSDKWrapper: FunSDKWrapper? @objc func initXMSDK(_ call: CAPPluginCall) { let wrapper = FunSDKWrapper(); self.funSDKWrapper = wrapper; let strongCompletionHandler: (([AnyHashable: Any]) -> Void) = { result in NSLog("Completion von iniXMSDK"); } let resp = wrapper.iniXMSDK(1, completion: strongCompletionHandler); call.resolve([ "status": resp ]) }
accepted answer of: http://stackoverflow.com/q/77629081
answers question: http://stackoverflow.com/q/77629081
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/comment/136807654
type: QuestionComment
comment on: http://stackoverflow.com/q/77599602
type: Comment
has text: I think you need to `import FacebookCore` before you import the other 2 pods
score: 0

http://stackoverflow.com/q/77686138
type: AnsweredQuestion
has title: Google Map layer snapshot in iOS 17.2 is blank
has body: I have developed an iOS app (way back with ObjectiveC) which creates an image of the current Google Map on the screen. I always have used this code, which ran fine: UIGraphicsBeginImageContextWithOptions(self.map.frame.size, NO, 0.0); [self.map.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return image; Now I have the problem that since iOS 17.2 the image is empty (only the Google logo is shown, but no map information at all). Does anybody know what the issue is? Thx, Danny
has answer: http://stackoverflow.com/a/77799515
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/137060345
tagged with: ios
tagged with: google-maps-sdk-ios
type: Question
answer count: 1
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/77799515
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/137092747
comment on: http://stackoverflow.com/q/77762066
type: QuestionComment
has text: Actually, what problem are you trying to solve with purgable states?
score: 0
type: Comment

http://stackoverflow.com/q/77617207
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/136858301
tagged with: xcode
favorite count: 0
has comment: http://stackoverflow.com/comment/136846910
answer count: 0
has title: NSLog( @"%d", 123456) produces 123,456
has comment: http://stackoverflow.com/comment/136837585
type: Question
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136835194
score: 1
has comment: http://stackoverflow.com/comment/136841747
has comment: http://stackoverflow.com/comment/136843574
has body: Objective C, Xcode 15.0.1 Is there a way to eliminate the pretty comma? "%i" doesn't help.
has comment: http://stackoverflow.com/comment/136835240
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136844267

http://stackoverflow.com/comment/136898063
score: 0
type: QuestionComment
has text: But with wrong DSYMs
type: Comment
comment on: http://stackoverflow.com/q/77649167

http://stackoverflow.com/comment/136923943
score: 1
has text: Most common reason is that the buttons are outside the bounds of their superview. set `boardView.clipsToBounds = YES;` and see if your buttons disappear.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77666355

http://stackoverflow.com/a/77683918
accepted answer of: http://stackoverflow.com/q/77683794
answers question: http://stackoverflow.com/q/77683794
has comment: http://stackoverflow.com/comment/136954307
has body: XCode 15.1 (15C65) was used, add new plist file with "Info.plist". turned on Info.plist，add NSContactsUsageDescription, and setting build and phaes. Open Mac App with code.
has comment: http://stackoverflow.com/comment/136954462
has comment: http://stackoverflow.com/comment/136954242
type: AcceptedAnswer
type: Answer
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/136954308
has comment: http://stackoverflow.com/comment/136954776
score: 1

http://stackoverflow.com/comment/136935638
score: 0
has text: There is something wrong with the symbols. It's finding the nearest one, that random function, but then the offset numbers are huge so that symbol is nowhere near the crash. It doesn't have names for any symbols closer than that.
comment on: http://stackoverflow.com/q/77649167
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136884776
score: 0
comment on: http://stackoverflow.com/q/77644430
type: QuestionComment
has text: You seem to be assuming that `sudo -s -i` will accept the following shell commands as input, but that's not how it works. You are running `sudo` and `passwd` as separate, unrelated subprocesses.
type: Comment

dynamic-frameworks
tags question: http://stackoverflow.com/q/77641465
tag name: dynamic-frameworks
type: Tag

http://stackoverflow.com/comment/137092176
type: QuestionComment
type: Comment
score: 0
has text: @Spo1ler Cool, I started implementing a reference counter on CPU. However, Is there any way to attach meta-data to a command buffer. I want to set an index to each command buffer so when it completes, I can decrement the buffer associated with that index
comment on: http://stackoverflow.com/q/77762066

http://stackoverflow.com/comment/137092741
comment on: http://stackoverflow.com/q/77762066
type: QuestionComment
score: 0
has text: In general, no, you shouldn't "attach metadata" to random Objective C objects. If you really need to do this, you can use `NSDictionary` or, better yet `NSMapTable`. But I would just pass the index as part of the closure that you would pass to `addCompletedHandler`.
type: Comment

http://stackoverflow.com/comment/136954308
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/77683918
has text: [Here](https://imgur.com/a/oVOp3L6) is my picture. I can see there is a file named `ViewController` in your project. This seems a bit odd for CLI app. Are you sure you didn't select regular multiplatform project instead of mac->cli? PS. Yup, CLI is command line tool.

deep-linking
tags question: http://stackoverflow.com/q/77767261
type: Tag
tag name: deep-linking

http://stackoverflow.com/comment/136870081
type: Comment
comment on: http://stackoverflow.com/q/77629081
type: QuestionComment
has text: Since you already guessed that it might be linked to the `FunSDKWrapper` object life-time, have you already tried to prolong it (e.g. by making it a property of the enclosing class). Also, could you please explain how the `OnFunSDKResult` method is called?
score: 0

http://stackoverflow.com/q/77689811
score: 0
tagged with: network.framework
has title: Exit command line Network.framework app that uses dispatch_main()
tagged with: grand-central-dispatch
type: Question
upvote count: 1
has body: Playing with low-level networking code in several languages on several platforms, I followed this example from the Apple developer forum to get a Network.framework example working. It works great but the app never exits back to the commandline due to using dispatch_main(). The documentation is very sparse, examples are not common, and tutorials barely exist at all. Hunting around the internet all I find is mentions that this never returns, but I can't find anything about how to break out of it when I actually want to return. I'm assuming this relies on background knowledge of GCD (grand central dispatch) and runloops and such that I don't have and that isn't easy to find. Perhaps it's only relevant for a commandline app but most Apple code is for GUI? So is there a way to break out of/return from the loop/thread/etc that dispatch_main puts me in? Or is there some alternative API or method other than dispatch_main that you're supposed to use when you intend to return?
answer count: 1
tagged with: macos
favorite count: 0
tagged with: command-line-tool
type: AnsweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/77690964
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/77690964

http://stackoverflow.com/comment/136927094
has text: https://www.biteinteractive.com/sherlock-holmes-and-the-mystery-of-the-untappable-button/
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77666355

http://stackoverflow.com/comment/137109191
comment on: http://stackoverflow.com/q/77762066
type: Comment
has text: no once they are purged, and all of the frames in flight that reference it have finished I do not use that buffer anymore. It is after all of an obsolete size because we resize the buffer.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136898012
comment on: http://stackoverflow.com/q/77649167
score: 0
has text: Download DSYMs from appstoreconnect.apple.com
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/137042485
has text: Ah, I see your edit. Yes, Metal is synced to the display cycle. `enableSetNeedsDisplay` (together with `paused`) is just used to allow you to update **less** often, not more often. Generally you want a CADisplayLink to drive your rendering loop, so you'll sync with it. This sample code may be helpful: https://developer.apple.com/documentation/metal/onscreen_presentation/creating_a_custom_metal_view?language=objc
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77734537

http://stackoverflow.com/comment/136856576
comment on: http://stackoverflow.com/q/77629081
has text: I haven't tried to integrate C++ with Objective-C in a long time. Swift/Objective C use ARC, (Automatic Reference Counting.) If you return dynamically allocated objects to Swift, you need to set up the memory semantics of your function header such that Swift knows it needs to take ownership of the object(s). I know how to do that between Objective-C and Swift, but not C++. I suggest adding a C++ tag to your question and change your subject to ask about using C++ frameworks from Swift/Objective-C
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136936288
has text: You set the entire sell alpha to 0.5, and the cell obviously includes its textLabel. I suppose you could try to add a solid-color subview to the cell with alpha 0.5, and the text as another subview with alpha 1.0.
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77672746

http://stackoverflow.com/comment/136967300
comment on: http://stackoverflow.com/a/77690964
type: AnswerComment
has text: A couple of things: If you just call `exit()` without cleaning up stuff your code created (i.e. objects created using the `create_*` functions of Network.framework) then things may not be cleaned up "correctly". You created those objects, you should destroy them. If you want to use `atexit()` to schedule cleanup, that's another option. That said, when you call `exit` your process will terminate. All sockets closed, all file handles closed, all memory given back to the OS, etc. It's a big hammer. But if you created temporary files not managed by `tmpfile()`, you'd need to delete them, etc.
score: 1
type: Comment

http://stackoverflow.com/q/77614453
type: Question
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136832488
tagged with: uiimage
tagged with: cgimage
has body: My app is trying to choose an image, and replace a given color with a separate image (green-screen). It uses Obj-C. So far, I'm attempting to replace a specific color (sky-blue) on this image with a space background. As you can see from the images below, I'm getting a washed out picture in which almost everything gets replaced instead of the intended sky color only. What am I handling wrong? I know there are some libraries with Swift that will do this, but I need to stay in Obj-C. My NSObject + (UIImage *)replaceWhiteColorWithImage:(UIImage *)image backgroundImage:(UIImage *)backgroundImage { CGImageRef rawImageRef = image.CGImage; const CGFloat colorMasking[6] = {130/255.0, 1.0, 151/255.0, 1.0, 186/255.0, 1.0}; UIGraphicsBeginImageContext(image.size); CGContextRef context = UIGraphicsGetCurrentContext(); // Flip the context to match the UIKit coordinate system CGContextTranslateCTM(context, 0.0, image.size.height); CGContextScaleCTM(context, 1.0, -1.0); // Draw the background image [backgroundImage drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)]; // Clip to the raw image using the white color as a mask CGContextClipToMask(context, CGRectMake(0, 0, image.size.width, image.size.height), rawImageRef); // Clear the white color with a transparent background CGContextClearRect(context, CGRectMake(0, 0, image.size.width, image.size.height)); UIImage *result = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return result; } My code to call this from my ViewController -(IBAction)chooseImage { // Assuming ImageProcessor is the class with the replaceWhiteColorWithImage method // Picking an image using UIImagePickerController (as mentioned in the previous response) UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; [self presentViewController:imagePicker animated:YES completion:nil]; } - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo…
score: 0
linked to: http://stackoverflow.com/q/12396236
answer count: 0
has comment: http://stackoverflow.com/comment/136831018
tagged with: uikit
has title: UIImage Replace Color with Background Image Washing Out and Overlaying everything Instead of Replacing
tagged with: ios

http://stackoverflow.com/a/77639630
type: Answer
answers question: http://stackoverflow.com/q/77616167
score: 0
has comment: http://stackoverflow.com/comment/136877463
has comment: http://stackoverflow.com/comment/136945310
has body: To enable dynamic cell height with Auto Layout constraints in Swift, you need to set up your cell with constraints that define its size based on the content. Here's an example of how you can achieve this: - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return UITableViewAutomaticDimension; } or in swift func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -&gt; CGFloat { return UITableView.automaticDimension }

http://stackoverflow.com/q/77629081
has comment: http://stackoverflow.com/comment/136870081
accepted answer: http://stackoverflow.com/a/77639437
score: 0
type: AnsweredQuestion
tagged with: automatic-ref-counting
tagged with: swift
tagged with: objective-c++
has title: Memory management issue while Call Obj-C in Swift
has answer: http://stackoverflow.com/a/77639437
has body: I'm currently developing a native plugin for a Capcitor app. I have very little experience with native iOS development, Swift and Obj-C. I use a framework (FunSDK) which is written in C++. I call this in an Objective-C++ wrapper. As described here: https://medium.com/@cecilia.humlelu/set-up-c-library-dependencies-in-swift-projects-5dc2ccd2ddaf The wrapper is then available in Swift via the bridging header. This works so far, I can call the functions from the framework and they are executed correctly. However, the functions of the framework are executed asynchronously. When a result is obtained, the “OnFunSDKResult” method is always executed. During this step I get an EXC_BAD_ACCESS error while debugging. Then I ticked “Zombie objects” under the diagnostics settings. This causes execution to stop with an EXC_BREAKPOINT. As I understand it, after executing the iniXMSDK method, the FunSDKWrapper class is cleared from memory before executing the "OnFunSDKResult" method? I have also already integrated a completionHandler, which is only called in the "OnFunSDKResult" method so that data is transferred to the Swift class. However, that doesn't help either. I have no idea how to proceed. I hope somebody can help me. If you need any more information, I would be happy to provide it. The FunSDKWrapper.mm // // FunSDKWrapper.m // App // // Created by Sysprobs on 12/8/23. // #import "FunSDKWrapper.h" #import "FunSDK/FunSDK.h" #import <XMNetInterface/Reachability.h> @implementation FunSDKWrapper -(NSString *)iniXMSDK:(int)test completion:(void (^)(int result))completionHandler{ self.initCompletionHandler = completionHandler; self.msgHandle = FUN_RegWnd((__bridge void *)self); FUN_Init(); Fun_LogInit(self.msgHandle, "", 0, "", LOG_UI_MSG); FUN_XMCloundPlatformInit("xxx", "xxx", "xxx", 1); FUN_InitNetSDK(); FUN_SetFunStrAttr(EFUN_ATTR_SAVE_LOGIN_USER_INFO,SZSTR([self GetDocumentPathWith:@"UserInfo.db"])); FUN_SetFunStrAttr(EFUN_ATTR_USER_PWD_DB, SZSTR([self GetDocumentPathWith:@"pa…
tagged with: ios
type: Question
has comment: http://stackoverflow.com/comment/136873172
answer count: 1
has comment: http://stackoverflow.com/comment/136861253
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136856576

http://stackoverflow.com/comment/136938946
comment on: http://stackoverflow.com/a/77674440
type: AnswerComment
type: Comment
score: 0
has text: The linked duplicate already covers this. Why not vote to close instead of posting an answer?

http://stackoverflow.com/q/77627573
answer count: 0
score: 0
tagged with: ionic-framework
has comment: http://stackoverflow.com/comment/136854250
type: Question
tagged with: cordova
type: UnansweredQuestion
has body: I have a qr code from which i want to read and extract 180 byte hexadecimal value, mine is an ionic app, and i am using phonegap barcode scanner in my app. When tried with this qr c ode scanner i am not getting any response, when i tried to debug this in xcode i found that its actually reading the qr code, and when i went to AVMetadataMachineReadableCodeObject -> _internal -> basicDescriptor -> BarCodeRawData There was a data present there which was, [40 0B 45 55 73 60 10 00 10 03 13 23 33 43 53 63 73 83 93 03 13 23 33 43 53 63 73 83 93 03 03 13 22 05 24 54 54 62 02 33 10 00 01 90 5E 70 70 DO EO A3 F4 20 FO 03 F4 20 FO 00 7B 20 10 09 FB BO DO 00 10 00 1010 1B BO 8E 90 90 1F F6 90 05 06 20 2B C0 00 17DO 00 06 25 93 5635 06 2B CO 00 07 EO 07 EO 07 DO 00 27 DO O7 DO 07DO 07 DO 07 DO 07 DO 07 EO 07 DO 07 DO 07DO 06 25 9F FB BO 86 25 96 20 16 80 0356 30 17 DO 00 10 20 AO 26 25 97 E0 06 25 97 EO 00 17 DO 07 FO 07 DO 00 17 DO 07 DO 08 30 07 EO 07 EO 07 E0 00 08 06 50 06 50 06 40 06 25 9F FO EC 11 EC 11 EC 11 EC 11 EC 11 EC 11 EC 11] But this is not the data we are expecting as raw bytes We are expecting a byte array which have a decimal values, I was able to get the intended result in android by using some properties, intent.getByteArrayExtra('SCAN_RESULT_BYTE_SEGMENTS_0'). "SCAN_RESULT_BYTE_SEGMENTS_0" when i haven't given this property for Android ,result was not intended byte array with decimal values. The actual data I want to get from this Qr code is a hexadecimal, that is: 555736010001003132333435363738393031323334353637383930303132205245454620233100001905E7070D0E0A3F420F003F420F0007B201009FBB0D000100010101BB08E90901FF6900506202BC00017D0000625935635062BC00007E007E007D00027D007D007D007D007D007D007E007D007D007D006259FFBB086259620168003563017D0001020A0262597E0062597E00017D007F007D00017D007D0083007E007E007E0000806500650064006259FF So basically in short i am really stuck here in for ios, can someone help me out.
has title: How to scan and get byte array with decimal values from qr code in ios?
tagged with: android
tagged with: ios
has comment: http://stackoverflow.com/comment/136864667
has comment: http://stackoverflow.com/comment/136882550
has comment: http://stackoverflow.com/comment/136854266
tagged with: objective-c

http://stackoverflow.com/a/77767909
score: 1
type: AcceptedAnswer
type: Answer
has body: Unfortunately, you can't. There are a few URL schemes that are supported by the system. And the camera is none of them. You have to use a built-in component such as UIImagePickerController or create a new one on your own. AFAIK, at most, you can able to open the gallery with this photos-redirect://. This document indicates all these supported links. Updated: I've found this helpful repo if you're curious.
accepted answer of: http://stackoverflow.com/q/77767261
answers question: http://stackoverflow.com/q/77767261
upvote count: 1
downvote count: 0

avaudioplayer
tags question: http://stackoverflow.com/q/77628617
type: Tag
tag name: avaudioplayer

http://stackoverflow.com/q/77616167
upvote count: 1
has comment: http://stackoverflow.com/comment/136833403
tagged with: ios
downvote count: 1
has body: hello i start learning obj-c and want to increase call log cells after write this code i have many issues with cell heights i want to have same default cell heights for all cells #import &lt;UIKit/UIKit.h&gt; #import &lt;UIKit/UITableViewController.h&gt; #import &lt;Foundation/Foundation.h&gt; @interface MPRecentsTableViewCell @property (readwrite, strong, nonatomic) UITableView * tableView; @property (readwrite, assign, nonatomic) long long tableViewDisplayMode; @property (readwrite, strong, nonatomic) UISegmentedControl * tableViewDisplayModeSegmentedControl; @property (readwrite, assign, nonatomic) bool tableViewNeedsReload; @end %hook MPRecentsTableViewController //-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -(NSInteger)tableView:(UITableView *)arg1 numberOfRowsInSection:(NSInteger)arg2 { return 200; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 60.5; } %end result:- enter image description here many size no one work
tagged with: jailbreak
type: Question
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/77639630
has title: auto resize cell heights
favorite count: 0
has comment: http://stackoverflow.com/comment/136838429
score: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/136896932
type: Comment
score: 0
type: QuestionComment
has text: This is on a release build
comment on: http://stackoverflow.com/q/77649167

http://stackoverflow.com/comment/136811143
type: QuestionComment
comment on: http://stackoverflow.com/q/77603588
score: 1
type: Comment
has text: Without knowing how the value was encoded into `NSData` to begin with, it's hard to know what the best solution is. But if `int` works, why try to use `int16_t`? If all you're doing is wrapping the result in `NSNumber`, then use whatever works.

http://stackoverflow.com/q/77709979
type: UnansweredQuestion
tagged with: macos
answer count: 0
has comment: http://stackoverflow.com/comment/137001903
has comment: http://stackoverflow.com/comment/137002098
has title: Inverting the MacOS's mouse X axis doesn't work with CGEventSetIntegerValueField
tagged with: objective-c
score: 0
has comment: http://stackoverflow.com/comment/137001191
type: Question
has body: I'm trying to invert the mouse movement (specifically my Magic Trackpad 2) on X axis on Mac OS, AFAIK I will have to listen to the NSEventMaskMouseMoved, and do the modification on the callback. Here is what I have #import <Foundation/Foundation.h> #import <CoreGraphics/CoreGraphics.h> #import <CoreFoundation/CoreFoundation.h> #import <AppKit/AppKit.h> static CGEventRef callback(CGEventTapProxy proxy, CGEventType type, CGEventRef eventRef, void *userInfo) { if (type == kCGEventMouseMoved) { // Get the original delta X value int64_t deltaX = CGEventGetIntegerValueField(eventRef, kCGMouseEventDeltaX); // Invert the delta X value int64_t invertedDeltaX = -deltaX; // Set the inverted delta X value back on the original event CGEventSetIntegerValueField(eventRef, kCGMouseEventDeltaX, invertedDeltaX); NSLog(@"Original Delta X: %lld", deltaX); NSLog(@"Inverted Delta X: %lld", invertedDeltaX); return eventRef; } return eventRef; } int main(int argc, const char * argv[]) { @autoreleasepool { CFMachPortRef tapPort = (CFMachPortRef)CGEventTapCreate(kCGSessionEventTap, kCGTailAppendEventTap, kCGEventTapOptionDefault, NSEventMaskMouseMoved, callback, nil); if (tapPort) { NSLog(@"tapPort created %p", tapPort); CFRunLoopSourceRef tapSource = (CFRunLoopSourceRef)CFMachPortCreateRunLoopSource(kCFAllocatorDefault, tapPort, 0); if (tapSource) { NSLog(@"tapSource created %p", tapSource); CFRunLoopAddSource(CFRunLoopGetMain(), tapSource, kCFRunLoopCommonModes); // CGEventTapEnable(tapSource, true); CFRunLoopRun(); } else { NSLog(@"tapSource NOT created"); } } else { NSLog(@"tapPort NOT created"); } } return 0; } On the log console, it seems everything's correct (I gave the Accessibiity permission). But the mouse movement event is not changed, unfortunately. Seems the CGEventSetIntegerValueField is not making any different. Maybe I'm doing in a wrong way? Thanks!

http://stackoverflow.com/q/77647922
answer count: 0
score: 1
has title: flutter plugin does not execute background iOS code with lock
type: Question
upvote count: 1
type: UnansweredQuestion
has body: I have flutter plugin (https://github.com/mapp-digital/Mapp-Intelligence-Flutter-Tracking) which contains native iOS code background execution, which works fine until last update of Flutter version: Flutter 3.16.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision b0366e0a3f (7 days ago) • 2023-12-05 19:46:39 -0800 Engine • revision 54a7145303 Tools • Dart 3.2.3 • DevTools 2.28.4 iOS part of code: ^(void) { // Background Thread [self-&gt;_conditionUntilGetFNS lock]; while (!self-&gt;_isReady) [self-&gt;_conditionUntilGetFNS wait]; [self enqueueRequestForEvent:event]; [self-&gt;_conditionUntilGetFNS signal]; [self-&gt;_conditionUntilGetFNS unlock]; }); this one line [self enqueueRequestForEvent:event]; is never executed. what I can do?
tagged with: flutter
favorite count: 0
tagged with: ios
tagged with: objective-c
downvote count: 0

http://stackoverflow.com/comment/137008194
type: QuestionComment
has text: @son I tried setting NULL to DISPATCH_QUEUE_SERIAL in dispatch_queue_create, but still problem stays the same. It does not seem like it fixes the problem :(
type: Comment
comment on: http://stackoverflow.com/q/77712292
score: 0

http://stackoverflow.com/comment/137009992
score: 0
type: Comment
type: QuestionComment
has text: @son I don't think I understand. :( May I ask you to show me how it's usually done?
comment on: http://stackoverflow.com/q/77712292

http://stackoverflow.com/q/77683794
type: Question
tagged with: command-line-interface
accepted answer: http://stackoverflow.com/a/77683918
tagged with: macos
type: AnsweredQuestion
score: 0
has title: How can I access contacts using Mac CLI app (XCode 14)?
tagged with: objective-c
has body: I'm having some problems accessing contacts inside of mac cli app. The main issue is that the app is not triggering a dialog requesting access to contacts. Some sources state that NSContactsUsageDescription should be added to info.plist. This info.plist is nowhere to be found inside the project in xcode. Then, some sources are stating that there was a xcode update, and now permissions are added on Targets -> Info tab, but this tab does not exist on mac cli project. Here is a code snippet: #import <Foundation/Foundation.h> #import <Contacts/Contacts.h> int main(int argc, const char * argv[]) { @autoreleasepool { CNAuthorizationStatus status = [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts]; if (status == CNAuthorizationStatusNotDetermined) { NSLog(@"Contact access not determined."); CNContactStore *contactStore = [[CNContactStore alloc] init]; [contactStore requestAccessForEntityType:CNEntityTypeContacts completionHandler:^(BOOL granted, NSError * _Nullable error) { NSLog(@"Got response"); NSLog(granted ? @"Yes" : @"No"); CFRunLoopStop(CFRunLoopGetCurrent()); }]; } else if (status == CNAuthorizationStatusAuthorized) { NSLog(@"Access granted"); } else { NSLog(@"Access to contacts is denied or restricted."); } } CFRunLoopRun(); return 0; } Running this outputs: Contact access not determined. and app exits with code 0. How would one access contacts inside of mac cli app project? Or setup proper permissions so that dialog would trigger? PS. I have also tried adding info.plist manually, but there was no difference. Maybe I did something wrong? Is info.plist even used in mac cli project?
has answer: http://stackoverflow.com/a/77683918
tagged with: xcode
answer count: 1

http://stackoverflow.com/comment/136806487
type: QuestionComment
has text: once you clear the text, you no longer have the attributed text attributes applied, you need to re apply them while you were typing the text.
type: Comment
comment on: http://stackoverflow.com/q/77600151
score: 0

http://stackoverflow.com/comment/137051223
type: QuestionComment
has text: You mean, PHAssetCollection#fetchAssetCollectionsWithType would crash before PHPhotoLibrary#requestAuthorization is called, even if the result of PHPhotoLibrary#authorizationStatusForAccessLevel is PHAuthorizationStatusAuthorized?
type: Comment
comment on: http://stackoverflow.com/q/77735215
score: 0

core-audio
type: Tag
tags question: http://stackoverflow.com/q/77709334
tag name: core-audio
tags question: http://stackoverflow.com/q/77877558
tags question: http://stackoverflow.com/q/77790334
tags question: http://stackoverflow.com/q/78129895
tags question: http://stackoverflow.com/q/78535483
tags question: http://stackoverflow.com/q/78811299

http://stackoverflow.com/a/77668347
answers question: http://stackoverflow.com/q/77668346
has body: Stack Overflow similar questions hints gave me some more ideas and one of it worked ).. All was needed is just to increase iOS Deployment Target. From 12.0 to 12.4 worked in my case. Flutter Xcode 12 archive build fails with Undefined symbol: _OBJC_CLASS_$_STPAPIClient
type: Answer
score: 0

uitextfield
type: Tag
tags question: http://stackoverflow.com/q/77600151
tag name: uitextfield
tags question: http://stackoverflow.com/q/79144762

http://stackoverflow.com/comment/137005433
comment on: http://stackoverflow.com/q/77712292
type: QuestionComment
type: Comment
score: 0
has text: As I remember, setting up input and output should be done in a serial queue before startRunning.

http://stackoverflow.com/comment/136939282
type: Comment
type: QuestionComment
has text: But that's the link you posted in your answer where you said you found the solution.
comment on: http://stackoverflow.com/q/77668346
score: 0

avaudioengine
type: Tag
tags question: http://stackoverflow.com/q/77628617
tag name: avaudioengine

url
tags question: http://stackoverflow.com/q/77688658
type: Tag
tag name: url

http://stackoverflow.com/comment/137116620
comment on: http://stackoverflow.com/q/77762066
type: Comment
has text: No. You don't need to manage purgeability for that. Purgeable state is for resources that your application might want to let go because it can easily restore them, such as textures that can be streamed from storage, when the memory pressure increases.
type: QuestionComment
score: 1

http://stackoverflow.com/comment/136886356
has text: How is it not working fine?
comment on: http://stackoverflow.com/q/77644430
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/136929730
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77668346
type: Comment
has text: Does this answer your question? [Flutter Xcode 12 archive build fails with Undefined symbol: \_OBJC\_CLASS\_$\_STPAPIClient](https://stackoverflow.com/questions/64707510/flutter-xcode-12-archive-build-fails-with-undefined-symbol-objc-class-stpapi)

http://stackoverflow.com/comment/136809965
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77598216
has text: @Cy-4AH I tried just using that, but the program kept crashing. Maybe the internal implementation has checks to prevent using the setter?

alpha
tags question: http://stackoverflow.com/q/77672746
type: Tag
tag name: alpha

http://stackoverflow.com/q/77655283
has comment: http://stackoverflow.com/comment/136916153
tagged with: ios
tagged with: nssortdescriptor
type: Question
upvote count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136906141
has body: I've got a CoreData database and I'm fetching a list of Animals from it, sorted by a namesortable field. But namesortables that start with ' and with ` are being treated as if they are the same and producing results like this: 'affirm' ‘california’ 'grasshopper' 'no doubt" ‘relentless’ ... This wouldn't inherently be a problem, but I'm fetching these with an NSFetchedResultsController which is sectioned by -namefirstletter and it's crashing because the sections are out of order. It thinks the sections are out of order because it keeps switching back and forth between ' and with `. I know that I could alter the -namefirstletter method to swap smart quotes for single quotes to bludgeon it into working, but I'd rather not have to start creating a longer and longer list of exception characters that I need to swap. I'd prefer to get CoreData to just sort the data without treating ' and with ` as the same. Any suggestions? NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:Animal.entityname inManagedObjectContext:self.managedObjectContext]; [fetchRequest setEntity:entity]; NSArray<NSSortDescriptor *> *sortdescriptors = @[ [NSSortDescriptor sortDescriptorWithKey:Animal.fieldname_namesortable ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)] ]; [fetchRequest setSortDescriptors:sortdescriptors]; fetchRequest.predicate = [NSPredicate predicateWithFormat:@"..."]; NSError *error = nil; NSArray<Animal*> *animals = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error];
linked to: http://stackoverflow.com/q/8776781
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/136904352
favorite count: 0
tagged with: core-data
has comment: http://stackoverflow.com/comment/136907358
downvote count: 0
has title: CoreData sorting is treating single straight quote and single smart quote as the same, how to treat them differently?
answer count: 0
score: 1

http://stackoverflow.com/q/77668346
has answer: http://stackoverflow.com/a/77668347
has comment: http://stackoverflow.com/comment/136939282
linked to: http://stackoverflow.com/q/64707510
tagged with: ios
has comment: http://stackoverflow.com/comment/136939266
tagged with: objective-c
has comment: http://stackoverflow.com/comment/136939396
has comment: http://stackoverflow.com/comment/136929730
tagged with: xcode
answer count: 1
score: 0
has body: Added Swift code to Objective-C project. Built and working for simulator. Failing with Undefined symbol error for Archive. Deep investigation of compiled files Objective-C "*.o" file wants symbol: _OBJC_CLASS_$_AClass But AClass.swift "AClass.o" file have only (per nm output): 0000000000002318 D _OBJC_METACLASS_$_AClass Comparing with simulator compilation I see that AClass.swift compiled into AClass.o with: 0000000000002890 S _OBJC_CLASS_$_AClass 0000000000002398 D _OBJC_METACLASS_$_AClass I do not understand why Archive not puts that "S OBJC_CLASS$_AClass". What I already did: cleared/removed and restarted all possible; having @objc attributes of cause and re-added swift files to Xcode (first the were placed there strange - not in group and one file showed in several places. But removed completely and re-added so compiled to simulator); experimented with all possible arch settings in build config; compared build logs in attempt to find some special flags preventing this (no special, just -DDEBUG=1 and like that). And of cause compilation and linking used different "sdk" folders. One for simulator and one for iPhone devices; set Debug for Archive and do not remove debug symbols. Set all ONLY_ACTIVE_ARCH to No. No effect; Symbols Hidden by Default is set to No. How to build Archive finally?
has title: Undefined symbol in linking archive Xcode 15 in mixed Swift/Objective-C
type: Question
tagged with: swift
type: UnansweredQuestion

http://stackoverflow.com/comment/138862069
comment on: http://stackoverflow.com/a/77797810
score: 0
type: AnswerComment
type: Comment
has text: It worked Thanks

http://stackoverflow.com/comment/136864667
type: Comment
comment on: http://stackoverflow.com/q/77627573
score: 0
type: QuestionComment
has text: @Robert I have edited the question, as u suggested. And i have added the intended output also.

http://stackoverflow.com/comment/136884777
comment on: http://stackoverflow.com/q/77644430
type: QuestionComment
score: 0
has text: Does this answer your question? [Pass commands as input to another command (su, ssh, sh, etc)](https://stackoverflow.com/questions/37586811/pass-commands-as-input-to-another-command-su-ssh-sh-etc)
type: Comment

http://stackoverflow.com/comment/136945310
comment on: http://stackoverflow.com/a/77639630
has text: Another way Set automaticDimention in viewDidLoad - tableView.rowHeight = UITableView.automaticDimension tableView.estimatedRowHeight = 44
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/77603588
has comment: http://stackoverflow.com/comment/136818154
has body: In iOS 16+, when the NSData *data ranges between 0 and 255, the int16_t buff retrieves values not within the range of 0 to 255, but rather 29440 to 29696. - (void)system:(id)system features:(void (^)(NSArray*))features { [self read:TAPropertyTypeAvailableFeatures system:system handler:^(NSDictionary* data, NSError* error){ NSArray* datas = [data objectForKey:@"value"]; NSMutableArray* numbers = [[NSMutableArray alloc] init]; for(NSData* data in datas) { int16_t buff; [data getBytes:&buff length:sizeof(buff)]; NSNumber* number = [NSNumber numberWithInteger:buff]; [numbers addObject:number]; } features(numbers); }]; } When I upgraded my MacBook to 14.1.2 and Xcode to 15.0.1, I encountered an issue with this function that I rebuilt. In iOS 16+, when the NSData *data ranges between 0 and 255, the int16_t buff retrieves values not within the range of 0 to 255, but rather 29440 to 29696. However, in iOS 15, it still remains between 0 and 255. This problem never occurred before. Changing int16_t to int resolves the issue. What is causing this issue? Is it possible to continue using int16_t without encountering this problem?
answer count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/136811143
has comment: http://stackoverflow.com/comment/136812682
tagged with: objective-c
type: Question
score: 0
has comment: http://stackoverflow.com/comment/136811305
has title: `[data getBytes:&buff length:sizeof(buff)]` got wrong bytes
type: UnansweredQuestion

http://stackoverflow.com/q/77628617
has comment: http://stackoverflow.com/comment/137110883
tagged with: sfspeechrecognizer
has body: As the title suggests I am using AVAudioEngine for SFSpeechRecognition input &amp; AVAudioPlayer for sound output. Apple says in this talk that the setVoiceProcessingEnabled function very usefully cancels the output from speaker to the mic. I set voiceProcessing on the AVAudioInputNode and AVAudioOutputNode. When running xcode when speechRecognitionEnabled:YES throws the following error: throwing 18,446,744,073,709,551,615 from AU (0x13bf98dd0): auou/vpio/appl, render err: 18,446,744,073,709,551,615 There is no error thrown when setting up the nodes and it seems to work however the volume is low, even when the system volume is turned up. Any solution to this would be much appreciated. I tried various AVAudioEngine node setups. One setup with a mixer node and one without. I am expecting the audio levels to be loud, in conjunction with the system volume.
has answer: http://stackoverflow.com/a/77725638
tagged with: ios
type: Question
answer count: 1
tagged with: objective-c
tagged with: avaudioengine
score: 4
favorite count: 0
tagged with: avaudioplayer
has title: AVAudioEngine & AVAudioPlayer. setVoiceProcessingEnabled low volume output
type: UnansweredQuestion
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/137043308
comment on: http://stackoverflow.com/q/77734537
type: Comment
score: 0
type: QuestionComment
has text: 8ms is how long it takes between two drawables being submitted when the display is at 120 Hz. `enableSetNeedsDisplay` has nothing to do with v-sync, the actual setting is `displaySyncEnabled`, which is only available on macOS.

http://stackoverflow.com/comment/137042654
has text: When I set it to 10, 15, and 30 I render frames to be 0ms. So everything is taking less than 1ms to finish.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77734537

http://stackoverflow.com/comment/137115175
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77762066
type: Comment
has text: If I let the reference go will the space still be allocated on the device??

http://stackoverflow.com/a/77797810
score: 2
has comment: http://stackoverflow.com/comment/138862069
has body: changing - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64 i386; inside Pods project and "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; inside iOS app project of my app compiles the code. hope this helps anyone facing the same issue
accepted answer of: http://stackoverflow.com/q/77760644
downvote count: 0
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/77760644
type: Answer

http://stackoverflow.com/a/77670245
downvote count: 0
has comment: http://stackoverflow.com/comment/136930477
has comment: http://stackoverflow.com/comment/136930511
upvote count: 2
score: 2
accepted answer of: http://stackoverflow.com/q/77670057
answers question: http://stackoverflow.com/q/77670057
type: AcceptedAnswer
type: Answer
has body: Using struct with objects is very tricky for memory management. Struct in objective-c is not the same as struct in Swift. You may reconsider declaring it a class. However, I think this is a workaround: struct ObjCStruct { __unsafe_unretained NSMenu* sMenu; //It's __strong by default int8_t menuID; }; In Swift: //Manage NSMenu manually by Unmanaged. Keep in mind to release this menu //object later or you will get a leak here. let menu: Unmanaged<NSMenu> = Unmanaged.passRetained(NSMenu(title: "2")) let model = Model(c: .init(), s: .init(sMenu: menu, menuID: 2)) //To get the NSMenu let menuUI = menu.takeRetainedValue()

http://stackoverflow.com/comment/136954776
comment on: http://stackoverflow.com/a/77683918
has text: Thank you, adding this to build phases fixed this issue, and app is now requesting permissions to contacts.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/136807479
comment on: http://stackoverflow.com/q/77600151
has text: the attributes you apply initially will get cleared as you removed the text by backspacing, at this point it will fallback to blue color, as that is what you set the text color of your text field.
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/comment/136884195
comment on: http://stackoverflow.com/q/77637622
has text: Unfortunately macOS Accessibility can be inconsistent, and have broken hierarchies, as you see. What I have been doing in some cases is get the deepest reliable element, and then make a mouse click relative to it's AXFrame to get to the Button/TextField I want. Depends on individual conditions.
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/77670057
accepted answer: http://stackoverflow.com/a/77670245
has answer: http://stackoverflow.com/a/77670245
type: AnsweredQuestion
upvote count: 2
tagged with: objective-c
tagged with: struct
answer count: 1
has title: Error using Objective-C structure in Swift (Cannot find type 'XXX' in scope)
favorite count: 0
has body: In my sample project, I tried using the Objective-C classes and struct in the Swift file using the bridging headers. I get an error using the struct: Cannot find type 'XXX' in scope However, classes are used without any error. My Objective-C file looks like: #import <Cocoa/Cocoa.h> struct ObjCStruct { NSMenu* sMenu; int8_t menuID; }; @interface ObjCClass : NSObject { NSMenu* cMenu; } @end In my bridging header, I have used it as: #import "ObjC.h" Finally, I used struct and classes in Swift file as: struct Model { var c : ObjCClass; var s : ObjCStruct; } If NSMenu* sMenu; has been commented out from ObjC.h, then it works fine. How can I use the Objective-C struct in the Swift file? I have imported the Objective-C headers in the bridging header and the bridging header has been referred correctly in the build settings.
type: Question
tagged with: swift
tagged with: bridging-header
score: 2
downvote count: 0

http://stackoverflow.com/q/77760404
has body: Apple provides the NS_ENUM and NS_OPTION macros (link to docs) to define enumerations in Objective-C. Here's an example how this looks like for NS_ENUM: --- EnumName.h --- #pragma once #import &lt;Foundation/NSObjCRuntime.h&gt; typedef NS_ENUM(NSUInteger, EnumName) { EnumMemberA, EnumMemberB, EnumMemberC, }; What is the syntax to write Doxygen documentation for such an enumeration type definition (and also for the enumeration members)? At first I tried the intuitive thing: Write a @brief documentation block just before the definition. --- EnumName.h --- #pragma once #import &lt;Foundation/NSObjCRuntime.h&gt; /// @file /// @brief A brief description. typedef NS_ENUM(NSUInteger, EnumName) { EnumMemberA, EnumMemberB, EnumMemberC, }; Result: Doxygen includes the documentation block in its generated output (✅), but parses the definition as a function (❌). Places where the enumeration type is used, such as in function/method arguments, are not linked (❌). Next I tried adding an @enum EnumName command in front. --- EnumName.h --- #pragma once #import &lt;Foundation/NSObjCRuntime.h&gt; /// @file /// @enum EnumName /// @brief A brief description. typedef NS_ENUM(NSUInteger, EnumName) { EnumMemberA, EnumMemberB, EnumMemberC, }; Result: Doxygen issues this warning: warning: Documentation for undefined enum 'EnumName' found and does not include the documentation block in its generated output at all (❌). I can understand that Doxygen may be unable to parse the typedef NS_ENUM construct, but in that case I would like to be able to write a documentation block decoupled from actual source code. I'm using Doxygen 1.10.0, installed via Homebrew on macOS 13.5.2 on an Intel Mac.
has answer: http://stackoverflow.com/a/77760405
answer count: 1
has title: How to document with Doxygen: typedef NS_ENUM(NSUInteger, EnumType)
score: 0
tagged with: objective-c
type: Question
tagged with: doxygen
type: UnansweredQuestion

http://stackoverflow.com/comment/137002098
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77709979
has text: The mouse pointer and the events are both driven by the mouse or trackpad. Changing the events does not change the mouse pointer.
type: Comment

http://stackoverflow.com/comment/137110883
has text: To get helpful answers, please show your code. Please read [How to create a Minimal, Reproducible Example.](https://stackoverflow.com/help/minimal-reproducible-example), then [edit] your question.
comment on: http://stackoverflow.com/q/77628617
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/q/77727458
tagged with: frameworks
tagged with: swift
answer count: 0
has title: Swift and Objective-C interoperability
downvote count: 1
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/137235229
has comment: http://stackoverflow.com/comment/137072972
tagged with: objective-c
type: UnansweredQuestion
favorite count: 0
has body: I am working on a project in which we are migrating from iOS project to framework. I am facing issues with Objective-C and Swift interoperability. I have one Swift class named Profile. It has been exposed to Objective-C. import Foundation @objc public class Profile: NSObject { @objc public var name : String? @objc public func getName() -> String{ return "XYZ" } } When I am importing “ProductName-Swift.h” it is showing me an error in generated header for the module map like “@import ModuleMapPrivate not found”. I wanted to know if there is any way in which I can import “Profile-Swift.h” instead of “ProductName-Swift.h”? I tried by adding User Header search paths
score: 0

http://stackoverflow.com/comment/136835240
score: 0
comment on: http://stackoverflow.com/q/77617207
type: QuestionComment
has text: I assume I've gotten something out of whack with my environment, some setting somewhere. I'm hoping someone has run into this.
type: Comment

http://stackoverflow.com/comment/136832488
type: Comment
score: 0
type: QuestionComment
has text: Are you aware that you never make use of `colorMasking` in `replaceWhiteColorWithImage`? And `CGContextClipToMask` only works with a grayscale image, not some arbitrary image.
comment on: http://stackoverflow.com/q/77614453

http://stackoverflow.com/q/77762066
answer count: 0
has comment: http://stackoverflow.com/comment/137116620
has body: I'm working in Objective-C, but this question is ubiquitous to swift too (I think). If I have buffer id&lt;MTLBuffer&gt; my_buffer and a render command currently queued on the GPU that reads from my_buffer. If I set my_buffer's purgeable state to be empty, i.e. [my_buffer setPurgeableState:MTLPurgeableStateEmpty]; BEFORE or DURING the command being processed on the GPU, what will happen? Will the GPU still use the resource without a problem and then discard it once it is done? Or will it not know that that buffer exists anymore? Does purgeableState even affect the device's allocation of memory? If this is not the case, how do I set a buffer to discard it's memory when there are no outstanding render command queued that reference it (but the program is oblivious to whether or not there are outstanding render commands referencing it)?
has comment: http://stackoverflow.com/comment/137103697
has comment: http://stackoverflow.com/comment/137091950
tagged with: metal
has comment: http://stackoverflow.com/comment/137115175
tagged with: objective-c
has comment: http://stackoverflow.com/comment/137092747
tagged with: metalkit
has comment: http://stackoverflow.com/comment/137103696
has title: Metal resource "purgeable state" mechanics
score: 0
has comment: http://stackoverflow.com/comment/137092741
tagged with: rendering
has comment: http://stackoverflow.com/comment/137107302
has comment: http://stackoverflow.com/comment/137109191
type: Question
has comment: http://stackoverflow.com/comment/137092176
has comment: http://stackoverflow.com/comment/137109690
type: UnansweredQuestion
tagged with: gpu

http://stackoverflow.com/comment/137042612
score: 0
has text: When you say "extremely fast frames" I assume you mean that `currentRenderPassDescriptor` returns quickly? My assumption is that when you set it to 10, it's possibly ignoring it because it's too low. Try 15 or 30. You might check CADisplayLink.preferredFrameRateRange. You're probably outside of it.
type: QuestionComment
comment on: http://stackoverflow.com/q/77734537
type: Comment

http://stackoverflow.com/comment/136906141
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77655283
score: 0
has text: +1 for sanitising the data, but see also https://stackoverflow.com/questions/8776781/what-is-the-difference-between-localizedcaseinsensitivecompare-and-caseinsensit

http://stackoverflow.com/comment/136966922
score: 1
has text: In this situation, It's up to you to do whatever cleanup you need to do. `dispatch_main()` is clearly documented as "This function never returns." so you're going to need some sort of heavier hand to exit from a process that uses that as its main loop (i.e. `exit()` or `abort()` etc.)
comment on: http://stackoverflow.com/a/77690964
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/136994748
type: Comment
has text: What is the question, how to calculate the sum from your data or how to display a text field at the bottom of the column? Core Data? Have you tried anything?
comment on: http://stackoverflow.com/q/77705575
score: 0
type: QuestionComment

http://stackoverflow.com/q/77635904
tagged with: objective-c
has title: define steps of 250 to leftAxis using iOS-charts
type: Question
answer count: 1
has body: I am trying to create a line chart using the danielgindi/ios-charts library. This works quite well so far. However, I cannot set the values on the left axis in 250 steps as desired.You can see my last attempt here: ChartYAxis *leftAxis = self.lineChartView.leftAxis; leftAxis.labelTextColor = [UIColor colorNamed:@"ColorGraphSD"]; leftAxis.axisMinimum = 0; leftAxis.axisMaximum = ceil(maxValue / 250.0) * 250; leftAxis.drawGridLinesEnabled = YES; leftAxis.drawZeroLineEnabled = NO; leftAxis.granularityEnabled = NO; leftAxis.granularity = .1; leftAxis.axisRange = 250; leftAxis.labelCount = ceil(maxValue / 250.0); Debugger tells me leftAxis.labelCount = 8; and leftAxis.axisMaximum = 2000; All I want is a line at 250,500,750.... How to do that?
accepted answer: http://stackoverflow.com/a/77667325
has answer: http://stackoverflow.com/a/77667325
tagged with: ios-charts
score: 0
type: AnsweredQuestion
tagged with: ios

http://stackoverflow.com/a/77764735
score: 0
has body: When I finally figured out what was wrong, it had to do with the version of the pod that the code was using. Therefore, if you're still having these problems, I advise you to: Verify the pod's compatibility to see whether that's the problem. Reinstall pods after uninstalling them. OR Delete the derived data. Quit Xcode. Reopen Xcode. Clean build. Build Update your packages to the latest version Check if the framework's repository has released a version that adds support for arm64 Upgrade to the highest patch for your minor or latest and verify if the issue persists OR Visit this links : https://github.com/facebook/react-native/issues/28777 https://github.com/facebook/react-native/issues/40932 https://forums.developer.apple.com/forums/thread/691640
answers question: http://stackoverflow.com/q/77760644
type: Answer

http://stackoverflow.com/comment/136967173
comment on: http://stackoverflow.com/a/77690964
score: 0
type: AnswerComment
type: Comment
has text: OK so I'm not bypassing anything internal, only code I specifically put there? Gotcha. By the way, after posting here I got an answer I couldn't verify from an AI chatbot saying I should use `dispatch_after(dispatch_get_main_queue(), ^{ exit(0); });` In an effort to explain my confusion, when I was playing with `NSApplication` some time ago I found out I should use `NSApp.stop()` to return back to the main code after launching the GUI loop with `NSApplication.shared.run()` rather than just call `exit(0)`.

http://stackoverflow.com/a/77725638
answers question: http://stackoverflow.com/q/77628617
has body: Did you enable voice processing on both the input and output nodes? Here is what I tried and it worked (somewhat): audioInputNode=engine.inputNode audioInputNode.volume=0 do{ try audioInputNode.setVoiceProcessingEnabled(true) } catch{ print("Could not enable voice processing in audioinputnode") } let outputNode = engine.outputNode do{ try outputNode.setVoiceProcessingEnabled(true) } catch{ print("Could not enable voice processing in output") } I say worked "somewhat" because when I record the mic input, the sound from the speaker is definitely cancelled out, but the mic audio recorded to a file is a little choppy
score: -1
has comment: http://stackoverflow.com/comment/137110887
downvote count: 1
upvote count: 0
has comment: http://stackoverflow.com/comment/137127246
type: Answer

http://stackoverflow.com/comment/136927540
type: QuestionComment
type: Comment
score: 0
has text: Likely duplicate of https://stackoverflow.com/questions/72427842/ibaction-not-firing-for-button-in-subview
comment on: http://stackoverflow.com/q/77666355

http://stackoverflow.com/comment/136837585
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/77617207
has text: I get `123.456`, it's the notation in System Prefs.
type: Comment

http://stackoverflow.com/comment/136816986
comment on: http://stackoverflow.com/q/77599602
type: Comment
has text: Sorry, what I meant is you need to have `pod FacebookCore` before the other 2 pods. See: https://cocoapods.org/pods/FacebookCore
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136981329
type: QuestionComment
score: 0
type: Comment
has text: Thanks. I guess that answer is what I need. However, I think this may be just a pure bug, since colon is included in `URLPathAllowedCharacterSet` but the function percent-encodes it anyway.
comment on: http://stackoverflow.com/q/77688658

http://stackoverflow.com/comment/136803782
comment on: http://stackoverflow.com/q/77598216
has text: Why are you trying to instantiate a class that doesn't have a public initializer? The initialisers are not public for a reason - `SCWindow` should only be initialised by the system.
score: 3
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/137127246
score: 0
has text: It only works when voice processing is enabled on both input and output. Doesn't work if it is enabled on just one of them. I think they also mentioned this in the WWDC 2019 session where they first unveiled voice processing. I didn't get a crash though, just the background sound didn't get cancelled.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77725638

http://stackoverflow.com/comment/136940547
type: AnswerComment
has text: @HangarRash - meh... figured since the OP hadn't tried using `colorWithAlphaComponent` they probably wouldn't get that from the linked answer (which only referenced `clearColor`).
type: Comment
comment on: http://stackoverflow.com/a/77674440
score: 0

http://stackoverflow.com/comment/136846910
comment on: http://stackoverflow.com/q/77617207
type: Comment
has text: I see the thousands separators for `NSLog()` but only when running from inside Xcode.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136806329
comment on: http://stackoverflow.com/q/77600151
has text: @TejaNandamuri It's just a demo. I will change textColor using setAttributedText: at specific time. After clearing the text, I wish textColor remains the same.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136973561
type: Comment
comment on: http://stackoverflow.com/q/77688658
has text: https://stackoverflow.com/a/44395835/7833793
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136886368
comment on: http://stackoverflow.com/q/77644430
type: QuestionComment
type: Comment
score: 0
has text: Do you read the data from `errorPipe`?

http://stackoverflow.com/comment/137091950
has text: An in-flight command buffer cannot reference any resources other than `NonVolatile`. Otherwise, you are basically invoking an undefined behavior. If you want to use purgable states, it's your job to track which resources are used by in-flight command buffers and make sure that all of them are non-volatile before a command buffer is submitted.
comment on: http://stackoverflow.com/q/77762066
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136844267
type: Comment
comment on: http://stackoverflow.com/q/77617207
has text: I was able to change the comma to a space, but there's no option without a comma, period, or space. Raptor, what's your setting to get 123456? Xcode 15.0.1, Sonoma 14.1.1, in case it matters.
score: 0
type: QuestionComment

http://stackoverflow.com/a/77655171
type: Answer
has body: You can play with CGEvent and send event like the new mouse position and keystrokes for instance: Move the mouse programmatically: private func moveMouseTo(x: Int, y: Int) { let moveEvent = CGEvent(mouseEventSource: nil, mouseType: .mouseMoved, mouseCursorPosition: CGPoint(x: x, y: y), mouseButton: .left) moveEvent?.post(tap: .cghidEventTap) } Send keystrokes programmatically: let keyDownEvent = CGEvent(keyboardEventSource: nil, virtualKey: rightArrowKeyCode, keyDown: true) keyDownEvent?.flags = CGEventFlags.maskCommand keyDownEvent?.post(tap: CGEventTapLocation.cghidEventTap) let keyUpEvent = CGEvent(keyboardEventSource: nil, virtualKey: rightArrowKeyCode, keyDown: false) keyUpEvent?.flags = CGEventFlags.maskCommand keyUpEvent?.post(tap: CGEventTapLocation.cghidEventTap) Note that in order to use both events (mouse and keyboard) you need to configure the "Accessibility" option in macOS Settings for your app, like AXIsProcessTrusted You can use also, OCR or a machine learning model using CreateML (for image recognition) to identify the correct bounding box of your 3rd party app (in particular to your textfield). In this way you can move the mouse and click in a precise position than send keystrokes.
answers question: http://stackoverflow.com/q/77637622
score: 0

uibutton
tags question: http://stackoverflow.com/q/77666355
tag name: uibutton
type: Tag

http://stackoverflow.com/comment/136831018
has text: You aren't really doing anything in code that matches the description of what you **want** to do. Take a look at this answer - it may have all the parts you need: https://stackoverflow.com/a/12399760/6257435
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77614453
type: QuestionComment

http://stackoverflow.com/a/77690964
accepted answer of: http://stackoverflow.com/q/77689811
has comment: http://stackoverflow.com/comment/136967362
has comment: http://stackoverflow.com/comment/136966830
has body: For this, you probably want to use the C function void exit(int status); See the output of man 3 exit. This will run various standard C cleanup processes and cause your process to exit cleanly with the status code you call it with. What's perhaps more interesting is the question: "How does your process know when to call exit()?" Is it going to receive a network payload that tells it when to quit? Will you send it a UNIX SIGTERM signal? (If this feels like a misuse of SIGTERM to you, you could consider using SIGUSR1 or SIGUSR2.) GCD has signal handling capabilities built in (see DispatchSource.makeSignalSource here). To be more explicit, you could add a GCD signal handler for SIGTERM do whatever other cleanup you need to do, and then call exit() at the end of the handler block, and that should do the trick. Hope that helps!
has comment: http://stackoverflow.com/comment/136966922
score: 1
has comment: http://stackoverflow.com/comment/136967300
has comment: http://stackoverflow.com/comment/136967173
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/77689811
downvote count: 0
upvote count: 1

http://stackoverflow.com/comment/136803691
score: 3
type: Comment
type: QuestionComment
has text: Doesn't look trustworthy even in Objective-C. Are you sure that just using own class with `@property CGWindowID windowID;` won't be enough?
comment on: http://stackoverflow.com/q/77598216

http://stackoverflow.com/comment/136939266
comment on: http://stackoverflow.com/q/77668346
type: Comment
score: 0
type: QuestionComment
has text: That not answers my question, but have a hint to check Deployment Target.

http://stackoverflow.com/a/77738334
upvote count: 1
answers question: http://stackoverflow.com/q/77734537
type: Answer
has body: currentRenderPassDescriptor of the MTKView asks its internal CAMetalLayer for the nextDrawable, which blocks waiting for the next drawable to be available. enableSetNeedsDisplay does not have anything to do with V-Sync and more so to do with when and how MTKView calls its delegate. The actual setting you are after is displaySyncEnabled. Keep in mind that it's only available on macOS. The reason you are seeing currentRenderPassDescriptor take 8 ms is because you are probably either running on an internal display on a MacBook Pro, which has a ProMotion display, which runs at up to 120 Hz or you are running on an external monitor which is also capable of 120 Hz. 120 Hz is equivalent to a screen being redrawn approximately every 8 ms. The reason you get "very fast frames" is because of how you are measuring it. Your frames are fast but they run not very often, because you are asking for 10 Hz updates and the compositor can basically give you all of the drawables instantly because the interval between you asking for drawables is more than the interval between the screen being drawn, so you always have at least two drawables, which means you will always get a new drawable instantly. Keep in mind that some behavior might change when running Direct or Composited, so enable Metal HUD to see which mode you are running in.
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/77734537
type: AcceptedAnswer

http://stackoverflow.com/comment/136861253
comment on: http://stackoverflow.com/q/77629081
has text: It is unclear to me how OnFunSDKResult actually gets called. In your code, you create an instance of FunSDKWrapper, retain count of 1. But there are no other references to that wrapper, so as soon as it goes out of scope, ARC will release it. Retain count of zero, the object will be dealloced. You have a non-memory-managed pointer in msgHandle internally, but you need to find a way to keep a managed reference around until OnFunSDKResult is called. If that is guaranteed, you could have FunSDKWrapper have a retained reference to itself in the ini method, then nil it out in OnFunSDKResult.
score: 1
type: QuestionComment
type: Comment

3d
tag name: 3d
type: Tag
tags question: http://stackoverflow.com/q/77783407

http://stackoverflow.com/comment/137060345
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77686138
has text: Are you by any means capturing the Google Map within the UI itself?
type: QuestionComment

http://stackoverflow.com/comment/136841747
type: Comment
comment on: http://stackoverflow.com/q/77617207
has text: May be by printing number with `NSNumberFormatter`? Why number format in NSLog is bothering you?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136805041
has text: why you need to have two colors when you always want red ?
comment on: http://stackoverflow.com/q/77600151
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136967362
score: 1
has text: It's worth keeping in mind: Almost every framework you might consume allocates private, global-ish data structures that you cannot explicitly release, except by virtue of your process terminating. WebKit is a great example: it allocates hundreds of MB of internal data structures that you have no way to force it to clean up, other than by terminating the process. I suggest explicitly handling the things you own/create, and trusting that the framework either handles its own cleanup, or *doesn't care* about not cleaning up.
comment on: http://stackoverflow.com/a/77690964
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/136994837
has text: Core Data, yes. The table populates as intended. And I can display (in a textField) the total number entries that populate the table using count. model key path binding. One column includes currency values. I need to display the sum of the column entries in a textfield as well. How would I set up bindings for textField to display the sum of column entries? Is there more to it than implementing @sum. model key path binding?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77705575
type: Comment

http://stackoverflow.com/comment/136897098
type: QuestionComment
has text: I read errors in error pipe. With different task configurations, "Password:" is read from error pipe and I am writing the password there. That's another way of passing the password.
type: Comment
comment on: http://stackoverflow.com/q/77644430
score: 0

crash-log
tags question: http://stackoverflow.com/q/77649167
tag name: crash-log
type: Tag

http://stackoverflow.com/a/77710378
score: 0
type: Answer
answers question: http://stackoverflow.com/q/77705575
type: AcceptedAnswer
has body: Bind the text field to the array controller Controller key: arrangedObjects Model Key Path: @sum.modelKey The sum value is the same type as the summed values. Add a number formatter to the text field with the same settings as the formatter of the cell in the column.
accepted answer of: http://stackoverflow.com/q/77705575

http://stackoverflow.com/q/77709334
has answer: http://stackoverflow.com/a/77713016
score: 0
tagged with: audioqueueservices
has body: I am trying to get the raw audio data from the system microphone using AudioToolbox and CoreFoundation frameworks. So far the writing packets to file logic works but when I try to capture the raw data into a file, some values are 0. static void MyAQInputCallback(void *inUserData, AudioQueueRef inQueue, AudioQueueBufferRef inBuffer, const AudioTimeStamp *inStartTime, UInt32 inNumPackets, const AudioStreamPacketDescription *inPacketDesc) { MyRecorder *recorder = (MyRecorder *)inUserData; if (inNumPackets > 0) { CheckError(AudioFileWritePackets(recorder->recordFile, FALSE, inBuffer->mAudioDataByteSize, inPacketDesc, recorder->recordPacket, &inNumPackets, inBuffer->mAudioData), "AudioFileWritePackets failed"); recorder->recordPacket += inNumPackets; int sampleCount = inBuffer->mAudioDataBytesCapacity / sizeof(AUDIO_DATA_TYPE_FORMAT); AUDIO_DATA_TYPE_FORMAT* samples = (AUDIO_DATA_TYPE_FORMAT*)inBuffer->mAudioData; FILE *fp = fopen(filename, "a"); for (int i = 0; i < sampleCount; i++){ fprintf(fp, "%i;\n",samples[i]); } fclose(fp); } if (recorder->running) CheckError(AudioQueueEnqueueBuffer(inQueue, inBuffer, 0, NULL), "AudioQueueEnqueueBuffer failed"); } And some properties: NumberRecordBuffers = 3 buffer duration = 0.1 format->mFramesPerPacket = 1024 samplerate = 44100 inNumPackets = 4 Out of 1024 samples, only about 400 is filled. Increasing the buffer duration increases the valid numbers proportionally but the overall data still contains gaps. The audio file that is written has no such error. Any help is appreciated. Thank you in advance.
has title: How to get raw audio data from AudioQueueRef in MacOS?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/77713016
tagged with: macos
type: Question
tagged with: core-audio
answer count: 1
tagged with: objective-c

http://stackoverflow.com/comment/136954307
type: AnswerComment
comment on: http://stackoverflow.com/a/77683918
type: Comment
score: 0
has text: Mac cli app is command line tool?

http://stackoverflow.com/a/77713016
accepted answer of: http://stackoverflow.com/q/77709334
score: 0
type: Answer
has body: Solved it using recordFormat.mFormatID = kAudioFormatLinearPCM for recording and using int sampleCount = inBuffer-&gt;mAudioDataByteSize / sizeof(AUDIO_DATA_TYPE_FORMAT)
answers question: http://stackoverflow.com/q/77709334
type: AcceptedAnswer

core-video
tag name: core-video
type: Tag
tags question: http://stackoverflow.com/q/77712292

http://stackoverflow.com/a/77616852
has body: I would advise you to subclass UITableViewCell, assign these layers as properties, and manage their visibility using hidden property of CALayer. Create a custom cell class @interface StatusCell: UITableViewCell @property (nonatomic, strong) CAShapeLayer *progressLayer; @property (nonatomic, strong) CAShapeLayer *sentLayer; @end Assign StatusCell class name to your cell prototype in storyboard. Create the layers – as you could notice, cellForRowAtIndexPath method is not the best place to do it, as it is called often during cell life cycle. I usually create properties in init methods, as your cell is storyboard-based, you can also use the awakeFromNib method, it is also called only once during nib-based cells' life cycle. @implementation StatusCell - (void)awakeFromNib { [super awakeFromNib]; CAShapeLayer *progressLayer; // configuraion progressLayer.hidden = YES; self.progressLayer = progressLayer; // repeat for sentLayer. } @end In your cellForRow method you set one layer to be hidden, and other to be visible. You can adjust layers' positions, if required. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { StatusCell *cell = [tableView dequeueReusableCellWithIdentifier:@"StatusCell"]; // Optionally adjust your layers' frames if your cell has dynamic height. NSManagedObject *object = [self.fetchedResultsController objectAtIndexPath:indexPath]; cell.progressLayer.hidden = ![[object valueForKey:@"status"] isEqualToString:@"sending"]; cell.sentLayer.hidden = ![[object valueForKey:@"status"] isEqualToString:@"sent"]; return cell; }
downvote count: 0
score: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/77600508
answers question: http://stackoverflow.com/q/77600508
upvote count: 1

http://stackoverflow.com/comment/136872114
has text: Is this mystery text box a regular Cocoa control, or rendered from something like a HTML document?
score: 1
comment on: http://stackoverflow.com/q/77637622
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/136877463
has text: Do not implement `heightForRowAtIndexPath` if you return the same value for all rows. Simply set the `rowHeight` property of the table view to that one value.
score: 0
comment on: http://stackoverflow.com/a/77639630
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/136805785
score: 0
type: Comment
has text: I think you should make custom views for each cell state to avoid redrawing continuously.
type: QuestionComment
comment on: http://stackoverflow.com/q/77600508

http://stackoverflow.com/comment/136935650
has text: I've seen the debugger lie before, caching the description from a previous "po" command and repeating it, even though the reality is different if the method was actually called.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77641579
score: 0

http://stackoverflow.com/comment/136811305
score: 0
has text: Haha, when I rebuilt with `int`, it fails now.
comment on: http://stackoverflow.com/q/77603588
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/137110887
has text: And what happens if you set `setVoiceProcessingEnabled` on one of the input/output nodes only?
comment on: http://stackoverflow.com/a/77725638
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/136898030
type: Comment
has text: Just to clarify, this crash log has been deSymbolicated.
comment on: http://stackoverflow.com/q/77649167
score: 0
type: QuestionComment

http://stackoverflow.com/comment/137109690
type: Comment
has text: then why bother with purgeability? Just let the reference go
score: 0
comment on: http://stackoverflow.com/q/77762066
type: QuestionComment

http://stackoverflow.com/comment/136814903
score: 1
type: Comment
has text: Can't you get the `SCWindow`s from `SCShareableContent` and handle them in the order from `CGWindowListCopyWindowInfo`?
comment on: http://stackoverflow.com/q/77598216
type: QuestionComment

http://stackoverflow.com/comment/136939396
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77668346
has text: Have a hint and have a solution - very different things. The "solution answer" not accepted there. Just I read near 5 provided for review questions. Checked all other solutions and recommendations. I have no idea how it is possible Deployment Target to have such influence here to "loose" some symbols. So I consider it is not "duplicate" question and of cause there is no strict solution.
type: Comment

http://stackoverflow.com/comment/136815285
type: Comment
score: 0
has text: @Willeke True. I think I was originally concerned about the extra complexity but I'll test it out.
comment on: http://stackoverflow.com/q/77598216
type: QuestionComment

interrupt
tag name: interrupt
tags question: http://stackoverflow.com/q/77644430
type: Tag

http://stackoverflow.com/a/77667325
downvote count: 0
score: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/77635904
answers question: http://stackoverflow.com/q/77635904
has body: You need 9 labels, not 8, because you need to include the Zero label. Also, setting .granularity = 250.0; will give you "steps" at 250 increments. Example: ChartYAxis *leftAxis = _chartView.leftAxis; leftAxis.labelFont = [UIFont systemFontOfSize:10.f]; leftAxis.labelPosition = YAxisLabelPositionOutsideChart; leftAxis.axisMinimum = 0.0; leftAxis.axisMaximum = 2000.0; // use .granularity leftAxis.granularity = 250.0; // we need 9 labels to include the Zero label leftAxis.labelCount = 9; Output:
upvote count: 1

http://stackoverflow.com/comment/137072717
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77735215
has text: What's the current status you got then? Have you called at all `requestAuthorizationForAccessLevel:handler:`?

http://stackoverflow.com/comment/137103696
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77762066
type: Comment
has text: I have already solved it, but for context i wanted to nicely abstract resizing `MTLBuffer`s by making a class that has two revolving `MTLBuffer*`s. When resizing, we format the back buffer while drawing from the front until the back is prepared. Once the back is done (reallocated) we swap buffers and draw (and edit) the new one. I could not just purge the old buffer because there may be frames in flight that read from it.

http://stackoverflow.com/comment/136835194
score: 2
type: Comment
has text: Your `NSLog` line produces `123456` for me.
type: QuestionComment
comment on: http://stackoverflow.com/q/77617207

http://stackoverflow.com/comment/136904352
type: Comment
comment on: http://stackoverflow.com/q/77655283
has text: If it was me, I'd sanitize the data before saving it, by either removing the quote marks or standardizing them on one type of quote mark. Or if I needed the original formatting for some reason, I'd add a secondary field with sanitized data and use that for sorting.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/136854266
score: 1
type: QuestionComment
has text: Please edit your post and include the QR code image of your sample data so we can see what data format you use.
type: Comment
comment on: http://stackoverflow.com/q/77627573

command-line-tool
tag name: command-line-tool
type: Tag
tags question: http://stackoverflow.com/q/77689811

http://stackoverflow.com/comment/136812682
type: QuestionComment
type: Comment
has text: Try `int16_t *buff = (int16_t*)data.bytes`
score: 0
comment on: http://stackoverflow.com/q/77603588

http://stackoverflow.com/comment/136873806
has text: Can you navigate to the text box using the arrow/tab keys? Can the Accessibility Inspector select the text box?
type: QuestionComment
score: 1
type: Comment
comment on: http://stackoverflow.com/q/77637622

http://stackoverflow.com/comment/136939543
comment on: http://stackoverflow.com/a/77674440
score: 0
has text: Because someone wants points obviously. :)
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/136885151
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/77637622
has text: Thanks for all the ideas provided. Now the way I’m using is through AXUIElementCopyElementAtPosition to get it. First, I get the coordinates of the main window, and then calculate the coordinates of the control I want to get. I have been able to get it. Thank you very much for your help. You are the best.

http://stackoverflow.com/comment/136882282
comment on: http://stackoverflow.com/q/77637622
has text: The type of the text box is Text Field, and the Element Class is NSTextFieldCell. I can inspect it with the Accessibility Inspector. However, when I check its Parent, I find that the Parent’s Children do not include it, and the Parent only contains an AXGroup.
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/136854250
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/77627573
has text: `We are expecting a byte array which have a decimal values,` A byte array contains bytes. Only bytes. No values. Every byte is eight bits. How you interpret the bits is up to you. You can display them as decimal, hexadecimal, octal value, what ever you want. But a byte is only eight bits.
score: 1

sh
tags question: http://stackoverflow.com/q/77644430
type: Tag
tag name: sh

nsmutableorderedset
tags question: http://stackoverflow.com/q/77641579
tag name: nsmutableorderedset
type: Tag

http://stackoverflow.com/comment/136811577
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77599602
has text: @Alexander Its macOS sonoma 14.1.1. when I remove podfile **use framework!** in the demo project pod install giving me an error. >you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies. If I use **use_modular_headers!** then not issue mut my other pods change and **FacebookShare** pod not working **:modular_headers => true**.

ios-charts
tag name: ios-charts
tags question: http://stackoverflow.com/q/77635904
type: Tag

http://stackoverflow.com/comment/136880874
score: 0
has text: *"sometimes it works and sometimes it does not"* -- not much we can do to help with that... You need to try to determine a pattern of actions that causes it ... then update your questions with code / description of actions that reproduces the issue.
type: QuestionComment
comment on: http://stackoverflow.com/q/77641579
type: Comment

http://stackoverflow.com/comment/136916153
has text: @KennyWyland I suspect that the way you do that is to file a bug with Apple and hope that a future release of iOS does what you need. In the meantime there are workarounds.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77655283

http://stackoverflow.com/comment/136902270
score: 0
type: QuestionComment
type: Comment
has text: @DonMag Thx for replying! There is no pattern as I can find. The code is that single line removeObjectAtIndex. By executing that line, the count of items in the set should be one less. But sometimes, the count remains the same as I print in the console. But if I try to print the object at that index (0 in the example posted), an error comes up (as in what was posted above).
comment on: http://stackoverflow.com/q/77641579

http://stackoverflow.com/comment/137538488
type: QuestionComment
comment on: http://stackoverflow.com/q/77783407
score: 1
type: Comment
has text: FYI - the Apple project at https://developer.apple.com/documentation/avfoundation/media_reading_and_writing/reading_multiview_3d_video_files?language=objc does have what you need. The important file is StereoViewModel.swift. It's trivial to make that work for iOS. Change `NSImage` to `UIImage` and `NSSize` to `CGSize`. Then of course you need to convert to Objective-C. Focus on the APIs used, not the language. Focus on just the parts that extract each pair of images for each frame. All of the AVFoundation and VideoToolBox APIs are there in both languages.

http://stackoverflow.com/a/77691170
score: 0
type: Answer
answers question: http://stackoverflow.com/q/77644430
has body: Apparently, the sudo -i command opens another bash, hence the signals are not passed. Solution is to launch my app in root level hence the bash will be launched in root level by default and I don't have to change to sudo manually. Another drawback of using sudo -i is that the user can use exit command to exit from sudo mode which I don't want. So launching the bash from root level is the right solution.

http://stackoverflow.com/comment/136809977
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77598216
has text: @DávidPásztor Honestly, I'm just not satisfied with `SCShareableContent` since it doesn't return the windows in z-index order. I'm using `CGWindowListCopyWindowInfo` to do this.

http://stackoverflow.com/comment/137107302
has text: are you reusing those later?
comment on: http://stackoverflow.com/q/77762066
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/136924326
type: Comment
has text: You should try to debug UI to see the view hierarchy. It will show exactly where the button is.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77666355

http://stackoverflow.com/comment/137001191
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/77709979
type: Comment
has text: How do you check the mouse movement event?

background
tags question: http://stackoverflow.com/q/77672746
tag name: background
type: Tag
tags question: http://stackoverflow.com/q/79470730

sfspeechrecognizer
tags question: http://stackoverflow.com/q/77628617
type: Tag
tag name: sfspeechrecognizer
tags question: http://stackoverflow.com/q/78378834

http://stackoverflow.com/a/77799515
downvote count: 0
accepted answer of: http://stackoverflow.com/q/77686138
answers question: http://stackoverflow.com/q/77686138
has body: I found the solution. I am now using: [self.map drawViewHierarchyInRect:self.map.bounds afterScreenUpdates:YES]; Code: UIGraphicsBeginImageContext(self.map.bounds.size); [self.map drawViewHierarchyInRect:self.map.bounds afterScreenUpdates:YES]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return image;
type: AcceptedAnswer
type: Answer
upvote count: 1
score: 1

camera
type: Tag
tag name: camera
tags question: http://stackoverflow.com/q/77767261
tags question: http://stackoverflow.com/q/77907322

http://stackoverflow.com/a/77760405
score: 0
has body: I got it to work by changing Doxygen's preprocessor expansion settings: ENABLE_PREPROCESSING YES MACRO_EXPANSION YES EXPAND_ONLY_PREDEF YES PREDEFINED "NS_ENUM(enum_type,enum_name)=enum enum_name" This changes the original definition typedef NS_ENUM(NSUInteger, EnumName) to look like this: typedef enum EnumName This is sufficiently good for the Doxygen parser so that regular documentation blocks can be written.
answers question: http://stackoverflow.com/q/77760404
type: Answer

http://stackoverflow.com/comment/136966830
comment on: http://stackoverflow.com/a/77690964
score: 0
type: AnswerComment
type: Comment
has text: The code sends a network request and receives the response. So I would stop upon either getting an error from a network call or after receiving the response. BUT I'd also worry that `exit()` might be too low-level and not allow for proper cleanup of the higher level mac-specific stuff, since I'm out of my environment and don't really know which parts of the rabbithole to go down (-:

screencapturekit
type: Tag
tags question: http://stackoverflow.com/q/77598216
tag name: screencapturekit
tags question: http://stackoverflow.com/q/78846311
tags question: http://stackoverflow.com/q/79002502

nssortdescriptor
type: Tag
tag name: nssortdescriptor
tags question: http://stackoverflow.com/q/77655283
tags question: http://stackoverflow.com/q/79259549

cgimage
type: Tag
tags question: http://stackoverflow.com/q/77614453
tag name: cgimage
tags question: http://stackoverflow.com/q/79518919

accessibility
type: Tag
tags question: http://stackoverflow.com/q/77637622
tag name: accessibility
tags question: http://stackoverflow.com/q/78816893

http://stackoverflow.com/q/77799533
linked to: http://stackoverflow.com/q/1174093
has answer: http://stackoverflow.com/a/77805420
has body: I want to create an Objective C class instance, input is class string, in KMM with Kotlin, is this possible? fun createObject(className: String): Any? { if (className == "MyCustomClass") { // create a instance of MyCustomClass and return } // return null }
has comment: http://stackoverflow.com/comment/137163968
tagged with: ios
tagged with: kotlin-multiplatform
score: 0
tagged with: objective-c
has title: How can I create an instance of Objective C instance by name in KMM?
type: Question
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/q/77788825
has body: Loading up a (very) old objective-c project, to do some bug fixes and it crashes out before I have gotten the chance to even load it to test, the line it crashes on is indicated below; - (void)viewDidLoad { activeViewController = [self loadStartViewController]; [self.view addSubview:activeViewController.view]; //Crashing on this line [activeViewController viewDidAppear:NO]; } the loadStartViewController method is; - (UIViewController*) loadStartViewController { StartViewController *viewController = [StartViewController alloc]; return viewController; } Appreciate this will likely need far further fixing, but wanted to get at least into the app first.
tagged with: ios
has title: Application tried to present modally a view controller <StartViewController: 0x14e90bfb0> that has a parent view controller
answer count: 1
tagged with: objective-c
score: 0
type: Question
has answer: http://stackoverflow.com/a/77789668
type: UnansweredQuestion

http://stackoverflow.com/comment/137212010
has text: I have removed that
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/77811774
score: 0

http://stackoverflow.com/a/77791661
has comment: http://stackoverflow.com/comment/137151376
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/137154800
has comment: http://stackoverflow.com/comment/137154824
has body: If all manipulations is done in C++ then you don't need to know anything about MyVertex content in ObjectiveC. In ObjectiveC you can work just with pointer on it. Yours declaration file should be: #ifdef __IN_CPP__ struct MyVertex { vec2 position; vec4 color; }; #else typedef struct _MyVertex MyVertex; #endif
answers question: http://stackoverflow.com/q/77789337
upvote count: 0
score: -1

avcapturesession
tags question: http://stackoverflow.com/q/77915582
type: Tag
tag name: avcapturesession
tags question: http://stackoverflow.com/q/78329532

http://stackoverflow.com/q/77952697
tagged with: ios
tagged with: tvos
has body: I have a tvOS project contains an App target and 3 static libraries: EntryPoint – Static library that contains main , AppDelegate and SceneDelegate Experience – Static library containing my UI elements AppTarget – executable built using above two libraries I have a class "SelectionTable" which subclasses UITableView in Experience target : import UIKit class SelectionTable : UITableView { private var vDataSrc:[String]! func SetDataSrc (_ pDataSrc:[String]) { self.vDataSrc = pDataSrc } func UpdateDataSrc (_ pStringList:[String]) { self.vDataSrc += pStringList } func GetDataSrc () -> [String] { return self.vDataSrc } } I am not using this class anywhere and still i am getting these errors when i build my AppTarget: Cannot find interface declaration for 'UITableView', superclass of 'SelectionTable' Expected a type These above error are coming in generated header file "Experience-Swift.h". This file is auto-generated by compiler. I am not using @objc anywhere in the code, But still the Target-Swift.h file has the below lines: SWIFT_CLASS("_TtC10Experience22SelectionTable") @interface SelectionTable : UITableView - (nonnull instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style OBJC_DESIGNATED_INITIALIZER; - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; @end When i am marking above class as Private , this error goes away . And also , if i am defining SelectionTable class in EntryPoint library , this error does not occur . I am using similar model for an iOS project also and there i am not facing this issue. I am using :- Swift version : Swift 5.9.2 XCode version : 15.2
has title: Getting Swift_header compilation error for tvOS
type: Question
upvote count: 1
tagged with: swift
downvote count: 0
type: UnansweredQuestion
tagged with: apple-tv
score: 1
favorite count: 0
tagged with: objective-c
answer count: 0

http://stackoverflow.com/comment/137298301
has text: That shouldn't be it. The message is complaining that the very first byte isn't 0x03 (which is the "header" in question.) Here's the file format; it's very simple: https://github.com/RNCryptor/RNCryptor-Spec/blob/04378bc27c604e97353badbead8c435698abe97a/RNCryptor-Spec-v3.md
type: QuestionComment
comment on: http://stackoverflow.com/q/77873161
score: 0
type: Comment

http://stackoverflow.com/a/77916474
has body: Depending on the type of video you are capturing, you should investigate the use of UIImagePickerController. A lot of people don't realize that not only does it have a camera-capture mode, but that mode supports video: https://developer.apple.com/documentation/uikit/uiimagepickercontroller/cameracapturemode/video A couple limitations: This is the older/legacy interface. It is still supported, but has not gotten many revisions for new hardware since the AV* frameworks were added. There maybe newer camera/video features that can't be accessed. The docs do not describe the use of temp files and full disks, so you should still test this feature before committing to its use. It does has a built in "video clip" feature, so users have some ways of limiting their use of storage when capturing the file.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/77907322

http://stackoverflow.com/q/77789337
type: Question
has title: Coordinating the padding of structs in C++ and Objective-C
has comment: http://stackoverflow.com/comment/137135741
tagged with: objective-c
has answer: http://stackoverflow.com/a/77791661
tagged with: c++
accepted answer: http://stackoverflow.com/a/77789462
tagged with: struct
has comment: http://stackoverflow.com/comment/137135789
has comment: http://stackoverflow.com/comment/137135758
has body: I’m using Objective-C and Metal to render to a window, however all of my application code is written in C++. So all of the CPU manipulation of data inside MTLBuffer is done in C++. This is done by passing the buffers contents (which is a void*) to the C++ code, where it casts the contents pointer to MyVertex* to write new vertex data. In my header file, i just add compiler conditions to type the vertex structs properly. #ifdef __IN_OBJC__ #define V2 vector_float2 #define V4 vector_float4 #endif #ifdef __IN_CPP__ #define V2 vec2 #define V4 vec4 #endif typedef struct { V2 position; V4 color; } MyVertex; Here vec2, vec4 are basically structs of 2, 4 floats implemented in my C++ code. But in this example, Objective-C and C++ think that MyVertex is of differing sizes. I’m compiling with clang and clang++. And the Objective-C compiler wants to pad the struct so it is of size 32, while C++ says that the struct is of size 24. I currently fixed this now with #pragma pack, but this feels like a weak solution. I would actually prefer my C++ implementation to be padded instead of packed to better optimize buffers in the shaders. But I cannot deliberately pad a struct like I can pack one. Should I make my own vectors (vec2…) compatible with Objective-C? Right now they are written as classes. That way i won’t have to do conditional declarations. I would prefer the solution to best optimize buffer performance in the shader.
has comment: http://stackoverflow.com/comment/137136640
has comment: http://stackoverflow.com/comment/137135772
score: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/137135753
answer count: 2
has answer: http://stackoverflow.com/a/77789462
tagged with: padding
has comment: http://stackoverflow.com/comment/137135810
possible better answer: http://stackoverflow.com/a/77791661
tagged with: metal
has comment: http://stackoverflow.com/comment/137135715

http://stackoverflow.com/q/77804229
has answer: http://stackoverflow.com/a/77808539
has title: How to dynamically controls constraint to active them without manually doing calculation and set active by my self?
has answer: http://stackoverflow.com/a/77812057
tagged with: autolayout
tagged with: objective-c
has body: I want the text label adjust its position based on the green view. It should left alignment to the view if possible, but if the text content extent out of the dashboard, I'd like the text to right alignment to the view. Example: The green view's position and changed randomly, I don't want to calculate the text frame every time and manually enable or disable different constraints, or set frame directly. I really want to explore some easy way to achieve that Currently I uses: C1 = [text.leadingAnchor constraintEqualToAnchor:view.leadingAnchor] C2 = [text.trailingAnchor constraintLessThanOrEqualToAnchor:view.trailingAnchor] C3 = [text.trailingAnchor constraintLessThanOrEqualToAnchor:dashboard.trailingAnchor] priority: C3&gt;C2&gt;C1 But in that case, the text position for the middle green view is wrong.
tagged with: constraints
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/137164057
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/137169512
type: UnansweredQuestion

http://stackoverflow.com/q/77790334
has comment: http://stackoverflow.com/comment/137228207
tagged with: core-audio
answer count: 1
tagged with: objective-c
upvote count: 3
tagged with: c++
accepted answer: http://stackoverflow.com/a/79129856
has comment: http://stackoverflow.com/comment/137221722
has comment: http://stackoverflow.com/comment/137216530
favorite count: 0
score: 2
type: Question
tagged with: swift
has answer: http://stackoverflow.com/a/79129856
downvote count: 1
linked to: http://stackoverflow.com/q/39574616
tagged with: macos
has title: Incorrect Value Returned by kAudioDevicePropertyDeviceIsRunningSomewhere for External Devices like AirPods
has comment: http://stackoverflow.com/comment/137258281
has body: I'm experiencing an issue where kAudioDevicePropertyDeviceIsRunningSomewhere is not returning the expected values for wireless audio devices such as AirPods. The expected behavior is to return 1 when the device is in use and 0 when it is not. However, even when the device is actively being used, it consistently returns 0. This problem seems to be a common one, as evidenced by discussions on platforms like the Apple Developer Forums and Stack Overflow. https://developer.apple.com/forums/thread/741026 How to detect microphone usage on OS X? I have attempted various methods to retrieve the correct value of kAudioDevicePropertyDeviceIsRunningSomewhere for wireless devices but have not been successful. One peculiar observation is that when I use ListenerBlock on kAudioDevicePropertyDeviceIsRunningSomewhere, the ListenerBlock is triggered, which is strange given that the property always reports the device as inactive, meaning "0". Can anyone provide insights or solutions on how to accurately obtain the kAudioDevicePropertyDeviceIsRunningSomewhere value for wireless audio devices?
type: AnsweredQuestion

http://stackoverflow.com/comment/137423216
comment on: http://stackoverflow.com/q/77950769
has text: Better yet, since you're using SwiftUI, you _could_ just use `onReceive` on your `View`...
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/137132767
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77787569
has text: Try just adding `#import "FingerprintSDKWrapper.h"`

http://stackoverflow.com/q/77916083
tagged with: cocoa
downvote count: 0
has comment: http://stackoverflow.com/comment/137364651
has comment: http://stackoverflow.com/comment/137363308
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/137362863
has comment: http://stackoverflow.com/comment/137364594
has comment: http://stackoverflow.com/comment/137421515
has comment: http://stackoverflow.com/comment/137410177
has comment: http://stackoverflow.com/comment/137409968
has comment: http://stackoverflow.com/comment/137424864
type: Question
has comment: http://stackoverflow.com/comment/137389692
upvote count: 1
has comment: http://stackoverflow.com/comment/137384883
has comment: http://stackoverflow.com/comment/137392132
has comment: http://stackoverflow.com/comment/137391040
tagged with: macos
has comment: http://stackoverflow.com/comment/137364051
has comment: http://stackoverflow.com/comment/137384809
has title: How can I tell NSOpenPanel to respect the ⌘A (select all items) key binding?
favorite count: 0
has comment: http://stackoverflow.com/comment/137384735
has comment: http://stackoverflow.com/comment/137409188
has body: MacVim is a macOS application with a file open dialog that calls NSOpenPanel with a simple view to show hidden files (see MMAppController.m's fileOpen method and Miscellaneous.m's showHiddenFilesView method). When I open files with MacVim, I can use ⌘A to select all files. But I don't see what it's doing that's any different than what I do below, which does not allow me to use ⌘A to select all files. NSOpenPanel *panel = [NSOpenPanel openPanel]; [panel setCanChooseFiles:YES]; [panel setCanChooseDirectories:YES]; [panel setAllowsMultipleSelection:YES]; if ([panel runModal] == NSModalResponseOK) { for ( NSURL* URL in [panel URLs] ) { NSLog( @"%@", [URL path] ); } } else { NSLog( @"ok button not pressed"); } The docs for NSOpenPanel and NSSavePanel, which NSOpenPanel inherits don't make any mention of key bindings or other booleans that I might set. The only thing that I saw that might be useful is a custom view but MacVim doesn't appear to be doing anything with NSView that relates. Below is the entire MCV example and how it's compiled. I suspect there's something wrong with the example since I have to click the graphics rectangle first before I can get the open panel to behave. But I don't think that's having an effect on the key bindings. #import <Cocoa/Cocoa.h> void openDialog () { @try { NSOpenPanel *panel = [NSOpenPanel openPanel]; [panel setCanChooseFiles:YES]; [panel setCanChooseDirectories:YES]; [panel setAllowsMultipleSelection:YES]; if ([panel runModal] == NSModalResponseOK) { for ( NSURL* URL in [panel URLs] ) { NSLog( @"%@", [URL path] ); } } else { NSLog( @"ok button not pressed"); } } @catch (NSException *exception) { NSLog(@"%@", [exception callStackSymbols]); } } void setup () { NSWindow *myWindow; NSRect graphicsRect = NSMakeRect(100.0, 350.0, 400.0, 400.0); myWindow = [ [NSWindow alloc] initWithContentRect: graphicsRect styleMask:NSWindowStyleMaskTitled |NSWindowStyleMaskClosable |NSWindowStyleMaskMiniaturizable backing:NSBackingStoreBuffered defer:N…
tagged with: macvim
tagged with: objective-c
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/76464494

http://stackoverflow.com/a/77808539
type: Answer
has body: Your question, effectively, whether you could have it right aligned with the green view if it would fit, and otherwise left align it. There is no simple set of constraints that will be able to do that automatically. You could theoretically have two constraints, one for left alignment and another for right alignment, and then programmatically activate one and deactivate the other based upon where the green view was within its superview. (Or, needless to say, you could go completely old-school, and adjust frames manually.) But there is a simple alternative that keeps it entirely within the scope of the constraints system, without any manual adjustments, but it isn’t precisely what you asked for. But, it might be sufficient for your purposes: Specifically, you could right align it with the green view if there is space, and left align it with the green view’s superview if not. The basic idea is to have required constraints for the label with respect to the container (your dashboard view), but a lower priority constraint with respect to the green view’s trailing edge. You might also want to set the priorities of the label’s content hugging and content compression resistance. These priorities should be higher than the green view’s trailing anchor constraint. E.g.: let c1 = label.leadingAnchor.constraint(greaterThanOrEqualTo: dashboard.leadingAnchor) let c2 = label.trailingAnchor.constraint(equalTo: greenView.trailingAnchor) let c3 = label.trailingAnchor.constraint(lessThanOrEqualTo: dashboard.trailingAnchor) c2.priority = .defaultLow label.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) label.setContentHuggingPriority(.required, for: .horizontal) NSLayoutConstraint.activate([c1, c2, c3]) Yields: Or, in Objective-C: NSLayoutConstraint *c1 = [label.leadingAnchor constraintGreaterThanOrEqualToAnchor:dashboard.leadingAnchor]; NSLayoutConstraint *c2 = [label.trailingAnchor constraintEqualToAnchor:greenView.trailingAnchor]; NSLayoutConstraint *c3 = [labe…
answers question: http://stackoverflow.com/q/77804229
score: 0

http://stackoverflow.com/comment/137384883
type: QuestionComment
has text: No, NSMenu[Item] normally handles that. You are free to change the target of any menu item. You can change Command-A to not invoke selectAll: if you really want just by editing it, or add new menu items (or change key bindings) to call other responder methods you define for your app. Most people would drop the standard Edit menu into their app and get the functionality that way.
comment on: http://stackoverflow.com/q/77916083
type: Comment
score: 1

decode
type: Tag
tags question: http://stackoverflow.com/q/77873161
tag name: decode

http://stackoverflow.com/a/77789462
has comment: http://stackoverflow.com/comment/137160900
answers question: http://stackoverflow.com/q/77789337
upvote count: 0
has comment: http://stackoverflow.com/comment/137146887
has comment: http://stackoverflow.com/comment/137136454
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/137160946
type: Answer
has body: Since Objective-C expects every field of your struct to align at a 16-byte (4 floats) boundary, you can ask C++ to do the same with alignas(16) struct MyVertex { alignas(16) V2 position; alignas(16) V4 color; }; This will adjust the offsets and resulting size of MyVertex: offsetof(MyVertex, position):0 offsetof(MyVertex, color):16 sizeof(MyVertex): 32
has comment: http://stackoverflow.com/comment/137140149
score: -1
has comment: http://stackoverflow.com/comment/137148223
downvote count: 1
accepted answer of: http://stackoverflow.com/q/77789337
has comment: http://stackoverflow.com/comment/137149140

http://stackoverflow.com/q/77787569
tagged with: frameworks
has comment: http://stackoverflow.com/comment/137132820
type: Question
tagged with: swift
downvote count: 0
has comment: http://stackoverflow.com/comment/137133136
has comment: http://stackoverflow.com/comment/137132669
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/137132767
has comment: http://stackoverflow.com/comment/137132535
answer count: 1
tagged with: objective-c
has title: Difficulty Accessing Objective-C Class within Swift Framework in XCFramework
upvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/137132548
has comment: http://stackoverflow.com/comment/137132674
has comment: http://stackoverflow.com/comment/137132728
has body: I have a Swift Framework and I want to add an Objective C wrapper to access from Objective C project (This is the requirement for some reason). I have wrapped up the Swift class to support in Objective as well. I have created XCFramework and import it in the project. Now I am encountering challenges in accessing an Objective-C class in Objective C, however I can access the Swift Classes. Any insights or solutions would be greatly appreciated. Here is my code of Objective C class in Framework #import <Foundation/Foundation.h> #import "FingerprintSDK/FingerprintSDK.h" NS_ASSUME_NONNULL_BEGIN @interface FingerprintSDKWrapper : NSObject + (instancetype)sharedInstance; - (void)scanFingerprintWithKeywindow:(UIWindow *)window compeltion:(void (^)(NSArray<Images *> *resultArray))completion; @end NS_ASSUME_NONNULL_END
has answer: http://stackoverflow.com/a/77788028

http://stackoverflow.com/comment/137284349
type: QuestionComment
has text: You should use a singleton for configuration where you set that variable (or these variables needed for the framework to run completely, like "id" etc.), or even read in the Info.plist some value. Plenty of framework do that. And it's then the client (ie the one importing your lib) that should set that value.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/77869520

http://stackoverflow.com/a/77895727
score: -1
answers question: http://stackoverflow.com/q/77877558
downvote count: 1
type: Answer
has body: It seems like you're on the right track with your iOS audio project. Your approach to decoding Opus audio data and attempting to play it using AVSampleBufferAudioRenderer is fundamentally sound, but there are a few potential issues and improvements to consider in your code. // Global variable to keep track of the current PTS CMTime currentPTS = kCMTimeZero; void AudioDecodeAndPlaySample(char* sampleData, int sampleLength) { // [Existing decoding logic] // Update PTS CMTime frameDuration = CMTimeMake(numSamples, sampleRate); currentPTS = CMTimeAdd(currentPTS, frameDuration); // [Existing LPCM stream description logic] // [Existing sample buffer creation logic] // Queueing sample buffer onto audio renderer within requestMediaDataWhenReady block [audioRenderer requestMediaDataWhenReadyOnQueue:dispatch_get_main_queue() usingBlock:^{ if ([audioRenderer isReadyForMoreMediaData]) { CMSampleBufferSetOutputPresentationTimeStamp(sampleBuffer, currentPTS); [audioRenderer enqueueSampleBuffer:sampleBuffer]; CFRelease(sampleBuffer); // Don't forget to release the sample buffer } }]; }
has comment: http://stackoverflow.com/comment/137338695
upvote count: 0

http://stackoverflow.com/comment/137315614
type: QuestionComment
comment on: http://stackoverflow.com/q/77889698
type: Comment
has text: Does this answer your question? [Detect volume button press](https://stackoverflow.com/questions/28471481/detect-volume-button-press)
score: 0

http://stackoverflow.com/comment/137383425
type: Comment
has text: Is it a requirement to use `AVSampleBufferAudioRenderer`?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77877558

http://stackoverflow.com/comment/137423292
type: Comment
comment on: http://stackoverflow.com/q/77950769
has text: It isn't `NotificationCenter.default` it's `NSWorkspace.shared`
score: 0
type: QuestionComment

http://stackoverflow.com/q/77889698
has answer: http://stackoverflow.com/a/77904782
linked to: http://stackoverflow.com/q/28471481
has title: Detect if volume down button is pressed twice OBJC iOS
accepted answer: http://stackoverflow.com/a/77904782
favorite count: 0
score: -1
has comment: http://stackoverflow.com/comment/137315754
has comment: http://stackoverflow.com/comment/137315614
has comment: http://stackoverflow.com/comment/137315628
has body: I want to call a function if the volume down button is pressed twice in the same second, is that possible or is it impossible?!
downvote count: 2
tagged with: ios
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/137317981
tagged with: objective-c
type: Question
upvote count: 1
answer count: 1

http://stackoverflow.com/a/77788028
upvote count: 1
downvote count: 0
score: 1
has body: A blunder wasted my time. Simple solution that works Add Objective C class in Swift Framework Set .h file as public in Target Membership import Objective C class in Umbrella header #import &lt;yourSDK/ObjectiveC-class.h&gt; That's all you need.
answers question: http://stackoverflow.com/q/77787569
type: Answer

format-specifiers
type: Tag
tags question: http://stackoverflow.com/q/77798833
tag name: format-specifiers

http://stackoverflow.com/q/77798833
tagged with: format-specifiers
tagged with: nslog
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/77803947
tagged with: integer
has comment: http://stackoverflow.com/comment/137154321
answer count: 1
has body: I'm coding Objective C in Xcode 15 and found this NSLog %d problem. The code I used to test: int someInt = -1; NSLog(@"AppDelegate status: %d (%d) ((%.0f)) %@ -> %d)" , someInt, -1, someInt * 1.0, [NSString stringWithFormat:@"%d", someInt], [NSString stringWithFormat:@"%d", someInt].intValue); The result in Log: AppDelegate status: 18,446,744,073,709,551,615 (18,446,744,073,709,551,615) ((-1.0000)) -1 -> 18,446,744,073,709,551,615) So for -1, it's printed as 8,446,744,073,709,551,615 with %d Converted to float using %f shows correct -1.0000 Converted to NSString shows correct -1 But %d with -1 doesn't work %d with someInt doesn't work %d with NSString converted back to intValue doesn't work. Seems like NSLog is printing %d as a unsigned int. In addition, using printf is fine with -1 and %d. Is there some setting problem of my Xcode? Any ideas how to fix this?
has comment: http://stackoverflow.com/comment/137205000
score: 0
has title: NSLog cannot print negative int with %d in Xcode 15
type: Question
has comment: http://stackoverflow.com/comment/137184105
accepted answer: http://stackoverflow.com/a/77803947
tagged with: objective-c
tagged with: xcode

http://stackoverflow.com/comment/137423184
type: Comment
has text: @jnpdx no, but when I add a `@NSApplicationDelegateAdaptor` I start to get errors like: `-[_TtCV13Notifications16NotificationsApp11AppDelegate sleepListener]: unrecognized selector sent to instance 0x600003670290`
score: 0
comment on: http://stackoverflow.com/q/77950769
type: QuestionComment

http://stackoverflow.com/comment/137369630
score: 0
type: Comment
type: QuestionComment
has text: Why not use the header? EDIT: store some secret in the header and use that to authenticate is what I mean.
comment on: http://stackoverflow.com/q/77855536

http://stackoverflow.com/comment/137423381
type: QuestionComment
score: 0
type: Comment
has text: No, not `NotificationCenter.shared` -- `NSWorksapce.shared`
comment on: http://stackoverflow.com/q/77950769

http://stackoverflow.com/a/77812848
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/77809737
answers question: http://stackoverflow.com/q/77809737
has comment: http://stackoverflow.com/comment/137185746
has body: While Alexander answered your question (and you should feel free to accept his answer; +1), I offer a few clarifying observations: What is the purpose of atomic? The atomic qualifier on the property just dictates how Objective-C synthesized accessors handle the pointer to the actor and has nothing to with the actor’s internal behaviors. As the documentation says, atomic “means that the synthesized accessors ensure that a value [the pointer in this case] is always fully retrieved by the getter method or fully set via the setter method, even if the accessors are called simultaneously from different threads.” The atomic keyword simply ensures that the synthesized accessor methods atomically fetch and store the pointer address, itself. It has no bearing on the internal thread-safety (or lack thereof) of the object to which it points. Should one use atomic or nonatomic? In practice, atomic often introduces (admittedly negligible) overhead with limited benefit. Like Alexander, I almost always use nonatomic. If the Objective-C code has thread-safety issues, one often needs a higher-level of synchronization, rendering the atomic nature to the pointer largely moot. It depends the Objective-C code (which is not really relevant to the immediate question). But, as Alexander pointed out, whether you mark the property as atomic or nonatomic is irrelevant to the fact that you are pointing to an actor or some other class. Should you use the property getter, self.someActor, or access the backing ivar, _someActor? You did not explicitly ask this question, but one of your examples, you refer to someActor (which I presume means you intended to use the getter, though given the absence of either self. or the leading underscore, it is not entirely clear) and in the other, _someActor (the property’s backing ivar). As Programming with Objective-C says, “… it’s best practice for an object to access its own properties using accessor methods or dot syntax.” The two common exceptions to this ru…

http://stackoverflow.com/comment/137135789
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77789337
has text: In fact I'm sure I can go deeper with `alignas` and optimize a lot more to focus on shader buffer and cache hits.. Somehow. Will have to read a bit more how that works.
type: Comment

http://stackoverflow.com/q/77907322
tagged with: ios
has title: Possible to write video directly to iOS Camera Roll or album without copying?
has answer: http://stackoverflow.com/a/77916474
tagged with: objective-c
has body: I have an iOS app that records videos. I want to place them in the user's Camera Roll, or in an album. However, to do this I must first record them to a temporary directory, then copy them to the Camera Roll. This means 2x storage space is required. Some videos may fail to copy of the storage on the device is near full. Is there any way to record directly into an an album? Or am I required to always make the copy?
answer count: 1
tagged with: xcode
score: 0
type: Question
type: UnansweredQuestion
tagged with: camera

http://stackoverflow.com/comment/137338695
type: Comment
has text: Thanks for the insight. Unfortunately even after implementing these changes I still get no audio, and audioRenderer reports an "unknown error". I think something must be wrong with my stream description or sample buffer creation logic.
comment on: http://stackoverflow.com/a/77895727
score: 0
type: AnswerComment

http://stackoverflow.com/q/77915582
tagged with: ios
has answer: http://stackoverflow.com/a/77918231
tagged with: avcapturesession
tagged with: objective-c
type: Question
answer count: 1
score: 0
has title: AVCaptureVideoDataOutputSampleBufferDelegate is not triggering captureOutput
type: UnansweredQuestion
has body: I am trying to build an card scanner app using vision framework of IOS. I am successfully able to open the camera but the problem is that AVCaptureVideoDataOutputSampleBufferDelegate is not triggering captureOutput function where I will do the analysis for identifying the card. Here is my .h file #import <AVFoundation/AVFoundation.h> #import <UIKit/UIKit.h> @interface Trying : NSObject <AVCaptureVideoDataOutputSampleBufferDelegate> @property (nonatomic, strong) AVCaptureSession *captureSession; @property (nonatomic, strong) AVCaptureVideoPreviewLayer *previewLayer; @property (nonatomic, strong) dispatch_queue_t videoDataOutputQueue; @property (nonatomic, strong) UIView *view; - (void)setupCamera; @end And .m file #import <Foundation/Foundation.h> #import <AVFoundation/AVFoundation.h> #import "Trying.h" @interface Trying () @end @implementation Trying - (void)setupCamera { self.captureSession = [[AVCaptureSession alloc] init]; AVCaptureDevice *captureDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; NSError *error; AVCaptureDeviceInput *deviceInput = [AVCaptureDeviceInput deviceInputWithDevice:captureDevice error:&error]; if (deviceInput) { [self.captureSession addInput:deviceInput]; AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:self.captureSession]; previewLayer.frame = self.view.bounds; previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill; [self.view.layer addSublayer:previewLayer]; self.previewLayer = previewLayer; // Create a video data output and set the delegate self.videoDataOutputQueue = dispatch_queue_create("VideoDataOutputQueue", DISPATCH_QUEUE_SERIAL); AVCaptureVideoDataOutput *videoDataOutput = [[AVCaptureVideoDataOutput alloc] init]; [videoDataOutput setSampleBufferDelegate:self queue:self.videoDataOutputQueue]; [self.captureSession addOutput:videoDataOutput]; // Start the session [self.captureSession startRunning]; } else { NSLog(@"Error setting up camera: %@", error.localizedDe…

http://stackoverflow.com/comment/137424864
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77916083
has text: Menu creation code: [Create Cocoa Document App without xib files](https://stackoverflow.com/questions/76464494/create-cocoa-document-app-without-xib-files/76466859#76466859)
type: QuestionComment

http://stackoverflow.com/q/77869520
has title: How do I declare an extern variable in a Cocoapods framework?
type: Question
answer count: 1
tagged with: objective-c
tagged with: xcode
accepted answer: http://stackoverflow.com/a/77869913
score: 0
has body: I am making a Cocoapod framework that needs to declare an extern variable such that the integrator defines the constant value. This is a requirement by our client. In the past, we used a static library (without Cocoapods), and we could declare variables as extern, use them in the code, and send the library to the client who would define the variables in their project. However, when we migrated to creating a Cocoapods framework, the same code no longer works. The variables are declared as extern, but if I try to build the framework, I get linker errors saying "Undefined symbols for architecture arm64". I am also using a Cocoapods example project which has the definitions for the variables, but I can't build and run the target because the framework still fails to compile. I can define the variables in the Cocoapod itself and the app will build and run, but this defeats the purpose (and, for the record, the values that are actually used are those that I define in the pod, not in the example app). How can I go about doing what I had done previously with a static library, but with a Cocoapods framework?
type: AnsweredQuestion
tagged with: cocoapods
has comment: http://stackoverflow.com/comment/137284349
has answer: http://stackoverflow.com/a/77869913
tagged with: ios

http://stackoverflow.com/q/77941248
tagged with: objective-c
has body: I have an older project with a mixed ObjC + Swift codebase. I'm in the process of converting everything to Swift in the hopes that Xcode will work better again when the Codebase is not mixed anymore. This is an example of the issues I'm currently facing: The class IVMapViewController is defined in ObjC and the property mapViewModel is declared in the ObjC Header fine. The ObjC Header file is included in the bridging header. I'm trying to access the property mapViewModel in an swift extension on the same class. I can actually compile & run the code just fine, but Xcode Autocompletion does not work, and Xcode generates "Phantom" errors in the Issue Navigator (those errors also stay there when a build completes successful) On the other hand, if I put an actual error in the code, compilation fails, but the actual error will NOT show up in the Issue Navigator. I'll have to dig through the build log to find the actual error. Am I doing anything wrong? Do I need to adjust some project setting?
answer count: 0
tagged with: autocomplete
has title: Xcode 15.2 - Issues with mixed ObjC and Swift Codebase
score: 0
has comment: http://stackoverflow.com/comment/137406186
has comment: http://stackoverflow.com/comment/137408087
type: Question
tagged with: swift
tagged with: xcode
has comment: http://stackoverflow.com/comment/137408159
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/137405953

http://stackoverflow.com/comment/137205000
comment on: http://stackoverflow.com/q/77798833
type: QuestionComment
score: 0
type: Comment
has text: The answer down here fixed the problem

http://stackoverflow.com/comment/137136640
type: Comment
has text: clang and clang++ will use the same layout. Your problem is that your vector_float2 does not require the right alignment, at least it's not the same as vec2.
comment on: http://stackoverflow.com/q/77789337
score: 0
type: QuestionComment

http://stackoverflow.com/comment/137148223
score: 0
comment on: http://stackoverflow.com/a/77789462
type: AnswerComment
has text: [*The float2 type in the Metal structure requires an alignment of 8 bytes.*](https://computergraphics.stackexchange.com/a/6258/11366) See also p26 of the [Metal spec](https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf)
type: Comment

encode
tags question: http://stackoverflow.com/q/77873161
type: Tag
tag name: encode

macvim
tag name: macvim
tags question: http://stackoverflow.com/q/77916083
type: Tag

http://stackoverflow.com/a/77904782
accepted answer of: http://stackoverflow.com/q/77889698
answers question: http://stackoverflow.com/q/77889698
upvote count: 1
score: 0
type: AcceptedAnswer
downvote count: 1
has body: The link by Willeke gives you a good starting point at a minimum. if your device is iPhone with OC, use AVFoundation and MediaPlayer can monitored the volume change. 1、 #import <AVFoundation/AVFoundation.h> #import <MediaPlayer/MediaPlayer.h> 2、 @property (nonatomic, strong) MPVolumeView* volumeView; @property (nonatomic, strong) UISlider* volumeSlider; 3、 NSError* error = nil; [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:&error]; if (error) { NSLog(@"error setting category:%@", error.localizedDescription); } _volumeView = [[MPVolumeView alloc] initWithFrame:CGRectZero]; [self.view addSubview:self.volumeView]; // 找到MPVolumeView上的UISlider for (UIView *view in [self.volumeView subviews]){ if ([view isKindOfClass:[UISlider class]]) { self.volumeSlider = (UISlider *)view; break; } } [self.volumeSlider addTarget:self action:@selector(volumeChanged:) forControlEvents:UIControlEventValueChanged]; 4、 - (void)dealloc { [self.volumeSlider removeTarget:self action:@selector(volumeChanged:) forControlEvents:UIControlEventValueChanged]; } - (void)volumeChanged:(UISlider *)sender { NSLog(@"%.2f", sender.value); } You can listen to the volume change in the method, and if you want to make consecutive clicks for 1 second, you need to set a timestamp as an anchor. But there are some problems with this method: Removed the default volume adjustment UI of the system, and the new iOS system can not use MPVolumeView; When the screen is locked, the APP cannot take effect when it is inactive; Different iOS versions may have different effects.
type: Answer

http://stackoverflow.com/a/77926814
has body: If your SDP offer negotiates BUNDLE generating only candidates with sdpMid 0 is the expected and correct behavior as all m-lines in the BUNDLE group are going to use those candidates.
has comment: http://stackoverflow.com/comment/137402277
type: Answer
score: 0
answers question: http://stackoverflow.com/q/77925270

http://stackoverflow.com/a/77922643
accepted answer of: http://stackoverflow.com/q/77918816
upvote count: 1
answers question: http://stackoverflow.com/q/77918816
score: 1
downvote count: 0
has body: tl;dr Yes, you have introduced a strong reference cycle. You should use weakSelf pattern. Needless to say, in the case of a timer, you could just add some logging in the timer code, so you will see that the timer is still firing after its owner has been dismissed. But more generally, to identify whether objects remain in memory longer than intended, one can empirically verify this with the “Debug Memory Graph” feature. E.g., here I started the timer in a view controller, presented and dismissed this view controller three times, and the panel to the left of my memory graph shows that I have three instances of that view controller still in memory! Sometimes, we will be lucky enough that the “memory graph” will successfully identify this as a strong reference cycle (and you may see ⚠️ warning icons or circular graphs in the main panel). But, sometimes, such as in this case, you will just see the lingering instances, at which point you can start your hunt for the strong reference cycle (which you have successfully already identified here). In this case, I: turned on the “Malloc Stack” diagnostic option under my scheme settings; ran the app in the debugger; manifested the strong reference cycle; clicked on the “Debug Memory Graph” button (circled at the bottom of the above screen snapshot); selected one of the lingering view controllers; clicked on the object that was keeping the strong reference; I could then see the call stack trace on the right and I clicked on the arrow next to the call in my code (circled on the right edge of the above screen snapshot); and that took me to where the strong reference was established: Once I defined weakSelf and modified the block to call [weakSelf sendLog], I repeated the above steps. There were no more lingering objects. I then removed the “Malloc stack” diagnostics once I confirmed there were no more strong reference cycles.
type: AcceptedAnswer
type: Answer

retain-cycle
tag name: retain-cycle
tags question: http://stackoverflow.com/q/77918816
type: Tag

http://stackoverflow.com/a/79129856
answers question: http://stackoverflow.com/q/77790334
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/77790334
score: 0
has body: After submitting an issue to Apple Developer Technical Support (DTS), I believe the problem has been resolved. I just tested with AirPods and it is now correctly returning 0, 1 for microphone usage.

http://stackoverflow.com/comment/137133136
type: QuestionComment
score: 0
has text: @dalton_c Thanks for your support. I forgot to set class public in target membership
type: Comment
comment on: http://stackoverflow.com/q/77787569

http://stackoverflow.com/comment/137405953
has text: Clean/Remove derived data? When converting code, there is sometimes some old cache for the compiler...
type: Comment
comment on: http://stackoverflow.com/q/77941248
score: 0
type: QuestionComment

http://stackoverflow.com/comment/137384809
comment on: http://stackoverflow.com/q/77916083
type: QuestionComment
score: 0
has text: @CarlLindberg Seems reasonable that NSOpenPanel should have its own listener that does that and wholly unreasonable for every app that every developer writes be responsible for it.
type: Comment

http://stackoverflow.com/q/77950769
has comment: http://stackoverflow.com/comment/137423292
has comment: http://stackoverflow.com/comment/137423411
has comment: http://stackoverflow.com/comment/137423366
tagged with: objective-c
has comment: http://stackoverflow.com/comment/137423103
score: 0
has comment: http://stackoverflow.com/comment/137423216
has title: Why are my NSWorkspace notification and listeners not being recieved or firing?
type: Question
has comment: http://stackoverflow.com/comment/137423381
tagged with: swiftui
has comment: http://stackoverflow.com/comment/137423257
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/137423194
has body: I recieve no errors, my app runs with no errors. None of the events are triggered at sleep / wake or when the listened are registered. What am I doing wrong here? Thanks! import SwiftUI @main struct NotificationsApp: App { var body: some Scene { WindowGroup { ContentView() } } class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { NSWorkspace.shared.notificationCenter.addObserver(self, selector: Selector(("sleepListener")), name: NSWorkspace.willSleepNotification, object: nil) NSWorkspace.shared.notificationCenter.addObserver(self, selector: Selector(("wakeUpListener")), name: NSWorkspace.didWakeNotification, object: nil) } @objc private func sleepListener(_ aNotification: Notification) { print("listening to sleep") if aNotification.name == NSWorkspace.willSleepNotification { print("Going to sleep") } else if aNotification.name == NSWorkspace.didWakeNotification { print("Woke up") } else { print("Some other event other than the first two") } } } } func sleepListener() { print("Sleep Listening"); } func wakeUpListener() { print("Wake Up Listening"); }
tagged with: macos
has comment: http://stackoverflow.com/comment/137423184

http://stackoverflow.com/q/77809737
answer count: 2
has comment: http://stackoverflow.com/comment/137236593
has title: ivar of Swift Actor in objc code: atomic or nonatomic?
type: Question
accepted answer: http://stackoverflow.com/a/77812848
has body: If I have a swift Actor... @objc public actor SomeActor: NSObject, SomeProtocol { ... } ...and I want to use it as an ivar in objc code, does it need to be listed as atomic to retain it's thread safety, or is it more performant to call it nonatomic? Also, do I need to be referencing it with a getter to preserve its thread safety, or can I call it directly? #import &lt;ThisProject/ThisProject-Swift.h&gt; @interface SomeClass () &lt;SomeId&gt; @property (strong, atomic, readwrite) SomeActor *someActor; @end ... [SomeOtherClass someMethod:someActor]; vs @interface SomeClass () &lt;SomeId&gt; @property (strong, nonatomic, readwrite) SomeActor *someActor; @end ... [SomeOtherClass someMethod:_someActor];
tagged with: objective-c
has answer: http://stackoverflow.com/a/77810175
tagged with: actor
possible better answer: http://stackoverflow.com/a/77810175
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/77812848
score: 2
tagged with: bridge
tagged with: swift
downvote count: 0
has comment: http://stackoverflow.com/comment/137172987
has comment: http://stackoverflow.com/comment/137177968
upvote count: 2

http://stackoverflow.com/comment/140236149
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77925270
has text: same issue with me

http://stackoverflow.com/comment/137315628
has text: @Willeke no it isnt the same!
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77889698
type: Comment

http://stackoverflow.com/comment/137423194
comment on: http://stackoverflow.com/q/77950769
score: 0
type: QuestionComment
has text: Ah -- sorry about the `NS` vs `UI` mixup. I suggest you use a more modern Combine or async/await approach and avoid the old `objc` code and `Selector`s -- then, the compiler can help you out of those issues
type: Comment

http://stackoverflow.com/comment/137364651
has text: @Willeke It's still useful to know if it works in a more complete app. I plan to add it to a java swing app to replace the crappy choices for file open dialogs. Before I do that, I was thinking it would be good to know if I could make NSOpenPanel behave better than the current choices. Sounds like I should proceed and hope for the best.
type: QuestionComment
comment on: http://stackoverflow.com/q/77916083
score: 0
type: Comment

http://stackoverflow.com/comment/137177968
score: 1
type: Comment
comment on: http://stackoverflow.com/q/77809737
type: QuestionComment
has text: Hmm. This has not been my experience. The actor isolation has always worked fine for me when called from Objective-C. If you have a chance, I’d love to see MRE where actor-isolation is not honored. IMHO, the only major annoyance that you cannot expose non-`async` isolated methods via `@objc` (as discussed in the [SE-0297](https://github.com/apple/swift-evolution/blob/main/proposals/0297-concurrency-objc.md#actor-classes)).

http://stackoverflow.com/a/77911426
has comment: http://stackoverflow.com/comment/137361392
has comment: http://stackoverflow.com/comment/137498118
upvote count: 5
type: Answer
has body: Congratulations on finding what I consider to be one of the more obscure Apple audio playback APIs! As MeLean correctly pointed out, your sample timestamps were not progressing (you do need them). In addition to that the AudioStreamBasicDescription was wrong and you didn't provide a mapping to the synchronizer between your timestamps' timeline and the hosttime timeline. The fixed ASBD: // In uncompressed audio, a Packet is one frame, (mFramesPerPacket == 1). // LPCM stream description AudioStreamBasicDescription asbd = { .mFormatID = kAudioFormatLinearPCM, .mFormatFlags = kLinearPCMFormatFlagIsSignedInteger, .mBytesPerPacket = sizeof(short) * channelCount, .mFramesPerPacket = 1, .mBytesPerFrame = sizeof(short) * channelCount, .mChannelsPerFrame = channelCount, // 2 .mBitsPerChannel = 16, .mSampleRate = sampleRate, // 48000 .mReserved = 0 }; One possible timeline mapping (a.k.a play it ASAP, consequences be damned): [renderSynchronizer setRate:1.0 time:kCMTimeZero atHostTime:CMClockGetTime(CMClockGetHostTimeClock())]; Timestamps that progress: // with your other variables uint64_t samplesEnqueued = 0; // ... // data block converted into a sample buffer CMSampleBufferRef sampleBuffer; status = CMAudioSampleBufferCreateReadyWithPacketDescriptions(kCFAllocatorDefault, blockBuffer, audioFormatDesc, numSamples, CMTimeMake(samplesEnqueued, sampleRate), NULL, &amp;sampleBuffer); samplesEnqueued += numSamples; // queueing sample buffer onto audio renderer [audioRenderer enqueueSampleBuffer:sampleBuffer]; // ... You have your own requirements for when you provide data the the renderer, but the code snippet in the API header file instead calls you. You can probably ignore this: [audioRenderer requestMediaDataWhenReadyOnQueue:dispatch_get_main_queue() usingBlock:^{ AudioDecodeAndPlaySample(sampleData, sampleLength); // get more sampleData }]; p.s. your use of SDL_malloc suggests you might be using this code in a game. Last time I used AVSampleBufferAudioRenderer IIRC its latenc…
has comment: http://stackoverflow.com/comment/137393614
score: 5
downvote count: 0
answers question: http://stackoverflow.com/q/77877558
has comment: http://stackoverflow.com/comment/137365849
has comment: http://stackoverflow.com/comment/137361369
has comment: http://stackoverflow.com/comment/137514305

http://stackoverflow.com/comment/137406186
type: QuestionComment
has text: It looks like the particular issue in your screen cap is caused by you defining a local variable that shadows the property `mapViewModel`.
type: Comment
comment on: http://stackoverflow.com/q/77941248
score: 0

http://stackoverflow.com/a/77916210
score: 1
has comment: http://stackoverflow.com/comment/137363815
type: Answer
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/77915637
has body: It's unclear what you're trying to do, and you have not supplied sufficient code even to generate the interface you've pictured, let alone to discover what the issue may be. However, the simplest thing is probably to transform the shape layer, not the path. The following code draws a non-symmetric shape in the center of the screen, and then flips it horizontally and enlarges it, operating round its center, so that it still in the center of the screen: let shape = CAShapeLayer() shape.frame = CGRect(x: 0, y: 0, width: 100, height: 100) let path = UIBezierPath() path.move(to: .zero) path.addLine(to: .init(x: 0, y: 100)) path.addLine(to: .init(x: 100, y: 100)) shape.path = path.cgPath self.view.layer.addSublayer(shape) shape.frame.origin = CGPoint( x: view.bounds.width / 2 - 50, y: view.bounds.height / 2 - 50 ) let newsize = 1.5 DispatchQueue.main.asyncAfter(deadline: .now() + 3) { shape.transform = CATransform3DMakeScale(-newsize, newsize, 0) } If you insist upon transforming the path, then the transform takes place around the origin (the top left), so you would need to move the center of the path to the origin, perform the scale transform, then move the center of the path back to the center. let shape = CAShapeLayer() shape.frame = CGRect(x: 0, y: 0, width: 100, height: 100) let path = UIBezierPath() path.move(to: .zero) path.addLine(to: .init(x: 0, y: 100)) path.addLine(to: .init(x: 100, y: 100)) shape.path = path.cgPath self.view.layer.addSublayer(shape) shape.frame.origin = CGPoint( x: view.bounds.width / 2 - 50, y: view.bounds.height / 2 - 50 ) let newsize = 1.5 DispatchQueue.main.asyncAfter(deadline: .now() + 3) { path.apply(CGAffineTransform(translationX: -50, y: -50)) path.apply(CGAffineTransform(scaleX: -newsize, y: newsize)) path.apply(CGAffineTransform(translationX: 50, y: 50)) shape.path = path.cgPath }

http://stackoverflow.com/comment/137423103
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77950769
has text: Does it work if you add `@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate` too your `App` struct?
score: 0

http://stackoverflow.com/comment/137255022
score: 0
type: QuestionComment
has text: Does this answer your question? [Is Php session data secure?](https://stackoverflow.com/questions/36496229/is-php-session-data-secure)
type: Comment
comment on: http://stackoverflow.com/q/77855536

http://stackoverflow.com/comment/137364594
type: QuestionComment
comment on: http://stackoverflow.com/q/77916083
type: Comment
score: 0
has text: I'm sorry, I tried the first piece of code and I assumed the open panel was used in an app, like MacVim.

http://stackoverflow.com/comment/137154321
has text: I tested on a macOS app and got `-1 (-1) ((-1)) -1 -> -1)` in Xcode 14.3 and `-1 (-1) ((-1,0000)) -1 -> -1)`in Xcode 15
comment on: http://stackoverflow.com/q/77798833
type: QuestionComment
score: 0
type: Comment

nslog
tags question: http://stackoverflow.com/q/77798833
type: Tag
tag name: nslog
tags question: http://stackoverflow.com/q/78356910
tags question: http://stackoverflow.com/q/78366079

http://stackoverflow.com/comment/137514305
has text: Another opus player!? You're not the OP?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77911426

http://stackoverflow.com/q/77918816
has answer: http://stackoverflow.com/a/77922643
type: AnsweredQuestion
tagged with: retain-cycle
accepted answer: http://stackoverflow.com/a/77922643
has body: I got a timer for uploading logs,here is the code: - (void)setupTimer { if (_timerForRecording) { dispatch_source_cancel(_timerForRecording); _timerForRecording = NULL; } _timerForRecording = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, _safeTransactionQueue); if (_timerForRecording) { dispatch_source_set_timer(_timerForRecording, dispatch_time(DISPATCH_TIME_NOW, 4.5 * NSEC_PER_SEC), 4.5 * NSEC_PER_SEC, 0.5 * NSEC_PER_SEC); dispatch_source_set_event_handler(_timerForRecording, ^{ [self sendLog]; }); dispatch_resume(_timerForRecording); } } seems like using self won't cause retain cycle, should I use weakSelf instead?
tagged with: objective-c
upvote count: 1
downvote count: 0
answer count: 1
score: 1
favorite count: 0
tagged with: grand-central-dispatch
type: Question
has title: if self in dispatch_source_set_event_handler need to be weak
tagged with: strong-reference-cycle

http://stackoverflow.com/comment/137149140
score: 0
has text: I know what it requires. I'm asking you what's in your code, because you have these funny defines.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77789462

http://stackoverflow.com/comment/137408087
score: 0
type: QuestionComment
has text: @Larme I've removed derived data / cleaned and rebuilt the project many times already
type: Comment
comment on: http://stackoverflow.com/q/77941248

http://stackoverflow.com/a/77963941
has body: Matt's response pushed me in the right direction and this is ultimately how I was able to solve the problem: CGAffineTransform transform = CGAffineTransformMakeScale(newSize.width / initialSize.width, newSize.height / initialSize.height); if (flipped) { transform = CGAffineTransformTranslate(transform, 0, initialSize.height / 2.0); transform = CGAffineTransformScale(transform, 1, -1); transform = CGAffineTransformTranslate(transform, 0, -initialSize.height / 2.0); }
score: 0
accepted answer of: http://stackoverflow.com/q/77915637
answers question: http://stackoverflow.com/q/77915637
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/137258281
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77790334
has text: Thank you for help. I should submit a ticket to DTS.
score: 0

bridge
type: Tag
tag name: bridge
tags question: http://stackoverflow.com/q/77809737

http://stackoverflow.com/comment/137421515
type: QuestionComment
comment on: http://stackoverflow.com/q/77916083
type: Comment
score: 0
has text: You could try creating a NSMenu with that item (or more) and assign it to the NSApp.mainMenu property, to see if that works in your situation. Probably a good idea to have cut/copy/paste too.

http://stackoverflow.com/q/77925270
type: Question
type: UnansweredQuestion
tagged with: swift
has body: I am developing an app for ios and have integrated WebRTC to make video calls. For outgoing call it's fine, all works fine. But when I want to receive a video call, while setting a local description, didGenerate delegate doesn't return me a ICE candidate for video call (candidate.sdpMid property should be 1) it returns me only ICE candidates for audio where candidate.spdMid is 0. Here is the steps what I am doing: Upon receiving an incoming video call I am handling remoteSdp (a have all parameters with m=video), creating RTCSessionDescription with Offer After I am preparing media (adding video tracks to peerConnection) Setting remote description to peerConnection and in it's callback I am creating answerForConstraints where OfferToReceiveVideo and OfferToReceiveAudio are true. in answerForConstraints's callback I am setting localSdp from callback via setLocalDescription. Then Webrtc is generating ICE candidates and there is no candidates for video. usually ICE candidate should contain in property candidate.sdpMid = 1 for video, but I am getting candidate.sdpMid = 0 (only for audio). UPDATE: This is Remote SDP from server that I am receiving upon incoming video call: v=0 o=- 1707110628 1707110628 IN IP4 37.112.129.29 s=- c=IN IP4 37.112.129.29 t=0 0 a=msid-semantic:WMS AF60F46C a=extmap-allow-mixed a=group:BUNDLE 0 1 m=audio 11260 UDP/TLS/RTP/SAVP 120 101 c=IN IP4 37.112.129.29 a=rtpmap:120 opus/48000/2 a=fmtp:120 maxaveragebitrate=40000;stereo=1;useinbandfec=1 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=fingerprint:SHA-256 D6:D2:83:38:B0:55:47:0F:D4:C8:9F:A9:5E:43:C8:2C:3F:BF:35:4F:33:F7:F4:4B:BC:61:AC:9E:F6:A1:BD:9F a=setup:actpass a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid a=mid:0 a=ice-ufrag:zjnyg58k a=ice-pwd:5hvz1eniu8kx8j8gxxefx1 a=candidate:…
has comment: http://stackoverflow.com/comment/140236149
has comment: http://stackoverflow.com/comment/137380825
has answer: http://stackoverflow.com/a/77926814
score: -1
downvote count: 1
answer count: 1
tagged with: objective-c
has title: WebRTC doesn't generate ICE candidates for video in incoming video call for iOS
upvote count: 0
tagged with: webrtc
favorite count: 0
tagged with: ios

http://stackoverflow.com/q/77811774
type: UnansweredQuestion
tagged with: google-ads-api
has comment: http://stackoverflow.com/comment/137212010
answer count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/137199175
has comment: http://stackoverflow.com/comment/137199219
tagged with: objective-c
has body: I am getting this error and my code is below - (void)viewWillAppear:(BOOL)animated { NSLog(@"self.inter eve reload cl %@", self.interstitial); DebugAssert(index != NSNotFound); double delayInSeconds = 5.0; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); if (!didPurchaseAds) { dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ NSLog(@"Interstitial ad loaded %ld", (long)index); if ((index % 2 == 0)) { NSLog(@"Interstitial ad loaded for even num %ld", (long)index); if (self.interstitial) { NSLog(@"Show InterstitialAd %@", self.interstitial); [self.interstitial presentFromRootViewController:self]; [self.interstitial presentFromRootViewController:self]; } else { NSLog(@"Ad wasn't ready event"); } } }); } } - (void)viewDidLoad{ [super viewDidLoad]; [self loadInterstitial]; } - (void)loadInterstitial { GADRequest *request = [GADRequest request]; [GADInterstitialAd loadWithAdUnitID:@"ca-app-pub-3940256099942544/4411468910" request:request completionHandler:^(GADInterstitialAd *ad, NSError *error) { if (error) { NSLog(@"Failed to load interstitial ad with error: %@", [error localizedDescription]); return; } self.interstitial = ad; self.interstitial.fullScreenContentDelegate = self; }]; } - (void)ad:(nonnull id<GADFullScreenPresentingAd>)ad didFailToPresentFullScreenContentWithError:(nonnull NSError *)error { NSLog(@"Ad did fail to present full screen content."); } /// Tells the delegate that the ad will present full screen content. - (void)adWillPresentFullScreenContent:(nonnull id<GADFullScreenPresentingAd>)ad { NSLog(@"Ad will present full screen content."); } /// Tells the delegate that the ad dismissed full screen content. - (void)adDidDismissFullScreenContent:(nonnull id<GADFullScreenPresentingAd>)ad { NSLog(@"Ad did dismiss full screen content."); }
score: 0
has comment: http://stackoverflow.com/comment/137188870
type: Question
has title: Ad did fail to present full screen content while showing Interstitial Google ads shows the error for me in iOS objective -C

http://stackoverflow.com/q/77894366
tagged with: objective-c
tagged with: cocoa
has body: I am trying to cut off my window from the screenshot on macOS. It is working perfectly fine. But when I am trying to get its value, which I was setting for sharingType (NSWindowSharingNone or NSWindowSharingReadOnly), I am getting 0 (NSWindowSharingNone) all the time after the second iteration. Here is the code that I have: @interface ViewController () { BOOL sharedState; } @property (strong) NSWindow* childWindow; @property (strong) NSTimer* timer; @end - (void)viewDidLoad { [super viewDidLoad]; [self createWindowAction: nil]; sharedState = YES; // Do any additional setup after loading the view. [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(triggerAction:) name: @"NotificationMessageEvent" object: nil]; self.timer = [NSTimer scheduledTimerWithTimeInterval: 4.0f repeats: YES block:^(NSTimer * _Nonnull timer) { self->sharedState = !self->sharedState; NSLog( @"Before sharing type was: %lu", (unsigned long)[self.childWindow sharingType] ); NSWindowSharingType updatedType = self->sharedState ? NSWindowSharingNone : NSWindowSharingReadOnly; NSLog( @"Updating sharing type to: %lu", (unsigned long)updatedType ); [self.childWindow setSharingType: updatedType]; NSLog( @"After sharing type was: %lu", (unsigned long)[self.childWindow sharingType] ); NSLog(@""); }]; } -(void) dealloc { [self.timer invalidate]; self.timer = nil; } - (IBAction)createWindowAction:(NSButton *)sender { NSLog(@"createWindowAction"); if (!self.childWindow) { self.childWindow = [[NSWindow alloc] initWithContentRect: CGRectMake( 100.0f, 150.0f, 500.0f, 400.0f ) styleMask: NSWindowStyleMaskBorderless | NSWindowStyleMaskNonactivatingPanel backing: NSBackingStoreBuffered defer: NO]; self.childWindow.collectionBehavior = NSWindowCollectionBehaviorMoveToActiveSpace | NSWindowCollectionBehaviorTransient | NSWindowCollectionBehaviorAuxiliary | NSWindowCollectionBehaviorParticipatesInCycle; self.childWindow.hasShadow = NO; self.childWindow.accessibilityElement = YES; [self.childWin…
favorite count: 0
has title: sharingType property for NSWindow works but property value is not updated correctly
score: 2
type: Question
downvote count: 0
tagged with: nswindow
type: UnansweredQuestion
answer count: 0
upvote count: 2

http://stackoverflow.com/comment/137216530
type: QuestionComment
type: Comment
has text: This might be a good question for DTS
comment on: http://stackoverflow.com/q/77790334
score: 0

http://stackoverflow.com/comment/137364051
score: 0
type: QuestionComment
type: Comment
has text: @Willeke When the MCV example runs, there is no Apple menu for which to control. There are many questions to ask regarding your inability to repro the problem.
comment on: http://stackoverflow.com/q/77916083

http://stackoverflow.com/q/77896763
has comment: http://stackoverflow.com/comment/137339971
tagged with: game-center
linked to: http://stackoverflow.com/q/70586616
tagged with: objective-c
tagged with: ios
score: 0
type: Question
has comment: http://stackoverflow.com/comment/137334529
type: UnansweredQuestion
has body: I'm trying to establish a connection between two devices using mobile network. The config in both devices are ok allowing use mobile data for the app. I'm able to connect and start the game with WIFI networ `// Initiate matchmaking - (void)initiateMatchmakingWithViewController:(UIViewController*)rustViewController { dispatch_async(dispatch_get_main_queue(), ^{ if (![GKLocalPlayer localPlayer].isAuthenticated) { NSLog(@"Player is not authenticated."); return; } NSLog(@"Preparing MatchMaker"); GKMatchRequest *request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 2; GKMatchmakerViewController *mmvc = [[GKMatchmakerViewController alloc] initWithMatchRequest:request]; mmvc.matchmakerDelegate = self; // Use the passed view controller to present the matchmaking UI [rustViewController presentViewController:mmvc animated:YES completion:nil]; NSLog(@"MatchMaker running...."); // Store the rustViewController for later, to revert back to it originalViewController = rustViewController; }); } // GKMatchmakerViewControllerDelegate methods - (void)matchmakerViewControllerWasCancelled:(GKMatchmakerViewController *)viewController { [originalViewController dismissViewControllerAnimated:YES completion:nil]; NSLog(@"Matchmaking was cancelled."); } - (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFailWithError:(NSError *)error { [originalViewController dismissViewControllerAnimated:YES completion:nil]; NSLog(@"Matchmaking failed with error: %@", error.localizedDescription); } - (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFindMatch:(GKMatch *)match { [originalViewController dismissViewControllerAnimated:YES completion:nil]; self.currentMatch = match; match.delegate = self; NSLog(@"Match found."); // Fetch details for each player in the match NSMutableArray<NSString *> *playerIDs = [NSMutableArray array]; for (GKPlayer *player in match.players) { [playerIDs addObject:player.playerID]; } [GKPl…
answer count: 0
has title: Matchmaker connecting issues on Mobile network

http://stackoverflow.com/q/77838327
type: UnansweredQuestion
has body: I was trying to change the minimum deployment from iOS 13 to iOS 14 of my app, however Xcode throws these error: ld: unaligned pointer(s) for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Once switch back to iOS 13, my app can build and run smoothly. As far as I know, the minimum deployment of this SDK is iOS 11.0, and it's a static .a file, not xcframework I used to see, is there any approach that can embed this SDK into Swift projects that above iOS 13, without changing the code of SDK, just modify it's setting?
has comment: http://stackoverflow.com/comment/137224092
answer count: 0
has title: Why does iOS 11 SDK written in objc unable to build on iOS14 swift project , but iOS13 does?
tagged with: ios
tagged with: sdk
tagged with: objective-c
type: Question
has comment: http://stackoverflow.com/comment/137236286
has comment: http://stackoverflow.com/comment/137257544
score: 0
tagged with: swift

http://stackoverflow.com/comment/137135810
type: Comment
has text: You may want to read up on a similar (inspirational?) issue in OpenGL land: [std140 vs std430 layout](https://www.khronos.org/opengl/wiki/Interface_Block_(GLSL))
comment on: http://stackoverflow.com/q/77789337
type: QuestionComment
score: 0

http://stackoverflow.com/comment/137365849
type: AnswerComment
comment on: http://stackoverflow.com/a/77911426
type: Comment
score: 0
has text: If you know that N frames were skipped due to silence, then you need to do `samplesEnqueued += N`. In retrospect that variable should probably be called `nextPresentationTimeStamp`. If you suspect timing, try adding some, uh, latency to the start hosttime, e.g. 1 second `CMTimeAdd(CMClockGetTime(CMClockGetHostTimeClock()), CMTimeMake(1, 1))` For SpatialAudio I think you need to look at the PHASE framework.

http://stackoverflow.com/q/77873161
has comment: http://stackoverflow.com/comment/137291978
has title: Using RNCryptor to decrypt data throws "Decryption error: unknownHeader"
type: Question
tagged with: swift
tagged with: encode
has comment: http://stackoverflow.com/comment/137340304
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/137298301
has body: I have used RNCryptor in my objective-c project to encrypt and decrypt a plist data file. Now I am recreating the project in Swift. When I try to decrypt the plist data in swift project which was created in objective-c project, it always throw "Decryption error: unknownHeader". I am using the same app identifier so that I can access the same plist file which was stored in App's Document's directory. Could someone advise what I am doing wrong? Here is my code: Objective C - Encrypting and Saving to directory: - (void)savePasswordlistItems { NSMutableData *data = [[NSMutableData alloc] init]; NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]; [archiver encodeObject:items forKey:@"MyKey"]; [archiver finishEncoding]; NSError *error; NSData *encryptedData = [RNEncryptor encryptData:data withSettings:kRNCryptorAES256Settings password:MY_SECRET_KEY error:&error]; [encryptedData writeToFile:[self dataFilePath] atomically:YES]; } Objective C - Decrypting, decoding, adding to NSmutableArray: - (void)loadPasswordlistItems { if ([[NSFileManager defaultManager] fileExistsAtPath:path]) { NSData *data = [[NSData alloc] initWithContentsOfFile:path]; NSError *error; NSData *decryptedData = [RNDecryptor decryptData:data withPassword:MY_SECRET_KEY error:&error]; NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData: decryptedData]; items = [unarchiver decodeObjectForKey:@"MyKey"]; [unarchiver finishDecoding]; } else { items = [[NSMutableArray alloc] initWithCapacity:20]; } } Swift - Decrypting, decoding and adding to NSMutableArray: func loadPasswordlistItems() { let path = dataFilePath() if FileManager.default.fileExists(atPath: path) { do { let data = try Data(contentsOf: URL(fileURLWithPath: path)) do { let decryptedData = try RNCryptor.decrypt(data: data, withPassword: Constants.MY_SECRET_KEY) let unarchiver = try NSKeyedUnarchiver(forReadingFrom: decryptedData) items = (unarchiver.decodeObject(forKey: "MyKey") as!…
has comment: http://stackoverflow.com/comment/137333481
tagged with: rncryptor
tagged with: objective-c
has comment: http://stackoverflow.com/comment/137334817
has comment: http://stackoverflow.com/comment/137290529
tagged with: decode
score: 0

actor
type: Tag
tags question: http://stackoverflow.com/q/77809737
tag name: actor

http://stackoverflow.com/comment/137284917
has text: Thats just great. Thanks!
comment on: http://stackoverflow.com/a/77872925
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/77877558
has answer: http://stackoverflow.com/a/77895727
has body: Edit: Updated code based on suggestions, fixing the ASBD and making another attempt at getting PTS right. It still doesn't play any audio, but there are no errors anymore at least. I'm working on an iOS project where I'm receiving packets of Opus audio data and attempting to play them using AVSampleBufferAudioRenderer. Right now I'm using Opus's own decoder, so ultimately I just need to get the decoded PCM packets to play. The whole process from top to bottom isn't suuuper well documented, but I think I'm getting close. Here's the code I'm working with so far (edited down, and with some hardcoded values for simplicity). static AVSampleBufferAudioRenderer* audioRenderer; static AVSampleBufferRenderSynchronizer* renderSynchronizer; int samplesPerFrame = 240; int channelCount = 2; int sampleRate = 48000; int streams = 1; int coupledStreams = 1; char mapping[8] = ['\0','\x01','\0','\0','\0','\0','\0','\0']; CMTime startPTS; // called when the stream is about to start void AudioInit() { renderSynchronizer = [[AVSampleBufferRenderSynchronizer alloc] init]; audioRenderer = [[AVSampleBufferAudioRenderer alloc] init]; [renderSynchronizer addRenderer:audioRenderer]; int decodedPacketSize = samplesPerFrame * sizeof(short) * channelCount; // 240 samples per frame * 2 channels decodedPacketBuffer = SDL_malloc(decodedPacketSize); int err; opusDecoder = opus_multistream_decoder_create(sampleRate, // 48000 channelCount, // 2 streams, // 1 coupledStreams, // 1 mapping, &amp;err); [renderSynchronizer setRate:1.0 time:kCMTimeZero atHostTime:CMClockGetTime(CMClockGetHostTimeClock())]; startPTS = CMClockGetTime(CMClockGetHostTimeClock()); } // called every X milliseconds with a new packet of audio data to play, IF there's audio. (while testing, X = 5) void AudioDecodeAndPlaySample(char* sampleData, int sampleLength) { // decode the packet from Opus to (I think??) Linear PCM int numSamples; numSamples = opus_multistream_decode(opusDecoder, (unsigned char *)sampleData, sampleLength, (shor…
upvote count: 5
has comment: http://stackoverflow.com/comment/137393629
favorite count: 0
tagged with: ios
has title: Using AVSampleBufferAudioRenderer to play packets of streamed PCM audio (decoded from Opus)
has comment: http://stackoverflow.com/comment/137383425
type: Question
tagged with: core-audio
tagged with: objective-c
type: UnansweredQuestion
tagged with: avfoundation
downvote count: 0
has answer: http://stackoverflow.com/a/77911426
answer count: 2
tagged with: audiotoolbox
score: 5

http://stackoverflow.com/comment/137228207
type: Comment
comment on: http://stackoverflow.com/q/77790334
score: 0
type: QuestionComment
has text: DTS is Apple Developer Technical Support. https://developer.apple.com/support/technical/

http://stackoverflow.com/comment/137423366
comment on: http://stackoverflow.com/q/77950769
type: Comment
score: 0
has text: When I try that I get: `Type 'NotificationCenter' has no member 'shared'`
type: QuestionComment

http://stackoverflow.com/comment/137199219
score: 0
has text: There are twice `[self.interstitial presentFromRootViewController:self];`, why? I guess the second one causes the error message...
type: QuestionComment
comment on: http://stackoverflow.com/q/77811774
type: Comment

http://stackoverflow.com/comment/137334817
score: 0
type: QuestionComment
has text: That make it sound like the `unknownHeader` is coming from the `NSKeyedUnarchiver(forReadingFrom:)` rather than from `RNCryptor.decrypt`. Is that possible?
comment on: http://stackoverflow.com/q/77873161
type: Comment

http://stackoverflow.com/a/79316671
downvote count: 1
upvote count: 0
has comment: http://stackoverflow.com/comment/139867195
has body: In this instance, you'll want to convert the NSValue to CMVideoDimensions using its getValue method. for (NSValue *obj in device.activeFormat.supportedMaxPhotoDimensions) { CMVideoDimensions vd; [obj getValue:&vd]; NSString *s = [NSString stringWithFormat:@"res=%d:%d", vd.width, vd.height]; //print that string }
answers question: http://stackoverflow.com/q/77961306
type: Answer
score: -1

http://stackoverflow.com/comment/137164057
score: 0
comment on: http://stackoverflow.com/q/77804229
has text: There is also the case where the text could be long enough to not fit the dashboard even if it is right-aligned. What do you want to happen in that case? Right-align the text anyway? Or not aligning the text and prioritise making the text visible?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/137154800
score: 0
has text: @Spo1ler You also provider all necessary functions to work with it that accepts that pointer. For example many functions in corefoundation using that approach.
comment on: http://stackoverflow.com/a/77791661
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137172987
type: QuestionComment
comment on: http://stackoverflow.com/q/77809737
has text: IMO (from experience) once you have to deal with objc, you can forget all the promises the swift concurrency gives you (including actor isolation) - it's just a class for objc. So how you handle that class very much depends on context.
type: Comment
score: 2

http://stackoverflow.com/q/77915637
tagged with: core-graphics
tagged with: objective-c
tagged with: cgaffinetransform
upvote count: 0
has answer: http://stackoverflow.com/a/77916210
accepted answer: http://stackoverflow.com/a/77963941
favorite count: 0
has comment: http://stackoverflow.com/comment/137361742
type: Question
has body: For the following lightning bolt graphic: I'm trying to flip it while scaling like such: CGAffineTransform transform = CGAffineTransformMakeScale(newSize.width / initialSize.width, -1 * (newSize.height / initialSize.height)); CGMutablePathRef mutablePath = CGPathCreateMutableCopyByTransformingPath(shapeLayer.path, &amp;transform); shapeLayer.path = mutablePath; CGPathRelease(mutablePath); This is what happens: I've tried a bunch of different ways to translate it but to no success: CGAffineTransform transform = CGAffineTransformMakeTranslation(newSize.width / 2, newSize.height / 2); transform = CGAffineTransformScale(transform, newSize.width / initialSize.width, -1 * (newSize.height / initialSize.height)); transform = CGAffineTransformTranslate(transform, -newSize.width / 2, -newSize.height / 2); Does anyone know the correct way to get my graphic back into the bounding box of the view?
has answer: http://stackoverflow.com/a/77963941
has comment: http://stackoverflow.com/comment/137361732
answer count: 2
score: -1
possible better answer: http://stackoverflow.com/a/77916210
has title: How to correctly position graphic after flipping it
tagged with: ios
downvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/137146887
comment on: http://stackoverflow.com/a/77789462
has text: What's the alignment of `vector_float2` and `vec2`?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137317981
has text: @HangarRash iOS
type: Comment
comment on: http://stackoverflow.com/q/77889698
score: 0
type: QuestionComment

http://stackoverflow.com/comment/137389692
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/77916083
has text: `NSOpenPanel` is designed to be used in an app and doesn't support Select All. `selectAll:` is implemented by `NSBrowser`, `NSOutlineView` and `NSCollectionView`. Try Command-Z, X, C and V in the search field.

http://stackoverflow.com/comment/137361732
type: Comment
comment on: http://stackoverflow.com/q/77915637
type: QuestionComment
score: 0
has text: Flipping is one thing, resizing is another. Which do you want to do?

http://stackoverflow.com/comment/137185746
type: AnswerComment
type: Comment
score: 0
has text: Both answers were great, but this was especially clarifying. I was actually trying to ask question 3 on here too, but was probably not clear enough. Thanks!
comment on: http://stackoverflow.com/a/77812848

constraints
tags question: http://stackoverflow.com/q/77804229
tag name: constraints
type: Tag

http://stackoverflow.com/comment/137184105
type: Comment
comment on: http://stackoverflow.com/q/77798833
has text: Did you try with %ld or %lld ?
type: QuestionComment
score: 0

http://stackoverflow.com/comment/137409968
type: QuestionComment
type: Comment
score: 0
has text: @CarlLindberg Sounds like there's a design conflict in my head. In my head, I would want NSOpenPanel to always respect ⌘A while others think it should be allowed to behave differently depending upon the application. I think that's crazy.
comment on: http://stackoverflow.com/q/77916083

http://stackoverflow.com/a/77869913
score: 1
accepted answer of: http://stackoverflow.com/q/77869520
has body: CocoaPods enforces pods being pure libraries. They need to be buildable without any knowledge of their clients. You could declare the variable without extern in the CocoaPod and set its value in the client.
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/77869520
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/137132674
comment on: http://stackoverflow.com/q/77787569
type: QuestionComment
type: Comment
score: 0
has text: @dalton_c I have tried adding #import <FingerprintScanSDK/FingerprintSDKWrapper.h> but I am getting an error "'FingerprintScanSDK/FingerprintSDKWrapper.h' file not found"

php
tags question: http://stackoverflow.com/q/77855536
tag name: php
type: Tag

http://stackoverflow.com/comment/137402277
score: 0
has text: here is the BUNDLE a=group:BUNDLE 0 1 so 0 for audio and 1 for video
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77926814

http://stackoverflow.com/comment/137409188
type: QuestionComment
has text: NSOpenPanel would use NSBrowser internally, I would think, to show the list of files. But something needs to call [NSApplication.sharedApplication sendEvent:@selector(selectAll:) to:nil from:<sender>] when Command-A is pressed (sending to nil should start at the first responder, and eventually find the NSBrowser implementation). Either that or a custom event listener, or set up an NSMenu and get it installed somehow. Or subclass NSOpenPanel and override sendEvent: to look for them.
comment on: http://stackoverflow.com/q/77916083
score: 0
type: Comment

http://stackoverflow.com/comment/137169512
comment on: http://stackoverflow.com/q/77804229
score: 0
type: QuestionComment
has text: You cannot accomplish this with constraints only. *"I don't want to ... I really want to explore some easy way..."* -- a fairly simple subclass would be "the easy way."
type: Comment

http://stackoverflow.com/comment/137340304
score: 0
type: QuestionComment
has text: I also believe that the error is coming from Unarchiver.
type: Comment
comment on: http://stackoverflow.com/q/77873161

http://stackoverflow.com/comment/137391040
type: QuestionComment
score: 0
type: Comment
has text: @Willeke MacVim uses NSOpenPanel. When it raises the open panel, you can select all items in the view. I see nothing in its source that coaxes NSOpenPanel to be fully featured.
comment on: http://stackoverflow.com/q/77916083

rncryptor
type: Tag
tags question: http://stackoverflow.com/q/77873161
tag name: rncryptor

http://stackoverflow.com/comment/137362863
has text: I tried your code and Command-A selects all files and folders. Is there a "Select All" menu item with key equivalent Command-A?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/77916083

http://stackoverflow.com/a/77789668
has body: For starters, you're allocating an instance of StartViewController but you're not initializing it. Second, assuming you have code inside StartViewController you want to add it as a child view controller. Third, never call methods such as viewDidAppear So, really quick example... SomeViewController.h #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface SomeViewController : UIViewController @end NS_ASSUME_NONNULL_END SomeViewController.m #import "SomeViewController.h" #import "StartViewController.h" @interface SomeViewController () @end @implementation SomeViewController - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor systemBlueColor]; StartViewController *vc = [StartViewController new]; [self addChildViewController:vc]; [self.view addSubview:vc.view]; // let's give it a frame so we can see it's been added vc.view.frame = CGRectMake(40, 100, 240, 320); [vc didMoveToParentViewController:self]; } @end StartViewController.h #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface StartViewController : UIViewController @end NS_ASSUME_NONNULL_END StartViewController.m #import "StartViewController.h" @interface StartViewController () @end @implementation StartViewController - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor systemYellowColor]; UILabel *v = [UILabel new]; v.text = @"Start VC"; v.translatesAutoresizingMaskIntoConstraints = NO; [self.view addSubview:v]; [v.centerXAnchor constraintEqualToAnchor:self.view.centerXAnchor].active = YES; [v.centerYAnchor constraintEqualToAnchor:self.view.centerYAnchor].active = YES; } @end Looks like this:
type: Answer
score: 0
answers question: http://stackoverflow.com/q/77788825

http://stackoverflow.com/q/77872847
score: 0
has title: Receive a ObjC constant in Swift
type: Question
tagged with: swift
has body: I like to use an ObjC constant in Swift. IronSource ad network recommends to initialize a banner ad like so: [IronSource loadBannerWithViewController:self size:ISBannerSize_SMART]; I use Swift and translate is like so: IronSource.loadBanner(with: self, size: dont_know) But for parameter ISBannerSize_SMART I don't know what to fill in as nothing works for me. ISBannerSize.ISBannerSize_SMART not working, ISBannerSize_SMART not working... This is how the ObjC source looks like. // // ISBannerSize.h // IronSource #import <Foundation/Foundation.h> static NSString* const kSizeSmart = @"SMART"; #define ISBannerSize_SMART [[ISBannerSize alloc] initWithDescription:kSizeSmart width:0 height:0] @interface ISBannerSize : NSObject
has answer: http://stackoverflow.com/a/77872925
type: AnsweredQuestion
answer count: 1
accepted answer: http://stackoverflow.com/a/77872925
tagged with: objective-c

http://stackoverflow.com/comment/137135741
type: Comment
score: 0
has text: @Botje No The Objective-C compiler pads the internals of each `MyVertex` struct, so that `position` is size 8, then pad 8, and then `color` is 16. I mean I could manually hack it so I the structs align, but that doesn't feel like best practice.
comment on: http://stackoverflow.com/q/77789337
type: QuestionComment

http://stackoverflow.com/a/77803947
score: 1
has comment: http://stackoverflow.com/comment/137204992
type: AcceptedAnswer
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/77798833
downvote count: 0
answers question: http://stackoverflow.com/q/77798833
has body: From Xcode 15 Release Notes: Console New Features By default, Xcode streams os_logs through the unified logging and activity tracing infrastructure. The output may be formatted differently compared to previous versions of Xcode, and its order relative to standard IO may also change. To customize the behavior of logging, edit the Run scheme action to set the environment variable IDELogRedirectionPolicy. The value “oslogToStdio” redirects os_log messages to standard IO and formats them in a style identical to previous versions of Xcode. The value stdioToOSLog redirects standard IO to the os_log messages, and presents them in the debug console with additional metadata. (109380695) Apparently there's a bug in the new logging system. Workaround: Edit Scheme and add environment variable IDELogRedirectionPolicy with value oslogToStdio.

http://stackoverflow.com/comment/137384735
type: Comment
score: 0
has text: I imagine NSOpenPanel implements the selectAll: responder method. But something else has to translate a Command-A keystroke into sending the selectAll: method to the first responder.
type: QuestionComment
comment on: http://stackoverflow.com/q/77916083

http://stackoverflow.com/comment/137254300
has text: Values stored in the PHP session are *not* stored in cookies. You can't access them from the client.
type: QuestionComment
comment on: http://stackoverflow.com/q/77855536
type: Comment
score: 0

http://stackoverflow.com/comment/137236593
comment on: http://stackoverflow.com/q/77809737
has text: Just always use `nonatomic` and properties. Ivars directly should be used only in initializers. For synchronisation use other tools. It's Apple's style: swift is example.
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/137363308
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/77916083
has text: ⌘A doesn't work for me either, just like OP.
score: 0

http://stackoverflow.com/a/77805420
type: Answer
has comment: http://stackoverflow.com/comment/137165314
has comment: http://stackoverflow.com/comment/137166016
answers question: http://stackoverflow.com/q/77799533
score: 0
has body: This is how you can do it in ObjC: [[NSClassFromString(className) alloc] init]; I'm not sure if you can do it from Swift, but Kotlin doesn't have such an option according to this discussion. So the only option I can think of that might work is to create ObjC files that implement this functionality, and then add them to your project using cinterops.

http://stackoverflow.com/comment/137132669
comment on: http://stackoverflow.com/q/77787569
type: Comment
score: 0
has text: Also... > "This is the requirement for some reason" < If I were you, I would try to figure out what this reason is, because it shouldn't be necessary to do what you're doing.
type: QuestionComment

http://stackoverflow.com/comment/137132548
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77787569
has text: Have you added `FingerprintSDKWrapper.h` to your framework's umbrella header?
type: Comment

http://stackoverflow.com/comment/137334529
score: 1
type: Comment
comment on: http://stackoverflow.com/q/77896763
has text: Is there an error message before like there https://stackoverflow.com/questions/70586616/cant-connect-players-in-gamekit-using-gkmatchmaker-shared-findmatch ?
type: QuestionComment

http://stackoverflow.com/comment/137423411
comment on: http://stackoverflow.com/q/77950769
type: QuestionComment
score: 0
type: Comment
has text: Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/256799/discussion-between-ian-and-jnpdx).

http://stackoverflow.com/comment/137393629
type: QuestionComment
has text: @sbooth Not at all, it's just one of a few approaches I want to try. Ultimately my goal is to get this working with airpod spatial audio, and based on other experiments it seems that if you pipe multichannel data into `AVSampleBufferAudioRenderer` it more or less automatically spatializes it for you. I did just recently stumble upon AudioQueue though, I'm curious if that'll do the same thing.
comment on: http://stackoverflow.com/q/77877558
type: Comment
score: 0

http://stackoverflow.com/comment/137199175
type: Comment
has text: Presentation Error: Will not present ad because ad object has been used.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77811774

http://stackoverflow.com/comment/137132820
type: Comment
has text: #import "FingerprintSDKWrapper.h" same issue
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77787569

http://stackoverflow.com/comment/137410177
type: Comment
score: 1
has text: System components simply implement the standard selectAll: responder method. In a normal app, the default Edit NSMenu would exist, which is the class which turns an actual Command-A keystroke into a sendAction: call to NSApplication to invoke selectAll: on the first responder in the responder chain which implements it. It's not the job of every system component to know about key bindings, and keep them consistent. There is even a system preference where users can override default key bindings for themselves across apps. NSMenu handles all that.
type: QuestionComment
comment on: http://stackoverflow.com/q/77916083

http://stackoverflow.com/comment/137380825
comment on: http://stackoverflow.com/q/77925270
type: QuestionComment
has text: Please provide enough code so others can better understand or reproduce the problem.
type: Comment
score: 0

http://stackoverflow.com/q/77855536
has title: How can I read session variables directly in Objective-C for my iOS application?
has comment: http://stackoverflow.com/comment/137255022
type: Question
upvote count: 1
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/36496229
has body: I'm writing an application which needs to be able to log into the Internet. The iOS part of the app is written in Objective-C and the server side is written in PHP. Those PHP functions are called by both the iOS app and the website. The code to retrieve data from the database works fine. I can populate my tables in iOS and I can also add data to the database by calling PHP functions (using NSURLSession and NSURLRequest). But now I want to add functionality to update secure pages (account management), and for this I intended to set cookies for the session. In PHP this doesn't present a problem. I can check that the login was successful and then set (and unset) using the following code: if(session_status() !== PHP_SESSION_ACTIVE) session_start(); if ($_POST['username'] == $username &amp;&amp; password_verify($_POST['passhash'], $passwordhash)) { $_SESSION['loggedin'] = true; $_SESSION['username'] = $username; } else { $_SESSION['loggedin'] = false; $_SESSION['username'] = ''; } I can then check to see if I'm logged in as follows: if(session_status() !== PHP_SESSION_ACTIVE) session_start(); if (isset($_SESSION['username']) &amp;&amp; ($_SESSION['username'] != '') &amp;&amp; isset($_SESSION['loggedin']) &amp;&amp; $_SESSION['loggedin']) { return true; } else { return false; } I could always call these functions from Objective-C (the same way that I populate and retrieve data from my tables), but this seems inefficient. I have an NSURLSession so (I would have thought) it should be possible to see these values directly without calling PHP code on my website. The problem is that I can't quite workout how. NSURLSession doesn't seem be quite right and NSHTTPCookieStorage seems to persist between sessions, which is definitely wrong. My understanding of how this all hooks together is clearly wrong. Can anyone set me straight? If possible, I do want to be able to continue sharing as much code between website and app as possible (so setting the cookies for login for example), bu…
downvote count: 0
has comment: http://stackoverflow.com/comment/137369630
favorite count: 0
answer count: 0
tagged with: php
has comment: http://stackoverflow.com/comment/137254300
tagged with: ios
has comment: http://stackoverflow.com/comment/137254908
tagged with: nsurlsession
tagged with: objective-c
score: 1

http://stackoverflow.com/comment/139867195
has text: `NSValue getValue` has been deprecated for many years. You should use `getValue:size:`. For example: `[obj getValue:&vd size:sizeof(CMVideoDimensions)];`. Even better is to use `CMVideoDimensions dim = obj.CMVideoDimensionsValue;`. Note that this requires importing AVFoundation and iOS 16+.
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/79316671

http://stackoverflow.com/a/79332103
has body: The AVFoundation framework provides a CMVideoDimensionsValue property for NSValue as of iOS 16. Simply change your line: CMVideoDimensions *vd = (__bridge CMVideoDimensions *)obj; to: CMVideoDimensions *vd = obj.CMVideoDimensionsValue; Ensure this .m file imports AVFoundation. If not, you will get a compiler error about an unknown property.
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/77961306
answers question: http://stackoverflow.com/q/77961306
type: Answer

http://stackoverflow.com/comment/137135772
comment on: http://stackoverflow.com/q/77789337
type: Comment
has text: So I align within the struct. And Both Objective-C and C++ will compile the same format if it is specified that way. That seems like a good solution
score: 0
type: QuestionComment

http://stackoverflow.com/comment/137339971
type: Comment
has text: syncPlayers failed to loadPlayersForLegacyIdentifiers
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77896763

http://stackoverflow.com/comment/137132535
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77787569
has text: Look's like you don't need mention `#import "FingerprintSDK/FingerprintSDK.h"` in `FingerprintSDKWrapper`'s header.
type: QuestionComment

http://stackoverflow.com/comment/137221722
comment on: http://stackoverflow.com/q/77790334
score: 0
type: QuestionComment
has text: @sbooth May I ask what DTS stands for and how it is related to the issue? Thank you!
type: Comment

http://stackoverflow.com/comment/137361369
type: AnswerComment
type: Comment
has text: Thank you so much for these details, I feel like I'm getting close. The renderer does seem to accept the ASBD now; I think I was getting confused by the definitions of "frames" and "packets", as they have different definitions at different steps of my pipeline. It still isn't playing audio, and I suspect it's still the PTS. I'm trying to adjust based on the silence => no callback...should it work to do something like `PTS = currentHostTime - initHostTime`? I'm not sure the best way to count missing silence samples with the API I'm using.
comment on: http://stackoverflow.com/a/77911426
score: 0

http://stackoverflow.com/comment/137333481
type: QuestionComment
has text: Somehow it works I add the name of the class used for NSCoding. Before encoding: NSKeyedArchiver.setClassName("Item", for: Item.self) Before decoding: NSKeyedUnarchiver.setClass(Item.self, forClassName: "Item")
comment on: http://stackoverflow.com/q/77873161
type: Comment
score: 0

http://stackoverflow.com/comment/137163968
type: Comment
score: 0
comment on: http://stackoverflow.com/q/77799533
type: QuestionComment
has text: OK, I have edit the example code to explain my goal

google-ads-api
tag name: google-ads-api
type: Tag
tags question: http://stackoverflow.com/q/77811774

http://stackoverflow.com/comment/137291978
comment on: http://stackoverflow.com/q/77873161
type: QuestionComment
score: 0
type: Comment
has text: Thanks @RobNapier for providing such an awesome library. Appreciate your assistance. It decrypts and decodes perfectly in obj-c version. So I am not sure what’s happening in swift version. Anything to do with “kRNCryptorAES256Settings” which used during encrypting in obj-c?

http://stackoverflow.com/comment/137363815
score: 0
has text: Thank you sir, this helped me find my way to the answer with my specific code (sorry I didn't include enough, always hard to know how much to include). Will post in a little.
comment on: http://stackoverflow.com/a/77916210
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137393614
type: AnswerComment
comment on: http://stackoverflow.com/a/77911426
type: Comment
has text: Thanks, I'll give that a try in a bit. I don't know of a way to track the missing frames via the library I'm using, hence why I'm trying to track myself how much time elapses between callback calls. We'll see what I can come up with.
score: 1

cgaffinetransform
tag name: cgaffinetransform
tags question: http://stackoverflow.com/q/77915637
type: Tag

http://stackoverflow.com/comment/137135758
type: QuestionComment
score: 0
has text: You can also use `alignas(16)` on individual field members. This is reminiscent of the OpenGL struct layout problem...
type: Comment
comment on: http://stackoverflow.com/q/77789337

http://stackoverflow.com/comment/137408159
comment on: http://stackoverflow.com/q/77941248
type: QuestionComment
has text: @JeremyP hm good point, but that code was actually just to illustrate the issue. All those lines above 187 in my screencapture were just attempts to break it down into several smaller steps to help out the compiler and see where it goes wrong. Initially I've attempted to directly access a property of `mapViewModel` inside a closure.
score: 0
type: Comment

http://stackoverflow.com/comment/137160900
comment on: http://stackoverflow.com/a/77789462
has text: its my code not @Botje ‘s code. vec2 is defined as a class template in C++. Templated for type and length. So a vector of 2 floats or 4 ints etc. will be the same code. so it’s super not portable to Objective-C. the only attribute to an instance is an `std::array`. (i used this for convenient constructors with `initializer_list` but i’m not married to `std::array`.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/137188870
type: Comment
comment on: http://stackoverflow.com/q/77811774
score: 0
has text: There is an error parameter in that delegate method, print the error (not only the error.localizedDescription btw).
type: QuestionComment

http://stackoverflow.com/comment/137204992
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/77803947
has text: Thanks, it's all good after setting the variables in the Schemem

http://stackoverflow.com/q/77961306
accepted answer: http://stackoverflow.com/a/79332103
type: AnsweredQuestion
tagged with: ios
has answer: http://stackoverflow.com/a/79316671
has answer: http://stackoverflow.com/a/79332103
score: 0
has title: Cannot read CMVideoDimensions structure with Objective C code
answer count: 2
has body: I have an AVCaptureDevice object at hand and would like to print the maximum supported photo dimensions as provided by activeFormat.supportedMaxPhotoDimensions (*), using Objective C. I tried the following: for (NSValue *obj in device.activeFormat.supportedMaxPhotoDimensions) { CMVideoDimensions *vd = (__bridge CMVideoDimensions *)obj; NSString *s = [NSString stringWithFormat:@"res=%d:%d", vd->width, vd->height]; //print that string } If I run this code, I get: res=314830880:24994 This is way too high, and there is obviously something I am doing wrong, but I don't know what it could be? According to the information I see on the web, I should get something closer to 4000:3000. I can successfully read device.activeFormat.videoFieldOfView and other fields, so I believe my code is sound overall. (*) https://developer.apple.com/documentation/avfoundation/avcapturedevice/format/3967581-supportedmaxphotodimensions
tagged with: objective-c
tagged with: avfoundation
possible better answer: http://stackoverflow.com/a/79316671
type: Question

http://stackoverflow.com/comment/137154824
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77791661
has text: @Spo1ler `_MyVertex` is struct forward declaration and code sugar to not write `struct MyVertex`
score: 0

http://stackoverflow.com/comment/137423257
comment on: http://stackoverflow.com/q/77950769
has text: @jnpdx That is actually what I was trying to do originally with something like `.onReceive(NotificationCenter.default.publisher(for: NSWorkspace.didWakeNotification), perform: { _ in` but I had the same issue with nothing being triggered.
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/137135715
type: Comment
has text: Is the real problem that every element of a `MyVertex[]` will start at multiples of 24 in C++ and multiples of 32 in Objective-C? If so, you can use `alignas(32)` modifier to make sure you match Objective-C.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77789337

http://stackoverflow.com/comment/137160946
comment on: http://stackoverflow.com/a/77789462
type: AnswerComment
type: Comment
score: 0
has text: But the std::array I don't think is a problem, because it will pack the floats together, WITHIN a single vector which is what `vector_floatx` also does.

http://stackoverflow.com/comment/137136454
score: 1
type: AnswerComment
type: Comment
has text: This is not even the right answer. The real answer is to make sure that alignment on different vectors structs that you defined is the same across the places that it gets included.
comment on: http://stackoverflow.com/a/77789462

padding
tag name: padding
type: Tag
tags question: http://stackoverflow.com/q/77789337

http://stackoverflow.com/comment/137166016
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77805420
has text: @Dewerro it's available, but how are you going to create an object instance from `AnyClass`?
score: 0

http://stackoverflow.com/comment/137132728
score: 0
has text: My client is working on NFI and they said Swift code is not supported at all. I don't know the reason. So I choose to provide them in both way.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77787569

http://stackoverflow.com/a/77872925
type: AcceptedAnswer
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/77872847
answers question: http://stackoverflow.com/q/77872847
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/137284917
has body: ISBannerSize_SMART is not a constant. It is a macro that expands to [[ISBannerSize alloc] initWithDescription:kSizeSmart width:0 height:0] Such macros are not imported into Swift. Only simple macros that expand to a constant value like the following, are imported into Swift: #define SOME_CONSTANT 3.14 So you would need to translate [[ISBannerSize alloc] initWithDescription:kSizeSmart width:0 height:0] into Swift, i.e. something like ISBannerSize(description: kSizeSmart, width: 0, height: 0) You can use this directly as the size parameter of loadBanner, or you can write an extension of ISBannerSize: extension ISBannerSize { static var smart: ISBannerSize { ISBannerSize(description: kSizeSmart, width: 0, height: 0) } } Usage: IronSource.loadBanner(with: self, size: .smart)

game-center
type: Tag
tags question: http://stackoverflow.com/q/77896763
tag name: game-center

http://stackoverflow.com/comment/137498118
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/77911426
type: Comment
has text: Great answer! Finally my opus player works!

http://stackoverflow.com/comment/137236286
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/77838327
type: Comment
has text: Check parameters of supported architectures. I suggest to remove any if specified. Also if you are using cocopods, you need manually rise deployment target in all pods. Doesn't know why cocoapods not doing it automatically.

audiotoolbox
tags question: http://stackoverflow.com/q/77877558
tag name: audiotoolbox
type: Tag

strong-reference-cycle
tags question: http://stackoverflow.com/q/77918816
type: Tag
tag name: strong-reference-cycle

http://stackoverflow.com/comment/137392132
comment on: http://stackoverflow.com/q/77916083
has text: MacVim has a Select All menu item with key equivalent Command-A and action `selectAll:`. It is possible to make Command-A work without a menu item but I don't know if it will work (in the future) outside the usual runloop of `NSApplication`. I'm surprised the open panel works at all.
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/a/77810175
upvote count: 4
score: 4
type: Answer
answers question: http://stackoverflow.com/q/77809737
downvote count: 0
has body: The atomic keyword is about the storage about the property itself, e.g. in this case, the SomeActor * pointer. All it guarantees is that changes to the pointer are done atomically. It has nothing to do with the semantics of the pointed-to thing, such as your actor. It's not often that I find that my synchronization issues are about settings specific fields. It's usually about synchronizing entire objects or collections, so I find the whole atomic feature pretty dubious. I just always go nonatomic.

http://stackoverflow.com/comment/137290529
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77873161
type: Comment
has text: Unknown header indicates the first bytes of the cipher text are incorrect. Looking at your ObjC encryptor and Swift decryptor, they look fine. My suspicion is that the output of the ObjC encryptor is not actually what you're reading. I would dig into that ; making sure the output of one is exactly the input of the other, and that you're using the same version of RNCryptor in both cases (which it seems like you are; I suspect a reading or writing problem).

http://stackoverflow.com/comment/137315754
comment on: http://stackoverflow.com/q/77889698
has text: What OS is this question about? iOS? macOS? Other? Show what you have tried so far. Clearly explain what issues you are having. The link by Willeke gives you a good starting point at a minimum.
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/comment/137224092
comment on: http://stackoverflow.com/q/77838327
score: 0
has text: You need to [edit] your question to include all relevant code in the form of a [mcve] in order to make the question on-topic.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/137151376
has text: This makes no sense as well as the other answer. What's `_MyVertex` even? How can you work with "just pointer" to something if you don't know it's layout? What
comment on: http://stackoverflow.com/a/77791661
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/137361392
type: AnswerComment
has text: Also good catch, I didn't mean to leave any SDL code in haha. Low latency is indeed a requirement, so I'll keep that in mind. This was already basically working using SDL_Audio, I'm just trying out this API to see if I can get better compatibility with Apple features like spatial audio. Definitely thought this was going to be an afternoon experiment, vs. a weeks-long head-wall-banging.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/77911426

http://stackoverflow.com/comment/137135753
score: 0
type: QuestionComment
has text: If I use`alignas(32)` with `MyVertex` in C++, then C++ will think `color` has an offset of 4 still, and Objective-C will think that `color` has an offset of 8.
type: Comment
comment on: http://stackoverflow.com/q/77789337

http://stackoverflow.com/comment/137257544
type: QuestionComment
comment on: http://stackoverflow.com/q/77838327
score: 0
has text: @Cy-4AH The setup of supported architectures is standard(arm64), and Build Active Architecture Only is No when releasing, Yes when Debugging, also feels same about cocapods.
type: Comment

integer
tag name: integer
tags question: http://stackoverflow.com/q/77798833
type: Tag

autocomplete
type: Tag
tags question: http://stackoverflow.com/q/77941248
tag name: autocomplete

http://stackoverflow.com/a/77812057
type: Answer
answers question: http://stackoverflow.com/q/77804229
score: 0
has body: As mentioned, this cannot be accomplished with constraints only, but the logic is fairly straightforward and we can take advantage of constraints for most of the work. So, the goal: align the label leading to the "green view" leading IF the label extends past the trailing edge of the superview, align the label trailing to the "green view" trailing Obviously, if the string is shorter than the view width, we don't have to do anything. When the label is wider than the view: create both Leading and Trailing constraints toggle the .active property of the constraints as needed But -- what should happen if the label is too wide to fit when it is right-aligned? We can lower the priority of the leading/trailing constraints from the label to the "green view" and add required constraints between the label and the superview: This may end up looking a little "un-balanced" -- so we can add in one more piece of logic... we'll use the wider "gap" on the left/right of the "green view" and the superview to give priority to the layout: Here is some sample code... AttachedLabelView.h #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface AttachedLabelView : UIView @property (strong, nonatomic) UILabel *attachedLabel; @end NS_ASSUME_NONNULL_END AttachedLabelView.m #import "AttachedLabelView.h" @interface AttachedLabelView () { UILabel *myLabel; NSLayoutConstraint *labelLeading; NSLayoutConstraint *labelTrailing; NSLayoutConstraint *limitLabelLeading; NSLayoutConstraint *limitLabelTrailing; } @end @implementation AttachedLabelView - (void)setAttachedLabel:(UILabel *)attachedLabel { // make sure this is set attachedLabel.translatesAutoresizingMaskIntoConstraints = NO; // initialize leading and trailing constraints // these will be toggled so the label is either // aligned with the leading edge, or // aligned with the trailing edge labelLeading = [attachedLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor]; labelTrailing = [attachedLabel.trailingAnchor constraintEqualToAnch…

http://stackoverflow.com/comment/137254908
type: QuestionComment
comment on: http://stackoverflow.com/q/77855536
type: Comment
has text: So NSURLSession is something distinct then? I have no choice but to use php for this, it’s not directly readable in my app code?
score: 0

http://stackoverflow.com/comment/137140149
has text: I was under the impression that the alignment of struct members was similar to std140 in OpenGL, where *every* member must be aligned to the largest alignment in the struct, frequently that of vec4. This means a single int gets padded up to 32 bytes. How would you achieve this without explicit alignment hints for c++?
score: 0
comment on: http://stackoverflow.com/a/77789462
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137165314
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77805420
has text: func NSClassFromString(_ aClassName: String) -> AnyClass? also available in swift
score: 0

http://stackoverflow.com/comment/137361742
score: 0
comment on: http://stackoverflow.com/q/77915637
type: QuestionComment
has text: @matt I need to do both simultaneously, the scale code I have is working on its own and as shown, it flips it, just repositions it out of the view and I don't know how to get it back in.
type: Comment

http://stackoverflow.com/a/77918231
answers question: http://stackoverflow.com/q/77915582
has body: You need to hold the output object to prevent it from being released. 1、@property (nonatomic, strong) AVCaptureVideoDataOutput* cameraOutput; 2、_cameraOutput = videoDataOutput; It is recommended that you also create an AVCaptureConnection object to distinguish the connection in the AVCaptureVideoDataOutputSampleBufferDelegate. 3、AVCaptureConnection* _videoConnection; 4、_videoConnection = [_cameraOutput connectionWithMediaType:AVMediaTypeVideo]; 5、this didOutputSampleBuffer, if (_videoConnection == connection), you can use sampleBuffer.
score: 0
type: Answer

apple-tv
tag name: apple-tv
tags question: http://stackoverflow.com/q/77952697
type: Tag

http://stackoverflow.com/comment/137701549
has text: Yes, if you create both in the XIB. The missing connector is because you didn't make `delegate` and IBOutlet, which is typically how you do that. (If you're not wiring it in the XIB, where are you setting `delegate`? If you never set it, it's going to be nil, right?)
score: 0
comment on: http://stackoverflow.com/a/78104547
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137544699
score: 0
type: QuestionComment
type: Comment
has text: @red_menace Entitlemenets are set accordingly.
comment on: http://stackoverflow.com/q/77976279

http://stackoverflow.com/comment/139401715
type: Comment
has text: I have an app group properly setup, and when my app tries to load the persistent storage, it shows that prompt, every time the app opens. I'm using App Groups already, I'm bringing to the Mac a setup that already works fine in iOS, but for some reason, every time my app tries to access the stores from its own app group, it's treated like it's trying to access data from other app.
score: 1
comment on: http://stackoverflow.com/a/78929081
type: AnswerComment

http://stackoverflow.com/q/78036902
tagged with: objective-c
answer count: 0
has comment: http://stackoverflow.com/comment/137574965
score: 0
has title: How do I stop MQTTClient from getting new data
has comment: http://stackoverflow.com/comment/137575373
has comment: http://stackoverflow.com/comment/137629493
type: Question
type: UnansweredQuestion
tagged with: mqtt
has body: I have an app which uses MQTTClient to connect to io.adafruit and then subscribes to various feeds. I then publish a "GET" message to start receiving data from the various feeds. Then I check the various feeds to see what they are and do whatever. This is fine when the app is in the foreground but when it is put into the background I would like to stop the process. I have tried setting the session to nil, disconnect the session, and set the MQTTCRSocketTransport to nil all to no avail. It just keeps checking for updates. This is my code. NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; self.myUserName = [defaults objectForKey:@"myUserNameFile"]; NSLog(@"myUserName:%@",self.myUserName); self.myUserKey = [defaults objectForKey:@"myUserKeyFile"]; NSLog(@"myUserKey:%@",self.myUserKey); transport = [[MQTTCFSocketTransport alloc] init]; transport.host = @"io.adafruit.com"; transport.port = 1883; NSLog(@"transport:%@",transport); session2 = [[MQTTSession alloc] init]; session2.userName =self.myUserName; session2.password = self.myUserKey; session2.transport = transport; session2.delegate = self; session2.keepAliveInterval = 30; NSString *feeds = [self.myUserName stringByAppendingString:@"/feeds/"]; self.battery = [feeds stringByAppendingString:@"battery"]; self.getbat = [self.battery stringByAppendingString:@"/get"]; [session2 connectWithConnectHandler:^(NSError *error) { if(!error){ [session2 subscribeToTopic:self.battery atLevel:1 subscribeHandler:^(NSError *error, NSArray *gQoss){ if (error) { NSLog(@"Subscription failed %@", error.localizedDescription); } else { NSLog(@"Subscription sucessfull! Granted Qos: %@", gQoss); NSData* data = [ @"0" dataUsingEncoding:NSUTF8StringEncoding]; [session2 publishData:data onTopic:self.getbat retain:NO qos:0 publishHandler:nil]; } }]; } else {NSLog(@"[connectWithConnectHandler]Error Connect %@", error.localizedDescription);} }]; } - (void)newMessage:(MQTTSession *)session data:(NSData *)data onTopic:(NSString *)topic…
has comment: http://stackoverflow.com/comment/137576225
tagged with: uibackgroundtask
tagged with: ios

http://stackoverflow.com/comment/137475145
score: 0
type: QuestionComment
has text: Thank you! I was hoping to find an alternate to manually evaluating each string. That is the last resort!
type: Comment
comment on: http://stackoverflow.com/q/77976314

http://stackoverflow.com/a/78050635
downvote count: 0
has body: When you need to support both Xcode 14 and Xcode 15 while also wanting to take advantage of new APIs added in macOS 14.0, you need to make use of the __MAC_OS_X_VERSION_MAX_ALLOWED macro. In your specific case you would want: #if __MAC_OS_X_VERSION_MAX_ALLOWED &gt;= 140000 // Only true in Xcode 15.0+ myNSView.clipsToBounds = YES; #endif clipsToBounds is a weird case since it became public in Xcode 15 but it can now be used with a deployment target back to macOS 10.9. The more general approach, when needing to support an API added in macOS 14.0 and not available at all prior to that, and your app has a deployment target older than macOS 14.0, all while supporting Xcode 14 and 15, then you need something like the following: #if __MAC_OS_X_VERSION_MAX_ALLOWED &gt;= 140000 // Built with Xcode 15.0+ if (@available(macOS 14.0, *)) { someObject.someNewProperty = someValue; } else { // optional code for pre-macOS 14.0 someObject.someOldProperty = someValue; } #else // Built with Xcode before 15.0 // optional code for pre-macOS 14.0 someObject.someOldProperty = someValue; #endif Once you stop trying to support Xcode 14 you can remove everything between #else and #endif, and remove the #if, #else, and #endif` lines. The downside to this is that if you do have alternate code for older versions of macOS while supporting multiple versions of Xcode, that code gets repeated in two places. The following resolves the duplicate code issue: if (@available(macOS 14.0, *)) { #if __MAC_OS_X_VERSION_MAX_ALLOWED &gt;= 140000 // Built with Xcode 15.0+ someObject.someNewProperty = someValue; #endif } else { // optional code for pre-macOS 14.0 someObject.someOldProperty = someValue; } Once you stop trying to support Xcode 14 you can remove the #if and #endif lines. Note: There is a macro named __MAC_14_0 that is defined as 140000 and using it would make the code easier to read. But that macro would only be defined when using Xcode 15 and not when using Xcode 14.
accepted answer of: http://stackoverflow.com/q/78046487
type: AcceptedAnswer
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/78046487

http://stackoverflow.com/q/78091125
has answer: http://stackoverflow.com/a/78093159
favorite count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/137670795
type: Question
tagged with: objective-c
type: UnansweredQuestion
upvote count: 0
has body: Every time I instantiate a UIView and add a UIBezierPath as a mask using the roundSpecificCorners:withRadius: function, the view seems to have a smaller margin on the right side and bottom, causing it not to cover the entire view as expected. @implementation LoginAccountViewController - (void)viewDidLoad { [super viewDidLoad]; // Initial setup of the view enterEmailView.inputTextField.placeholder = @"Enter Email"; enterPasswordView.inputTextField.placeholder = @"Enter Password"; } - (void)viewWillLayoutSubviews{ // Apply corner rounding on the main view [mainViewContainer roundSpecificCorners:UIRectCornerTopLeft | UIRectCornerTopRight withRadius:10.0]; [super viewWillLayoutSubviews]; } - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator { __weak typeof(self) weakSelf = self; [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) { // Apply corner rounding when changing orientation UIWindowScene *windowScene = (UIWindowScene *)self.view.window.windowScene; UIInterfaceOrientation orientation = windowScene.interfaceOrientation; if (UIInterfaceOrientationIsLandscape(orientation)) { [weakSelf.mainViewContainer roundSpecificCorners:UIRectCornerTopLeft | UIRectCornerTopRight withRadius:10.0]; } else { [weakSelf.mainViewContainer roundSpecificCorners:UIRectCornerTopLeft | UIRectCornerTopRight withRadius:10.0]; } } completion:nil]; [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; } @end @implementation UIView (CustomLoader) // Other functions here... - (void)roundSpecificCorners:(UIRectCorner)corners withRadius:(CGFloat)radius { // Apply a layer mask with corner rounding CAShapeLayer *maskLayer = [CAShapeLayer layer]; maskLayer.path = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:corners cornerRadii:CGSizeMake(radius, radius)].CGPath; self.layer.mask = maskLayer; // Adjust the autoresizingMask to allow for…
has title: Why does a smaller margin appear on the right side and bottom when adding a UIBezierPath as a mask to a UIView for the first time?
has comment: http://stackoverflow.com/comment/137670909
score: -1
tagged with: uikit
downvote count: 1
answer count: 1

http://stackoverflow.com/comment/137531677
score: 0
has text: Thanks for your suggestion, I tried to remove `.sign()` , but the error was still the same @Robert
comment on: http://stackoverflow.com/q/78011219
type: QuestionComment
type: Comment

azure-cognitive-services
type: Tag
tags question: http://stackoverflow.com/q/77973278
tag name: azure-cognitive-services

http://stackoverflow.com/comment/137599256
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78046631
has text: I updated the answer, you may want to take a look.
score: 0

http://stackoverflow.com/comment/137684995
has text: Where do you ever assign a non-nil value to the `delegate` property of a `SquareView` instance?
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/78099020

http://stackoverflow.com/comment/137704534
has text: That looks promising. Could you share the full project?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78107492
score: 0

http://stackoverflow.com/q/77981579
tagged with: xcode
type: UnansweredQuestion
answer count: 0
tagged with: http://stackoverflow.com/tag/c
score: 1
has body: I'm using (Product -> Perform Action -> Assemble "file") in Xcode to investigate assembler instructions. But for some unknown to me reasons it sometimes shows llvm instructions instead. It happens for both .c and .m files. Sometimes it suddenly just starts to produce llvm for the same file which produced assembler many times before. Has anyone else encountered this? Is that a bug or am I doing something wrong? I'm using Xcode 15.0.1
tagged with: ios
has title: Performing assembly in Xcode sometimes produces llvm instead
tagged with: objective-c
favorite count: 0
tagged with: assembly
type: Question
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/137534822
type: Comment
score: 0
type: QuestionComment
has text: @matt yeah you're right, got so wound up in redesigning some of my code and moving stuff around that I lost sight of it. going to change it and see if it fixes it, though if it does not sure I understand why.
comment on: http://stackoverflow.com/q/78014194

http://stackoverflow.com/comment/137568192
score: 0
comment on: http://stackoverflow.com/q/78032810
type: Comment
has text: @Cy-4AH I would love to but I have no choice. I have to implement this framework which is only available locally and written in Objective-C.
type: QuestionComment

http://stackoverflow.com/comment/139480291
has text: @Konrad I will try to contact Apple's code level support and see if they can help me with that, then I post here whatever they tell me.
comment on: http://stackoverflow.com/a/78929081
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/137709554
score: 2
type: Comment
type: QuestionComment
has text: You're using private API via the key path, it's not safe at all. You could think about another way like a custom `navigationItem` for titleView, leftItem, right item, etc.
comment on: http://stackoverflow.com/q/78112507

http://stackoverflow.com/comment/137739011
score: 0
comment on: http://stackoverflow.com/q/78126489
type: Comment
type: QuestionComment
has text: FYI - there is no unavoidable reason for using MRC. Even in an MRC project, individual files can be converted to ARC. The trivial amount of time doing the conversion far outweighs all of the issues from staying with MRC.

http://stackoverflow.com/comment/137740407
type: AnswerComment
has text: I was curious how this was going to turn out. Congrats on sleuthing the problem.
comment on: http://stackoverflow.com/a/78129770
score: 1
type: Comment

http://stackoverflow.com/a/78046631
has comment: http://stackoverflow.com/comment/137591548
score: 1
has comment: http://stackoverflow.com/comment/137591523
type: Answer
has comment: http://stackoverflow.com/comment/137599303
has body: The reason is that clipsToBounds ships with macOS 14 SDK, which includes Xcode 15. In Xcode below 15, this property is not available, so the compiler cannot find it and throws an error. It's just a kind of syntax detection. The release note is here. In macOS 14, AppKit is exposing the clipsToBounds property of NSView. Updated: You can use preprocessors which define in &lt;AvailabilityMacros.h&gt; to cover this case //You don't really need to import this //#import &lt;AvailabilityMacros.h&gt; ... //You can also check all available versions in the AvailabilityVersions.h file. //140000 means MacOS 14.0 #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 140000 view.clipsToBounds = YES; #endif
upvote count: 1
has comment: http://stackoverflow.com/comment/137599287
has comment: http://stackoverflow.com/comment/137599324
has comment: http://stackoverflow.com/comment/137599256
has comment: http://stackoverflow.com/comment/137591579
answers question: http://stackoverflow.com/q/78046487
downvote count: 0

http://stackoverflow.com/q/78014996
type: UnansweredQuestion
tagged with: macos
tagged with: objective-c
has body: I would like find a way to track changes to the onActiveSpace property of an NSWindow. I used the KVO method to monitor this property, but did not receive the property change notification. Does this property not support KVO? If so, is there any way to confirm whether a certain attribute supports KVO? Here is my code: first: addobserver - (instancetype)initWithWidgetSpaceTracker:(WidgetSpaceTracker*)owner { if ((self = [super init])) { DCHECK(owner); _owner = owner; NSWindow* window = _owner->GetNSWindow(); if (window) { [window addObserver:self forKeyPath:@"onActiveSpace" options:NSKeyValueObservingOptionNew context:nil]; } } return self; } second:receive the change notification - (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey, id>*)change context:(void*)context { DCHECK(_owner); if ([keyPath isEqual:@"onActiveSpace"]) { _owner->OnSpaceActiveChanged([change[NSKeyValueChangeNewKey] boolValue]); } else { [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } }
type: Question
answer count: 1
score: 0
has answer: http://stackoverflow.com/a/79406610
has title: How track a NSWindow's onActiveSpace property
tagged with: nswindow

http://stackoverflow.com/q/77969695
has title: How to access the storyboard of an SDK?
score: 0
has body: I have created an SDK which includes a storyboard. In the storyboard there are 4-5 view controllers. How to access the storyboard of the SDK? Here is my code: - (void)openAppleInAppProvisionMain { // NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSBundle *bundle = [NSBundle bundleWithIdentifier:@"com.digiTech.apple.applewalletNFI"]; NSLog(@"Received from Main Kony Callback : %@", shManager.callBack); NSLog(@"Received from Main Kony Data : %@", shManager.dictResponse); NSLog(@"method is accessible in this way"); UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"WalletMain" bundle:bundle]; UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"CardsViewsController"]; [AppleWallet performSelectorOnMainThread:@selector(presentTheViewController:) withObject:vc waitUntilDone:YES]; [[NSNotificationCenter defaultCenter] postNotificationName:@"getCardsList" object:nil userInfo:shManager.dictResponse]; } + (void)presentTheViewController:(UIViewController *)vc { if(vc) { vc.modalPresentationStyle = UIModalPresentationFullScreen; // [KonyUIContext onCurrentFormControllerPresentModalViewController:vc animated:YES]; } } In this way I am able to access this method and also all other methods in my sample app, but I'm not able to load the storyboard of the SDK to my sample app. My storyboard settings are like this. I have tried with the bundle changes but not working.
type: Question
tagged with: storyboard
type: UnansweredQuestion
tagged with: ios
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/77969819

http://stackoverflow.com/comment/137531227
has text: If I understand it correctly `cfunc` is an ObjC method that returns a point of a C-function? Why do you execute `sign()` on the pointer? That doesn't make sense to me. It would make more sense to me without `.sign()`. Then you define the native method and call it with the three zero arguments.
type: Comment
comment on: http://stackoverflow.com/q/78011219
score: 0
type: QuestionComment

http://stackoverflow.com/q/78104447
has body: I am trying to build a program where the MainController uses a delegate to pass data into a table inside TableViewController. I think I've initialized it correctly but LoadSN() does not trigger the delegate function (I do see it run). Does the initialization of the MainController and the TableViewController not playing well together? (maybe I am not understanding the order of initialization?) MainController.h #import <Cocoa/Cocoa.h> NS_ASSUME_NONNULL_BEGIN @class MainController; @protocol MainDelegate <NSObject> - (void)addMainEntry:(NSString *)patchName :(NSString *)filename; @end @interface MainController : NSWindowController { @private IBOutlet NSTextField *status; IBOutlet NSTextField *serialNumber; } @property (nonatomic, weak) id<MainDelegate> delegate; -(IBAction)LoadSNBtn:(id)sender; -(IBAction)saveBtn:(id)sender; @end NS_ASSUME_NONNULL_END MainController.m #import "MainController.h" @implementation MainController @synthesize delegate; - (void)awakeFromNib { //NSLog(@"%@",[status stringValue]); NSLog(@"awakeFromNib MainController"); NSString* msg = @"Main Station: Scan or Enter Serial Number above."; msg = [NSString stringWithFormat:@"%@\n%@",[status stringValue], msg]; [status setStringValue:msg]; [status setDrawsBackground:YES]; [status setSelectable:YES]; } - (void)windowDidLoad { [super windowDidLoad]; // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. } - (IBAction)LoadSNBtn:(id)sender { NSLog(@"LoadSNBtn"); [delegate addMainEntry:@"LoadName" :@"LoadFilename"]; } - (IBAction)saveBtn:(id)sender { } @end TableViewController.h #import <Foundation/Foundation.h> #import <Cocoa/Cocoa.h> #import "MainController.h" #import "mainImage.h" NS_ASSUME_NONNULL_BEGIN @interface TableViewController : NSObject <NSTableViewDataSource, MainDelegate> { @public IBOutlet NSTableView *tableView; NSMutableArray *imageList; } @property (copy) NSMutableArray *imageList; @property (weak) MainController *m…
has title: initialization order with delegates and multiple view controllers is not working
has answer: http://stackoverflow.com/a/78104547
answer count: 1
tagged with: objective-c
tagged with: delegates
tagged with: cocoa
score: 0
type: Question
type: UnansweredQuestion

http://stackoverflow.com/q/78038240
tagged with: arrays
has comment: http://stackoverflow.com/comment/137577052
tagged with: swift
has title: Access NSString *const *Array in Swift
has comment: http://stackoverflow.com/comment/137578209
answer count: 0
score: 1
tagged with: ios
type: Question
has comment: http://stackoverflow.com/comment/137578144
has comment: http://stackoverflow.com/comment/137576762
tagged with: objective-c
has comment: http://stackoverflow.com/comment/137577305
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/24299045
has comment: http://stackoverflow.com/comment/137577139
upvote count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/137576767
has body: Still trying my best to learn swift and hit this problem with some old library code - I have something like this - static NSString *const fooStrings[] = { @"Foo" } Getting a value through this is rather easy in Objective C: NSString *foo = fooStrings[0]; How do I get these in Swift though? I've tried casting UnsafePointer<NSString> and getting the string back with code similar to that above. I also tried fooStrings.elements[0] or trying dereferencing with &fooStrings.elements[0] or (fooStrings as UnsafePointer).pointee[0], but every time, it complains about not being able to do this with an NSString * strong. I'm obviously out of my depth here and am asking for help as I wasn't able to find an answer to what looks like a straightforward thing to do.
tagged with: pointers

http://stackoverflow.com/comment/137484134
score: 0
type: Comment
has text: Have you tried printing the pdf in the Preview app? what does the preview look like?
type: QuestionComment
comment on: http://stackoverflow.com/q/77983169

http://stackoverflow.com/q/78076129
has title: Is there a way to be notified any time a drag-and-drop operation begins in the current application?
type: Question
answer count: 1
type: UnansweredQuestion
has body: I'm working on a framework that's intended to be added to a native macOS application so that it can post events into the application's event queue in response to touch-screen events. In order to function properly, it needs to know when a drag-and-drop operation has started within the current application. (It doesn't need to know about drag-and-drop operations started anywhere else within the system.) Is there any way to do that? So far I've checked to see if any relevant notifications are posted to the application's shared notification center, but that didn't bear any fruit. I'm willing to use Objective-C method swizzling, but I'd prefer to avoid that if possible.
tagged with: macos
favorite count: 0
score: -1
tagged with: drag-and-drop
downvote count: 1
tagged with: appkit
tagged with: objective-c
has answer: http://stackoverflow.com/a/78102759
upvote count: 0

http://stackoverflow.com/comment/137464167
score: 1
comment on: http://stackoverflow.com/a/77974178
type: AnswerComment
type: Comment
has text: Instructive and entertaining.

http://stackoverflow.com/comment/137719777
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78093159
type: AnswerComment
has text: @JaelRuvalcaba - then the problem is with your constraints / layout. Here are two screenshots (corner radius set to 30 to make it easier to see): https://i.sstatic.net/xZQPj.png ... https://i.sstatic.net/lMiP9.png

http://stackoverflow.com/q/78112507
tagged with: ios17
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/137709997
has answer: http://stackoverflow.com/a/78114528
answer count: 1
tagged with: objective-c
tagged with: xcode15
favorite count: 0
accepted answer: http://stackoverflow.com/a/78114528
has comment: http://stackoverflow.com/comment/137709823
has body: I have made a custom class for UINavigationBar which has all the custom features I need for an application. After initialising the class I am adding it to the navigation controller like this if (!navBar) { navBar=[[NavigationBar alloc]initWithFrame:self.navigationController.navigationBar.frame]; [self.navigationController setValue:navBar forKeyPath:@"navigationBar"]; } My app is crashing on the line [self.navigationController setValue:navBar forKeyPath:@"navigationBar"]; Till Xcode 14 its working fine but on Xcode 15 it's crashing. Any help is highly appreciated. below is the crash that I am getting *** Assertion failure in -[UINavigationBar layoutSubviews], UINavigationBar.m:3856
type: AnsweredQuestion
has title: Xcode 15: App is crashing when setting custom Navigation bar for navigation controller
tagged with: uinavigationbar
downvote count: 0
tagged with: xcode
has comment: http://stackoverflow.com/comment/137709554
score: 1
has comment: http://stackoverflow.com/comment/137709959

http://stackoverflow.com/q/77983169
has answer: http://stackoverflow.com/a/78039414
favorite count: 0
has body: I want to print a document which is consists of multiple pages with different orientations. Let's say every odd page is in portrait orientation and every even page is in landscape orientation. Below is the code for my PrintView class: // PrintView.h @interface PrintView : NSView { NSPrintInfo* printInfo; int nPages; } - (id)initWithParams:(CGRect)frame pages:(int)pagesCount; - (void)setPrintInfo:(NSPrintInfo *)pi; @end // PrintView.m #import "PrintView.h" @implementation PrintView - (id)initWithParams:(CGRect)frame pages:(int)pagesCount { self = [super initWithFrame:frame]; if (self) { nPages = pagesCount; } return self; } - (void)setPrintInfo:(NSPrintInfo *)pi { if (printInfo != pi) { printInfo = pi; } } // print support - (BOOL)knowsPageRange:(NSRangePointer)range { range->location = 1; range->length = nPages; return YES; } - (NSRect)rectForPage:(NSInteger)page { if (page % 2) [printInfo setOrientation:NSPaperOrientationPortrait]; else [printInfo setOrientation:NSPaperOrientationLandscape]; NSRect r = NSMakeRect(0, 0, printInfo.paperSize.width, printInfo.paperSize.height); [self setFrame:r]; return r; } @end This code simply produces blank pages without any drawings. Page orientations are applied in rectForPage:. When I run print operation (more details in function onBtnClick in MRE below) in built-in preview I see that all pages are shown in portrait orientation: though actually the second page should be in landscape orientation. Moreover, if I print this to PDF I can see that in PDF all page orientations are correct: So the problem is in built-in Cocoa preview as I think. If the last page is in landscape orientation then all pages in preview will be shown in landscape orientation too. Seems that only last page orientation is applied to preview. Is there any workarounds for showing pages with different orientations in default Cocoa printing preview? Or am I doing something wrong? Minimal Reproducible Example Below is the code for simple application with just one …
has title: Different page orientations in default print preview in NSPrintPanel
tagged with: objective-c
type: Question
upvote count: 1
downvote count: 0
tagged with: xcode
tagged with: nsprintoperation
accepted answer: http://stackoverflow.com/a/78039414
has comment: http://stackoverflow.com/comment/137484134
tagged with: nsprintpanel
has comment: http://stackoverflow.com/comment/137486639
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/137484177
has comment: http://stackoverflow.com/comment/137484825
score: 1
answer count: 1
tagged with: macos

http://stackoverflow.com/a/78114528
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/78112507
has body: I was able to solve the issue after putting the code in viewDidLayoutSubviews -(void)viewDidLayoutSubviews{ [self.navigationController setValue:navBar forKeyPath:@"navigationBar"]; } After this code is working and not crashing anymore
accepted answer of: http://stackoverflow.com/q/78112507
score: 0

http://stackoverflow.com/comment/137591351
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78046487
type: QuestionComment
has text: I am talking about 'NSView' only. if it's available from macOS 10.9, then why it is throwing error on Xcode 14.3.1 and working on Xcode 15. if I put macOS 10.9 availability in code its throwing same error.

http://stackoverflow.com/comment/137577139
score: 2
type: Comment
has text: That or convert it to a literal `NSArray`. `static NSArray<NSString> *fooStrings = @[@"foo"]`
type: QuestionComment
comment on: http://stackoverflow.com/q/78038240

http://stackoverflow.com/q/78129689
has body: I try to implement a custom Cocoa main loop for my app using metal-cpp (the source code is also available here) wrapper. The first step is to write a something like: [NSThread detachNewThreadSelector:@selector(doNothing:) toTarget:stubTarget withObject:nil]; To run a stub selector (the solution is based on GLFW source code). The metal-cpp doesn't contain NSThread class, so I've implemented it: metal-cpp/Foundation/NSThread.hpp: #pragma once #include <functional> #include "NSObject.hpp" namespace NS { class Runnable { public: virtual ~Runnable() {} virtual void run() {} }; class Thread: public NS::Referencing< Thread > { public: static void detachNewThread( const Runnable* pRunnable ); }; _NS_INLINE void NS::Thread::detachNewThread( const Runnable* pRunnable ) { NS::Value* pWrapper = NS::Value::value( pRunnable ); typedef void (*DispatchFunction)( NS::Value*, SEL, void* ); DispatchFunction run = []( Value* pSelf, SEL, void* unused ) { auto pDel = reinterpret_cast< NS::Runnable* >( pSelf->pointerValue() ); pDel->run(); }; return Object::sendMessage<void>(_NS_PRIVATE_CLS(NSThread), _NS_PRIVATE_SEL(detachNewThreadSelector_toTarget_withObject_), run, pWrapper, nullptr ); } } Also I've registered new _NS_PRIVATE_SEL variants in metal-cpp/Foundation/NSPrivate.hpp: _NS_PRIVATE_DEF_SEL(detachNewThreadSelector_toTarget_withObject_, "detachNewThreadSelector:toTarget:withObject:"); Finally, I've included NSThread into the main header metal-cpp/Foundation/Foundation.hpp. The source code of NSThread was written researching a source code of NSApplication and Apple references. I don't know Objective-C and its code is a little magic for me. Later, I call NSThread::detachNewThread() in my app: class MainLoopTarget: public NS::Runnable { public: void run() override { std::cout << "run()" << std::endl; } }; auto target = new MainLoopTarget(); NS::AutoreleasePool* autorelease_pool = NS::AutoreleasePool::alloc()->init(); NS::Thread::detachNewThread(target); autorelease_pool->release(); d…
score: 1
tagged with: nsthread
answer count: 1
has answer: http://stackoverflow.com/a/78129770
tagged with: objective-c
tagged with: foundation
has title: NSThread initWithTarget:selector:object:]: target does not implement selector ((null))'
tagged with: c++
type: Question
upvote count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion

header-files
tags question: http://stackoverflow.com/q/78032810
tag name: header-files
type: Tag

http://stackoverflow.com/q/77974177
accepted answer: http://stackoverflow.com/a/77974178
answer count: 1
upvote count: 3
favorite count: 0
type: Question
tagged with: objective-c
has answer: http://stackoverflow.com/a/77974178
tagged with: uitraitcollection
downvote count: 0
has title: How to implement custom traits in Objective-C?
type: AnsweredQuestion
tagged with: uikit
tagged with: swift
has body: The WWDC 2023 video Unleash the UIKit trait system discusses new UIKit APIs added in iOS 17 related to custom traits in trait collections. The video and its associated code is all in Swift but I wish to use these APIs in an older Objective-C app. I've run into some questions while converting the sample code from Swift to Objective-C. To start, here is some sample Swift code provided on the Code tab (at timestamp 11:00) of the video: enum MyAppTheme: Int { case standard, pastel, bold, monochrome } struct MyAppThemeTrait: UITraitDefinition { static let defaultValue = MyAppTheme.standard static let affectsColorAppearance = true static let name = "Theme" static let identifier = "com.myapp.theme" } extension UITraitCollection { var myAppTheme: MyAppTheme { self[MyAppThemeTrait.self] } } extension UIMutableTraits { var myAppTheme: MyAppTheme { get { self[MyAppThemeTrait.self] } set { self[MyAppThemeTrait.self] = newValue } } } So far, this is what I have for the Objective-C conversion: MyTraits.h: @import UIKit; NS_ASSUME_NONNULL_BEGIN typedef enum : NSUInteger { MyAppThemeStandard, MyAppThemePastel, MyAppThemeBold, MyAppThemeMonochrome } MyAppTheme; @interface MyAppThemeTrait : NSObject<UINSIntegerTraitDefinition> @end @interface UITraitCollection (MyTraits) @property (nonatomic, readonly) MyAppTheme myAppTheme; @end NS_ASSUME_NONNULL_END MyTraits.m: #import "Traits.h" @implementation MyAppThemeTrait + (NSInteger)defaultValue { return MyAppThemeStandard; } + (BOOL)affectsColorAppearance { return YES; } + (NSString *)name { return @"Theme"; } + (NSString *)identifier { return @"com.myapp.theme"; } @end @implementation UITraitCollection (MyTraits) - (MyAppTheme)myAppTheme { return [self valueForNSIntegerTrait:MyAppThemeTrait.class]; } @end The sticky point here is how to implement the extension on the UIMutableTraits protocol. Objective-C doesn't support adding a computed property to a protocol through an extension/category. How do you finish implementing custom traits in …
score: 3

http://stackoverflow.com/q/78032397
has answer: http://stackoverflow.com/a/78522949
tagged with: ios
type: Question
upvote count: 1
answer count: 1
tagged with: objective-c
linked to: http://stackoverflow.com/q/75740568
type: UnansweredQuestion
tagged with: react-native
downvote count: 0
has comment: http://stackoverflow.com/comment/137684437
favorite count: 0
tagged with: java
has comment: http://stackoverflow.com/comment/137591222
has comment: http://stackoverflow.com/comment/137566862
tagged with: android
has body: I have a react-native app that I build a week ago, when I checked the app size in android it was initialiy 17MB, and that i supposed is okay, but now when i check my apk size its 638MB and the bundle size is 283.3MB. and the ios app size is 180MB the asset size for the app is 3.6MB and overall src where the assets is also located size is 4.7MB which means my code size is 1.1MB I haven't added any other libraries, all of the libraries are required for functionality. my package.json file is here { "name": "salushealth", "version": "1.0.2", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest", "pregit": "git status", "git": "git add . && git commit -m", "postgit": "git push", "i-15": "react-native run-ios --simulator='iPhone 15 Pro Max'", "iPad": "react-native run-ios --simulator='iPad Pro (12.9-inch) (6th generation)'", "run-all": "yarn iPad && yarn i-15 && yarn android" }, "dependencies": { "@apollo/client": "^3.8.8", "@preact/signals-react": "^2.0.0", "@react-native-async-storage/async-storage": "^1.19.6", "@react-native-community/netinfo": "^11.2.1", "@react-native-community/slider": "^4.5.0", "@react-native-masked-view/masked-view": "^0.3.0", "@react-navigation/bottom-tabs": "^6.5.11", "@react-navigation/native": "^6.1.9", "@react-navigation/native-stack": "^6.9.17", "@reduxjs/toolkit": "^2.0.1", "@stripe/stripe-react-native": "0.19.0", "add": "^2.0.6", "axios": "^1.6.2", "camelize": "^1.0.1", "eslint-plugin-react-hooks": "^4.6.0", "formik": "^2.4.5", "graphql": "^16.8.1", "jsrsasign": "^11.1.0", "lottie-react-native": "^6.5.0", "moment": "^2.29.4", "prop-types": "^15.8.1", "react": "18.2.0", "react-native": "0.72.7", "react-native-calendars": "^1.1303.0", "react-native-circular-progress": "^1.3.9", "react-native-device-info": "^10.11.0", "react-native-dropdown-picker": "^5.4.6", "react-native-gifted-charts": "^1.3.18", "react-native-gifted-chat": "^2.4…
has title: React-Native app size is too large in both ios and android (android bundleRelease size is 283.3MB)
score: 1

http://stackoverflow.com/a/78010126
has comment: http://stackoverflow.com/comment/138582545
downvote count: 1
has body: My current solution is to intercept the odoc AppleEvent, and if that's invoked, set a flag that causes [NSApp restoreWindowWithIdentifier:] to return NO. Here's the code inside AppDelegate.m: static AEEventHandlerUPP openDocHandler = NULL; static SRefCon openDocRefcon; static pascal short HandleOpenDocMessage (const AEDesc *theAppleEvent, AEDesc *reply, void* handlerRefcon) { // intercepts the "odoc" Event to check if we're about to open any files, and then continues with the original handler NSAppleEventDescriptor *event = [NSAppleEventDescriptor.alloc initWithAEDescNoCopy:theAppleEvent]; NSURL *url = [NSURL URLWithString:[[event paramDescriptorForKeyword:keyDirectObject] stringValue]]; if (url) { NSString *docType = [NSDocumentController.sharedDocumentController typeForContentsOfURL:url error:nil]; if ([docType isEqualToString:@"..."]) { // I can check for particular types here in case I can open several [(Application*)NSApplication.sharedApplication setSuppressRestorationOfSearchWindows:YES]; } } return openDocHandler (theAppleEvent, reply, openDocRefcon); } - (void)applicationWillFinishLaunching:(NSNotification *)notification { AEGetEventHandler(kCoreEventClass, kAEOpen, &openDocHandler, &openDocRefcon, false); AEInstallEventHandler(kCoreEventClass, kAEOpen, HandleOpenDocMessage, (__bridge SRefCon)(self), false); ... Inside Application.h: @property (assign) BOOL suppressRestorationOfSearchWindows; Inside Application.m: - (BOOL)restoreWindowWithIdentifier:(NSString *)identifier state:(NSCoder *)state completionHandler:(void (^)(NSWindow *, NSError *))completionHandler // override { if ([identifier isEqualToString:@"MyWindowType"] && self.suppressRestorationOfSearchWindows) { // prevent window restoration on startup if the user launched this app by opening a file of my particular type return NO; } else { // continue with regular state restoration return [super restoreWindowWithIdentifier:identifier state:state completionHandler:completionHandler]; } } Feels like a…
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/78010035
score: 2
has comment: http://stackoverflow.com/comment/138572548

http://stackoverflow.com/comment/137659979
type: Comment
has text: Your answer is in my Edit 1.
comment on: http://stackoverflow.com/q/78063975
score: 0
type: QuestionComment

http://stackoverflow.com/a/78018445
answers question: http://stackoverflow.com/q/78014194
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
downvote count: 0
has body: The problem is with ownership. You have one place that creates and takes ownership of the CGMutablePathRef. You then pass that reference to another method that then releases it. But that method should not take responsibility for releasing the reference. It has no idea if the reference it is getting should be released or not. The simple fix is to put the responsibility in the correct place. Change loadSquarePath in GraphicViewController to something like this: - (void) loadSquarePath { CGMutablePathRef path = [SquarePath newSquareBalloonPath]; [self.graphicView loadPath:path]; CGPathRelease(path); } and remove the call to CGPathRelease from loadPath: in GraphicView. Or in the second set of code, remove CGPathRelease from loadGraphicView:withPath: in GraphicViewController. These changes quiet the analyzer because it moves the responsibility of releasing to the same place that took the responsibility of ownership at creation. This also eliminates possible crashes due to the CGReleasePath in loadPath: over-releasing paths that should not be released. While your current code is only passing a path reference that does need to be released, that may not always be the case.
accepted answer of: http://stackoverflow.com/q/78014194

http://stackoverflow.com/comment/138582545
has text: @MarekH I stated the reason in my question, 2nd paragraph. This happened in all macOS versions, not just Sonoma.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78010126
score: 0

http://stackoverflow.com/comment/137478441
has text: Your question is unclear. But `@"Ratings":[NSString stringWithFormat:@"[%@]",[self.ratings componentsJoinedByString:@","]]` seems a lot wrong to me...
type: Comment
comment on: http://stackoverflow.com/q/77982472
score: 0
type: QuestionComment

http://stackoverflow.com/comment/137578209
type: QuestionComment
has text: Does this answer your question? [Any way to iterate a tuple in swift?](https://stackoverflow.com/questions/24299045/any-way-to-iterate-a-tuple-in-swift)
type: Comment
comment on: http://stackoverflow.com/q/78038240
score: 1

state-restoration
tags question: http://stackoverflow.com/q/78010035
type: Tag
tag name: state-restoration

http://stackoverflow.com/a/77974591
answers question: http://stackoverflow.com/q/77974419
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/77974419
score: 0
type: Answer
has body: I figured out the solution in a different way. I got rid of the func layout() function. I put the savedIcon inside an ASInsetLayoutSpec whose top and left are set to CGFloat.infinity. I returned a ASOverlayLayoutSpec whose child is the inseted content and overlay is the above created savedIconSpec. I learnt about this trick from the Photo with Inset Text Overlay example below: https://texturegroup.org/docs/automatic-layout-examples-2.html Now my layoutSpecThatFits looks like this: override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -&gt; ASLayoutSpec { let content = ASStackLayoutSpec(direction: .horizontal, spacing: sizeToUse, justifyContent: .spaceBetween, alignItems: .start, children: [title,thumbnailNode]) let inseted = ASInsetLayoutSpec(insets: UIEdgeInsets(top: sizeToUse, left: sizeToUse, bottom: sizeToUse, right: sizeToUse), child: content) savedIcon.style.preferredSize = CGSize(width: sizeToUse, height: sizeToUse) savedIcon.style.layoutPosition = CGPoint(x: constrainedSize.max.width - sizeToUse, y: 0) let savedIconSpec = ASInsetLayoutSpec(insets: UIEdgeInsets(top: CGFloat.infinity, left: CGFloat.infinity, bottom: 0, right: 0), child: savedIcon) return ASOverlayLayoutSpec(child: inseted, overlay: savedIconSpec) } It looks like this now:

http://stackoverflow.com/comment/137535615
score: 0
has text: FYI - I created a project and added your two sets of code, first one, then the other. After adding enough other code to make it compile, I ran the analyzer. I get the message about the potential leak in both sets of code. I'm using Xcode 15.2 under macOS 14.3.1. Perhaps you need to post a minimal, complete example that replicates the issue. But in either case, the solution is as I stated earlier - the code that should call `CGPathRelease` is the code that calls `newSquarePath`. It makes the analyzer happy and it avoids the risk of over releasing.
type: Comment
comment on: http://stackoverflow.com/q/78014194
type: QuestionComment

http://stackoverflow.com/q/78136069
tagged with: iboutlet
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/137753286
has comment: http://stackoverflow.com/comment/137752347
has body: The results are pretty easy to replicate. Create a new Xcode project called TestWindow. XIB not storyboard. Objective-C Set the project’s scheme to turn off Metal API validation. Set Build Options to NO ARC under Objective-C options. Delete the Main Menu window. Create a new window object called GoWindow. And add a window to it. Set File’s Owner of the AppDelegate object in Placeholders to AppDelegate. Drag a Scrollable Text View from the Library to the Window Connect an IBOutlet NSWindow in AppDelegate to the window. Connect an IBOutlet NSScrollview in AppDelegate to the scrollview in the window. Connect an IBOutlet NSTextView in AppDelegate to the textView in the ScrollView in the window. In AppDelegate, create an IBAction method to makeWindow. Add a menu item called makeWindow to the AppDelegate. Wire the menu item to the IBAction in AppDelegate. Create a method in AppDelegate called makeWindowContinued. Add a breakpoint to an NSBeep(); inside the makeWindowContinued method. Add [self performSelector:@selector(makeGoWindowContinued) withObject:nil afterDelay:1]; to the AppDelegate method. Run the app. The breakpoint will trigger allowing you to see that the three outlets and not being set. Here is the resultant AppDelegate.h code: #import <Cocoa/Cocoa.h> @interface AppDelegate : NSObject <NSApplicationDelegate> { IBOutlet NSWindow *theDocumentWindow; IBOutlet NSScrollView *theDocumentWindowScrollView; IBOutlet NSTextView *theDocumentWindowTextView; NSWindowController *myDocumentWindowController; } - (NSWindowController *)myDocumentWindowController ; - (void)set_myDocumentWindowController:(NSWindowController *)t; - (IBAction)makeWindow:(id)sender; - (void)makeGoWindowContinued; @end And the resultant AppDelegate.m code: #import "AppDelegate.h" @interface AppDelegate () @property (strong) IBOutlet NSWindow *window; @end @implementation AppDelegate - (NSWindowController *)myDocumentWindowController {return myDocumentWindowController;} - (void)set_myDocumentWindowCon…
has comment: http://stackoverflow.com/comment/137751635
has comment: http://stackoverflow.com/comment/137750683
has title: I would like to know why I’m not getting IBOutlets connected in an App’s window
tagged with: objective-c
has comment: http://stackoverflow.com/comment/137752043
tagged with: xib
tagged with: cocoa
answer count: 0
has comment: http://stackoverflow.com/comment/137757160
tagged with: xcode
has comment: http://stackoverflow.com/comment/137752389
has comment: http://stackoverflow.com/comment/137751250
has comment: http://stackoverflow.com/comment/137752368
has comment: http://stackoverflow.com/comment/137754979
score: 0
has comment: http://stackoverflow.com/comment/137752356
has comment: http://stackoverflow.com/comment/137781909
type: Question

http://stackoverflow.com/comment/137709959
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78112507
has text: thanks @lazarevzubov for the suggestion. My bad that I haven't added the crash that I am getting. I have added now. Also I was using valueForKeyPath:@"navigationbar" and it was working fine till Xcode 14 and its even working on iOS 16 when build with Xcode 15. Its only crashing when I am running with combination of Xcode 15 and iOS 17
type: QuestionComment

http://stackoverflow.com/comment/140022744
type: Comment
has text: Also, what if my (security tool) binary, which isn't an app at all - needs to send AppleEvents to other 3rd party apps NOT in the same app-group? Why would this dialog pop again and again and again even if user presses "Allow" every time?
comment on: http://stackoverflow.com/a/79177597
score: 0
type: AnswerComment

http://stackoverflow.com/a/79177597
has comment: http://stackoverflow.com/comment/140099595
upvote count: 5
type: Answer
score: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/139847881
has comment: http://stackoverflow.com/comment/140022744
has comment: http://stackoverflow.com/comment/140022736
has body: macOS Sequoia has started to fully control security. The issue is with App Groups in xCode. The app developer in xCode should go to the section (repeat for each target): Signing &amp; Capabilities → Targets → TARGET_NAME → App Groups → App Group where he should specify the following: $(TeamIdentifierPrefix)myFirm.myName A fictitious ID like this does not work: myGroupID.myFirm.myName And in the program code he should specify the real group ID (in numbers): let storeDirectory = FileManager.default.containerURL( forSecurityApplicationGroupIdentifier: “0123456789.myFirm.myName” ) After recompiling the app, the problem disappears.
answers question: http://stackoverflow.com/q/77976279

http://stackoverflow.com/comment/137575373
has text: session2 is the client with the userName, password and transport and connectsWithConnectHandler. I have put didEnterBackground in my code and tried it with the added code but nothing happens. There is a didEnterBackground in the AppDelegate that works but since the Session2 is created in the main ViewController I can't put it into the AppDelegate. I have tried to create session2 in the AppDelegate and use it in the ViewController but no go. Thanks
type: Comment
comment on: http://stackoverflow.com/q/78036902
type: QuestionComment
score: 0

http://stackoverflow.com/a/77969819
has comment: http://stackoverflow.com/comment/137461025
type: Answer
has comment: http://stackoverflow.com/comment/137457008
has body: Your storyboard is not located within main app bundle. You may try it in next way, where the CardsViewsController class is expected to be part of your SDK: NSBundle *sdkBundle = [NSBundle bundleForClass:[CardsViewsController class]]; UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"WalletMain" bundle:sdkBundle];
score: 0
answers question: http://stackoverflow.com/q/77969695

cgpath
tag name: cgpath
tags question: http://stackoverflow.com/q/78014194
type: Tag

http://stackoverflow.com/q/78014194
has comment: http://stackoverflow.com/comment/137534938
has comment: http://stackoverflow.com/comment/137534872
score: 1
has comment: http://stackoverflow.com/comment/137535615
has comment: http://stackoverflow.com/comment/137534910
has comment: http://stackoverflow.com/comment/137563484
has comment: http://stackoverflow.com/comment/137541791
has comment: http://stackoverflow.com/comment/137534822
has comment: http://stackoverflow.com/comment/137534812
tagged with: ios
has answer: http://stackoverflow.com/a/78018445
has comment: http://stackoverflow.com/comment/137534984
type: Question
upvote count: 1
answer count: 1
tagged with: core-graphics
tagged with: objective-c
has body: I have a class GraphicView that basically creates a UIView that uses a CAShapeLayer as its default layer object: GraphicView.h #import <UIKit/UIKit.h> @interface GraphicView : UIView { CAShapeLayer *_shapeLayer; } @property(nonatomic, strong) CAShapeLayer *shapeLayer; - (void) loadPath:(CGPathRef)path; @end GraphicView.m #import "GraphicView.h" @implementation GraphicView - (id) initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.shapeLayer = (CAShapeLayer *) self.layer; } return self; } + (Class)layerClass { return [CAShapeLayer class]; } - (void) loadPath:(CGPathRef)path { CGMutablePathRef tempPath = path; self.shapeLayer.path = tempPath; CGPathRelease(tempPath); } @end When I call loadPath: GraphicViewController.m - (void) loadSquarePath { [self.graphicView loadPath:[SquarePath newSquarePath]]; } SquareBalloonPath.m - (CGMutablePathRef) newSquareBalloonPath { CGSize mutablePathInitialSize = [self squareBalloonPathInitialSize]; CGMutablePathRef mutablePath = CGPathCreateMutable(); CGPathMoveToPoint(mutablePath, NULL, 0, 0); CGPathAddRect(mutablePath, NULL, CGRectMake(0, 0, mutablePathInitialSize.width, mutablePathInitialSize.height)); CGPathCloseSubpath(mutablePath); return mutablePath; } I get an analyzer error saying "Potential leak of an object of type 'CGMutablePathRef'". However, when I move loadPath from GraphicView to GraphicViewController (and change the method header to loadGraphicView:WithPath: GraphicViewController.m - (void) loadGraphicView:(GraphicView *)graphicView withPath:(CGPathRef)path { CGPathRef tempPath = path; graphicView.shapeLayer.path = tempPath; CGPathRelease(tempPath); } - (void) loadSquarePath { [self.graphicView loadPath:[SquarePath newSquarePath]]; } The analyzer error goes away! Is there something I have to tell the compiler so I can get loadPath to work when it's included as an instance method within GraphicView?
has title: Xcode analyzer is showing leak for CGPathRef when it's in a class instance method?
favorite count: 0
tagged with: cgpath
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/137572600
accepted answer: http://stackoverflow.com/a/78018445
tagged with: clang-static-analyzer
has comment: http://stackoverflow.com/comment/137534923
downvote count: 0

http://stackoverflow.com/q/77973278
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
tagged with: azure
score: 0
tagged with: python
has title: Determine which microphone source to use for Azure Cognitive Services with Python
has answer: http://stackoverflow.com/a/77979357
has body: I've set up an instance of Azure Cognitive Services to listen on a microphone for a key phrase. This works fine, however I'm unable to tell it to listen to a specific microphone on my Apple Mac. The code I have is: mic_name = self.preferences.get('mic_name', None) self.audio_config = speechsdk.audio.AudioConfig(device_name=mic_name) if mic_name else None ... self.keyword_recognizer = speechsdk.KeywordRecognizer(audio_config=self.audio_config) Where I'm providing the microphone name as the device name to the speechsdk.audio.AudioConfig library. However from what I can read via https://aka.ms/csspeech/microphone-selection it seems I need to provide the device ID, not the name or index which is what pyaudio gives me. I've been searching online in an attempt to find a solution to getting the device ID, and the only thing I've been able to determine is that the pyobjc package might be needed in order to interact with the hardware via objective-c. Yet my attempts at that have also failed. Does anyone know of an existing library, or example I could reference, where a Python script is able to return the ID of a microphone device so I can provide it to the Speech Services SDK? (I also want this to work for windows, but that is a seperate matter) === Update - to be clear, I need the user to be able to select the microphone they want to use from a dropdown, and then pass said Microphone ID through to the speechsdk.audio.AudioConfig library.
tagged with: azure-cognitive-services
type: Question

http://stackoverflow.com/comment/137576762
type: QuestionComment
has text: Just `fooStrings[0]`. `NSArray` is toll-free bridged to Swift `Array` and `NSString` is toll-free bridged to Swift `String`
type: Comment
score: 1
comment on: http://stackoverflow.com/q/78038240

http://stackoverflow.com/comment/137710828
type: Comment
score: 0
has text: Ill have to do more investigations on this. It seems to me that xCode does more than advertised - i.e. does more than set CFBundleURLTypes
comment on: http://stackoverflow.com/a/78107492
type: AnswerComment

http://stackoverflow.com/comment/137577052
type: QuestionComment
has text: You can create obj-c function that returns NSString from that array by index and use that function from swift. That would probably be cleaner than messing with unsafe pointers in swift.
type: Comment
score: 1
comment on: http://stackoverflow.com/q/78038240

http://stackoverflow.com/comment/137727488
comment on: http://stackoverflow.com/a/78112109
type: Comment
score: 0
has text: Please do not post code-only answers. A good answer explains how it solved the issue.
type: AnswerComment

http://stackoverflow.com/comment/137599324
type: AnswerComment
type: Comment
has text: @son Good point about the `__MAC_14_0` macro. That probably isn't defined in Xcode 14. I don't actually have Xcode 14 so I didn't catch that oversight in my answer. I need to update for that.
score: 1
comment on: http://stackoverflow.com/a/78046631

http://stackoverflow.com/comment/137591579
score: 1
has text: with #if, how we can check for Mac OS version availability ?
comment on: http://stackoverflow.com/a/78046631
type: AnswerComment
type: Comment

http://stackoverflow.com/q/77976279
score: 5
type: Question
has comment: http://stackoverflow.com/comment/137544699
tagged with: security
tagged with: macos
favorite count: 0
type: AnsweredQuestion
upvote count: 5
has answer: http://stackoverflow.com/a/79177597
answer count: 2
has answer: http://stackoverflow.com/a/78929081
tagged with: objective-c
has comment: http://stackoverflow.com/comment/137472977
has title: <app> would like to access data from other apps - macOS Sonoma
downvote count: 0
accepted answer: http://stackoverflow.com/a/78929081
possible better answer: http://stackoverflow.com/a/79177597
tagged with: macos-sonoma
has body: i have a properly sandboxed and codesigned app for macOS in objective-c. On Sonoma (macOS 14) i keep getting the dialog " would like to access data from other apps". According to Apple Developer this is a new security related message on macOS 14.2. See here: https://developer.apple.com/forums/thread/742147 My App is developed according to Apples guidelines. E.g. using Open or SavePanels, Security scoped Bookmarks and so on. It does NOT try to access anothers app AppContainer (so this is whats confusing me). My app controls another one by the usage of Apple Events but i do not try to access the apps AppContainer to read/write data. CodeSigning uses a valid DeveloperIDApplication signature, Notarization also succeeds every time. I searched through Developer Docs, Forums and so on and I am quite lost, just seeing that others got this issue too. Any hint towards the right direction is very much appreciated.

http://stackoverflow.com/comment/137709997
score: 0
type: QuestionComment
has text: This custom navigation bar is being used in more than 15 view controllers. So, I didn't want to go in each one of them and create separate buttons and navigations items, that why I created a separate custom class.
comment on: http://stackoverflow.com/q/78112507
type: Comment

http://stackoverflow.com/comment/137722388
type: Comment
has text: Thanks, I edited the post corresponding to your questions.
score: 0
comment on: http://stackoverflow.com/q/78109418
type: QuestionComment

http://stackoverflow.com/q/78091416
score: 0
has body: If I create a command line tool project and run something like: NSError *error = nil; NSFileManager *fileManager = [NSFileManager defaultManager]; if(![fileManager createDirectoryAtPath:@"/vault/ahh/eee" withIntermediateDirectories:YES attributes:nil error:&error]) { NSLog(@"couldn't make dir: %@", error); } I am actually able to make the 'eee' directory. But if I do the same thing with an app (Cocoa): couldn't make dir: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “eee” in the folder “ahh”." UserInfo={NSFilePath=/vault/ahh/eee, NSUnderlyingError=0x600000a5d800 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}} Why is this and what should I do for the app so that it can handle file accesses?
has title: No file access permission for Cocoa app but works with command line app
has comment: http://stackoverflow.com/comment/137671426
tagged with: permissions
has answer: http://stackoverflow.com/a/78094355
type: Question
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
tagged with: cocoa

http://stackoverflow.com/q/78069138
has comment: http://stackoverflow.com/comment/137656686
type: UnansweredQuestion
tagged with: mqtt
answer count: 0
tagged with: mosquitto
has body: I have create a MQTT system using MQTTClient library on my Arduino IDE for ESP8266 to publish and subscribe to io.Adafruit. Everything is working great except there is some functionality that I can't get on an app I developed for my iPhone/iPad using MQTT. So I have installed a Mosquitto broker on an old MacBook pro using Homebrew. When I look at the Publish and Subscribe code for the broker on the MacBook it looks different than that I use on the Arduino and iPhone app. //this is on the arduino using MQTTClient library //connect Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY); //publish Adafruit_MQTT_Publish temperature = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/temperature"); //subscribe Adafruit_MQTT_Subscribe trip2 = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/temperature"); On the local Mosquitto on MacBook I use this it subscribe mosquitto_sub -t topic/state //and this to publish mosquitto_pub -t topic/state -m "hello World" Is there a way to reconcile these so they work together? Can someone recommend a book or website or tutorial that will help me do this?
tagged with: objective-c
tagged with: macos
has comment: http://stackoverflow.com/comment/137656721
has title: How do I use MQTTClient library on Arduino to publish and subscribe to the MQTT broker installed on a Mac using Homebrew?
score: 0
has comment: http://stackoverflow.com/comment/137631401
has comment: http://stackoverflow.com/comment/137645160
tagged with: arduino-esp8266
type: Question
has comment: http://stackoverflow.com/comment/137644683

http://stackoverflow.com/q/78008072
tagged with: ios
has title: NSInvalidArgumentException: expected Dictionary but actual _SwiftDeferredNSDictionary
score: 0
tagged with: objective-c
tagged with: bridging
tagged with: react-native
type: Question
upvote count: 1
tagged with: swift
answer count: 1
has body: I'm working on a ReactNative application with native dependencies. Particularly I'm trying to link iOS xcframework of a proprietary library. I can build an application and init SDK but in a couple of moments after it, the app crashes because the SDK is trying to send an analytics but fails. The error message: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unacceptable type of value for attribute: property = "data"; desired type = Dictionary; given type = _TtGCs26_SwiftDeferredNSDictionarySSSS_$; value = { "app_type" = MEP; "application_bundle_id" = "xxx"; "application_installer_id" = "com.apple.dt.Xcode"; "application_name" = xxx; "application_version" = "999.999.999"; "client_id" = "xxx"; country = xxx; "device_platform" = "iPhone16,1|iOS|17.2"; "external_app_id" = "xxx"; "mep_analytics_sdk_version" = "1.1.1"; }.' Top of the backtrace: Last Exception Backtrace: 0 CoreFoundation 0x110ee6751 __exceptionPreprocess + 226 1 libobjc.A.dylib 0x116290904 objc_exception_throw + 48 2 CoreData 0x10f367a7c _PFManagedObject_coerceValueForKeyWithDescription + 2175 3 CoreData 0x10f36f51b _sharedIMPL_setvfk_core + 177 4 CoreData 0x10f3737e3 _sharedIMPL_copying_setvfk_core + 54 5 XxxAnalytics 0x1137d94f5 specialized Client.__allocating_init(entity:insertInto:id:data:) + 229 6 XxxAnalytics 0x1137e5a13 closure #1 in AnalyticsStorageManager.add(_:) + 355 7 XxxAnalytics 0x1137daedc thunk for @callee_guaranteed () -> () + 12 8 XxxAnalytics 0x1137daefe thunk for @escaping @callee_guaranteed () -> () + 14 9 CoreData Where XxxAnalytics is a proprietary lib that I'm linking. Investigation: When I link the lib to a new ReactNative application (created with npx react-native@0.71.2 init TestProj) everything works OK. But when I link it with the production application it crashes. Looks like the issue is in build settings but I don't know where exactly. The production application doesn't use ReactNative autolinking. In Swift sources I've found that SwiftDeferred…
favorite count: 0
downvote count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/78036742

http://stackoverflow.com/q/78099020
has answer: http://stackoverflow.com/a/78100797
accepted answer: http://stackoverflow.com/a/78100797
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/137684995
answer count: 1
tagged with: objective-c
tagged with: delegates
tagged with: cocoa
has comment: http://stackoverflow.com/comment/137837467
has body: I've looked at other delegate questions but there weren't any good existing answers. Everything should be set up properly, I can see my slider will change value in logs. For some reason, the delegate function numberOfSquaresInSquareView() never fires when I call it from squareView, and the squareView delegate call just returns nil. I know I am fairly close since this closely matches some lessons I've found, but I think I am missing something. The changeSquareCount() works and I can see in logs that it saves the value. squareView.h #import <Cocoa/Cocoa.h> NS_ASSUME_NONNULL_BEGIN @class SquareView; @protocol SquareViewDelegate <NSObject> - (NSNumber *)numberOfSquaresInSquareView:(SquareView *)squareView; @end @interface SquareView : NSView @property (nonatomic, weak) id<SquareViewDelegate> delegate; @end NS_ASSUME_NONNULL_END squareView.m #import "SquareView.h" @implementation SquareView @synthesize delegate; - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { } return self; } - (void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; NSLog(@"drawing rect"); [[NSColor redColor]set]; //NSNumber *num = ; //cound pass in nil, dont matter NSLog(@"squares to draw: %@", [delegate numberOfSquaresInSquareView:self]); // Drawing code here. } @end AppController.h #import <Foundation/Foundation.h> #import "SquareView.h" //@class SquareView; NS_ASSUME_NONNULL_BEGIN @interface AppController : NSObject <SquareViewDelegate> @property (retain) IBOutlet SquareView *squareView; - (IBAction)changeSquareCount:(id)sender; @end NS_ASSUME_NONNULL_END AppController.m #import "AppController.h" @implementation AppController { NSNumber *_squareCount; } @synthesize squareView = _squareView; - (void)awakeFromNib { [_squareView setDelegate:nil]; _squareCount = @(10); [_squareView setNeedsDisplay:YES]; } - (void)changeSquareCount:(id)sender { _squareCount = @([sender intValue]); NSLog(@"square count stored: %@",_squareCount); [_squareView setNeedsDisplay:YES]; …
has title: Delegate does not trigger method
score: 0
type: Question
has comment: http://stackoverflow.com/comment/137687502

http://stackoverflow.com/comment/139612449
comment on: http://stackoverflow.com/a/78929081
score: 0
type: AnswerComment
has text: Any news on this ? Same problem here...still not solved in 2024-11-10
type: Comment

http://stackoverflow.com/comment/137757160
has text: Have you tried `[[NSWindowController alloc] initWithWindowNibName:@"GoWindow" owner:self]`? The File's Owner class is `AppDelegate`.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78136069

http://stackoverflow.com/a/78012538
score: -1
answers question: http://stackoverflow.com/q/78010035
has comment: http://stackoverflow.com/comment/137532013
type: Answer
has comment: http://stackoverflow.com/comment/137537715
has body: Can you maybe delay state restoration? Queue up all the data you get for restoring state, return an "everything fine" value, and then wait for 'oapp' Apple Event to restore it (or just clear the queue if an 'odoc' arrives).
upvote count: 1
downvote count: 2

http://stackoverflow.com/comment/137696941
score: 0
comment on: http://stackoverflow.com/q/78081552
has text: Thanks matt. I solved it refer below link. https://huisoo.tistory.com/17
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/137701937
has text: In Xcode, select your project file, choose your target and select the 'Info' tab. This list 'Custom macOS Application Target properties' first, and then below, 'URL Types'. Click +, and set an identifier (reverse domain is recommended) [com.example.myApp], and set [myApp] as URL Schemes. In the AppDelegate, implement -(BOOL) application:(NSApplication*)app continueUserActivity..... Run the app. In Safari, type [myApp://Open] and it asks to open the app.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78107492

http://stackoverflow.com/a/78104547
has body: This looks like TableViewController is loaded from a Storyboard or XIB (given the IBOutlet annotation). init isn't going to be called in that case. You'll need to put your logic in awakeFromNib, as you do for MainController. You'll also need to make sure that you've actually wired the delegate property to TableViewController in the XIB. This is a very common thing to forget to do. Make sure that delegate isn't nil. If "nothing happens" then something is almost certainly nil.
score: 0
has comment: http://stackoverflow.com/comment/137695234
answers question: http://stackoverflow.com/q/78104447
has comment: http://stackoverflow.com/comment/137701549
type: Answer

http://stackoverflow.com/comment/137708802
type: Comment
score: 0
has text: Sure i posted it
type: QuestionComment
comment on: http://stackoverflow.com/q/78081552

http://stackoverflow.com/comment/137752043
score: 0
comment on: http://stackoverflow.com/q/78136069
type: QuestionComment
has text: Step 7 creates a window object with a window in it. That window will have a scrollView in it. Step 8 sets the File's Owner to App Delegate, I also tried setting File's Owner to NSApplication, No luck. The AppDelegate files (.h and .m) were created by Xcode when the project was created. The object of the question is to find out why the IBOutles are still nil when the breakpoint occurs. The window has had plenty of time to load.
type: Comment

http://stackoverflow.com/q/78129895
answer count: 1
type: UnansweredQuestion
favorite count: 0
has title: [MyTarget]-Swift.h does not have MySwiftClass declaration
upvote count: 0
has body: On macOS CoreAudio plugin development, I try to call Swift func from Objective-C code. But I get error: Use of undeclared identifier 'MySwiftClass' I checked these. Add "@objc" on Swift class and public func. #import "[MyTarget]-Swift.h" on Objective-C code On Xcode "Target Membership" of MySwiftClass.swift, MyTarget is checked. Set Swift version to Swift5. Set macOS min support to 12.3. Run xcodebuild on command line and fixed all error But "[MyTarget]-Swift.h" under ~/Library/Developer/Xcode/DerivedData/[MyProject]-[hash] has no declaration of MySwiftClass I like to know command to generate [MyTarget]-Swift.h, and find out why MySwiftClass is ignored. If target is macOS app, I can call Swift func from Objective-C code.
has answer: http://stackoverflow.com/a/78130070
tagged with: objective-c
score: -1
tagged with: core-audio
downvote count: 1
type: Question
tagged with: swift

http://stackoverflow.com/comment/137645160
comment on: http://stackoverflow.com/q/78069138
has text: It you want to subscribe to multiple topics then you need to specify this on the command like (e.g. `mosquitto_sub -t topic/state -t topic/temp -t feed/#`). If you subscribe to a topic and no messages are published on that topic then nothing will appear to happen (the program is just waiting for a message that never comes). You may benefit from reading an MQTT introduction (e.g. [steves](http://www.steves-internet-guide.com/mqtt/), [Hives](https://www.hivemq.com/article/how-to-get-started-with-mqtt/)).
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/137707101
score: 0
has text: `-reportBlockkonfigurieren:` is an action, not an outlet. What is the class of the view controller in IB? How is the view controller instantiated? How old is the Xcode project?
type: Comment
comment on: http://stackoverflow.com/q/78109418
type: QuestionComment

http://stackoverflow.com/comment/137751250
score: 0
comment on: http://stackoverflow.com/q/78136069
type: QuestionComment
has text: Sorry, I copied the question's text from Notes. Didn't know how to format but it seems to be right now, above.
type: Comment

http://stackoverflow.com/comment/137477021
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/77979357
has text: Your updated solution uses the mic name, not the ID - I've tried passing it the name (see my initial question), but it doesn't pick up the microphone based on the name. As such, I want to find the device ID to pass through. I appreciate your help, but I think you're maybe not understanding the issue?

http://stackoverflow.com/q/78131990
tagged with: objective-c
has comment: http://stackoverflow.com/comment/137746033
has answer: http://stackoverflow.com/a/78136461
has comment: http://stackoverflow.com/comment/137746030
has comment: http://stackoverflow.com/comment/137749585
has title: Saving nested array of objects to JSON
type: Question
tagged with: http://stackoverflow.com/tag/json
answer count: 1
has comment: http://stackoverflow.com/comment/137749590
type: UnansweredQuestion
has body: I have an array of nested objects that I want to save as JSON. Object is defined as following: @interface TreeNode : NSObject @property(nonatomic, strong) NSString *title; @property(nonatomic, strong) NSMutableArray&lt;TreeNode *&gt; *children; @property(nonatomic, strong) NSString *identifier; @property(nonatomic, assign) bool isCompleted; - (instancetype)initWithValue:(NSString *)title :(NSString *)number; - (void)addChild:(TreeNode *)child; @end @implementation TreeNode - (instancetype)initWithValue:(NSString *)title :(NSString *)number { self = [super init]; if (self) { _isCompleted = false; _title = [title copy]; _identifier = [number copy]; _children = [[NSMutableArray alloc] init]; } return self; } - (void)addChild:(TreeNode *)child { [_children addObject:child]; } - (void)dealloc { [_title release]; [_identifier release]; [_children release]; [super dealloc]; } @end The above object is added to array as unlimited nested objects as following: [[String,[[String,[]], [String,[]]]],[String,[]],[String,[]]] [String,[]] above represents my class object(TreeNode). I want to save it locally in document directory. I am trying to save it as JSON but not able to convert it to JSON object.
has comment: http://stackoverflow.com/comment/137751165
favorite count: 0
upvote count: 0
score: -1
has comment: http://stackoverflow.com/comment/137751287
downvote count: 1

http://stackoverflow.com/comment/137752389
type: QuestionComment
has text: I think that is what I did in the MakeWindow method.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78136069

http://stackoverflow.com/q/78109418
tagged with: macos-sonoma
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/137722388
has body: I have two rather old app that use Objectiv-C-code, integrated with an Interface-Bridging-Header file. One runs well on Sonoma, but the other has an NSViewViewController class using IBOutlets and IBActions in the Objective-C-Part. That run well in macos Monterey with Xcode 14. But now with Sonoma and Xcode15, the IBOutlets and the corresponding IBActions are not connected any more: For the IBOutlets, the error is: Failed to connect (CNC_BlockKonfigurierenTaste) outlet from (NSViewController) to (NSButton): missing setter or instance variable and the error for the IBAction is Could not connect action. Target class 'NSViewController' does not respond to '-reportBlockkonfigurieren:' The IBOutlet CNC_BlockKonfigurierenTaste and the IBAction function reportBlockkonfigurieren are declared in the Objective-C header file and implemented in the corresponding c file. The IBOutlets defined in the Objectiv-C file also do not respond to mouseclicks. The viewcontroller is class rViewController: NSViewController, NSWindowDelegate It has a member AVR which is instantiated inas var AVR = rAVRview() The project is a CNC-Hotwire-cutting app, started in 2014 in pure Objectiv-C and revised for every new version of Xcode. It run well until macos Monterey. The objective-C files are about 25'000 lines, making translating to swift a big job. My question: Is connecting IBOutlets and IBActions from Objective-C no more supported in Xcode15?
tagged with: bridging-header
has comment: http://stackoverflow.com/comment/137707101
answer count: 0
score: 0
tagged with: objective-c
has title: How to use Interface-Bridging-Header.h in macos Sonoma
tagged with: xcode15
has comment: http://stackoverflow.com/comment/137722615
type: Question

http://stackoverflow.com/a/77983161
has body: If you want to prepare a JSON request, you would use NSJSONSerialization. But, first, I would advise not using stringValue when building your array of ratings. You want numbers as NSNumber: self.ratings = [[NSMutableArray alloc] init]; for (RatingQuestion *question in reviewQuestions) { [self.ratings addObject:@{ @"QuestionId": question.ID, @"Rating": question.rating, }]; } Then, you want to build JSON, just put your ratings (an NSArray of NSDictionary) in the params dictionary (and, again, avoiding stringValue for ustaID and jobID): NSDictionary *params = @{ @"Ratings": self.ratings, @"Comment": self.comment, @"UstaId": self.ustaID, @"JobId": self.jobID }; Then, to build the JSON, use NSJSONSerialization: NSError *error = nil; NSData *json = [NSJSONSerialization dataWithJSONObject:params options:NSJSONWritingPrettyPrinted error:&error]; if (!json) { NSLog(@"error: %@", error); return; } Now, you can use that json however you want. For example, you likely want to set the HTTPBody of an NSMutableURLRequest: NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url]; [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; request.HTTPMethod = @"POST"; request.HTTPBody = json; If you want to confirm that the JSON is what you expected (for debugging purposes), you can also create an NSString of that NSData: NSString *string = [[NSString alloc] initWithData:json encoding:NSUTF8StringEncoding]; NSLog(@"%@", string); Which will output: { "JobId" : 564876565946, "UstaId" : 242816809697, "Comment" : "test postman", "Ratings" : [ { "QuestionId" : 3533, "Rating" : 4 }, { "QuestionId" : 9767, "Rating" : 4 } ] } Note, above I used the NSJSONWritingPrettyPrinted option. Once you have confirmed that the JSON is what you want, you can use 0 or kNilOptions instead. But pretty-printed format is useful when visually inspecting the JSON for correctness. Note, the reason we make sure our NSDictionary has numeric values as NSNumber rather than NSStrin…
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/77982472
answers question: http://stackoverflow.com/q/77982472

http://stackoverflow.com/comment/137534812
type: QuestionComment
has text: Since `loadGraphicView` takes a GraphicView as a parameter, why isn't it an _instance_ property of GraphicView (that _doesn't_ take a GraphicView as a parameter)? Just call it `-(void) loadWithPath:`.
type: Comment
comment on: http://stackoverflow.com/q/78014194
score: 0

http://stackoverflow.com/comment/137461025
comment on: http://stackoverflow.com/a/77969819
has text: please can someone help me in this
score: 0
type: AnswerComment
type: Comment

permissions
tags question: http://stackoverflow.com/q/78091416
tag name: permissions
type: Tag

http://stackoverflow.com/comment/137599287
comment on: http://stackoverflow.com/a/78046631
has text: FYI - you don't need to explicitly import AvailabilityMacros.h. You usually get it automatically through other main imports you would use in an AppKit app (or other frameworks). It's also best to avoid using numbers such as `140000`. There are much more human readable macros (as seen in my answer).
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/q/77976314
tagged with: objective-c
answer count: 0
has comment: http://stackoverflow.com/comment/137469771
upvote count: 2
tagged with: nslocalizedstring
type: Question
has comment: http://stackoverflow.com/comment/137475145
type: UnansweredQuestion
has body: I have an older objective-C iOS project with thousands of strings, both user facing and internal, that is not localized. My main challenge is to identify user facing text that are string literals in code without NSLocalizedString wrapper. I cannot just find and replace all string literals in code, as some (hundreds) of them are not user facing text. Is there a way to find all the user facing strings, and wrap them with NSLocalizedString so that I can localize my app?
score: 1
favorite count: 0
tagged with: localization
tagged with: ios
downvote count: 1
has title: What is the best way to find all user facing text in an iOS app for localization?

http://stackoverflow.com/comment/137578144
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/78038240
type: Comment
has text: It's imported in swift as tuple, so it will be `fooString.0`. Do you need iterate over that array or `fooString.0` will be enough?

http://stackoverflow.com/comment/137684437
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78032397
has text: Does this answer your question? [New React Native iOS app size over 500 MB - in release mode](https://stackoverflow.com/questions/75740568/new-react-native-ios-app-size-over-500-mb-in-release-mode)

http://stackoverflow.com/comment/137670795
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78091125
type: Comment
has text: Please update your question showing how you create and setup `mainViewContainer`.

http://stackoverflow.com/q/78010035
tagged with: macos
possible better answer: http://stackoverflow.com/a/78010126
has answer: http://stackoverflow.com/a/78012538
accepted answer: http://stackoverflow.com/a/78014672
downvote count: 1
answer count: 3
type: Question
upvote count: 8
tagged with: objective-c
has answer: http://stackoverflow.com/a/78010126
tagged with: cocoa
has comment: http://stackoverflow.com/comment/137530049
score: 7
favorite count: 0
has comment: http://stackoverflow.com/comment/137535466
tagged with: state-restoration
has title: How to prevent automatic State Restoration if the app was launched to open specific documents?
has answer: http://stackoverflow.com/a/78014672
has body: I have implemented State Restoration in my AppKit (Cocoa) app. That works. However: If the user opens the app by double clicking a document file saved by the app, then I want the app not to restore the previous windows but only open the document that was opened in Finder. The problem is that the state restoration appears to happen before the handlers for opening document files are invoked, so even if I had a way to suppress the state restoration, I have no knowledge of the pending openURL calls at that point, yet. I understand that I could check the launch arguments, but that seems to be a rather dirty way. I'd think that I should be able to query the stored file paths/URLs from the app object somehow, but I can't find anything. Or can I change the order of restoring documents vs. opening documents? I've so far found out that both happens deep inside [NSDocument restoreDocumentWindowWithIdentifier:state:completionHandler:], inside the completionHandler function. I could not find an overridable function below that where I'd have more control over this, though. I implement State Restauration by overriding restoreStateWithCoder: and encodeRestorableStateWithCoder: in my NSDocument subclass.
type: AnsweredQuestion
tagged with: swift

http://stackoverflow.com/a/78066436
answers question: http://stackoverflow.com/q/78066067
upvote count: 1
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/78066067
has comment: http://stackoverflow.com/comment/137625370
type: AcceptedAnswer
has body: I gues there is a typo here. It was retractingFact in Objective-C and assertingFact in Swift. //Objc-C [ruleSystem addRule:[GKRule ruleWithPredicate:playerNear retractingFact:@"hunt" grade:1.0]]; ///Swift ruleSystem.add(GKRule(predicate: playerNear, assertingFact: assertingFactKey, grade: 1.0)) And you might consider changing to this rather than hard code in the format. let num = 10.0 let playerFar = NSPredicate(format: "$distanceToPlayer.floatValue >= %f", num)
type: Answer

http://stackoverflow.com/q/78046487
tagged with: objective-c
has answer: http://stackoverflow.com/a/78046631
possible better answer: http://stackoverflow.com/a/78046631
tagged with: xcode
score: 0
has answer: http://stackoverflow.com/a/78050635
type: AnsweredQuestion
answer count: 2
has comment: http://stackoverflow.com/comment/137591309
has title: Xcode is throwing compile error even if use #available for older version Xcode
accepted answer: http://stackoverflow.com/a/78050635
has body: Xcode14 is throwing compile error - When I use clipsToBounds property in Mac OS 14 with Xcode 15 it works. I need to run code on both Xcode 15 and Xcode 14. I added availability check, but its failing at compile time. any suggestion?
tagged with: macos
has comment: http://stackoverflow.com/comment/137614163
has comment: http://stackoverflow.com/comment/137591351
linked to: http://stackoverflow.com/q/58083310
type: Question

http://stackoverflow.com/comment/137631401
has text: Sorry, I'm unclear as to what kind of answer you are looking for here (bearing in mind that requests for books etc are [off topic](https://stackoverflow.com/help/on-topic) here). Take a look at the [`mosquitto_sub` docs](https://mosquitto.org/man/mosquitto_sub-1.html); these will show you how to specify the server, username, password etc.
type: Comment
comment on: http://stackoverflow.com/q/78069138
type: QuestionComment
score: 1

http://stackoverflow.com/a/78107492
answers question: http://stackoverflow.com/q/78106703
has comment: http://stackoverflow.com/comment/137705474
type: Answer
has comment: http://stackoverflow.com/comment/137701937
upvote count: 1
has comment: http://stackoverflow.com/comment/137710828
score: 1
has comment: http://stackoverflow.com/comment/137701772
has comment: http://stackoverflow.com/comment/137705630
downvote count: 0
has comment: http://stackoverflow.com/comment/137704534
has body: You need to add a URL to your target (Project &gt; Target &gt; Info &gt; URL Types) [Example here] Then, follow this guide and run your application. From a browser, type in your urlscheme (yourAppName://open) and Safari asks if you want to open the app. This works for a Objective-c application, I don't know what QT is (hopefully not QuickTime).. Also, I would personally avoid using 10+ year old SO questions as a reference, a lot have happend since :) Edit: Added a few screenshots to help explain: Run the app to register the URL schema In Safari, type schema://whatever User is promted to open the app or not

http://stackoverflow.com/comment/137670909
comment on: http://stackoverflow.com/q/78091125
type: Comment
score: 0
has text: So `mainViewContainer` is a view inside a view inside a stack view which is in another stack view? Are there any constraints on `mainViewContainer` to size and position it within its parent view? When using constraints, do not also set the `autoresizingMask`.
type: QuestionComment

http://stackoverflow.com/comment/137702360
score: 0
has text: I'm not clicking a link. If you have a solution, post it here as an Answer. Answering your own question is legal and encouraged.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78081552

http://stackoverflow.com/a/78093159
upvote count: 2
type: Answer
has body: The problem is that you end up calling roundSpecificCorners when auto-layout has not yet set the final frame / bounds. You will find it much easier to use a UIView subclass that updates the corners on its own. Quick example: @interface RoundedCornersView : UIView @end @implementation RoundedCornersView - (void)layoutSubviews { [super layoutSubviews]; CAShapeLayer *maskLayer = [CAShapeLayer layer]; maskLayer.path = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10.0, 10.0)].CGPath; self.layer.mask = maskLayer; } @end In Storyboard, select that view and assign its Custom Class to RoundedCornersView, and your view controller becomes: @interface LoginAccountViewController () @end @implementation LoginAccountViewController - (void)viewDidLoad { [super viewDidLoad]; // Initial setup of the view //enterEmailView.inputTextField.placeholder = @"Enter Email"; //enterPasswordView.inputTextField.placeholder = @"Enter Password"; } @end You can remove the @implementation UIView (CustomLoader) completely, as well as everything in viewWillLayoutSubviews and viewWillTransitionToSize. In fact, by using a few IBInspectable properties and making that custom view IB_DESIGNABLE, you can modify the corners and radii and see it in Storyboard: IB_DESIGNABLE @interface RoundedCornersView : UIView @property (assign, readwrite) IBInspectable CGFloat radius; @property (assign, readwrite) IBInspectable BOOL topLeft; @property (assign, readwrite) IBInspectable BOOL topRight; @property (assign, readwrite) IBInspectable BOOL bottomLeft; @property (assign, readwrite) IBInspectable BOOL bottomRight; @end @implementation RoundedCornersView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self commonInit]; } return self; } - (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { [self commonInit]; } return self; } - (void)co…
has comment: http://stackoverflow.com/comment/137719777
downvote count: 0
has comment: http://stackoverflow.com/comment/137719460
has comment: http://stackoverflow.com/comment/137724943
answers question: http://stackoverflow.com/q/78091125
score: 2
has comment: http://stackoverflow.com/comment/137728647
has comment: http://stackoverflow.com/comment/137719824

clang-static-analyzer
tag name: clang-static-analyzer
type: Tag
tags question: http://stackoverflow.com/q/78014194

java
tag name: java
tags question: http://stackoverflow.com/q/78063975
type: Tag
tags question: http://stackoverflow.com/q/78032397

http://stackoverflow.com/q/77982472
tagged with: ios
score: 0
has body: I sent my data as url-encoded form: JobId=564876565946&UstaId=242816809697&Comment=&Ratings=%5B%7B%0A%20%20%20%20QuestionId%20%3D%203533%3B%0A%20%20%20%20Rating%20%3D%204%3B%0A%7D%2C%7B%0A%20%20%20%20QuestionId%20%3D%209767%3B%0A%20%20%20%20Rating%20%3D%205%3B%0A%7D%5D When I decode this data: JobId=564876565946&UstaId=242816809697&Comment=&Ratings=[{ QuestionId = 3533; Rating = 4; },{ QuestionId = 9767; Rating = 5; }] It is shown as above, but in postman it was successful when I sent in this form: { "JobId": 564876565946, "UstaId": 242816809697, "Ratings": [ { "QuestionId": 3533, "Rating": 4 }, { "QuestionId": 9767, "Rating": 4 } ], "Comment": "test postman" } In the JSON format. The parameters that I created are created like this: NSDictionary *params = @{ @"Ratings":[NSString stringWithFormat:@"[%@]",[self.ratings componentsJoinedByString:@","]], @"Comment":comment, @"UstaId":[self.ustaID stringValue], @"JobId":[self.jobID stringValue] }; And I add my answers to the self.ratings(which is a NSMutableArray) as like this: for(RatingQuestion * question in AppDlg.reviewQustions){ self.answer=[[NSMutableDictionary alloc]init]; [self.answer setObject:[question.ID stringValue]forKey:@"QuestionId"]; [self.answer setObject:@5 forKey:@"Rating"]; [self.ratings addObject:self.answer]; } The code is written in Objective-C for iOS and I can provide more information when requested. I want my URL encoded data sent correctly.
tagged with: objective-c
type: Question
accepted answer: http://stackoverflow.com/a/77983161
has title: Sending Data in dictionary in form of x-www-form-urlencoded but it expects JSON
answer count: 1
tagged with: http://stackoverflow.com/tag/json
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/77983161
has comment: http://stackoverflow.com/comment/137478441

http://stackoverflow.com/comment/137656721
comment on: http://stackoverflow.com/q/78069138
score: 0
type: Comment
type: QuestionComment
has text: Unfortunately you can't because there is no answer (just some comments). Please feel free to answer your own question if you feel it may help others (but the question does not really provide enough detail for someone else to answer it).

http://stackoverflow.com/q/78063975
tagged with: java
type: Question
has comment: http://stackoverflow.com/comment/137656146
type: UnansweredQuestion
score: 1
downvote count: 0
tagged with: macos
favorite count: 0
has title: NSOpenPanel allows a file's selection on the first invocation but not the second possibly due to an inode change
has comment: http://stackoverflow.com/comment/137659979
answer count: 0
has body: I have a java swing app that calls NSOpenPanel two times. The first time, it allows a file to be selected. When NSOpenPanel's [Open] button is clicked, the app changes the file that was selected such that the file's inode changes. When the app calls NSOpenPanel again, that file is not selectable. But if I navigate away from that folder and come back to it, then the changed file is now selectable. Is this NSOpenPanel behavior defined or undefined? Is there any way I can coax NSOpenPanel to refresh it's view of the former folder instead of indicating staleness? It inherits NSSavePanel and the only attribute there that looked interesting was validateVisibleColumns but it isn't accessible to NSOpenPanel, according to my compiler. Below is the MCV example that reliably repros what I consider a problem on Sonoma 14.2.1 and Xcode 15.2. Open.java import java.awt.event.*; import javax.swing.*; import java.io.*; import java.nio.file.*; public class Open extends JFrame { public Open () { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); getContentPane().add(new JButton(new AbstractAction() { public void actionPerformed (ActionEvent e) { SwingWorker<Void,Void> worker = new SwingWorker<Void,Void>() { String[] files = null; public Void doInBackground () throws Exception { files = NativeOpenFileDialog.run(); return null; } protected void done () { if (files != null) { for (String s : files) { File old = new File(s); File tmp = new File("tempfile"); try { Files.copy(old.toPath(), tmp.toPath(), StandardCopyOption.REPLACE_EXISTING); if (tmp.renameTo(old)) System.out.println(s + ": ok"); else System.err.println(s + ": rename fail"); } catch (Throwable ex) { System.err.println(s + ": copy fail"); } } } } }; worker.execute(); } })); pack(); setVisible(true); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new Open(); } }); } } NativeOpenFileDialog.java import javax.swing.*; public class NativeOpenFileDialog { static { System.loadL…
tagged with: objective-c
tagged with: cocoa
upvote count: 1

http://stackoverflow.com/q/78081552
has comment: http://stackoverflow.com/comment/137702360
has comment: http://stackoverflow.com/comment/137696941
type: Question
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/137652362
favorite count: 0
upvote count: 0
has comment: http://stackoverflow.com/comment/137708802
tagged with: uikit
downvote count: 2
tagged with: ios
tagged with: line-breaks
answer count: 2
has answer: http://stackoverflow.com/a/78083941
tagged with: objective-c
has answer: http://stackoverflow.com/a/78112109
has title: How to UILabel Linebreak set character wrap + truncate tail?
tagged with: uilabel
has body: I want to set UILabel to character wrap + truncate tail. If I only set it to truncate tail, it breaks lines for word wrapping. How can I achieve this?&quot; NSLineBreakByCharWrapping | NSLineBreakByTruncatingTail I try it but failed
score: -2

http://stackoverflow.com/comment/137752368
type: Comment
has text: So the window I put in the XIB is redundant? How do I get IBOutlets into a window created by a window controller?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78136069

http://stackoverflow.com/comment/137572600
has text: @Rob Thanks for the info, I'll definitely be using UIBezierPath for my next project.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78014194

http://stackoverflow.com/comment/137746030
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78131990
has text: Show your attempts to convert to/from JSON.

http://stackoverflow.com/comment/137476455
has text: the issue is that the speechsdk.audio.AudioConfig package requires a device ID, not an index
comment on: http://stackoverflow.com/a/77979357
score: 0
type: AnswerComment
type: Comment

nsprintpanel
type: Tag
tags question: http://stackoverflow.com/q/77983169
tag name: nsprintpanel

http://stackoverflow.com/a/78039414
has body: After doing some research I have figured out that there is actually no way to apply landscape orientation only to some pages while leaving other pages as portrait in default printing preview. One either can apply landscape orientation or portrait orientation to ALL pages. So I have solved my problem by rotating content inside of pages instead. That it is the way Preview.app works, for example. You can distinguish between printing to preview and printing to file using printInfo.jobDisposition which is NSPrintSpoolJob when printing to a screen or an actual printer and NSPrintSaveJob when saving to PDF. That way you can save your actual page orientations while printing to PDF. Here is modified rectForPage: function: - (NSRect)rectForPage:(NSInteger)page { currentPage = (int)page - 1; if (printInfo.jobDisposition == NSPrintSaveJob) { // apply my page orientation only when saving to file [printInfo setOrientation:[self getCurrentPageOrientation]]; } NSRect r = NSMakeRect(0, 0, printInfo.paperSize.width, printInfo.paperSize.height); [self setFrame:r]; return r; } Function getCurrentPageOrientation simply return 0 for odd pages and 1 for even pages as before. And here is overriden drawRect: function: - (void)drawRect:(NSRect)dirtyRect { CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] CGContext]; if (printInfo.jobDisposition == NSPrintSpoolJob &amp;&amp; (int)printInfo.orientation != [self getCurrentPageOrientation]) { // rotate content only when drawing on preview AND current page is in wrong orientation CGAffineTransform transform = CGAffineTransformMake(0, -1, 1, 0, 0, dirtyRect.size.height); CGContextConcatCTM(context, transform); } // rect sizes int rectW = 200; int rectH = 100; // bottom left rectangle CGRect rect1 = NSMakeRect(0, 0, rectW, rectH); CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1.0); CGContextFillRect(context, rect1); } I draw a red rectangle 100 x 200 at the left bottom corner of every page. For every page that is in wrong …
accepted answer of: http://stackoverflow.com/q/77983169
answers question: http://stackoverflow.com/q/77983169
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/q/78126489
type: UnansweredQuestion
has title: Releasing object when you get it from another function
tagged with: memory-management
has comment: http://stackoverflow.com/comment/137739011
has comment: http://stackoverflow.com/comment/137770706
tagged with: objective-c
has comment: http://stackoverflow.com/comment/137734789
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/137738152
has body: For some unavoidable reasons I have to work on a program with Objective-C and manual memory management environment (no ARC). I am filtering an array that I receive from another function like following: - (void) setNodeAndChildrenCompletion: (TreeNode *) node :(bool) isComplete { node.isCompleted = isComplete; NSMutableArray *childNodes = [self getFlattenedChildren:node]; for (TreeNode *node in childNodes) { node.isCompleted = isComplete; } } Do I need to release or autorelease the childNodes variable when I am done? I feel I don't need to do anything here but I am not sure. Can someone please help me? The getFlattenedChildren is further defined as following: - (NSMutableArray *) getFlattenedChildren:(TreeNode *) node { return [self flattenedNodeArray: node.children]; } - (NSMutableArray *) flattenedNodeArray:(NSMutableArray*) array { NSMutableArray *_flatTodoList = [[[NSMutableArray alloc] init] autorelease]; for (TreeNode *element in array) { [_flatTodoList addObject:element]; if ([element children] != nil) { NSMutableArray *array1 = [self flattenedNodeArray:[element children]]; for (TreeNode *element in array1) { [_flatTodoList addObject:element]; } } } return _flatTodoList; } Following is init and dealloc: - (instancetype)init { self = [super init]; if (self) { _todoList = [[NSMutableArray alloc] init]; _flatTodoList = [[NSMutableArray alloc] init]; } return self; } (void)dealloc { [_todoList release]; [_flatTodoList release]; [super dealloc]; }
type: Question

http://stackoverflow.com/a/78036742
has body: This issue is caused by ReactNative navigation lib. This lib contains a Dictionary interface that creates a name collision with the Swift Dictionary. Renaming this interface resolves the issue.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/78008072

http://stackoverflow.com/comment/137751165
has text: Using `copy` in the `NSString` passed to `init` is a good idea. But this means you should declare the `title` and `identifier` properties as `copy` instead of `strong`. And way back before ARC, there was no `strong`. Instead, you used `retain`. With ARC they are now synonyms. But back to your question - please update your question with your attempt JSON code.
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78131990

http://stackoverflow.com/comment/137576225
type: Comment
comment on: http://stackoverflow.com/q/78036902
has text: `didEnterBackground` is an AppDelegate method. You can't just add it to any class and expect it to run. You need provide the `session2` object to the App Delegate or you can observe the did enter background `NSNotification` in your other class. Really your view controller should not own the MQTT session. That should be in some other object that both the view controller and the app delegate can reference.
score: 0
type: QuestionComment

http://stackoverflow.com/a/78083941
answers question: http://stackoverflow.com/q/78081552
downvote count: 1
has comment: http://stackoverflow.com/comment/137696934
score: 0
type: Answer
upvote count: 1
has body: I would consider looking into the numberOfLines property on UILabel. I am not sure the exact behavior without testing this, but if you set the numberOfLines = 2 and then the lineBreakMode = .byTruncatingTail you might be able to get this functionality by sacrificing a dynamic number of lines.

http://stackoverflow.com/comment/137577305
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78038240
type: QuestionComment
has text: Is there a way to do this conversion in Swift? It's an older library's code that someone else has written and not something I can directly modify. If I was to use an ObjC function to return it, it might be a better idea to just have everything done in ObjC (would prefer not to since I'm learning Swift).

http://stackoverflow.com/comment/137534923
score: 0
type: QuestionComment
has text: @HangarRash I have all my shape paths stored in one class and are returned as above using the new keyword i.e. newSquareBalloonPath, so it needs to be released in that case right because new will add one to the reference count. As for why mutable, I'm building the paths using CGPathAddCurveToPoint.
comment on: http://stackoverflow.com/q/78014194
type: Comment

http://stackoverflow.com/a/78014672
accepted answer of: http://stackoverflow.com/q/78010035
type: AcceptedAnswer
upvote count: 2
type: Answer
has body: Undocumented (= unsupported) feature: Restoring all documents when the app is launched by opening a document can be disabled. In applicationWillFinishLaunching do [NSUserDefaults.standardUserDefaults setBool:YES forKey:@"NSDiscardWindowsOnDocumentOpen"];
score: 2
answers question: http://stackoverflow.com/q/78010035
downvote count: 0

http://stackoverflow.com/q/78066067
accepted answer: http://stackoverflow.com/a/78066436
score: 0
tagged with: gameplay-kit
type: AnsweredQuestion
tagged with: swift
has answer: http://stackoverflow.com/a/78066436
tagged with: nspredicate
type: Question
answer count: 1
has body: I wrote a piece of code with swift, but can not get the result expected. If you know the bug in the code, please help me, thank you very much in advance. This the code I wrote: let assertingFactKey = "hunt" as NSString // let ruleSystem = GKRuleSystem() let playerFar : NSPredicate = NSPredicate(format:"$distanceToPlayer.floatValue >= 10.0") ruleSystem.add(GKRule(predicate: playerFar, assertingFact: assertingFactKey, grade: 1.0)) let playerNear = NSPredicate(format:"$distanceToPlayer.floatValue < 10.0") ruleSystem.add(GKRule(predicate: playerNear, assertingFact: assertingFactKey, grade: 1.0)) // for i in 1...30 { ruleSystem.state["distanceToPlayer"] = i ruleSystem.reset() ruleSystem.evaluate() let result = ruleSystem.grade(forFact:assertingFactKey) > 0.0 if result { print ("**True : \(i)") } else { print ("**False") } } The result is always to True. I want to know the correct way to use GKRuleSystem in swift The code with Objective-C: GKRuleSystem *ruleSystem = [[GKRuleSystem alloc] init]; NSPredicate *playerFar = [NSPredicate predicateWithFormat:@"$distanceToPlayer.floatValue >= 10.0"]; [ruleSystem addRule:[GKRule ruleWithPredicate:playerFar assertingFact:@"hunt" grade:1.0]]; NSPredicate *playerNear = [NSPredicate predicateWithFormat:@"$distanceToPlayer.floatValue < 10.0"]; [ruleSystem addRule:[GKRule ruleWithPredicate:playerNear retractingFact:@"hunt" grade:1.0]]; for (NSUInteger i = 0; i<=30; i++) { ruleSystem.state[@"distanceToPlayer"] = @(i); [ruleSystem reset]; [ruleSystem evaluate]; BOOL result = ([ruleSystem gradeForFact:@"hunt"] > 0.0); if (result) { NSLog(@"true: %ld", i); } else { NSLog(@"false"); } }
tagged with: objective-c
has title: Use NSPredicate with swift, but can not get the same result with code written by Objective-C

http://stackoverflow.com/comment/137708796
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78112109
score: 0
has text: You can use numberOfLine method instead of numberOfLinesForString but if then will be some bugs in iOS15.

http://stackoverflow.com/comment/137781909
comment on: http://stackoverflow.com/q/78136069
has text: Willeke, I have restructured my program to eliminate using WindowControllers and instead use windows defined in MainMenu. Seems to work as expected now. I'm very grateful for your suggestion, I had so presumed that WindowControllers were the right way to go that I hadn't considered another entirely different approach. I guess that sometimes you get too close to the problem and don't see an alternative. I very much appreciate your involvement and suggestions, they forced me into a different solution.
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/140022736
type: AnswerComment
type: Comment
has text: Sorry, but I don't understand the answer. Cookbook only helps if one knows the ingredients by name. What are "App Groups" and why should my app/binary have an App Group? Where in the app's code should the provided code be added, and when should it be executed? This is very frustrating.
score: 0
comment on: http://stackoverflow.com/a/79177597

http://stackoverflow.com/comment/137584076
type: Comment
type: QuestionComment
has text: I am not the one who created this framework, thus I have no control over it @Cy-4AH
comment on: http://stackoverflow.com/q/78032810
score: 0

http://stackoverflow.com/comment/137566862
has text: you should have to remove un-necessary packages from your package.json.
comment on: http://stackoverflow.com/q/78032397
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/137534938
comment on: http://stackoverflow.com/q/78014194
type: Comment
score: 0
has text: Yes, after calling `newSquarePath`, you do need to eventually call `CGReleasePath`. I'm just questioning the ownership and responsibility of that release. `loadPath` is not the owner of the created path so it shouldn't be the one that releases it. Ideally, the caller of `newSquarePath` should call `CGPathRelease`. And you should change `loadPath` to take `CGPathRef`, not `CGMutablePathRef`. `loadPath` does not need a mutable path.
type: QuestionComment

http://stackoverflow.com/comment/137625370
type: AnswerComment
type: Comment
score: 1
has text: Thank you very much. you save me a lot of time. I did not notice my miss type.
comment on: http://stackoverflow.com/a/78066436

http://stackoverflow.com/comment/137531827
comment on: http://stackoverflow.com/q/78011219
type: Comment
score: 0
has text: As we are talking about ObjC: Is it possible that the returned value is not a pointer but an `ObjC.Block`? AFAIR callbacks are usually stored as such a block instead of plain pointer in ObjC 8see e.g. https://codeshare.frida.re/@ivan-sincek/ios-touch-id-bypass/) . Is the pointer value still as high as `0x600001931050`? because such a value doesn't look like a pointer (too high) instead it could be handle is used to identify something.
type: QuestionComment

http://stackoverflow.com/comment/137574965
comment on: http://stackoverflow.com/q/78036902
score: 0
type: QuestionComment
has text: You will see different behaviour depending on whether you are running under Xcode or not. Under Xcode your app has infinite background time. When not running under Xcode iOS will terminate your app after 30 seconds. The correct thing to do is disconnect the client in `didEnterBackground`. If that isn't working then you probably aren't disconnecting the right client . Show that code
type: Comment

http://stackoverflow.com/comment/137563484
comment on: http://stackoverflow.com/q/78014194
type: Comment
score: 0
type: QuestionComment
has text: FWIW, I agree with HangarRash that whomever calls `newSquareBalloonPath` (or `newSquarePath`) should `CGPathRelease` it after calling `loadPath` (and that `loadPath` should not be releasing objects it did not create). For the sake of completeness, the other alternative is to use `UIBezierPath` instead of `CGPathRef`, which cuts the Gordian knot, because assuming you are using ARC, it completely eliminates the need to manually release the path.

http://stackoverflow.com/q/77974419
tagged with: objective-c
type: Question
answer count: 1
tagged with: asyncdisplaykit
score: 0
tagged with: swift
has body: I am using AsyncDisplayKit/Texture in my iOS app to display a simple list. On each row, I want to display some text and an image horizontally and at the very bottom right corner of the row, I want to display a triangle. I have the following simple code which can demonstrate the entire issue: import UIKit import SnapKit import AsyncDisplayKit class ViewController: UIViewController, ASTableDataSource { let tableNode = ASTableNode() override func viewDidLoad() { super.viewDidLoad() view.addSubnode(tableNode) tableNode.view.snp.makeConstraints { make in make.edges.equalToSuperview() } tableNode.dataSource = self } func tableNode(_ tableNode: ASTableNode, numberOfRowsInSection section: Int) -> Int { return 100 } func tableNode(_ tableNode: ASTableNode, nodeBlockForRowAt indexPath: IndexPath) -> ASCellNodeBlock { let row = indexPath.row return { return MyCellNode(str: "Row \(row)") } } } let sizeToUse = 15.0 class MyCellNode: ASCellNode { private var title = ASTextNode() private let savedIcon = SaveIconNode() private var thumbnailNode = ASNetworkImageNode() init(str : String) { super.init() automaticallyManagesSubnodes = true automaticallyRelayoutOnSafeAreaChanges = true automaticallyRelayoutOnLayoutMarginsChanges = true title.attributedText = NSAttributedString(string: str, attributes: [.foregroundColor:UIColor.white,.font:UIFont.systemFont(ofSize: 30, weight: .medium)]) title.backgroundColor = .darkGray thumbnailNode = ASNetworkImageNode() thumbnailNode.isLayerBacked = true thumbnailNode.cornerRoundingType = .precomposited thumbnailNode.cornerRadius = sizeToUse thumbnailNode.style.preferredSize = CGSize(width: 60, height: 60) thumbnailNode.url = URL(string: "https://favicon.mars51.com/instagram.com") } override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec { let content = ASStackLayoutSpec(direction: .horizontal, spacing: sizeToUse, justifyContent: .spaceBetween, alignItems: .start, children: [title,thumbnailNode]) let inseted = ASInsetLayoutSp…
type: AnsweredQuestion
has title: iOS AsyncDisplayKit / Texture's ASAbsoluteLayoutSpec not stretching content to fill width
tagged with: flexbox
accepted answer: http://stackoverflow.com/a/77974591
has answer: http://stackoverflow.com/a/77974591
tagged with: ios

http://stackoverflow.com/a/78100797
score: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/78099020
type: AcceptedAnswer
type: Answer
has body: The delegate has to 'retain' somewhere to make it work. As I can see here, the SquareView is a sub-view of AppController, and the delegate works like SquareView &lt;-&gt; AppController. It's a kind of callback in this case. However, you're assigning it to nil by [_squareView setDelegate:nil] It should be: _squareView.delegate = self; By doing that, every time drawRect in SquareView gets called, it will trigger numberOfSquaresInSquareView in AppController, and in this case, it will print out squares to draw: 10
upvote count: 1
answers question: http://stackoverflow.com/q/78099020

http://stackoverflow.com/comment/137484825
type: Comment
comment on: http://stackoverflow.com/q/77983169
score: 0
type: QuestionComment
has text: @Willeke 1. Yes, I have tried printing pdf with different page orientations from Preview app. In the printing preview all pages have the same orientation, but the content inside landsape pages is rotated, which is, in fact, suitable for an actual printer. 2. The third page is clipped on my screenshot - it is actually correctly drawn in the preview. I'm sorry for bad screenshot.

python
type: Tag
tags question: http://stackoverflow.com/q/77973278
tag name: python
tags question: http://stackoverflow.com/q/78543490
tags question: http://stackoverflow.com/q/78499204
tags question: http://stackoverflow.com/q/79279193

http://stackoverflow.com/comment/138572548
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78010126
has text: Are you doing this hack because of bug in Sonoma? I found that the windows are only open if content of saved state is "dirty". (_NSPersistentUIDeleteItemAtFileURL(NSURL *const __strong) Failed to stat item: file:///Users/<user_name>/Library/Containers/<container_name>/Data/Library/Saved%20Application%20State/<container_name>.savedState/restorecount.plist)

http://stackoverflow.com/comment/139448179
score: 0
has text: @RafaelBitencourt I'm experiencing the same issue, app and plugin are expected to share the same group within AppGroup to manage settings access and storage.
comment on: http://stackoverflow.com/a/78929081
type: AnswerComment
type: Comment

http://stackoverflow.com/a/78136461
has body: I am able to save the array as folowing: -(void) saveToDoList:(NSMutableArray&lt;TreeNode *&gt; *)todoList { NSMutableArray *array = [self convertArrayToJson:todoList]; NSError *error; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:array options:NSJSONWritingPrettyPrinted error:&amp;error]; NSString *jsonString = [[[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding] autorelease]; [self writeStringToFile:jsonString]; } //Following function will convert a nested array of array to JSON Object -(NSMutableArray *) convertArrayToJson: (NSMutableArray *) array { NSMutableArray *mainArray = [NSMutableArray new]; for (TreeNode *element in array) { NSMutableDictionary *node = [NSMutableDictionary new]; [node setValue:element.title forKey:keyTitle]; [node setValue:element.identifier forKey:keyIdentifier]; if (element.children != nil &amp;&amp; [[element children] count] &gt; 0) { NSMutableArray *array1 = [self convertArrayToJson:element.children]; [node setValue:array1 forKey:keyChildren]; } else { [node setValue:nil forKey:keyChildren]; } [mainArray addObject:node]; } return mainArray; } - (void)writeStringToFile:(NSString*)aString { NSString *fileAtPath = [self jsonFilePath]; if (![[NSFileManager defaultManager] fileExistsAtPath:fileAtPath]) { [[NSFileManager defaultManager] createFileAtPath:fileAtPath contents:nil attributes:nil]; } [[aString dataUsingEncoding:NSUTF8StringEncoding] writeToFile:fileAtPath atomically:NO]; }
answers question: http://stackoverflow.com/q/78131990
score: 0
type: Answer

http://stackoverflow.com/a/78013383
answers question: http://stackoverflow.com/q/78011219
has body: i have solved the question. script: var stackAddress = ObjC.classes.Herlper.cfunc() var memoryAddress = Memory.readPointer(stackAddress) var func = new NativeFunction(memoryAddress,'pointer',['int','int']) var result = func(0x0,0x0) Memory.readByteArray(result,100)
score: 0
type: Answer

http://stackoverflow.com/comment/137535466
has text: Are the previous windows document windows? Post a [mre] please.
comment on: http://stackoverflow.com/q/78010035
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/a/78130070
answers question: http://stackoverflow.com/q/78129895
has body: I found Xcode [Target]-Swift.h gen tool does not care about "Target Membership". It only see swift files under MyTarget directory. Failed case files location MyTarget1/MyOBJC1Class.m MyTarget1/MySwiftClass.swift MyTarget2/MyOBJC2Class.m Xcode Target Membership of MySwiftClass.swift ON for MyTargert2 Success case files location MyTarget1/MyOBJC1Class.m MyTarget1/MySwiftClass.swift MyTarget2/MyOBJC2Class.m MyTarget2/MySwiftClass.swift (exact copy)
type: Answer
score: 0

http://stackoverflow.com/comment/137530049
type: QuestionComment
has text: How did you implement "State Restoration"?
comment on: http://stackoverflow.com/q/78010035
score: 1
type: Comment

http://stackoverflow.com/q/78011219
has title: how to call pointer function in Frida script
has body: I'm debugging a macOS app by Frida. here is pseudocode rax = [Herlper cfunc]; rax = *rax; rax = (rax)(0x0, 0x0, 0x0); rax = [rax retain]; r13 = rax; r12 = [[r13 dataUsingEncoding:0x4] retain]; How do I get r12 results in a script? Hope you can help, thank you! i tried using this script var f = new NativeFunction(ptr(ObjC.classes.Herlper.cfunc()).sign(),'pointer',['uint8','uint8','uint8']) f(0x0,0x0,0x0) but it error: Error: access violation accessing 0x600001931050 at &lt;eval&gt; (&lt;input&gt;:1)
type: Question
downvote count: 0
answer count: 1
tagged with: frida
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/137531227
score: 1
tagged with: macos
favorite count: 0
has comment: http://stackoverflow.com/comment/137531827
has comment: http://stackoverflow.com/comment/137533305
has comment: http://stackoverflow.com/comment/137531677
tagged with: objective-c
upvote count: 1
has answer: http://stackoverflow.com/a/78013383

http://stackoverflow.com/a/78129770
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/78129689
type: Answer
upvote count: 1
has body: Well, I've got my mistake. Right implementation is below: In metal-cpp/Foundation/NSPrivate.hpp: _NS_PRIVATE_DEF_SEL(detachNewThreadSelector_toTarget_withObject_, "detachNewThreadSelector:toTarget:withObject:"); // Register our selector _NS_PRIVATE_DEF_SEL(run_, "run:"); In metal-cpp/Foundation/NSThread.hpp: _NS_INLINE void NS::Thread::detachNewThread( const Runnable* pRunnable ) { NS::Value* pWrapper = NS::Value::value( pRunnable ); typedef void (*DispatchFunction)( NS::Value*, SEL, void* ); DispatchFunction run = []( Value* pSelf, SEL, void* unused ) { auto pDel = reinterpret_cast< NS::Runnable* >( pSelf->pointerValue() ); pDel->run(); }; // Register the class method on Objective-C side class_addMethod( (Class)_NS_PRIVATE_CLS( NSValue ), _NS_PRIVATE_SEL( run_ ), (IMP)run, "v@:@" ); // Here we call an Objective-C side's selector return Object::sendMessage<void>(_NS_PRIVATE_CLS(NSThread), _NS_PRIVATE_SEL(detachNewThreadSelector_toTarget_withObject_), _NS_PRIVATE_SEL(run_), pWrapper, nullptr ); }
has comment: http://stackoverflow.com/comment/137740407

http://stackoverflow.com/comment/137644683
score: 0
type: QuestionComment
type: Comment
has text: Thanks you so much for the info. I have looked at the mosquitto_sub docs and think I am getting the hang of it. However I can't seem to be able to change the topic -t. Originally it says to use ```mosquitto_sub -t topic/state```. That works ok but when I try to change to say topic/temp or feed/temp nothing happens. Can someone show me how to change to topics and have more than one to subscribe to. If you want me to start another thread I can.
comment on: http://stackoverflow.com/q/78069138

http://stackoverflow.com/comment/137652362
score: 0
type: QuestionComment
has text: "How can I achieve this?" In a UILabel you can't. You would have to draw the text yourself and lay it out yourself with TextKit.
comment on: http://stackoverflow.com/q/78081552
type: Comment

http://stackoverflow.com/comment/137656146
type: QuestionComment
score: 0
type: Comment
has text: What compiler error was there with -validateVisibleColumns ? Any inherited method should exist.
comment on: http://stackoverflow.com/q/78063975

http://stackoverflow.com/comment/137734789
type: Comment
has text: See [Memory Management Policy](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html)
comment on: http://stackoverflow.com/q/78126489
score: 0
type: QuestionComment

http://stackoverflow.com/comment/139987311
has text: See the other answer
comment on: http://stackoverflow.com/a/78929081
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/137749590
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78131990
has text: I am getting value for title at init so wouldn't copy will make more sense here than strong?
type: QuestionComment

http://stackoverflow.com/comment/137671426
comment on: http://stackoverflow.com/q/78091416
type: QuestionComment
score: 2
has text: It's a sandbox issue.
type: Comment

http://stackoverflow.com/comment/137484177
type: Comment
has text: Tip: draw something on the page, the third page doesn't look right in the preview.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/77983169

http://stackoverflow.com/comment/137754979
type: Comment
has text: AppDelegate owns the window. Because WindowControllers make new windows from nibs. Because this is a demo program that illustrates that my outlets are not being connected. In reality, I have a huge program that is having the same problem but can't be replicated here because it's too large. MainMenu is used for other things. I think I instantiate only once, follow the steps in my original question. ai want to use the outlets right after the NSBeep() but they are always nil.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78136069

http://stackoverflow.com/comment/137599303
comment on: http://stackoverflow.com/a/78046631
type: AnswerComment
score: 1
type: Comment
has text: Thanks @HangarRash, I updated it, and my purpose is to point out to OP that there are preprocessors in AvailabilityMacros.h that can support in this scenario. Beside that, it seems like __MAC_14_0 doesn't really work on the lower Xcode version (I tried on 14.3.1), so I decided to use its value directly.

http://stackoverflow.com/comment/137591309
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78046487
has text: Also this seems to be Objective-C code, so please don't tag [swift], and post your code as *text*, not an image.
type: QuestionComment

http://stackoverflow.com/a/78929081
has body: This message pops up if you try to read data frm any other app(s container) that is not in the same app group. In my case i send a script to InDesign that includes a path to a screenshot inside my apps Container (where I stored the image). Once InDesign processes the script it tries to access this image and voila. The onliest workaround I found so far is to create a subfolder in documents folder (requires users acceptance) and store the images there. Then InDesign asks (once only) to access that folder.
has comment: http://stackoverflow.com/comment/139987321
has comment: http://stackoverflow.com/comment/139987311
downvote count: 0
has comment: http://stackoverflow.com/comment/139401715
score: 1
has comment: http://stackoverflow.com/comment/139612449
has comment: http://stackoverflow.com/comment/139448179
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/139480291
accepted answer of: http://stackoverflow.com/q/77976279
upvote count: 1
answers question: http://stackoverflow.com/q/77976279

http://stackoverflow.com/comment/137701772
comment on: http://stackoverflow.com/a/78107492
type: AnswerComment
type: Comment
has text: Thanks for your answer - i know theses Docs, but i dont find a working sample, and i am unable to build one.
score: 0

security
tag name: security
tags question: http://stackoverflow.com/q/77976279
type: Tag
tags question: http://stackoverflow.com/q/78543725
tags question: http://stackoverflow.com/q/79013987

http://stackoverflow.com/a/78522949
has body: Your app size increases through the packages installed in your application. I have React-Is, Formik and Moment also installed, and yes these 3 packages increase the size of my application too.
type: Answer
has comment: http://stackoverflow.com/comment/138432814
answers question: http://stackoverflow.com/q/78032397
score: 0

http://stackoverflow.com/comment/137709823
score: 0
comment on: http://stackoverflow.com/q/78112507
type: QuestionComment
type: Comment
has text: I agree with @son, but please at least add the crash's stack trace to the question—without it it's not possible to figure out the reason of the crash.

http://stackoverflow.com/comment/137472977
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/77976279
score: 0
has text: Does the app you are controlling have access to user data?

http://stackoverflow.com/comment/138432814
score: 0
has text: As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
type: AnswerComment
comment on: http://stackoverflow.com/a/78522949
type: Comment

http://stackoverflow.com/comment/137676842
comment on: http://stackoverflow.com/a/78094355
type: AnswerComment
type: Comment
has text: Keep in mind that only sandboxed apps can be submitted to the App Store.
score: 0

http://stackoverflow.com/comment/137705630
has text: I don't know why, but suddenly it seems to work I closed and reload the Xcode project several times etc.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78107492

http://stackoverflow.com/a/78094355
type: Answer
score: 0
has body: Found the answer. you can turn off sandbox by going to signing and capabilities tab and just remove the sandbox settings on the right.
has comment: http://stackoverflow.com/comment/137676842
answers question: http://stackoverflow.com/q/78091416

http://stackoverflow.com/comment/137752356
has text: If you want the app delegate to be the file's owner then use `[[NSWindowController alloc] initWithWindowNibName:@"GoWindow" owner:self]`. Be aware of dangling pointers when you close the window.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78136069
type: Comment

http://stackoverflow.com/comment/137719824
has text: I add a view inside that view that you put , but when I try to put in landscape or portrait I got the same space in the leading, and I erase a lot of constraints
comment on: http://stackoverflow.com/a/78093159
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137541791
type: QuestionComment
comment on: http://stackoverflow.com/q/78014194
type: Comment
has text: @HangarRash Thanks for doing that. Dunno why I'm getting the analyzer error for one set of code and not the other, but regardless what you're saying about CGPathRelease and newSquarePath is correct. Have to find a new solution.
score: 0

http://stackoverflow.com/comment/137474710
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77979357
score: 0
has text: Okay I don't think this exactly answers my question... So the issue I have is that I want the user to be able to select their microphone source - which means that I need to show a list of the microphones and then let retrieve the ID. This microphone is then what I need for the speechsdk.KeywordRecognizer I cant manually specify the ID as I won't know it - and I need the ID to pass through to speechsdk.audio.AudioConfig

http://stackoverflow.com/comment/137746033
comment on: http://stackoverflow.com/q/78131990
type: QuestionComment
score: 1
type: Comment
has text: As a side note, 1. Why are you using MRC instead of ARC? 2. You declare the `title` and `identifier` properties as `strong` but your `init` method is using copy semantics on both.

http://stackoverflow.com/comment/140099595
has text: The reason why this works is explained by this Apple engineer here: https://developer.apple.com/forums/thread/721701 You would not see the alert if your app is deployed via App Store or TestFlight. And here is one of their recommendation: "If you use an iOS-style app group ID in a macOS app, you might run into the authorisation prompt during day-to-day development. One way around this is to use a macOS-style app group ID during development and switch to the iOS-style app group ID for production."
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79177597
score: 0

http://stackoverflow.com/q/78032810
has comment: http://stackoverflow.com/comment/137568192
has comment: http://stackoverflow.com/comment/137567402
tagged with: ios
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/137568217
has comment: http://stackoverflow.com/comment/137584076
tagged with: objective-c
has title: Umbrella-Header uses wrong import syntax after `pod install`
tagged with: header-files
type: UnansweredQuestion
favorite count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/140132139
has body: I am developing a local Expo module in which I am using a 3rd party Framework. My .podspec looks something like this: Pod::Spec.new do |s| # root specification s.dependency 'ExpoModulesCore' s.vendored_frameworks = 'Frameworks/MyLocalFramework.framework' s.public_header_files = "Frameworks/MyLocalFramework.framework/Headers/*" # Swift/Objective-C compatibility s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'SWIFT_COMPILATION_MODE' => 'wholemodule' } s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}" end After running pod install in my prebuilded iOS app, which implements my module, I am able to import and use MyLocalFramework in my Objective-C and Swift files without issues. However, once I try to run my app with npx expo run:ios I get a build error saying an import in my ModuleName-umbrella.h failed. There it tries to import the Frameworks headers via the "Header.h" syntax (this was generated after pod install). Now, when I manually change the imports using the <MyLocalFramework/Header.h> syntax I can build and run the app without issues. My question is: Why does pod install use the "" import syntax here instead of <>? I don't want to manually change the imports every time I run pod install. Additional information: Under my modules Build Phases > Headers > Project I specified the ModuleName-umbrella.h as well as the MyLocalFramework headers.
tagged with: cocoapods
tagged with: swift
downvote count: 0
score: 3

http://stackoverflow.com/a/78112109
downvote count: 1
has comment: http://stackoverflow.com/comment/137708796
has body: + (void)addEllipsisAtLabel:(nonnull UILabel *)label ellipsis:(nonnull NSString *)ellipsis { if (label == nil || label.text == nil || label.text.length == 0 || ellipsis == nil) return; if (label.numberOfLines &lt;= 1) return; if (!(label.lineBreakMode == NSLineBreakByCharWrapping)) return; // int lines = [THISUTILCLASS numberOfLine:label content:label.text]; CGSize maxSize = CGSizeMake(label.frame.size.width, CGFLOAT_MAX); NSInteger lines = [THISUTILCLASS numberOfLinesForString: label.text size:maxSize font:label.font]; NSUInteger index = label.text.length; while (lines &gt; label.numberOfLines) { NSString *subStr = [label.text substringToIndex: index]; if (!subStr) { return; } NSString *combineStr = [NSString stringWithFormat:@&quot;%@%@&quot;, subStr, ellipsis]; // int newLines = [THISUTILCLASS numberOfLine:label content:combineStr]; NSInteger newLines = [THISUTILCLASS numberOfLinesForString: combineStr size:maxSize font:label.font]; if (newLines &gt; label.numberOfLines) { if (--index &lt;= 0) return; } else { label.text = combineStr; return; } } } + (int)numberOfLine:(nonnull UILabel *)label content:(nonnull NSString *)content { if (label == nil || content == nil || content.length == 0) return 0; CGSize maxSize = CGSizeMake(label.frame.size.width, CGFLOAT_MAX); CGRect rect = [content boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin | label.lineBreakMode attributes:@{NSFontAttributeName:label.font} context:nil]; return (int)(ceil((rect.size.height / label.font.lineHeight))); } + (NSInteger)numberOfLinesForString:(nonnull NSString *)string size:(CGSize)size font:(nonnull UIFont *)font { if (string == nil || font == nil) return 0; NSTextStorage *textStorage = [[NSTextStorage alloc] initWithString:string attributes:@{NSFontAttributeName: font}]; NSTextContainer *textContainer = [[NSTextContainer alloc] initWithSize:size]; textContainer.lineBreakMode = NSLineBreakByWordWrapping; textContainer.maximumNumberOfLines = 0; textContainer.lineFragme…
type: Answer
answers question: http://stackoverflow.com/q/78081552
upvote count: 0
score: -1
has comment: http://stackoverflow.com/comment/137727488

http://stackoverflow.com/comment/137837467
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78099020
score: 0
has text: setNeedsDisplay belongs to NSView subclass, not to a controller. What you are trying to achieve is data source. Instead of calling setneedsdisplay you need method called reload. Look at how NSTableView is being implemented

http://stackoverflow.com/comment/140132139
score: 0
type: QuestionComment
type: Comment
has text: @grazer1998 did you ever find a solution to this? i'm running into the same issue.
comment on: http://stackoverflow.com/q/78032810

http://stackoverflow.com/comment/137719460
score: 0
has text: It continues not to cover all the space, it still looks strange, and in Lanscape the view completely disappears @DonMag
comment on: http://stackoverflow.com/a/78093159
type: AnswerComment
type: Comment

http://stackoverflow.com/q/78106703
answer count: 1
tagged with: objective-c
has body: We want to be able to call our application from a browser link (as i.e. MS teams does when you open a link to a teams meeting). The principle is quite simple and exists since quite a while. Under Windows this consists just of a few registry entries (How do I register a custom URL protocol in Windows?). But anything i tried on the Mac does not work at all. See i.e. Mac custom protocol fails on some machines or https://web.archive.org/web/20091215155410/http://www.xmldatabases.org/WK/blog/1154_Handling_URL_schemes_in_Cocoa.item (very old...) I learned that we need: Add CFBundleURLTypes to pInfo.list Add a handler that shall be called by MacOs. But i dont get it to work at all. Neither my application gets started after adding the required entries to CFBundleURLTypes, nor is such a Handler in our application ever called. The Application in Question uses QtWidgets so the code in the application is C++ / Objective-C. Does anyone have a working sample project or a link to such that does this using Objective-C or even Qt?
score: 0
tagged with: qt
tagged with: c++
type: Question
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/78107492
tagged with: macos
has title: Implement a Custom Protocol on Mac for a Cocoa / Qt Application
linked to: http://stackoverflow.com/q/15721047
linked to: http://stackoverflow.com/q/80650

nslocalizedstring
tags question: http://stackoverflow.com/q/77976314
type: Tag
tag name: nslocalizedstring

mqtt
tags question: http://stackoverflow.com/q/78069138
tag name: mqtt
type: Tag
tags question: http://stackoverflow.com/q/78036902
tags question: http://stackoverflow.com/q/79470730

http://stackoverflow.com/comment/137614163
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78046487
has text: Does this answer your question? ["if (@available(iOS 13.0, \*))" doesn't compile in Xcode 10.3](https://stackoverflow.com/questions/58083310/if-availableios-13-0-doesnt-compile-in-xcode-10-3)
type: Comment

delegates
tags question: http://stackoverflow.com/q/78099020
tags question: http://stackoverflow.com/q/78104447
tag name: delegates
type: Tag

http://stackoverflow.com/comment/137591222
type: Comment
comment on: http://stackoverflow.com/q/78032397
has text: all of the packages are required for the app functionality, I have cross-checked
score: 0
type: QuestionComment

http://stackoverflow.com/a/77974178
downvote count: 0
accepted answer of: http://stackoverflow.com/q/77974177
answers question: http://stackoverflow.com/q/77974177
has comment: http://stackoverflow.com/comment/137464167
type: AcceptedAnswer
upvote count: 5
type: Answer
has body: It turns out that you don't need the computed property on UIMutableTraits for this to work. That added property in the example Swift code is just a convenience for later use. In Objective-C, you can still make it work, it's just that the final code is slightly more cumbersome. For example, in the Swift code you can create a UITraitCollection with the sample custom trait using code such as: let myTraits = UITraitCollection { mutableTraits in mutableTraits.myAppTheme = .pastel // <-- custom trait here mutableTraits.horizontalSizeClass = .regular } In Objective-C, the code looks as follows: UITraitCollection *myTraits = [UITraitCollection traitCollectionWithTraits:^(id<UIMutableTraits> _Nonnull mutableTraits) { [mutableTraits setNSIntegerValue:MyAppThemePastel forTrait:MyAppThemeTrait.class]; mutableTraits.horizontalSizeClass = UIUserInterfaceSizeClassRegular; }]; Since there is no convenience property named myAppTheme on UIMutableTraits, we need to use the more verbose syntax of calling setNSIntegerValue:forTrait: (or setObjectValue:forTrait: or setCGFloatValue:forTrait: as needed for the given trait). However, there is the added property myAppTheme on UITraitCollection so we can now read the value as follows: MyAppTheme theme = myTraits.myAppTheme; To see a fully working example in Objective-C, create a new iOS app project. Select Storyboard for the user interface and Objective-C for the language. Add MyTraits.h and MyTraits.m as shown in the question above. To work with the theme, we need to add a custom dynamic color. Add the following to MyTraits.h: @interface UIColor (MyTraits) @property (nonatomic, readonly, class) UIColor *customBackgroundColor; @end Add the following to MyTraits.m: @implementation UIColor (MyTraits) + (UIColor *)customBackgroundColor { return [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) { // This example uses some randomly chosen colors. Pick your own to suit your needs switch (traitCollec…
score: 5

http://stackoverflow.com/comment/137486639
type: QuestionComment
comment on: http://stackoverflow.com/q/77983169
type: Comment
has text: Maybe you can do something with `printInfo.jobDisposition`?
score: 0

http://stackoverflow.com/comment/139847881
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/79177597
has text: This should be marked as best answer. I haven't prefixed the group identifier with Team ID, but with "group." instead. Now that I'm revisiting docs it's clear, and it seems that the way I had it is under section "Create App Groups for all other platforms", which is not my case.

http://stackoverflow.com/comment/137534984
has text: @HangarRash Good idea, I will change CGMutablePathRef to CGPathRef. I agree about ownership, it was making my head explode a little when I started nesting method calls, passing the newSquarePath down the chain as opposed to working with it / releasing it in the initial method that gets it.
comment on: http://stackoverflow.com/q/78014194
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/137475269
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/77979357
has text: @Dan The Approach 1 code shows the list of Microphone and you can use one of the microphone in your speech recognizer.

xcode15
type: Tag
tag name: xcode15
tags question: http://stackoverflow.com/q/78109418
tags question: http://stackoverflow.com/q/78112507
tags question: http://stackoverflow.com/q/78700937
tags question: http://stackoverflow.com/q/78796285

http://stackoverflow.com/a/77979357
score: 0
has comment: http://stackoverflow.com/comment/137476542
has comment: http://stackoverflow.com/comment/137477021
has body: Updated Solution2 with Device Id:- After multiple trial and error, I have used subprocess module to directly run powershell command in Python and retrieve Device_Id of Microphone then use the same device Id in the audio_config = speechsdk.audio.AudioConfig(device_name=mic_device_id) My code:- import subprocess import azure.cognitiveservices.speech as speechsdk def get_audio_devices(): try: # Execute PowerShell command to get audio devices command = ['powershell', 'Get-WmiObject Win32_SoundDevice | Select-Object DeviceID, Name'] process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) output, error = process.communicate() # Print out any error message if error: print(f"Error: {error.decode()}") # Decode and split the output to extract device ID and name output_lines = output.decode().strip().split('\n')[2:] # Skip first two lines (column headers) if output_lines: devices = [] for line in output_lines: device_id, name = line.strip().split(None, 1) # Split on first whitespace devices.append((device_id.strip(), name.strip())) return devices else: print("No audio devices found.") return [] except Exception as e: print(f"Error: {e}") return [] def text_to_speech(text, mic_device_id): speech_config = speechsdk.SpeechConfig(subscription="de63f99217074bd88429dbc7ccb45a10", region="eastus") audio_config = speechsdk.audio.AudioConfig(device_name=mic_device_id) speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config) # Synthesize text to speech result = speech_synthesizer.speak_text_async(text).get() if result.reason == speechsdk.ResultReason.SynthesizingAudioCompleted: print("Speech synthesized successfully") elif result.reason == speechsdk.ResultReason.Canceled: cancellation_details = result.cancellation_details print("Speech synthesis canceled:", cancellation_details.reason) if cancellation_details.reason == speechsdk.CancellationReason.Error: print("Error details:", cancellation_details.error_details…
has comment: http://stackoverflow.com/comment/137475269
has comment: http://stackoverflow.com/comment/137474710
type: Answer
has comment: http://stackoverflow.com/comment/137519237
downvote count: 1
answers question: http://stackoverflow.com/q/77973278
upvote count: 1
has comment: http://stackoverflow.com/comment/137476455

http://stackoverflow.com/comment/137568217
score: 0
comment on: http://stackoverflow.com/q/78032810
type: QuestionComment
has text: There are no problems to create frameworks written in Objective-C with SPM
type: Comment

http://stackoverflow.com/comment/137738152
type: Comment
score: 1
comment on: http://stackoverflow.com/q/78126489
type: QuestionComment
has text: Looks like the array passed to you is autoreleased: `NSMutableArray *_flatTodoList = [[[NSMutableArray alloc] init] autorelease];`.

http://stackoverflow.com/comment/137753286
type: Comment
has text: It depends on what you're trying to accomplish. Which object owns the window? Why do you use a `NSWindowController`? Why is the window in a new xib instead of MainMenu.xib? Do you instantiate the window once? When do you want to use the outlets?
comment on: http://stackoverflow.com/q/78136069
score: 0
type: QuestionComment

http://stackoverflow.com/comment/137749585
type: Comment
score: 0
has text: It is actually some task I am doing to learn manual memory management as I have possibility to work on a project which is using manual memory management. I have not seen the code yet so I don't know how easy or difficult it will be to convert it to ARC. The app was crashing a lot with title variable but once I did a copy on this, it has fixed the crashes.
comment on: http://stackoverflow.com/q/78131990
type: QuestionComment

http://stackoverflow.com/comment/137696934
has text: Thank to answer Sam. But it doesn't work.
score: 0
comment on: http://stackoverflow.com/a/78083941
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137576767
type: Comment
has text: @Paulw11 The OP has a C-style array, not an `NSArray`.
comment on: http://stackoverflow.com/q/78038240
type: QuestionComment
score: 1

http://stackoverflow.com/comment/137629493
has text: Background task is not reliable enough for my needs so I will be deleting this post.
comment on: http://stackoverflow.com/q/78036902
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/137751287
type: Comment
comment on: http://stackoverflow.com/q/78131990
has text: Thank you for your suggestion, I will follow it. I am now able to save it to JSON file, adding my code as answer to this question.
score: 0
type: QuestionComment

gameplay-kit
tag name: gameplay-kit
tags question: http://stackoverflow.com/q/78066067
type: Tag

flexbox
tags question: http://stackoverflow.com/q/77974419
type: Tag
tag name: flexbox

assembly
tag name: assembly
type: Tag
tags question: http://stackoverflow.com/q/77981579

http://stackoverflow.com/comment/139987321
comment on: http://stackoverflow.com/a/78929081
score: 0
has text: This thread too: https://developer.apple.com/forums/thread/758375
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137695234
has text: I added a check to see if delegate == nil and it is. I moved the init code in TableViewController to awakeFromNib. still delegate == nil. What do you mean wire delegate property to TableViewController? The delegate property is in MainController, I created a MainController object in the XIB but there is no delegate pull out that I can set to TableViewController. (Can I even set a delegate property in one controller object to another controller?)
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78104547

http://stackoverflow.com/comment/137722615
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78109418
has text: Are the outlet and action connected in a xib or storyboard? How is the `rViewController` instantiated?

http://stackoverflow.com/comment/137656686
comment on: http://stackoverflow.com/q/78069138
has text: thanks that did it I finally figured it out with the help. Not sure where I can put answered
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/137476542
has text: @Dan check the **Updated Solution** in my updated answer now with the new code that uses audioConfig and the Mic selected from the Listed option
type: AnswerComment
comment on: http://stackoverflow.com/a/77979357
type: Comment
score: 0

uinavigationbar
type: Tag
tag name: uinavigationbar
tags question: http://stackoverflow.com/q/78112507

http://stackoverflow.com/comment/137532013
type: AnswerComment
score: 2
type: Comment
has text: This is more of a comment than an answer.
comment on: http://stackoverflow.com/a/78012538

http://stackoverflow.com/comment/137591548
comment on: http://stackoverflow.com/a/78046631
has text: Absolutely yes on Xcode below 15, what do you expect? Are you confused `@available` and `#if`? It isn't relevant to the @available macro here.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/137469771
type: Comment
comment on: http://stackoverflow.com/q/77976314
type: QuestionComment
has text: There is no "best way". You have to manually look at every string in the code and decide yourself whether to wrap it in `NSLocalizedString`. It's a terribly tedious process to go back and add localization to an old project. I went through that years ago on a very large code base. No fun. I now add the comment `// NO_I18N` to end of every line that contains a string that doesn't need to be localized. I wrote a script that scans source files for string literals and it filters out references to `NSLocalizedString` and the `NO_I18N` comment. What's left are strings that need to be localized.
score: 1

azure
type: Tag
tags question: http://stackoverflow.com/q/77973278
tag name: azure
tags question: http://stackoverflow.com/q/78824897

http://stackoverflow.com/comment/137591523
score: 0
comment on: http://stackoverflow.com/a/78046631
type: AnswerComment
type: Comment
has text: if I add below code still it throws error - if (@available(macOS 14.0, *)) { myNSView.clipsToBounds = YES; }

nsthread
type: Tag
tags question: http://stackoverflow.com/q/78129689
tag name: nsthread

http://stackoverflow.com/comment/137534872
comment on: http://stackoverflow.com/q/78014194
has text: I also question why you call `CGPathRelease` inside either `loadGraphicView` method. Neither version should assume that the passed in path needs to be released. You are likely to overrelease `path` in some cases. Also, why does `loadGraphicView` take a `CGMutablePathRef` instead of just `CGPathRef`?
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/137519237
comment on: http://stackoverflow.com/a/77979357
score: 0
has text: @Dan Check my ***Updated Solution2 with Device Id:-*** in my updated answer, it meets your current requirement
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137705474
score: 0
has text: I created a sample app using Xcode 13 doing just the same, but it just won't work. I uploaded the here: https://www.file2send.eu/de/download/kFf6xo1p8Hl5jsprLKOwkeRgJ8P47ZtOVvx8L2Btt28RjuympAB2lmGi71sCCQSA Can you tell what I m missing?
comment on: http://stackoverflow.com/a/78107492
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137770706
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78126489
has text: @HangarRash If it works, don't touch it. You'll never know what kind of retain/release hocus pocus an old app contains. Converting to modern Objective-C and ARC is not trivial.
type: Comment

uibackgroundtask
type: Tag
tags question: http://stackoverflow.com/q/78036902
tag name: uibackgroundtask

http://stackoverflow.com/a/79406610
has body: onActiveSpace can change under the following circumstances: When the user changes the stage they are currently viewing. For example, assume that in Mission Control there are Stage 1 and Stage 2, and the window is on Stage 1 while the user is viewing Stage 1. In this case, onActiveSpace is YES; however, if the user switches to Stage 2, onActiveSpace will change to NO. This stage change can be detected via the NSWorkspaceActiveSpaceDidChangeNotification. When the window moves to another stage. This cannot be achieved using public APIs. Instead, you can use the SkyLight API as shown below: #import <Cocoa/Cocoa.h> NS_ASSUME_NONNULL_BEGIN APPKIT_EXTERN NSNotificationName const MA_NSWindowActiveSpaceDidChangeNotification; APPKIT_EXTERN void startWindowActiveSpaceObservation(void); NS_ASSUME_NONNULL_END /* ——————————— */ #import <objc/message.h> #import <objc/runtime.h> #include <dlfcn.h> NSNotificationName const MA_NSWindowActiveSpaceDidChangeNotification = @"MA_NSWindowActiveSpaceDidChangeNotification"; void _ma_NSWindow_Category_didReceiveEvent(unsigned int type, const void *data, size_t length, const void *context, unsigned int cid) { long windowNumber = *(long *)data; NSWindow *window = reinterpret_cast<id (*)(id, SEL, long)>(objc_msgSend)(NSApp, sel_registerName("windowWithWindowNumber:"), windowNumber); if (window == nil) return; [NSNotificationCenter.defaultCenter postNotificationName:MA_NSWindowActiveSpaceDidChangeNotification object:window]; } void startWindowActiveSpaceObservation(void) { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ void *handle = dlopen("/System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight", RTLD_NOW); void *symbol = dlsym(handle, "SLSRegisterConnectionNotifyProc"); assert(symbol != NULL); __kindof NSNotificationCenter *notificationCenter = NSWorkspace.sharedWorkspace.notificationCenter; unsigned int connectionID = reinterpret_cast<unsigned int (*)(id, SEL)>(objc_msgSend)(notificationCenter, sel_registerNam…
answers question: http://stackoverflow.com/q/78014996
score: 0
type: Answer

http://stackoverflow.com/tag/json
tag name: json
tags question: http://stackoverflow.com/q/77982472
tags question: http://stackoverflow.com/q/78131990
type: Tag

iboutlet
tags question: http://stackoverflow.com/q/78136069
type: Tag
tag name: iboutlet

foundation
type: Tag
tag name: foundation
tags question: http://stackoverflow.com/q/78129689
tags question: http://stackoverflow.com/q/78585460
tags question: http://stackoverflow.com/q/78770407

mosquitto
tags question: http://stackoverflow.com/q/78069138
type: Tag
tag name: mosquitto

http://stackoverflow.com/comment/137724943
comment on: http://stackoverflow.com/a/78093159
type: AnswerComment
type: Comment
score: 0
has text: @JaelRuvalcaba - I added your "second try" images to your original post. Looking at those images, the "rounded corners view" ***does*** size correctly. The UI elements you're adding as subviews are the problem. We can't help you without seeing how you're setting up constraints. Create a new project with **only that view controller** and post it somewhere like GitHub ... then we can see what you're doing, and hopefully correct it for you.

nsprintoperation
tag name: nsprintoperation
tags question: http://stackoverflow.com/q/77983169
type: Tag

http://stackoverflow.com/comment/137687502
has text: When you do `NSLog(@"squares to draw: %@", [delegate numberOfSquaresInSquareView:self]);`, what's the value of `delegate`. I guess it's `nil` since I only see this line setting it: `[_squareView setDelegate:nil];`. If it's nil, then there is no delegate object, so no-one to execute the delegate method, right? To illustrate, imagine having a manager (delegate) position, that's the delegate declaration (only a position, no hired people), employees that need that delegate. So the delegations won't work.
type: QuestionComment
comment on: http://stackoverflow.com/q/78099020
score: 0
type: Comment

http://stackoverflow.com/comment/137533305
has text: Thanks for your help, I have solved the question. The function of `cfunc` is to return the function stack address
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78011219
type: Comment

http://stackoverflow.com/comment/137534910
comment on: http://stackoverflow.com/q/78014194
type: Comment
has text: @matt Fixed it and updated the question, still having same issue but code is nicer.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/137457008
has text: still not working , tried your solution. also tried some way to debug , while debugging inside the Xcode I can see the view controller but it is not showing on the device
comment on: http://stackoverflow.com/a/77969819
type: AnswerComment
type: Comment
score: 0

uitraitcollection
tags question: http://stackoverflow.com/q/77974177
tag name: uitraitcollection
type: Tag

http://stackoverflow.com/comment/137750683
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78136069
type: Comment
has text: Can you please format your code blocks. Right now it’s a mulch of bullet points and code.

http://stackoverflow.com/comment/137751635
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78136069
has text: What are you trying to accomplish? I'm sorry but I don't understand steps 7 and 8. Add a window to a window? What is "File’s Owner of the AppDelegate object in Placeholders"?
type: Comment

bridging
tag name: bridging
tags question: http://stackoverflow.com/q/78008072
type: Tag

http://stackoverflow.com/comment/137537715
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78012538
has text: Nope, as I explained in the question, I found no way to delay the state restoration without also stopping the process that would open the documents, as it all happens in the same subroutine into which I cannot find a way to hook into.
score: 0

http://stackoverflow.com/comment/137728647
comment on: http://stackoverflow.com/a/78093159
type: AnswerComment
type: Comment
has text: Solved! , I see that self.bounds = container View.bounds causes the problems, I needed to make the entire view with constraints, the space that was left over in white or whatever color was because when the view was rendered that space was part of the safe area . @DonMag
score: 0

http://stackoverflow.com/comment/137567402
score: 0
comment on: http://stackoverflow.com/q/78032810
type: QuestionComment
has text: I suggest to use SPM and it's commands
type: Comment

arduino-esp8266
type: Tag
tag name: arduino-esp8266
tags question: http://stackoverflow.com/q/78069138

http://stackoverflow.com/comment/137752347
type: QuestionComment
comment on: http://stackoverflow.com/q/78136069
score: 0
has text: Is a window object a xib file? If a window has a window controller then usually the window controller owns the window, is the file's owner, is the window's delegate and has the outlets to the controls in the window. The app delegate talks to the window controller, not to the window or the controls. The window controller controls the window.
type: Comment

uilabel
type: Tag
tags question: http://stackoverflow.com/q/78081552
tag name: uilabel

asyncdisplaykit
tag name: asyncdisplaykit
tags question: http://stackoverflow.com/q/77974419
type: Tag

xib
type: Tag
tag name: xib
tags question: http://stackoverflow.com/q/78136069

line-breaks
type: Tag
tag name: line-breaks
tags question: http://stackoverflow.com/q/78081552

http://stackoverflow.com/a/78102759
has body: The method I've found so far is to use Objective-C method swizzling and replace these three methods with a function that calls my callback function and then calls the original method: dragImage:at:offset:event:pasteboard:source:slideBack: on NSWindow dragImage:at:offset:event:pasteboard:source:slideBack: on NSView beginDraggingSessionWithItems:event:source: on NSView I'm not 100% sure that will catch every drag-and-drop operation, but it's caught all the ones I've tested out so far.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/78076129

http://stackoverflow.com/q/78252191
has comment: http://stackoverflow.com/comment/137970873
has comment: http://stackoverflow.com/comment/137962009
has body: I have a weather app that refreshes asynchronously. While I've never seen it crash myself, I do see about a crash per day in Apple's reports, and not from a specific device. The app does have a good amount of users and it refreshes every few minutes, but I have no idea what kind of percentage send reports to Apple, so don't really know how rare the crash really is. I've tried a few things, like making sure I the Async Downloader class that creates the datatask does not get destroyed etc. There are 2 kinds of reported crashes, the most common is at this code: -(void)startDownload { NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:fileURL] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:12]; NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; if (!session || !request || ![session respondsToSelector:@selector(dataTaskWithRequest:completionHandler:)]) return; // Stack trace points to line below crashing self.dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {...} // ... } The "defensive" if is a sanity check as the crash stack trace looks like this: That self.dataTask is just @property NSURLSessionDataTask *dataTask;. Any ideas on what to look into or try in order to avoid this? I seems quite rare overall so I am wondering if it's a case of the app is getting killed by the system or something like that which causes an unclean termination. Would welcome any suggestion though. Edit: Couldn't find how to get Xcode to show me more info from the crash dump, but of course I could just open it with a text editor and here is all the info: Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Triggered by Thread: 9 Last Exception Backtrace: 0 CoreFoundation 0x1ca108cb4 __exceptionPreprocess + 164 (NSException.m:202) 1 libobjc.A.dylib 0x1c32243d0 objc_exception_th…
has title: Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
score: 0
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/137963354
type: Question
has comment: http://stackoverflow.com/comment/137957633
has comment: http://stackoverflow.com/comment/137957275
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/137957215
has comment: http://stackoverflow.com/comment/137960431
tagged with: ios
has comment: http://stackoverflow.com/comment/137957453
has comment: http://stackoverflow.com/comment/137957187
has comment: http://stackoverflow.com/comment/137957113
tagged with: objective-c

http://stackoverflow.com/comment/137919620
score: 0
has text: You question is unclear. According to provided link you need to change Image of left and right swipe cell in cellForRowAt function. But you are changing it in tappedButtonAtIndex that's why you image is not getting change. Do you want to change the image when cell get's swipe or what?
type: Comment
comment on: http://stackoverflow.com/q/78230445
type: QuestionComment

http://stackoverflow.com/q/78290156
answer count: 1
tagged with: objective-c
linked to: http://stackoverflow.com/q/2255861
has answer: http://stackoverflow.com/a/78290317
tagged with: ibaction
score: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/138030785
has comment: http://stackoverflow.com/comment/138028405
tagged with: xcode
accepted answer: http://stackoverflow.com/a/78290317
has title: Issue with NSString access from IBAction in a macOS app for 10.4 Tiger PPC in Xcode 2.5
has comment: http://stackoverflow.com/comment/138086012
tagged with: macos
has body: So this is a rather obscure issue but here goes. I have access to only 1 kind of Mac at work (I teach programming at a high school) and that's an old EMac 1.25Ghz. I've got it running Tiger. I also have a 1Ghz EMac at home also running Tiger, both have Xcode 2.5 installed. My app works fine for the most part but I find I am having issues writing to NSString variables from IBActions. I can read the strings fine and read and write to ints or bools, but NSStrings throw a BAD_EXEC_ACCESS error whenever I try to write to them if they are variables that exist outside the IBAction method. The code works fine on my Mac Pro at home, compiled for macOS 14, but not in Tiger, or Leopard. I've tried recompiling the app in Xcode 3.1 but get the same issues. I'm looking for a vet or 2 who can tell me how to correctly set up NSStrings to be accessed from the IBAction. Here's my code: #import "GameWindow.h" @implementation GameWindow // game variables int gameStage; int playerType; int startUpSetting; bool languageSelect; int playerPortrait; bool firstTimeGettingInput; //strings are char characters NSString *playerName; NSString *inputText; NSString *onGoingDisplayText; -(void)awakeFromNib{ //init the view here, set text, ect //define variable values gameStage = 0; //where we are in the game playerType = 0; //who we're playing as startUpSetting = 1; //this becomes 0 once start up perameters have been set languageSelect = 0; //0 is English, 1 is Japanese playerPortrait = 4; //what the players portrait looks like. firstTimeGettingInput = true; //has the game just started? //strings are char characters playerName = @"Jyoubu"; //player's name inputText = @""; //the command or text the player has just typed onGoingDisplayText = @""; //what the player has typed so far } -(IBAction) textSubmitted: (id) sender { //run the code for when text has been submitted via the input area by pressing enter. //sort out strings NSString *introNameString; NSString *onGoingDisplayText2 = [mainTextView str…
tagged with: nsstring
type: Question

http://stackoverflow.com/comment/137821640
comment on: http://stackoverflow.com/q/78173482
type: Comment
score: 0
type: QuestionComment
has text: " if I set it to 1, it renders at 1fps." it's exactly what it's supposed to do, it presents a drawable after waiting one second, which gives you 1 fps if you can encode all the command buffers in the frame in one second.

http://stackoverflow.com/q/78207140
score: 1
type: AnsweredQuestion
tagged with: ios
tagged with: ios-simulator
type: Question
upvote count: 1
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/78207247
has body: Im sure this is something that will be easy for someone with more objective C experience than me. I did not write this but I am stuck using it. I have a .h file: bleconfigLibrary with an interface: @interface bleconfigLibrary : NSObject. In a different .m file I have: #import <Foundation/Foundation.h> #import "BTCommands.h" #import "bleconfigLibrary.h" #define MAX_BUF_SIZE (512) @implementation BTCommands bleconfigLibrary *handleRequest; + (void)initialize{ handleRequest = [bleconfigLibrary alloc]; } The problem seems to be: handleRequest = [bleconfigLibrary alloc]; When I try to run on a simulator I get the error: Undefined symbol: _OBJC_CLASS_$_bleconfigLibrary But it runs fine on physical devices. If I comment out that section, it runs on the simulator. Any help would be appreciated.
favorite count: 0
accepted answer: http://stackoverflow.com/a/78207247
has title: Undefined symbol: _OBJC_CLASS_$_ only on simulator
linked to: http://stackoverflow.com/q/10024608
downvote count: 0
tagged with: xcode

http://stackoverflow.com/a/78408149
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/78192465
answers question: http://stackoverflow.com/q/78192465
has body: Disabling Malloc Scribble in the scheme seems like a temporary fix for this until it gets resolved with a new version of Xcode. Screenshot

http://stackoverflow.com/comment/137899769
comment on: http://stackoverflow.com/a/78207247
score: 0
type: AnswerComment
has text: There is no practical way to convert a `.a` file built for one platform into a `.a` for another. The only practical approach is to rebuild the library from source. (For extremely small and simple libraries, and a reasonable expertise in ARM assembly and C, it can be done. I've done it once for a library that held a single function and less than 200 lines of code. But I wouldn't call it a "practical" solution. Even in that case, we finally were able to rebuild it from source.)
type: Comment

http://stackoverflow.com/comment/137979733
type: QuestionComment
type: Comment
has text: @Larme : My public key used for encryption was wrong
score: 0
comment on: http://stackoverflow.com/q/78254151

http://stackoverflow.com/q/78307909
tagged with: objective-c
has title: removing WKWebView leaving keyboard stuck open
has comment: http://stackoverflow.com/comment/138068716
tagged with: wkwebview
score: -1
type: Question
has comment: http://stackoverflow.com/comment/138066322
has answer: http://stackoverflow.com/a/78324286
type: UnansweredQuestion
favorite count: 0
upvote count: 0
has body: Updated an app that used UIWebView to use WKWebView instead. However, the keyboard can be made to stay up and remain unresponsive following these steps: A WKWebView is opened to a URL that has input field(s) and attached to the superview. Input field is activated and the keyboard is displayed. Text can be entered with the keyboard as expected. An action is performed that removes the WKWebView from the superview while the keyboard is displayed. The keyboard is removed as expected along with the WKWebView. Open a new WKWebView to a URL that has input field(s) and attached to the superview. Activate an input field and a keyboard is displayed. An action is performed that removes the WKWebView from the superview while the keyboard is displayed. At this point, the keyboard will not go away, nor can it be made to go away. Clearly the desired behavior is for the keyboard to go away every time the webview is made to go away. I wrote a simple little test app and I can reproduce the issue outside the complexity of the app. So what is the acceptable method to dispose of a WKWebView? This is a code fragment of what does not work for me, leaving the keyboard lifeless on the second invocation as if it has been detached and forgotten. [webView stopLoading]; webView.navigationDelegate = nil; webView.scrollView.delegate = nil; [webView removeFromSuperview]; webView = nil; Here is a bit more of a working example. I tried to keep it simple and used a double tap to add/remove, but a button or timer works as well to trigger the adding/removing of the webview. I don't think it makes any difference. The issue appears to be disposing of a WKWebView while the keyboard is open and active. - (void)viewDidLoad { [super viewDidLoad]; webView = nil; webViewIsActive = FALSE; tap2Recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)]; tap2Recognizer.numberOfTouchesRequired = 1; tap2Recognizer.numberOfTapsRequired = 2; tap2Recognizer.delegate = self; [se…
tagged with: ios
downvote count: 1
answer count: 1

http://stackoverflow.com/q/78234249
upvote count: 1
downvote count: 0
type: UnansweredQuestion
tagged with: pow
answer count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/137943738
has body: I have this solution, in nineteen languages. I needs a pow() function (or operator) to calc from increase to interest rate and from interest rate to increase. The only language I can't calc it is in Objective-C. How to use it? This works: NSLog(@"Pow = %f", pow(1.03, 0.5)); This don't works: - (double) pot: (double) value exponent: (double) e { return pow(value, e); } It gives this error: /usr/sbin/ld: /tmp/ccYQw9Wv.ltrans0.ltrans.o: undefined reference to symbol 'pow@@GLIBC_2.29' /usr/sbin/ld: /usr/lib/libm.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status
has title: How to use pow() in Objective-C?
tagged with: exponent
has comment: http://stackoverflow.com/comment/137925219
tagged with: objective-c
type: Question

http://stackoverflow.com/a/78168282
type: AcceptedAnswer
score: 0
type: Answer
has body: The Swift compiler generates one header for each module. Your different targets are creating different modules and so the header ends up with different names. The name of the header generated by a target is in the build settings for that target. It's in the section Swift Compiler - General and the setting name is Generated Header Name. If you set that generated header to the same name for each of your targets that may resolve your issue. If both targets are building the same "thing" - the same Module, you might also look in the Packaging Section of your target build settings and change the targets so that they use the same Product Module Name. Generally, however, if you want to build the same "thing" for debug and for release, what you would do is set up one single Target and then you can build it for debug, or for release using the product menu. If you need to make more complex changes then you can make different Schemes of the same target to switch between debug and release. The current scheme is at the left side of the small information area in the tile bar of an Xcode project (see the image at https://developer.apple.com/documentation/xcode/build-system where the scheme and target settings are called out).
accepted answer of: http://stackoverflow.com/q/78167503
answers question: http://stackoverflow.com/q/78167503
has comment: http://stackoverflow.com/comment/137808781

http://stackoverflow.com/q/78173482
type: Question
has comment: http://stackoverflow.com/comment/137819988
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/137817755
answer count: 0
has comment: http://stackoverflow.com/comment/137822526
tagged with: ios
has comment: http://stackoverflow.com/comment/137818021
tagged with: metal
has comment: http://stackoverflow.com/comment/137822343
has body: I am working on a metal renderer with the GLFW windowing api (the reason I use glfw is for portability). The problem is that the frame rate is capped at sixty which I do not want, after some googling I found you can modify the frame rate through an MTKView, though I cannot find how to get such an object. The questions is, can I get the MTKView through glfw somehow, or rather, how should I modify the frame rate in this situation? Some sample code: ... CAMetalLayer* layer = [CAMetalLayer new]; ... NSWindow* window = glfwGetCocoaWindow(glfwWindow); window.contentView.layer = layer; windwo.contentView.wantsLayer = YES; ... I must say I am completely new to Metal and I am not sure if using glfw is the way to go, I do definitely want to use Glfw since I rely on it on windows with Vulkan and I found some code can be cross platform with glfw. (edit) Rendering happens as follows: id &lt;CAMetalDrawable&gt; surface = ...; MTLRenderPassDescriptor* render_pass = ...; id &lt;MTLCommandQueue&gt; queue = ...; CAMetalLayer* layer = ...; id &lt;MTLRenderCommandEncoder&gt; command = ...; id &lt;MTLRenderPipelineState&gt; pipeline = ...; id &lt;MTLCommandBuffer&gt; command_buffer = [queue commandBuffer]; render_pass.colorAttachments[0].texture = surface.texture; command = [command_buffer renderCommandEncoderWithDescriptor: render_pass]; [command setRenderPipelineState: pipeline]; [command endEncoding]; [command_buffer presentDrawable: surface]; [command_buffer commit]; surface = [layer nextDrawable]; Thank you.
tagged with: objective-c
has comment: http://stackoverflow.com/comment/137818017
has title: How to set frame rate in GLFW based metal application?
has comment: http://stackoverflow.com/comment/137821640
has comment: http://stackoverflow.com/comment/137821249
score: 0
has comment: http://stackoverflow.com/comment/137821647
tagged with: frame-rate

http://stackoverflow.com/a/78287125
has body: You can call the apply method on the kernel instead: - (CIImage *)outputImage { CISampler *src = [CISampler samplerWithImage: inputImage]; CIKernelROICallback roiCallback = ^(int index, CGRect rect) { return rect; }; return [Self.alphaRemoveKernel applyWithExtent: [inputImage extent], roiCallback: roiCallback, arguments: @[src]]; } And it's actually simpler if you use CIColorKernel instead, because you don't need the roiCallback then. This works for your filter since you have a 1:1 mapping of input to output pixels: #import "AlphaFilter.h" @implementation CIAlphaFilter @synthesize inputImage; static CIColorKernel *alphaRemoveKernel = nil; - (id)init { if(alphaRemoveKernel == nil) { NSString *code = @"kernel vec4 darkToTransparent(__sample src){vec4 color = src;color.a = 0.5;return color;}"; alphaRemoveKernel = [CIColorKernel kernelWithString:code]; } return [super init]; } - (CIImage *)outputImage { CISampler *src = [CISampler samplerWithImage: inputImage]; return [Self.alphaRemoveKernel applyWithExtent: [inputImage extent], arguments: @[src]]; } @end And, even simpler, for this use case you can use the built-in CIColorMatrix filter. You don't need to write your own kernel: #import "AlphaFilter.h" @implementation CIAlphaFilter @synthesize inputImage; - (CIImage *)outputImage { CIColorMatrix *colorMatrixFilter = [CIFilter colorMatrixFilter]; colorMatrixFilter.inputImage = inputImage; colorMatrixFilter.AVector = [CIVector vectorWithX:0 Y:0 Z:0 W:0.5] return colorMatrixFilter.outputImage; } @end
accepted answer of: http://stackoverflow.com/q/78282950
answers question: http://stackoverflow.com/q/78282950
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/78270748
answer count: 0
has comment: http://stackoverflow.com/comment/137989814
tagged with: onesignal
has title: Use Web localStorage in Objective-C but not working
has body: #import "AppDelegate.h" #import "MainViewController.h" #import <OneSignalFramework/OneSignalFramework.h> // Import OneSignalFramework @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.viewController = [[MainViewController alloc] init]; // Remove this method to stop OneSignal Debugging [OneSignal.Debug setLogLevel:ONE_S_LL_VERBOSE]; // OneSignal initialization [OneSignal initialize:@"OneSignal App ID" withLaunchOptions:launchOptions]; // requestPermission will show the native iOS notification permission prompt. // We recommend removing the following code and instead using an In-App Message to prompt for notification permission [OneSignal.Notifications requestPermission:^(BOOL accepted) { NSLog(@"User accepted notifications: %d", accepted); } fallbackToSettings:true]; // NSString *userId = OneSignal.User.onesignalId; // Store OneSignal player ID in local storage NSString *oneSignalPlayerID = OneSignal.User.onesignalId; if (oneSignalPlayerID != nil) { NSLog(@"OneSignal Player ID: %@", oneSignalPlayerID); // Store the player ID in local storage (NSUserDefaults) [[NSUserDefaults standardUserDefaults] setObject:oneSignalPlayerID forKey:@"oneSignalPlayerID"]; [[NSUserDefaults standardUserDefaults] synchronize]; } else { NSLog(@"OneSignal Player ID is nil or not available."); } // Retrieve the value from NSUserDefaults NSString *playerID = [[NSUserDefaults standardUserDefaults] objectForKey:@"oneSignalPlayerID"]; // Log the value NSLog(@"oneSignalPlayerID: %@", playerID); // Login your customer with externalId // [OneSignal login:@"EXTERNAL_ID"]; return [super application:application didFinishLaunchingWithOptions:launchOptions]; } @end used this method but having error in webView "Use of undeclared identifier 'webView'" NSString \*oneSignalPlayerID = OneSignal.User.onesignalId; if (oneSignalPlayerID != nil) { NSLog(@"OneSignal Player ID: %@", oneSignalPlayerID); // Inject JavaScrip…
tagged with: ios
has comment: http://stackoverflow.com/comment/138003887
type: Question
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/137990156
score: 0
tagged with: ionic-framework

httprequest
tags question: http://stackoverflow.com/q/78254151
tag name: httprequest
type: Tag

http://stackoverflow.com/q/78300952
type: Question
type: UnansweredQuestion
answer count: 0
has title: Known changes to NSURLSessionDataTask from iOS 16 to iOS 17?
has body: I've tried to find out if there were any significant behavioral changes for NSURLSessionDataTask between iOS versions 16 and 17, but have not found any answers. I'm having an issue where I'm performing a 'POST' request to an endpoint. On iOS 16, I'm getting a 400 status code, on iOS 17, a 200. There are no changes in the source code or the endpoint being accessed. NSURLSessionDataTask is being configured with [NSURLSessionConfiguration defaultSessionConfiguration] and the request Content-Type is set to application/json Are there any known changes in iOS versions that can explain this behavior?
has comment: http://stackoverflow.com/comment/138042497
tagged with: ios
tagged with: objective-c
score: 0
has comment: http://stackoverflow.com/comment/138042449

http://stackoverflow.com/comment/138042449
type: Comment
comment on: http://stackoverflow.com/q/78300952
type: QuestionComment
has text: Unlikely, your best bet is to check the server logs. When I encountered similar issues in the past, it was usually a simple mistake like forgotten `#available` directive or a more subtle difference, e.g. iPhone vs iPad.
score: 0

http://stackoverflow.com/comment/137988029
comment on: http://stackoverflow.com/q/78269843
has text: I would implore you to think critically about the UX requirements to which you're alluding here - it's highly likely that bolting on a Dock-like thing to the Dock itself would cause significant user confusion when said bolt-on doesn't look and/or behave the same way the Dock itself does.
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/137921643
comment on: http://stackoverflow.com/q/78230445
type: QuestionComment
score: 0
type: Comment
has text: When the slide out button to the left appears, change the picture after clicking the button with the red circle drawn on it.

http://stackoverflow.com/comment/138086012
type: Comment
has text: Yeah but the point is that your Objective-C code isn't correct. If you use that same pattern in any class, the class will be wrong. It's important that you correctly declare instance variables to avoid bugs that will be difficult to track down.
type: QuestionComment
comment on: http://stackoverflow.com/q/78290156
score: 0

nsxpcconnection
type: Tag
tag name: nsxpcconnection
tags question: http://stackoverflow.com/q/78295722

http://stackoverflow.com/comment/137896620
type: QuestionComment
score: 0
type: Comment
has text: Is that macOS or iOS? Also, what is `e` here? Is it a local variable?
comment on: http://stackoverflow.com/q/78218464

http://stackoverflow.com/q/78291071
has title: Why these code can make a continuous child thread?
has answer: http://stackoverflow.com/a/78293581
has body: - (void)testCreateContinuousChildThread { testThread *thread = [[testThread alloc] initWithBlock:^{ NSTimer *timer = [NSTimer timerWithTimeInterval:1.0 repeats:NO block:^(NSTimer * _Nonnull timer) { NSLog(@"current thread:%@", [NSThread currentThread]); }]; NSRunLoop *loop = [NSRunLoop currentRunLoop]; [loop addTimer:timer forMode:NSRunLoopCommonModes]; [loop run]; }]; [thread start]; [self performSelector:@selector(testSelector) onThread:thread withObject:nil waitUntilDone:YES]; } - (void)testSelector { NSLog(@"testSelector"); } The class of 'testThread' only contains dealloc method to log message of dealloc. And after running these code, the testThread won't be destroyed automatically. When I delete this line, the testThread will be destroyed automatically as expected. [self performSelector:@selector(testSelector) onThread:thread withObject:nil waitUntilDone:YES];
type: Question
upvote count: 1
downvote count: 0
answer count: 1
tagged with: runloop
score: 1
accepted answer: http://stackoverflow.com/a/78293581
favorite count: 0
tagged with: multithreading
tagged with: nstimer
tagged with: ios
type: AnsweredQuestion
tagged with: objective-c

http://stackoverflow.com/a/78242048
answers question: http://stackoverflow.com/q/78241949
type: Answer
has body: The fully qualified selector name (with the class name) is not required, even in methods not marked with @objc. Of course the selector itself must be either an Objective-C method or a Swift method marked with @objc. Oddly, none of the documentation shows any example of a #selector without the fully qualified name but I never use the fully qualified name and it works just fine. It works just like it does in Objective-C. As long as the compiler can find such a method on any known class in the project, the unqualified selector can be used in any context. Relevant documentation (with no unqualified examples): Swift language reference Using Objective-C Runtime Features in Swift BTW - Xcode does not force a fully qualified name for me. If I type something like: let sel = #selector( and then type a letter such as v, Xcode offers lots of selectors that start with a v but it does not include any class name. Also note that the selector name does not require the parentheses and arguments except in cases where you need to disambiguate between overloaded method names. As an example, let's say we have a button handler in some iOS code. We need the selector for the call to addTarget. The handler method may look like this: @objc func buttonTapped(_ button: UIButton) { } The following are all valid uses of #selector: #selector(SomeClass.buttonTapped(_:)) #selector(SomeClass.buttonTapped) #selector(buttonTapped(_:)) #selector(buttonTapped) And if the referenced selector is in the same class as the #selector line, you can also prefix the selector name with Self.: #selector(Self.buttonTapped(_:)) #selector(Self.buttonTapped) though there seems to be little reason to do so. The main reason to fully qualify the selector name with the class name is to avoid runtime issues by ensuring, at compile time, that the referenced method actually exists on the specified class.
score: 0
accepted answer of: http://stackoverflow.com/q/78241949
type: AcceptedAnswer

selector
tags question: http://stackoverflow.com/q/78241949
type: Tag
tag name: selector

http://stackoverflow.com/comment/137867495
score: 0
has text: Thank you sir, really appreciate this incredibly well thought out and detailed response. Think I'm just going to go with the all view approach to keep things clean and simple as recommended above, though it's a useful resource to have the layers / zPosition approach as well.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78201663

http://stackoverflow.com/q/78186819
answer count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138298802
score: 1
has title: Crash in Google maps cocoapod in iOS project
tagged with: ios
tagged with: google-maps-sdk-ios
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138920593
type: Question
upvote count: 1
has body: My project is using GoogleMap (8.3.0) version. It is working all good. But suddenly it is crashing with the error : *** -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil -[GMSStyleTableService checkStyleTableMemoryCacheForKey:callbackQueue:handler:] Here is what i tried to make sure mapview is not nil : if(self.mapView==nil) return; self.mapView.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height); GMSPath *path = [GMSPath pathFromEncodedPath:pathString]; GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithPath:path]; GMSPolyline *polyline = [GMSPolyline polylineWithPath:path]; polyline.strokeWidth = 3; polyline.strokeColor = color.blue; polyline.map = self.mapView; GMSCameraPosition *camera = [self.mapView cameraForBounds:bounds insets:UIEdgeInsetsMake(32, 32, 32, 32)]; self.mapView.camera = camera; GMSMarker *myMarker = [[GMSMarker alloc] init]; myMarker.position = self.myCoords; myMarker.icon = [UIImage imageNamed:@"dot.png"]; myMarker.map = self.mapView;
downvote count: 0

http://stackoverflow.com/q/78283285
has answer: http://stackoverflow.com/a/78287165
upvote count: 2
tagged with: objective-c
tagged with: chromakey
tagged with: avplayer
score: 2
type: Question
downvote count: 0
tagged with: cifilter
answer count: 1
has body: I followed this document to make a chroma key filter for AVPlayerItem on iOS. I want all pixels that match a condition become transparent. For now, the condition is whether the pixel has hue value between 0.3 and 0.4 (green pixels). My filter: - (CGFloat) hueFromRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue { UIColor* color = [UIColor colorWithRed:red green:green blue:blue alpha:1]; CGFloat hue, saturation, brightness; [color getHue:&hue saturation:&saturation brightness:&brightness alpha:nil]; return hue; } - (CIFilter<CIColorCube> *) chromaKeyFilterHuesFrom:(CGFloat)minHue to:(CGFloat)maxHue { const unsigned int size = 64; const size_t cubeDataSize = size * size * size * 4; NSMutableData* cubeData = [[NSMutableData alloc] initWithCapacity:(cubeDataSize * sizeof(float))]; for (int z = 0; z < size; z++) { CGFloat blue = ((double)z)/(size-1); for (int y = 0; y < size; y++) { CGFloat green = ((double)y)/(size-1); for (int x = 0; x < size; x++) { CGFloat red = ((double)x)/(size-1); CGFloat hue = [self hueFromRed:red green:green blue:blue]; float alpha = (hue >= minHue && hue <= maxHue) ? 0 : 1; float premultipliedRed = red * alpha; float premultipliedGreen = green * alpha; float premultipliedBlue = blue * alpha; [cubeData appendBytes:&premultipliedRed length:sizeof(float)]; [cubeData appendBytes:&premultipliedGreen length:sizeof(float)]; [cubeData appendBytes:&premultipliedBlue length:sizeof(float)]; [cubeData appendBytes:&alpha length:sizeof(float)]; } } } CIFilter<CIColorCube> *colorCubeFilter = CIFilter.colorCubeFilter; colorCubeFilter.cubeDimension = size; colorCubeFilter.cubeData = cubeData; return colorCubeFilter; } In ViewController, I created a button to start the video player and apply the filter to AVPlayerItem. [self chromaKeyFilterHuesFrom:0.3 to:0.4] means filtering the green pixels: - (AVVideoComposition*) createVideoComposition:(AVPlayerItem *)_playerItem { CIFilter<CIColorCube>* chromaKeyFilter = [self chromaKeyFilterHuesFrom:0.3 to:0.4]; AVM…
type: UnansweredQuestion
favorite count: 0
has title: CIFilter on AVPlayerItem: Chroma key filter make pixels become black instead of transparent
tagged with: ios

http://stackoverflow.com/q/78167503
type: Question
tagged with: objective-c
has title: When importing a header into swift file, how do I define conditional macros for different targets?
tagged with: xcode
score: 0
has answer: http://stackoverflow.com/a/78168282
type: AnsweredQuestion
has body: I'm trying to import a Swift class into an Objective-C file in Xcode. It works fine, based on exposing the class to Objective-C and importing the ProductModuleName-Swift.h Xcode generated file. The problem I'm having is that my app has multiple targets, and it seems that Xcode generates a different -Swift.h file for each target. So if I import the production -Swift.h, the dev target won't build, and vice versa. I've tried: - Importing both of them: doesn't work (neither will build due to not being able to locate the other) - Added conditional macros to only import the right file for the right target: when wrapped in the conditionals the Swift methods from the class are no longer locatable by Xcode and don't compile. My current solution, which does work, involves going into build settings for one of the targets and disconnecting the Generated Header Name from the Product Module Name, and manually giving it the same name as the other target. Now it compiles fine. However my concern is that I'm tinkering with something that shouldn't be changed and could have negative ramifications. So my question is - is there a better way of doing what I want to achieve? Thanks in advance. *LogStatements Swift class no longer found and doesn't compile -> #if PRODUCTION #import "ProductionTarget-Swift.h" #elif DEV #import "DevelopmentTarget-Swift.h" #endif @implementation STNetworkManager + (void)saveDictionary:(NSDictionary *)dictionary withFileName:(NSString *)fileName { if (dictionary == nil || fileName == nil) { return; } // check if all objects are valid JSON objects if (![NSJSONSerialization isValidJSONObject:dictionary]) { NSLog(@"Error saving dictionary, invalid JSON object: %@", dictionary); LogStatements *logging = [[LogStatements alloc] init]; [logging logger:@[@"Hello from Objective-C"]]; return; }
accepted answer: http://stackoverflow.com/a/78168282
tagged with: swift
tagged with: bridging-header
tagged with: macros
answer count: 1

http://stackoverflow.com/comment/137822343
comment on: http://stackoverflow.com/q/78173482
score: 0
type: Comment
type: QuestionComment
has text: Thanks again for your response, but that too does not achieve what I am looking for, the frame rate remains the exact same (60).

http://stackoverflow.com/q/78195287
score: 0
type: Question
answer count: 1
has body: I have the following view set up: Where the anchor point for V3 is (0, .5) and it can be rotated by a UIPanGestureRecognizer that's attached to V4. I'm trying to translate a point on V4 to V1s coordinate space (so I can attach a subview to V1 that appears over the center of V4) and I can't get it to place correctly. I have the following code: CGSize targetImageViewSize = CGSizeMake(v4.frame.size.width / 2, v4.frame.size.height / 2); //find the point that will place the target in the center of v4 when attached as a subview to v1 (i.e. in its center) CGPoint convertedTargetImageViewOrigin = [v1 convertPoint:CGPointMake((v4.frame.size.width - targetImageViewSize.width) / 2, (v4.frame.size.height - targetImageViewSize.height) / 2) fromView:v4]; UIImageView *targetImageView = [[UIImageView alloc] initWithFrame:CGRectMake(convertedTargetImageViewOrigin.x, convertedTargetImageViewOrigin.y, targetImageViewSize.width, targetImageViewSize.height)]; targetImageView.image = [UIImage imageNamed:@"TargetIcon"]; targetImageView.transform = CGAffineTransformMakeRotation(v3.degreesRotated); [v1 addSubview:targetImageView]; I've also tried rotating the point to no avail: convertedTargetImageViewOrigin = CGPointApplyAffineTransform(convertedTargetImageViewOrigin, CGAffineTransformMakeRotation(v3.degreesRotated)); To be clear, I don't this target to appear over v4 while the user is rotating, just briefly when the user taps v1. Any help as to why I can't get the correct point would be appreciated, thanks.
has comment: http://stackoverflow.com/comment/137856027
has answer: http://stackoverflow.com/a/78197598
tagged with: ios
has comment: http://stackoverflow.com/comment/137855858
has title: Having trouble converting point that's on a rotated view with a (0, .5) anchor point
type: AnsweredQuestion
tagged with: cgpoint
accepted answer: http://stackoverflow.com/a/78197598
has comment: http://stackoverflow.com/comment/137855872
tagged with: objective-c
tagged with: uiview

http://stackoverflow.com/q/78153217
has comment: http://stackoverflow.com/comment/137790938
has comment: http://stackoverflow.com/comment/137788185
tagged with: objective-c
has title: How to client SSL certificate for iOS app for React native project?
tagged with: react-native
score: 0
has body: I have clients cloudflare SSL certificate(.pem). I want to embed this SSL certificate for my react native project for iOS so that we can access our API's. I am new to this I have tried so many ways but didn't get exact solution for it. The language we are using is Objective C where we have to write code for SSL cert embedding. Can anyone help me with this any tutorial link will work for me to get reference. I have tried to convert cert into .p12 but when I decode response and call our API I am getting 403 error code. I want try same cert which client gave me .pem I dont want to convert it to somethingelse
type: Question
tagged with: ssl-certificate
type: UnansweredQuestion
answer count: 0
tagged with: ios
tagged with: nsurlsession

http://stackoverflow.com/q/78149183
has comment: http://stackoverflow.com/comment/137781291
score: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/137775841
has answer: http://stackoverflow.com/a/78153912
accepted answer: http://stackoverflow.com/a/78153912
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/137781173
tagged with: objective-c
has body: I know this question been asked before. But None of the answers worked for me. What is the requirements: on iOS app, user to be able to record a short audio file (30sec) then upload it to the server using https request. The recording and saving temporary on the phone works very well. But I couldn't get the upload part to work. My code to upload file on the API side as follow. Tested it with Postman, works very well. File received and saved as intended. [HttpPost] public async Task<IActionResult> UploadFile([FromForm] IFormFile file, [FromForm] string name) { try { if(webHostEnvironment == null) { throw new SqlNullValueException("webHostEnvironment is null"); } if (webHostEnvironment.ContentRootPath == null) { throw new SqlNullValueException("webHostEnvironment.ContentRootPath is null"); } if(file == null) { throw new SqlNullValueException("File is null"); } String path = Path.Combine(webHostEnvironment.ContentRootPath, "uploads"); if (file.Length > 0) { string filePath = Path.Combine(path, file.FileName); using (Stream fileStream = new FileStream(filePath, FileMode.Create)) { await file.CopyToAsync(fileStream); } } return BuildResponse(Ok().StatusCode, name); } catch(Exception ex) { throw new Exception(ex.Message ); } } Here's is my Objective-C code to upload the file: -(void)uploadFile:(NSData*)fileData{ if(fileData != nil){ NSString *fileName = self.temporaryRecFile.path.lastPathComponent; NSString *urlString = @"some url";//upload file url NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; [request setURL:[NSURL URLWithString:urlString]]; [request setHTTPMethod:@"POST"]; NSString *boundary = @"---------------1234567890"; NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary]; [request addValue:contentType forHTTPHeaderField:@"Content-Type"]; NSMutableData *bodyData = [[NSMutableData alloc] init]; [bodyData appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncod…
tagged with: .net-core
has title: NSURLSessionDataTask Fail to upload audio file to server
has comment: http://stackoverflow.com/comment/137781440
type: Question
answer count: 1

http://stackoverflow.com/q/78259397
has title: How are Swift and Obective-C interoperable despite having different runtimes?
tagged with: xcode
upvote count: 2
has comment: http://stackoverflow.com/comment/137968779
score: 2
type: Question
tagged with: swift
downvote count: 0
type: UnansweredQuestion
tagged with: objective-c-runtime
favorite count: 0
has body: As I understand it, Swift and Objective-C are interoperable. A project predominantly written in Swift can use Objctive-C libraries (or even C and C++ libraries) and vice versa. I know that Java and Kotlin can do this because they have the same runtime (JVM). But I've read that Swift has its own runtime separate from Objective-C's. So how are Swift and Objective-C interoperable?
tagged with: ios
has answer: http://stackoverflow.com/a/78267801
answer count: 1
tagged with: objective-c

http://stackoverflow.com/comment/138068716
type: QuestionComment
score: 0
type: Comment
has text: @Cristik The app does use a double tap to exit. Not my UI design, and this is not the only part of the UI that suffers. I tried with a timer and it failed for me, so if it did not fail for you that gives me something to dig into. Seems like a timer would be just as forceful as somehow digesting the touch events it was looking for?
comment on: http://stackoverflow.com/q/78307909

http://stackoverflow.com/comment/137781291
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78149183
has text: What could be the reason of the inconsistency? Could it be that all the API calls/endpoints `content-type` are `application/json` and this is the only `form-data` ? When printing the `response` of the `NSURLSessionDataTask` it says '"Content-Type" = ("application/json"); I don't have much experience in API and core.net so I'm a bit confused

http://stackoverflow.com/comment/138237607
score: 0
has text: If you bring click in a text field, the keyboard comes up. If you then click off the text field, say to click "sign in" or "search", the keyboard hides and the webview is removed. No sign in or search can be done :-) I do have a 90% solution to this now, except testing has returned they get stuck (user error, but still not ideal). The "solution" was to not use any gesture recognizer, but to actually insert javascript that executes when double tap is recognized in the webview. So no conflicting gesture to foul things up.
comment on: http://stackoverflow.com/a/78324286
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137967508
comment on: http://stackoverflow.com/q/78254151
has text: Thank you @PtitXav for your reply . It has to be converted .ut8 encoding
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/q/78218464
linked to: http://stackoverflow.com/q/31944011
has comment: http://stackoverflow.com/comment/137896867
duplicate of: http://stackoverflow.com/q/31944011
has body: I am trying to learn about making http requests using Swift but for some reason i cannot get the getPosts() method to print anything. It keeps skipping over the dataTask and prints after it. I understand that the dataTask is happening asynchronously on a different thread but how would i go about printing this data onto the console? Note: I am creating an instance and calling this method from a Obj-C main file but I do not see how that would affect this. class EndpointInterface: NSObject { @objc var baseUrl:URL = URL(string:"https://api.publicapis.org")! @objc func getPosts() -> Void{ let getPostsEndpoint:URL = URL(string: "/entries", relativeTo: baseUrl)! print(getPostsEndpoint.absoluteString) let getPostsRequest:URLRequest = URLRequest(url: getPostsEndpoint) let session = URLSession.shared let task = session.dataTask(with: getPostsRequest) {(data, response, error) in if let error = error { print(error) } else if let data = data, let response = response as? HTTPURLResponse { if response.statusCode == 200 { print(data) } else { print(response.statusCode) } } } task.resume() } } Thank You. I have tried passing a completion handler @objc func getPosts(completion: @escaping (NSData?) -> Void) -> Void{ let getPostsEndpoint:URL = URL(string: "/entries", relativeTo: baseUrl)! print(getPostsEndpoint.absoluteString) let getPostsRequest:URLRequest = URLRequest(url: getPostsEndpoint) let session = URLSession.shared let task = session.dataTask(with: getPostsRequest) {(data, response, error) in if let error = error { print(error) } else if let data = data, let response = response as? HTTPURLResponse { if response.statusCode == 200 { print(data) completion(data as NSData) } else { print(response.statusCode) completion(nil) } } } task.resume() } like so and [e getPostsWithCompletion:^(NSData *data) { NSLog(@"%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]); return; }]; in main.m
tagged with: objective-c-swift-bridge
score: 0
tagged with: objective-c
linked to: http://stackoverflow.com/q/9449123
has comment: http://stackoverflow.com/comment/137896675
has comment: http://stackoverflow.com/comment/137896620
type: Question
tagged with: swift
type: UnansweredQuestion
answer count: 0
tagged with: objective-c-blocks
has title: Why is my Swift function not printing from inside the dataTask closure?

http://stackoverflow.com/comment/137899540
type: AnswerComment
type: Comment
score: 0
has text: Thank you for the information. I still get the error but that is all good to know. It is a very old library, looking deeper I think the issue is the library is missing a suitable simulator architecture. Is there a way to use a .a file to build what is needed? I am out of my depth when it comes to C stuff. The .a and .h files are all I have to work with.
comment on: http://stackoverflow.com/a/78207247

http://stackoverflow.com/a/78270238
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/78269843
downvote count: 0
has comment: http://stackoverflow.com/comment/137992013
has comment: http://stackoverflow.com/comment/137992028
score: 2
has body: You can hack a solution together using calls to AppleScript per below; be forewarned that this does require your application to be whitelisted as an accessibility application in System Preferences before this will work. Assuming the Dock is centered (see note 1 below), you would need to take the int value returned by this method and subtract it from the full width of the screen itself; the result of that calculation, then halved, should correspond to the amount of space on either side of the Dock on screen. - (int) getDockWidth { // Define AppleScript source code to execute NSString *appleScriptSource = @"" "tell application \"System Events\" to tell application process \"Dock\" to set dockSize to the size of list 1\r" "return dockSize"; // Create landing zone for the error dictionary that NSAppleScript can dump error information to NSDictionary *errorDict = NULL; NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:appleScriptSource]; NSAppleEventDescriptor *eventDescriptor = [appleScript executeAndReturnError:&errorDict]; if (errorDict != NULL) { [NSException exceptionWithName:@"Error executing AppleScript" reason:nil userInfo:errorDict]; } return [[eventDescriptor descriptorAtIndex:1] int32Value]; } A couple of notes: This approach does not consider when the Dock has been pinned in a specific position on the screen differing from the centered default. In its current form, this method also does not currently support a scenario where a user has moved the Dock to reside anywhere else other than the bottom of the screen (i.e., left or right) although it would be trivial to detect with the addition of a few more lines of code. There is likely a better, more native way to do this through the Accessibility API & without involving AppleScript. I'm just not personally aware of how that would look in practice.

http://stackoverflow.com/comment/137781173
has text: @Paulw11 I also tested `name` on the server and it's null as well.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78149183
type: QuestionComment

http://stackoverflow.com/comment/137801858
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78159159
has text: Hi @Aqeel Ahmad thank you so much for your response. Actually we used to use PUBLIC key in past with the same TrustKIt but now our client want us to use certificate directly, fo you know the way for it. I appreciate your help.

onesignal
type: Tag
tags question: http://stackoverflow.com/q/78270748
tag name: onesignal
tags question: http://stackoverflow.com/q/78582894
tags question: http://stackoverflow.com/q/78957932

http://stackoverflow.com/q/78241949
tagged with: objective-c
tagged with: cocoa
has answer: http://stackoverflow.com/a/78242048
type: Question
has title: In what context can we use an unqualified #selector() expression in Swift?
upvote count: 1
downvote count: 0
answer count: 1
tagged with: selector
accepted answer: http://stackoverflow.com/a/78242048
favorite count: 0
tagged with: swift
score: 1
has body: The Swift equivalent of Objective-C's @selector() expression, is #selector(). In Xcode, the Objective-C, @selector() expression will offer autocompletions for all available selectors and the selector expression is constructed with just the selector; e.g., @selector(valueForKey:). In Swift, Xcode only sometimes offers autocompletions for a #selector() expression and we must explicitly qualify the selector with a type; e.g., #selector(NSObject.value(forKey:)). As far as I can tell, in an @objc context, Xcode will allow us to construct a #selector() expression without qualifying the selector with a type. For example: @objc @objcMembers class Individual: NSObject { func testFunc() { let sel = #selector(value(forKey:)) } } Is there any other context in which we can use an #selector() expression that isn't qualified by a type?
type: AnsweredQuestion

http://stackoverflow.com/comment/137981702
type: Comment
has text: If you just want to test it, you can edit the scheme and run the app as root. Otherwise perhaps look at https://developer.apple.com/documentation/security/1397453-authorizationcreate?language=objc
score: 1
comment on: http://stackoverflow.com/q/78254753
type: QuestionComment

http://stackoverflow.com/q/78254730
tagged with: ios
type: Question
has comment: http://stackoverflow.com/comment/138022259
has body: Starting with the macOS version 14.x.x and TextKit1, selecting multiple lines of text triggers a text replacement bug: some of the text on one of the selected lines inadvertently replaces a portion of the selected text. For example, the bug is exhibited when selecting the following lines: Carnaroli, Maratelli, or Vialone Nano are best Vialone Nano cooks quickly – watch it! It also absorbs condiments nicely. Avoid Baldo, Originario, Ribe and Roma To trigger the bug, select the three line paragraph using either the cursor or shift with arrow keys. Notice that a portion of the selected text was replaced. Command-Z to undo will allow you to repeat the undesired behavior. In this case, "e Nano cooks quickly - " is replaced by "Baldo, Originario, Ribe." This does not occur with all strings or selected strings, but in cases where it does occur, it is perfectly reproducible. It does not occur on iOS. Pasteboard contents are irrelevant. After triggering the bug repeatedly, at some point it stops occurring. Why does this bug occur? How can it be fixed? Screen grabs showcasing the behavior Before selection: After selection: Sample code to recreate the issue @interface TestNoteViewController () @end @implementation TestNoteViewController - (void)viewDidLoad { [super viewDidLoad]; [self createTextView]; } - (void)createTextView { NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:self.note.text attributes:nil]; NSTextStorage *textStorage = [NSTextStorage new]; [textStorage appendAttributedString:attrString]; CGRect newTextViewRect = self.view.bounds; // Create the layout manager NSLayoutManager *layoutManager = [NSLayoutManager new]; [textStorage addLayoutManager:layoutManager]; // Create a text container NSTextContainer *container = [[NSTextContainer alloc] initWithSize:CGSizeMake(newTextViewRect.size.width, CGFLOAT_MAX)]; [layoutManager addTextContainer:container]; // Create and place a text view UITextView *textView = [[UITextView alloc] initWithFrame…
has comment: http://stackoverflow.com/comment/138032845
tagged with: mac-catalyst
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138029930
has comment: http://stackoverflow.com/comment/137979401
score: 0
has title: Selected Text Replacement Bug UITextView Mac Catalyst
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138022532
answer count: 0
tagged with: textkit

http://stackoverflow.com/q/78269843
tagged with: dock
has comment: http://stackoverflow.com/comment/137992152
has body: I want/need to place a dock-alike window in the "empty" areas left or right of the macOS 14+ system dock, when located at the bottom. Getting the height of the dock is easy, e.g. as shown here: How to get Position, Width and Height of Mac OS X Dock? Cocoa/Carbon/C++/Qt But getting the actual width or dimensions of the dock, and thereby the uncovered space left and right of the dock, seems to be impossible. Does anyone have any ideas or hints where to look, other than brute force, taking a screenshot and analyzing it? I followed any hint I can find, tried everything I can find. But it seems there is no API that supports (directly or indirectly) to retrieve the size, both height AND width, of the Dock.
downvote count: 2
score: -1
has answer: http://stackoverflow.com/a/78270238
has title: How to get the width of the macOS dock?
type: Question
tagged with: swift
upvote count: 1
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/137987583
tagged with: macos
linked to: http://stackoverflow.com/q/35826550
favorite count: 0
linked to: http://stackoverflow.com/q/4982656
has comment: http://stackoverflow.com/comment/137988029
tagged with: objective-c
linked to: http://stackoverflow.com/q/6684278

http://stackoverflow.com/comment/138024377
has text: what do you suggest I do then? Can you give me an example of how to retain and release an NSString? I tried [playerName retain]; in the init before posting but it didn't solve the problem
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78290317
type: AnswerComment

http://stackoverflow.com/a/78214819
has comment: http://stackoverflow.com/comment/137890073
type: AcceptedAnswer
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/78214804
score: 2
has body: I wonder if it is possible to use UICollectionViewCell with IBOutlet No, it isn't possible. (And even if it is, don't do it.) Cells are reused; they have no permanent existence within the collection view. You never know what cell object will be used at a given section/item position. Therefore you must dequeue the cell every time cellForItemAtIndexPath is called. There are ways to obtain a reference to a cell that actually exists within the collection view, at runtime. (Though in many case, the need to do even this is to be regarded as a Bad Smell.)
has comment: http://stackoverflow.com/comment/137890021
downvote count: 0
accepted answer of: http://stackoverflow.com/q/78214804

http://stackoverflow.com/q/78192465
has comment: http://stackoverflow.com/comment/137852075
has comment: http://stackoverflow.com/comment/137850840
type: Question
has title: In iPad/iPhone (iOS 17.4) App crashed on Launching
tagged with: launch
possible better answer: http://stackoverflow.com/a/78266074
has answer: http://stackoverflow.com/a/78408149
accepted answer: http://stackoverflow.com/a/78408149
favorite count: 0
tagged with: firebase
score: 0
tagged with: ios
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/78266074
answer count: 2
has body: I am facing an issue when ever I am trying to install app on iOS 17.4 app getting crashed on Launching. Crash occurred in FIRDLJavaScriptExecutor file and I also update the firebase pods to latest version. Even also getting same crashed. Getting this error.
tagged with: objective-c
downvote count: 1
upvote count: 1
tagged with: wkwebview
has comment: http://stackoverflow.com/comment/137852510

http://stackoverflow.com/q/78214804
has title: Using UICollectionViewCell with IBOutlet
tagged with: uicollectionviewcell
accepted answer: http://stackoverflow.com/a/78214819
tagged with: ios
downvote count: 1
type: Question
upvote count: 1
has body: I wonder if it is possible to use UICollectionViewCell with IBOutlet? As I always get this error *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the cell returned from -collectionView:cellForItemAtIndexPath: was not retrieved by calling -dequeueReusableCellWithReuseIdentifier:forIndexPath: at index path Below is my code: @property (nonatomic, strong) NSMutableArray *cellArray; @property (nonatomic, strong) IBOutlet UICollectionViewCell *sort1Cell; @property (nonatomic, strong) IBOutlet UICollectionViewCell *sort2Cell; @property (nonatomic, strong) IBOutlet UICollectionViewCell *sort3Cell; @property (nonatomic, strong) IBOutlet UICollectionViewCell *sort4Cell; - (void)viewDidLoad { [super viewDidLoad]; self.cellArray = [NSMutableArray array]; [cellArray addObject:sort1Cell]; [cellArray addObject:sort2Cell]; [cellArray addObject:sort3Cell]; [cellArray addObject:sort4Cell]; [theCollectionView reloadData]; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { UICollectionViewCell *cell = [cellArray objectAtIndex:indexPath.row]; return cell; //THE ERROR IS FROM HERE } Or perhaps I am missing something?
answer count: 1
tagged with: objective-c
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/78214819
tagged with: uicollectionview
type: AnsweredQuestion

http://stackoverflow.com/a/78201663
score: 1
accepted answer of: http://stackoverflow.com/q/78195402
upvote count: 1
has comment: http://stackoverflow.com/comment/137867495
type: AcceptedAnswer
has body: Couple things to note... Layers - whether CALayer, CAShapeLayer, CAGradientLayer, etc - belong to a view. You can manipulate the appearance of the layers via the .zPosition. Also, a layer doesn't really exist on its own... it must be added as a sublayer to a view's layer. A view has its own layer ... so when trying to manipulate layer ordering, that must be taken into account. So, your goal is to have one view with multiple layers, another view with one or more layers, and insert the second view (and its layers) between layers of the first view. If we start with two views -- yellow with two CAShapeLayer sublayers; cyan with one CAShapeLayer sublayer: Looks like this (with the layers separated out): and we want to insert cyanView (and its triangle sublayer) between the rectangle and oval layers of yellowView: Let's add cyanView as a subview of yellowView, offset by 40,40 and yellowView.clipsToBounds = true so we can see it's a subview: That gives us what we expect... but not what we want, because the rect and oval layers belong to yellowView. To move the oval layer to the top, we'll change the .zPosition properties: // we don't want to mess with the .zPosition of yellow view's layer, // because it's the "base" of the hierarchy rectShapeLayer.zPosition = 1; cyanView.layer.zPosition = 2; triShapeLayer.zPosition = 3; ovalShapeLayer.zPosition = 4; and we get this result: cyanView and its triangle layer are now between yellow view's rectangle and oval layers. Goal accomplished? Maybe... Let's look at the Debug View Hierarchy now: Notice that the layers are not separated from their views. In the first Hierarchy images above, I used individual views just to show what we're trying to do. Now, managing the .zPosition values may work for you... but I would think it would be much easier to implement either only layers, or only views (we can change a view's layer class to eliminate the need to add a sublayer to every view). Here is some example code to produce the above: ViewsAn…
type: Answer
answers question: http://stackoverflow.com/q/78195402
downvote count: 0

http://stackoverflow.com/comment/137817755
has text: How are you presenting the drawable in the application? The easiest way to pace the app would be to use `presentDrawable:afterMinimumDuration:` method https://developer.apple.com/documentation/metal/mtlcommandbuffer/2806849-presentdrawable
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78173482
type: Comment

xcodebuild
tags question: http://stackoverflow.com/q/78260865
type: Tag
tag name: xcodebuild
tags question: http://stackoverflow.com/q/78511969

http://stackoverflow.com/q/78254753
tagged with: cocoa
tagged with: launchd
has comment: http://stackoverflow.com/comment/137981702
has comment: http://stackoverflow.com/comment/137980560
score: 0
has comment: http://stackoverflow.com/comment/137968777
has title: MacOS App: How do we launch bundled helper program from main application?
type: Question
has body: I would like to achieve simple thing but struggling for the whole day. :( I made a simple macOS app. In AppDelegate, applicationDidFinishLaunching, I would like to execute a helper program which is bundled together inside the app. https://github.com/hkjlee109/objc-helper-example But I am getting an error. Load failed: 5: Input/output error Try running `launchctl bootstrap` as root for richer errors. Here's what I did: 0. From I've a target called "helper-agent" which is a commandline application. For "helper-agent" application, I've added "com.example.helper.agent.plist" file. <?xml version="1.0" encoding="UTF-8"?> Label com.example.helper.agent BundleProgram Contents/Resources/helper-agent MachServices com.example.helper.agent <true/> And I've added two things for "Build phase" of main application. Copy Bundle Resources: Copy "helper-agent" application to "Contents/Library/LaunchAgents" Copy Files: Copy "com.example.helper.agent.plist" to "Contents/Library/LaunchAgents" Lastly, in AppDelegate, I am using below code to launch the helper. NSTask* task = [NSTask new]; task.launchPath = @"/bin/launchctl"; task.arguments = @[@"load", @"com.example.helper.agent.plist"]; [task launch]; [task waitUntilExit]; I would be appreciated for any piece of advices or suggestions. Thanks! https://github.com/hkjlee109/objc-helper-example
type: UnansweredQuestion
tagged with: macos
answer count: 0
tagged with: launchctl
tagged with: objective-c

http://stackoverflow.com/a/78290317
score: 1
answers question: http://stackoverflow.com/q/78290156
has comment: http://stackoverflow.com/comment/138043641
type: AcceptedAnswer
has body: There's nothing wrong with accessing NSString from an IBAction. The problem is with the memory management. This error message (BAD_EXEC_ACCESS) means you are trying to access a deallocated object. Since ARC (Automatic Reference Counting is not available for Tiger, and only properly supported from 10.7 Lion the memory is not managed automatically. https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/MemoryMgmt.html https://developer.apple.com/library/archive/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011226 If the program relies on ARC, it won't work in older systems (crashes due to access to deallocated objects). You could write manual retains and releases like in pre-ARC times, but that would mean you would have to manage memory manually everywhere. Possible, but not fun.
has comment: http://stackoverflow.com/comment/138024900
type: Answer
accepted answer of: http://stackoverflow.com/q/78290156
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/138024377

http://stackoverflow.com/comment/138028405
type: Comment
comment on: http://stackoverflow.com/q/78290156
score: 0
has text: FYI - all of those variables just after the `@implementation` line are global variables. They are not instance variables to the class. If you ever create more than one instance of `GameWindow`, they will be sharing the values of those variables. To make them instance variables, they need to be within curly braces.
type: QuestionComment

http://stackoverflow.com/comment/137957633
type: QuestionComment
comment on: http://stackoverflow.com/q/78252191
score: 0
type: Comment
has text: @HangarRash It's https weather API endpoints. Nothing strange. The user can select weather API and I can see most failures are from the default one, but I get some from the ones users can switch to as well, so it's not URL specific.

http://stackoverflow.com/comment/137979401
type: Comment
score: 0
has text: Does this issue appear if you create a normal `UITextView` without setting up your own text container for it?
type: QuestionComment
comment on: http://stackoverflow.com/q/78254730

http://stackoverflow.com/a/78302310
answers question: http://stackoverflow.com/q/78282782
has body: Objective-C++ is superset of C++ language and all rules of C++ apply here. I.e. when declaring a function you have to deal with so-called name mangling, which alters the function signature in a way that the compiler won't be able to locate it in a Objective-C/C compilation unit. For such scenarios you are supposed to tell the linker to apply C rules when including this header in a C++ compilation unit by employing extern "C" section: #ifdef __cplusplus extern "C" { #endif void GetInputSizeFromUsage(PPVEUsage usage, size_t *width, size_t *height); #ifdef __cplusplus } #endif
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/78282782

http://stackoverflow.com/comment/137957275
score: 0
has text: @Paulw11 yes, the exception message would be great, but maybe not available if it's not a DEBUG build? Remember my main issue is I can't reproduce (neither can my beta testers), so only see the crash logs from users in the field. I have now added everything relevant from the crash dump I received from Apple to the question above.
type: QuestionComment
comment on: http://stackoverflow.com/q/78252191
type: Comment

http://stackoverflow.com/a/78304699
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/78303864
score: 1
accepted answer of: http://stackoverflow.com/q/78303864
type: AcceptedAnswer
type: Answer
has body: but when buffer is empty and there are no bytes to play. You need to start here and determine why this is happening. Ideally this should never happen. If it does happen, it should be rare and for a clear reason. If the upstream has paused, then you need to pause your downstream. If there is network latency, then you need to increase the size of your buffer. Anytime you inject a constant value, whether zero or the last value received, you're going to inject high frequency noise. This will sound like a small pop. If you do this often, then it will crackle. There are techniques for smoothing this, but they're fairly complex, and not something you should reach for before fixing your underlying under-run problem. If your upstream has variable latency, then you will need to buffer a bit (10ms, 50ms, 2000ms, it depends on how variable it is) before you start your downstream. If your buffers are drained, you'll need to pause your downstream until you can build your buffer up again. Sometimes, it's worth the occasional "pop" to avoid pausing the downstream, and that's when advice like "fill with zeros" or "fill with last value" come in. But if you're getting pops many times a second (and that's what "crackle" usually is), it likely means you're not buffering enough before starting your downstream. Depending on the nature of your audio, you also need to consider cases where there is a long pause in your upstream, and then you suddenly get a lot of past data. You have to decide at that point whether to keep it and increase latency, or discard it to get closer to "real-time." The strategies for this completely depend on your use case and is a major part of designing any real-time system. Note that TPCircularBuffer and Audio Unit are pretty low-level tools, and put a lot of the work on you. Personally, I prefer building these kinds of systems with a bit higher-level tool like AVSampleBuffer. It's still challenging and you need to understanding real-time systems, but AVFoundation…

http://stackoverflow.com/q/78254151
has comment: http://stackoverflow.com/comment/137967508
type: Question
has comment: http://stackoverflow.com/comment/137959982
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/137960040
has comment: http://stackoverflow.com/comment/137979733
has title: Passing encrypted string as nsdata in http body gives 400 bad request error
has comment: http://stackoverflow.com/comment/137967500
has comment: http://stackoverflow.com/comment/137967522
answer count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/137960327
tagged with: httprequest
tagged with: objective-c
score: 0
has body: I am encrypting a json string and then converting it into NSData and trying to pass it as http body as per standard but it gives me sever error as 400 bad request whereas it works perfectly as expected in postman. But failing I guess at iOS end , can someone highlight what could be wrong? Check below code for reference : NSData *datas = [NSJSONSerialization dataWithJSONObject:paramsDic options:NSJSONWritingPrettyPrinted error:nil]; NSString *jsonStrings = [[NSString alloc] initWithData:datas encoding:NSUTF8StringEncoding]; NSString *jencWithPubKey = [EncryptionAlgorithm encryptString:jsonStrings publicKey:APP_PUBLIC_KEY2]; NSData *data1 = [jencWithPubKey dataUsingEncoding:NSUTF8StringEncoding]; NSLog(@"Value of json string %@", jencWithPubKey); NSMutableURLRequest *urlRequest = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:QMMemberLogin]]; NSDictionary *heads =@{@"User-Agent":@"Apifox/1.0.0(https://apifox.com)", @"Content-Type":@"appliction/json; charset=UTF-8", @"Accept":@"*/*", @"Conection":@"keep-alive"}; [urlRequest setAllHTTPHeaderFields:heads]; //Apply the data to the body [urlRequest setHTTPBody:data1]; //create the Method "GET" or "POST" [urlRequest setHTTPMethod:@"POST"]; NSURLSession *session = [NSURLSession sharedSession]; NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:urlRequest completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; if(httpResponse.statusCode == 200) { NSError *parseError = nil; NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError]; NSLog(@"The response is - %@",responseDictionary); NSInteger success = [[responseDictionary objectForKey:@"success"] integerValue]; if(success == 1) { NSLog(@"Login SUCCESS"); } else { NSLog(@"Login FAILURE"); } } else { NSLog(@"Error"); } }]; [dataTask resume]; Above code I have tried in objective C
has comment: http://stackoverflow.com/comment/137963748
has comment: http://stackoverflow.com/comment/137969101

http://stackoverflow.com/q/78295722
has title: XPC Service always falling into invalidationHandler despite proper configuration
tagged with: macos
tagged with: nsxpcconnection
type: Question
tagged with: objective-c
type: UnansweredQuestion
has body: I have configured an XPC service in my macOS application, and I've ensured that the service is set up correctly. However, whenever I try to establish a connection between my app and the XPC service, it always falls into the invalidationHandler block, indicating that the connection is being invalidated. I just want to test if the connection works at the moment, so I'm not concerned about specific functionality. I've checked my XPC service configuration, and everything seems to be in place. Here's a simplified version of my code, and some pictures that I provide for my setup of my project : I'm struggling to figure out why the connection is being invalidated despite the proper configuration. Any insights or suggestions on how to troubleshoot and resolve this issue would be greatly appreciated. Thank you!
tagged with: xcode
score: 0
answer count: 0

http://stackoverflow.com/comment/137795710
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78160846
has text: @WarrenBurton I'm using the recent Cpp interoperability, which doesn't require a bridging header, but a module map to expose C++ and ObjC types to Swift. And the new interior is implemented correctly, because I'm able to access the URLHandler in Swift. The error is not `Undefined symbol URLHandler`, but a missing method, which I implemented in the category. Sorry, I missed to add the interop thing in the question.

http://stackoverflow.com/comment/138024900
type: AnswerComment
type: Comment
has text: Managed to solve it. Your answer gave me the hint that I needed. I changed the code from [playerName retain] to playerName = [playerName retain] and now it works. many thanks, now I can sleep properly tonight.
score: 0
comment on: http://stackoverflow.com/a/78290317

http://stackoverflow.com/comment/137957113
type: Comment
has text: @Rob the `[NSObject doesNorRecognizeSelector]` in the stack trace is the method in the NSobject class that gets invoked to throw the exception when the dynamic method dispatch fails. The OP needs the exception message which will give the details of the object class and the method that was attempted to be invoked.
type: QuestionComment
comment on: http://stackoverflow.com/q/78252191
score: 0

ibaction
tags question: http://stackoverflow.com/q/78290156
tag name: ibaction
type: Tag

http://stackoverflow.com/comment/137781440
has text: The content type of the response is set by your server.
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/78149183
type: Comment

http://stackoverflow.com/comment/137969101
has text: POSTMAN code needs to be corrected/adapted, as it's not "beautiful" code (but usually working code). It's a good thing to help compare and see what's different, and what was wrong. What was the error then?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78254151
type: Comment

http://stackoverflow.com/comment/137822526
has text: Well this probably needs a sample then where it reproduces, it’s impossible to say why it does it like that
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78173482
type: Comment

http://stackoverflow.com/comment/138023018
score: 0
has text: I tried your suggestion but it didn't work. However. if I replace ```AVPlayerViewController``` with ```AVPlayerLayer```, everything works as expected! I updated the question.
comment on: http://stackoverflow.com/a/78287165
type: AnswerComment
type: Comment

http://stackoverflow.com/q/78290210
tagged with: qlpreviewcontroller
has body: We are implementing our custom subclassed QLPreviewController. Indeed we subclassed and customized it since we do not want its 'Save to Files', 'Print', 'Share' options to be shown to the user. For this purpose, we used Lukas' solution suggestion in this page and hid both navigation bar at the top and toolbar at the bottom. After all just placed a 'back' button over its hidden toolbar and it is seen as such Everything upto now was nice so far, but we do not want to lose 'search' feature of QLPreviewController because it is good enough. Normally this functionality can be accessed inside bottom toolbar of QLPreviewController by the user and another popup appears if clicked. Just to test it, when we made our blocking bottom view's height lesser and let this 'search' button be visible and clicked, this search popup is laying out over our blocking view, so this is enough for us to use it. The search item button is normally existing inside bottom toolbar (before we hide it with a blocking view) as shown in the picture Hence all we need to do is, making that search button (which is staying under our blocking bottom view) action be called programmatically. We have already searched it in stackoverflow and over internet, but almost all questions are about customizing it, hiding buttons or any other appearance things etc. Any help and assistance will be kindly appreciated by us.
type: Question
has title: Call QLPreviewController toolbar action programmatically
tagged with: swift
tagged with: uitoolbar
type: UnansweredQuestion
tagged with: ios
linked to: http://stackoverflow.com/q/6957091
tagged with: objective-c
answer count: 0
score: 0

http://stackoverflow.com/comment/137968779
comment on: http://stackoverflow.com/q/78259397
score: 4
type: QuestionComment
has text: iOS apps don't run on a virtual machine. Both the Swift compiler and the Objective C compiler output ARM64 instructions. The Swift compiler understands how to output code to call Objective-C functions and how to be called by Objective-C functions.
type: Comment

http://stackoverflow.com/comment/138042497
comment on: http://stackoverflow.com/q/78300952
score: 1
type: Comment
has text: Also check the response body from the server. It should tell you why there was a 400 response
type: QuestionComment

http://stackoverflow.com/a/78287165
type: Answer
downvote count: 0
score: 1
has body: The pixel buffers used by the AVPlayerViewController probably don't support the alpha channel by default (to save memory). But you can change the pixel format like this: AVPlayerViewController *controller = [[AVPlayerViewController alloc] init]; controller.pixelBufferAttributes = @{kCVPixelBufferPixelFormatTypeKey: kCVPixelFormatType_32BGRA};
has comment: http://stackoverflow.com/comment/138023018
answers question: http://stackoverflow.com/q/78283285
upvote count: 1

http://stackoverflow.com/a/78172838
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/78172699
type: Answer
has body: First, there's a small bug here that when you fix the memory leak will cause crashes, so to fix that first, remove the [rep release] call. You must only call release when you have taken (shared) ownership: You take ownership of an object if you create it using a method whose name begins with "alloc" or "new" or contains "copy" (for example, alloc, newObject, or mutableCopy), or if you send it a retain message. You are responsible for relinquishing ownership of objects you own using release or autorelease. Any other time you receive an object, you must not release it. See Basic Memory Management Rules for details. So, in CaptureWindowImageData, delete the line [rep release]. With that fixed, your problem is that you're generating large objects on the autorelease pool and never draining the pool. When you are called from a non-ObjC context, its is your responsibility to manage the pool. Since you're currently returning an autoreleased object, this requires a little bit of a dance to hold onto it. I haven't built this, but it should work: // Rename this to Create... rather than Capture... It now returns a // retained object, so needs to have the word Create in its name. // https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-103029 CFDataRef CreateWindowImageData(CGWindowID windowNumber) { // Create your pool NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; CGWindowID windowList[] = {windowNumber}; // ... [nsImage release]; // [rep release]; <---- delete this; you don't own this object // Hold onto your imageData CFRetain(imageData); // Drain the rest of the pool [pool drain]; return imageData; } With that, your Go code should be correct (except for fixing the name of the function). It correctly releases the object already. Core Foundation and Foundation have extremely consistent naming conventions to indicate memory management. Once you learn the rules, you can …
answers question: http://stackoverflow.com/q/78172699
score: 2
downvote count: 0

http://stackoverflow.com/a/78197598
type: AcceptedAnswer
score: 0
type: Answer
has body: HangarRash pointed me in the right direction by suggesting that I use v4's center property instead of manually calculating the origin. After that, I just had to adjust for the fact that v4's center property is in terms of v3's coordinate space when using convertPoint:fromView, and then it worked! CGSize targetImageViewSize = CGSizeMake(v4.frame.size.width / 2, v4.frame.size.height / 2); CGPoint targetImageViewCenter = v4.center; CGPoint convertedTargetImageViewCenter = [v1 convertPoint:targetImageViewCenter fromView:v3]; UIImageView *targetImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, targetImageViewSize.width, targetImageViewSize.height)]; targetImageView.image = [UIImage imageNamed:@"TargetIcon"]; targetImageView.center = convertedTargetImageViewCenter; [self.targetImageViews addObject:targetImageView]; targetImageView.transform = CGAffineTransformMakeRotation(v3.angle); [v1 addSubview: targetImageView];
accepted answer of: http://stackoverflow.com/q/78195287
answers question: http://stackoverflow.com/q/78195287

http://stackoverflow.com/comment/137815535
type: QuestionComment
score: 1
has text: I'm unable to run this program as-is. Are there other dependencies needed for it? `CGImageDestinationFinalize failed for output type 'public.tiff'`
comment on: http://stackoverflow.com/q/78172699
type: Comment

http://stackoverflow.com/comment/137990156
type: Comment
comment on: http://stackoverflow.com/q/78270748
has text: Don’t know how to implement this. This is compiled code of Ionic for iOS APP and i am using iOS onsignal sdk in Xcode
score: 0
type: QuestionComment

audio-streaming
tags question: http://stackoverflow.com/q/78303864
tag name: audio-streaming
type: Tag

http://stackoverflow.com/comment/137925219
type: Comment
has text: @esqew This is a linker error, so compilation already succeeded. I suspect he hasn't linked against glibc, although I thought that would be done by default.
comment on: http://stackoverflow.com/q/78234249
type: QuestionComment
score: 3

http://stackoverflow.com/a/78153912
accepted answer of: http://stackoverflow.com/q/78149183
type: AcceptedAnswer
type: Answer
has body: Thanks to @Paulw11 who mentioned the inconsistency issue. Took a fresh look at my code on both sides and realized that I made a mistake on the iOS form by calling the file as userfile. API expects file. So there should be two choices here: 1- Change and rename userfile here: Content-Disposition: form-data; name=\"userfile\"; to file so that API recognizes it. 2- Or keep any custom name of your choice and modify the API as follow: public async Task<IActionResult> UploadFile([FromForm(Name = "userfile")] IFormFile file, [FromForm(Name = "filename")] string filename){ //upload logic here } And that solved my problem and file is now uploaded!
answers question: http://stackoverflow.com/q/78149183
score: 0

http://stackoverflow.com/comment/137790938
comment on: http://stackoverflow.com/q/78153217
has text: Correct I get this certificate form client so both have same keys.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/137837435
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78159127
type: QuestionComment
has text: Try dsdump by delek selander https://github.com/DerekSelander/dsdump

http://stackoverflow.com/q/78280183
has body: I am developing a Swift library that supports both Objective-C and Swift. In order to utilize the +load method for initialization tasks, I have implemented it in an Objective-C file. This approach works perfectly when using CocoaPods. However, when I migrated to Swift Package Manager (SPM) and organized my Objective-C files in a separate target (folder ObjC), I encountered an issue where the +load method is not being called during runtime.
tagged with: objective-c
has title: Issue with + (void)load method not being called in Swift Package Manager (SPM) for Objective-C files in multi-target Swift library
answer count: 0
score: 0
tagged with: swift-package-manager
type: Question
tagged with: swift
type: UnansweredQuestion

http://stackoverflow.com/comment/137866357
comment on: http://stackoverflow.com/q/78195402
has text: Well... yes and no. Layers *belong to* a view. You *can* manage the layer appearance (not the hierarchy) by manipulating the `.zPosition`. I'm adding an answer for one approach....
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/q/78195402
type: Question
answer count: 1
tagged with: cashapelayer
score: 0
has comment: http://stackoverflow.com/comment/137858710
tagged with: calayer
has comment: http://stackoverflow.com/comment/137866357
accepted answer: http://stackoverflow.com/a/78201663
has body: I have the following set-up of CAShapeLayers and UIViews attached to a UIView: [self.layer addSublayer:self.shapeLayer1]; if (someCase) { [self.layer addSublayer:self.shapeLayerOptional]; } [self.layer addSublayer:self.shapeLayer2]; [self addSubview: self.view1]; I want there to be functionality that allows the user to insert another UIView, let's call it view0, before shapeLayer2, but I don't know how to accomplish this. The parent UIView subviews property only includes view1, while its layer.sublayers property includes the layers of the shapelayers and subview1, but I don't want to insert subview0.layer into layers.sublayers because subview0 has a UITouchGestureRecognizer. This seems like a simple design problem on the surface but it's really confusing me for some reason. Anyone have any recommended solutions? I want to try and avoid wrapping the CAShapeLayers into UIViews if I can.
tagged with: ios
tagged with: uiview
has title: Inserting subview into view where I've added subviews and sublayers
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/137857040
has answer: http://stackoverflow.com/a/78201663
tagged with: objective-c

http://stackoverflow.com/comment/137899903
has text: Note that this is true of any binary distribution, not just bare `.a` files. Even xcframeworks, which are quite nice ways to bundle multi-platform binaries, cannot be used on new platforms they weren't built for. Accepting a binary-only package will always make you dependent on the other party to provide you new versions when platforms change significantly. It's usually years between this happening, so folks don't realize the trouble it's going to cause when it finally does happen. Best of luck. It's always a hard spot to be in.
comment on: http://stackoverflow.com/a/78207247
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137852075
type: Comment
has text: Actually this occurred in FIRDLJavaScriptExecutor file that is Pod file. whenever I trying to launch app on iOS 17.4 Devices this has been crashed.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78192465

http://stackoverflow.com/q/78282950
has body: I'm creating a simple custom CIFilter that implements CIKernel to decrease alpha value. My "AlphaFilter.h": @interface CIAlphaFilter: CIFilter { CIImage *inputImage; } @property (retain, nonatomic) CIImage *inputImage; @end My "AlphaFilter.m": #import "AlphaFilter.h" @implementation CIAlphaFilter @synthesize inputImage; static CIKernel *alphaRemoveKernel = nil; - (id)init { if(alphaRemoveKernel == nil) { NSString *code = @"kernel vec4 darkToTransparent(sampler image){vec4 color = sample(image, samplerCoord(image));color.a =0.5;return color;}"; alphaRemoveKernel = [CIKernel kernelWithString:code]; } return [super init]; } - (CIImage *)outputImage { CISampler *src = [CISampler samplerWithImage: inputImage]; return [self apply: alphaRemoveKernel, src, nil]; // Error here } @end At the return for (CIImage *)outputImage, Xcode give me an error: 'apply:' is unavailable: not available on iOS Can anyone tell me what mistake I made? I'm using Xcode 15.2.
tagged with: ios
type: AnsweredQuestion
tagged with: objective-c
has answer: http://stackoverflow.com/a/78283088
possible better answer: http://stackoverflow.com/a/78283088
has title: CIFilter 'apply:' is unavailable: not available on iOS
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/78287125
has answer: http://stackoverflow.com/a/78287125
has comment: http://stackoverflow.com/comment/138010857
type: Question
tagged with: cifilter

http://stackoverflow.com/comment/137788185
score: 0
comment on: http://stackoverflow.com/q/78153217
type: QuestionComment
type: Comment
has text: This is a very open question. Am I guessing right that you are trying to get mTLS (Mutual Transport Layer Security) to work? That means you have the private key also on your client? (I guess you won't develop your application for the appstore?)

http://stackoverflow.com/q/78260865
tagged with: objective-c
answer count: 0
tagged with: xcode
score: 0
type: Question
has body: I do have a fairly large obj-c static library I have converted to XCFramework and for the base that works great. Thing is, the old library compiled differently based on xcodebuild defines and created like 20 different variants, containing more header files, something like: base: Headers mainheader.h variant1: Headers mainheader.h customheader.h .. However I failed to find a way from the commandline with xcodebuild to mark specific headers to be public to copy when creating the framework. I can make that magic with adding more targets, sure, but prefer to not go that route unless I have to
type: UnansweredQuestion
has title: XCFramework include additional public headers with xcodebuild
tagged with: xcodebuild
tagged with: xcframework

http://stackoverflow.com/q/78230445
has comment: http://stackoverflow.com/comment/137919620
tagged with: objective-c
type: Question
type: UnansweredQuestion
has body: enter image description here -(nullable NSArray<UIView*>*) swipeTableCell:(nonnull MGSwipeTableCell*) cell swipeButtonsForDirection:(MGSwipeDirection)direction swipeSettings:(nonnull MGSwipeSettings*) swipeSettings expansionSettings:(nonnull MGSwipeExpansionSettings*) expansionSettings { swipeSettings.transition = MGSwipeTransition3D; // 滑出动画 if (direction == MGSwipeDirectionRightToLeft) { expansionSettings.fillOnTrigger = YES; expansionSettings.threshold = 1.5; CGFloat padding = 10; MGSwipeButton *isTop = [MGSwipeButton buttonWithTitle:@"" icon:[UIImage imageNamed:@"top"] backgroundColor:[UIColor colorWithRed:243/256.0 green:243/256.0 blue:243/256.0 alpha:1] padding:padding callback:^BOOL(MGSwipeTableCell *sender) { NSIndexPath *indexPath = [self.tableView indexPathForCell:sender]; TrackNumbersCellModel*model = self.dataSource[indexPath.row]; if (model.isTop) { model.isTop = NO; [self.dataSource removeObject:model]; [self.dataSource insertObject:model atIndex:self.dataSource.count - 1]; [[TrackNumbersNetTools shareIntance] trackTable_MR_update_top_Entity:model.t_number isTop:NO]; [self.tableView reloadData]; }else{ model.isTop = YES; [self.dataSource removeObject:model]; [self.dataSource insertObject:model atIndex:0]; [[TrackNumbersNetTools shareIntance] trackTable_MR_update_top_Entity:model.t_number isTop:YES]; [self.tableView reloadData]; } return YES; }]; [isTop centerIconOverTextWithSpacing:7]; MGSwipeButton *isDelete = [MGSwipeButton buttonWithTitle:@"" icon:[UIImage imageNamed:@"delet"] backgroundColor:[UIColor colorWithRed:243/256.0 green:243/256.0 blue:243/256.0 alpha:1] padding:padding callback:^BOOL(MGSwipeTableCell *sender) { NSIndexPath *indexPath = [self.tableView indexPathForCell:sender]; TrackNumbersCellModel*model = self.dataSource[indexPath.row]; [self.dataSource removeObjectAtIndex:indexPath.row]; [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationLeft]; [[TrackNumbersNetTools shareIntance] trackTable_MR_de…
score: 0
has title: How to change the image on the MGSwipeButton in MGSwipeTableCell
has comment: http://stackoverflow.com/comment/137921643
answer count: 0
tagged with: ios

bugsnag
type: Tag
tag name: bugsnag
tags question: http://stackoverflow.com/q/78169320

http://stackoverflow.com/comment/137896867
has text: It's a Command Line? Okay, then do you ensure that your app hasn't reached yet the end of the "file"? I think you have this issue: https://stackoverflow.com/questions/31944011/how-to-prevent-a-command-line-tool-from-exiting-before-asynchronous-operation-co https://stackoverflow.com/questions/9449123/keep-command-line-tool-alive etc
comment on: http://stackoverflow.com/q/78218464
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/a/78256769
score: 0
type: Answer
has body: Confirm that your Mach-O file has been successfully decrypted. You can check it by using the following command $ otool -l &lt;Mach-O file&gt; | grep cryptid cryptid 0 If the value of cryptid is not 0, please decrypt your Mach-O file first. If the value of cryptid is 0, then please try using AloneMonkey's class-dump tool. AloneMonkey has made some fixes to class-dump.
answers question: http://stackoverflow.com/q/78159127

http://stackoverflow.com/comment/137856027
type: QuestionComment
score: 0
has text: @HangarRash Thanks I changed to the center, and it seems to be more consistent in how it's missing, so maybe it was correct to do that but something else is at play. And yeah changed from frame to bounds as well, good call.
type: Comment
comment on: http://stackoverflow.com/q/78195287

http://stackoverflow.com/comment/138043641
type: AnswerComment
type: Comment
has text: Glad you made it work. However, random retaining without proper release will lead to memory leaks. If you must fix it properly I suggest to familiarise yourself with manual memory management. Here are some good summaries: https://stackoverflow.com/questions/2255861/property-retain-assign-copy-nonatomic-in-objective-c
score: 0
comment on: http://stackoverflow.com/a/78290317

http://stackoverflow.com/comment/137960327
score: 0
type: QuestionComment
has text: Are you sure of that the data in Post should not be base64 or other encoding ?
type: Comment
comment on: http://stackoverflow.com/q/78254151

http://stackoverflow.com/q/78158611
tagged with: ios
score: 0
has title: SSL certificate pinning in iOS app using objective C for React Native Project
type: Question
tagged with: objective-c
type: UnansweredQuestion
tagged with: mobile
has answer: http://stackoverflow.com/a/78159159
tagged with: react-native
tagged with: ssl-certificate
has body: I want to embed clients SSL certificate for iOS app using objective C for my React native project. I have tried lots of solutions but not getting any luck with it. So we have clients SSL certificate (.pem) which we need embed so that our API will work. I am getting 403 when calling our API I am sharing my code. **MyURLSessionDelegate.mm** #import "MyURLSessionDelegate.h" #import <Security/Security.h> @implementation MyURLSessionDelegate + (instancetype)sharedInstance { static MyURLSessionDelegate *sharedInstance = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedInstance = [[MyURLSessionDelegate alloc] init]; }); return sharedInstance; } - (NSURLSession *)configuredSession { NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration]; NSLog(@"MyURLSessionDelegate=====>working=====>line 16 : %@", sessionConfig); // Load the client certificate NSString *pathToCertificate = [[NSBundle mainBundle] pathForResource:@"xyz" ofType:@"pem"]; NSLog(@"pathToCertificate ====> : %@", pathToCertificate); NSData *certificateData = [NSData dataWithContentsOfFile:pathToCertificate]; NSLog(@"MyURLSessionDelegate=====>working=====>line 21 : %@", certificateData); NSString *base64Certificate = [certificateData base64EncodedStringWithOptions:0]; NSLog(@"Base64 Encoded Certificate: %@", base64Certificate); if (!certificateData) { NSLog(@"Client certificate not found"); return nil; } // Create a custom SSL configuration with the client certificate NSDictionary *sslSettings = @{ (NSString *)kCFStreamSSLCertificates: @[certificateData], (NSString *)kCFStreamSSLValidatesCertificateChain: @NO // Disable certificate chain validation if needed }; sessionConfig.TLSMinimumSupportedProtocol = kTLSProtocol1; sessionConfig.TLSMaximumSupportedProtocol = kTLSProtocol12; sessionConfig.TLSMinimumSupportedProtocol = kTLSProtocol12; sessionConfig.TLSMaximumSupportedProtocol = kTLSProtocol13; sessionConfig.connectionProxyDictionary = sslSetting…
answer count: 1

http://stackoverflow.com/q/78172699
upvote count: 3
tagged with: go
score: 2
type: Question
has title: Rapid memory growth caused by Go calling Objective-C
tagged with: http://stackoverflow.com/tag/c
tagged with: macos
has body: MacOS 12.6.8 Apple M1 Pro go version go1.20.7 darwin/arm64 Invoking the function GetWindowImage leads to rapid memory expansion. Code: package main /* #cgo CFLAGS: -x objective-c #cgo LDFLAGS: -framework Cocoa -framework ApplicationServices #import <Cocoa/Cocoa.h> #import <ApplicationServices/ApplicationServices.h> CGWindowID GetWindowNumber(const char *title) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *windowTitle = [NSString stringWithUTF8String:title]; CFArrayRef windowList = CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly, kCGNullWindowID); CGWindowID windowNumber = 0; for (NSDictionary *entry in (__bridge NSArray *)windowList) { NSString *winTitle = [entry objectForKey:(id)kCGWindowName]; // NSLog(@"Window Title: %@", winTitle); if ([winTitle isEqualToString:windowTitle]) { windowNumber = (CGWindowID)[[entry objectForKey:(id)kCGWindowNumber] integerValue]; break; } } CFRelease(windowList); [pool drain]; return windowNumber; } CFDataRef CaptureWindowImageData(CGWindowID windowNumber) { CGWindowID windowList[] = {windowNumber}; CFArrayRef windowArray = CFArrayCreate(NULL, (const void **)windowList, 1, NULL); CGImageRef image = CGWindowListCreateImageFromArray(CGRectNull, windowArray, kCGWindowImageDefault); NSImage *nsImage = [[NSImage alloc] initWithCGImage:image size:NSZeroSize]; CFRelease(windowArray); CGImageRelease(image); NSBitmapImageRep *rep = [NSBitmapImageRep imageRepWithData:[nsImage TIFFRepresentation]]; NSDictionary *props = [NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:1.0] forKey:NSImageCompressionFactor]; CFDataRef imageData = (CFDataRef)[rep representationUsingType:NSBitmapImageFileTypePNG properties:props]; [nsImage release]; [rep release]; return imageData; } */ import "C" import ( "bytes" "fmt" "image" "image/png" "unsafe" ) func GetWindowNumber(name string) uint { cTitle := C.CString(name) defer C.free(unsafe.Pointer(cTitle)) return uint(C.GetWindowNumber(cTitle)) } func GetWindowImage(win…
accepted answer: http://stackoverflow.com/a/78172838
has comment: http://stackoverflow.com/comment/137815535
downvote count: 1
type: AnsweredQuestion
answer count: 1
tagged with: objective-c
favorite count: 0
has answer: http://stackoverflow.com/a/78172838

http://stackoverflow.com/comment/138030785
type: Comment
type: QuestionComment
has text: Yes, fortunately I wont need more than 1 window for this app but I'll keep that in mind. Basically this app is sort of a glorified text adventure with a few GUI elements in the window.
comment on: http://stackoverflow.com/q/78290156
score: 0

http://stackoverflow.com/comment/137821249
type: Comment
comment on: http://stackoverflow.com/q/78173482
score: 0
type: QuestionComment
has text: I mean, it works as expected. The layer is probably set up with vsync by default

http://stackoverflow.com/a/78207247
has comment: http://stackoverflow.com/comment/137899903
has body: You've defined an @interface for bleconfigLibrary, but you haven't defined an @implementation for it in the code you've shown here. The fact that it works on physical devices but not the simulator suggests you're linking a library that defines an implementation, but that library isn't built for simulator. Possibly it's an old-style "fat" library that wasn't built for Apple Silicon. The library would need to be rebuilt as an xcframework. (While the linked page discusses Swift, xcframeworks are applicable to ObjC as well.) But note that BLE functionality generally does not work in the simulator anyway, so you may prefer to simply not build this code for simulator. This line is incorrect: handleRequest = [bleconfigLibrary alloc]; That allocates memory, but does not initialize the object. While it might "work" (if, for example, the object happens not to need initialization), the correct line here is, assuming ARC is enabled: handleRequest = [bleconfigLibrary new]; or equivalently, whether ARC is or isn't enabled: handleRequest = [[bleconfigLibrary alloc] init]; As a side note, ObjC classes should begin with an uppercase letter (though it's not mandatory). The normal capitalization convention here would be BLEConfigLibrary. (I'm assuming the . at the end of your @interface definition is a typo in your question, since it wouldn't compile in ObjC.)
accepted answer of: http://stackoverflow.com/q/78207140
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/137899540
has comment: http://stackoverflow.com/comment/137899769
score: 0
answers question: http://stackoverflow.com/q/78207140

http://stackoverflow.com/comment/137852510
type: Comment
has text: Instead of adding screenshots of your code, please add the actual code to the question. To capture the error message, right click on the red indicator and "Reveal in Issue Navigator".
comment on: http://stackoverflow.com/q/78192465
score: 0
type: QuestionComment

pow
tag name: pow
type: Tag
tags question: http://stackoverflow.com/q/78234249

http://stackoverflow.com/comment/137943738
type: QuestionComment
score: 0
has text: Maybe this is because I am using jdoodle on-line compiler.
type: Comment
comment on: http://stackoverflow.com/q/78234249

http://stackoverflow.com/comment/137794737
type: Comment
comment on: http://stackoverflow.com/q/78160846
has text: Have you added the relevant header to AppTarget-Bridging-Header.h (and configured a bridging header in your project).
score: 0
type: QuestionComment

http://stackoverflow.com/q/78159127
score: 0
has answer: http://stackoverflow.com/a/78256769
has comment: http://stackoverflow.com/comment/137837435
has body: I want to parse a Mach-O file so I use class-dump: class-dump -H xxx.app But it throw an error: class-dump[7747:13147879] Unknown load command: 0x00000032 And only generate one .h file: CDStructures.h // // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // My class-dump version is 3.5.
tagged with: ios
type: Question
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
has title: class-dump -H throw Unknown load command: 0x00000032

http://stackoverflow.com/comment/137992028
score: 0
type: AnswerComment
has text: I will continue to search for alternatives and add them to this thread.
type: Comment
comment on: http://stackoverflow.com/a/78270238

runloop
tag name: runloop
type: Tag
tags question: http://stackoverflow.com/q/78291071
tags question: http://stackoverflow.com/q/78309419

http://stackoverflow.com/comment/137960431
type: QuestionComment
has text: Did you tried to manually make a second request while the first one is still running ? As you create a new data task each time, the previous dataTask is possibly released from your object but called when the session task finished. So in this case it calls a method on the wrong type if object.
comment on: http://stackoverflow.com/q/78252191
score: 1
type: Comment

http://stackoverflow.com/comment/138040043
type: Comment
comment on: http://stackoverflow.com/q/78293837
score: 0
type: QuestionComment
has text: I was able to get things going by removing all the frameworks and using cocoapods to install firebase instead.

http://stackoverflow.com/comment/137963748
comment on: http://stackoverflow.com/q/78254151
has text: I don't think it's problematic but `@"Conection"` -> `@"Connection"`? Also, could you ask POSTMAN to generate Objective-C code? It might help to see what's wrong by comparing the codes.
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/78282782
accepted answer: http://stackoverflow.com/a/78302310
has comment: http://stackoverflow.com/comment/138013554
has title: How to share a global function between .m file and .mm file (obj c and obj c++) with common header file?
linked to: http://stackoverflow.com/q/53258343
type: Question
answer count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138022357
tagged with: objective-c++
tagged with: xcode
has body: abc.h /** @function GetInputSizeFromUsage @abstract return frame width and height from usage @param usage PPVEUsage to be inqure @param width (out) the input width for usage @param height (out) the input height for usage */ void GetInputSizeFromUsage(PPVEUsage usage, size_t *width, size_t *height); file1.m #import &lt;abc.h&gt; void GetInputSizeFromUsage(PPVEUsage usage, size_t *width, size_t *height) { switch(usage) { case UsageLandscape848x480: *width = 848; *height = 480; break; default: *width = 0; *height = 0; break; } } // This file uses this above function in various other functions and is fine to compile file2.mm #import &lt;abc.h&gt; size_t GetInputSizeFromUsage(PPVEUsage usage) { size_t width, height; GetInputSizeFromUsage(usage, &amp;width, &amp;height); return (width * height); } Error: Undefined symbol: GetInputSizeFromUsage(PPVEUsage, unsigned long*, unsigned long*) The error is due to file2.mm not being able to see the symbol. If I comment it out in file2.mm it compiles fine. Expecting it to be able to see the symbols
linked to: http://stackoverflow.com/q/1314743
duplicate of: http://stackoverflow.com/q/53258343
score: 0
has answer: http://stackoverflow.com/a/78302310
type: AnsweredQuestion

http://stackoverflow.com/q/78293837
tagged with: firebase
tagged with: ios-simulator
has title: Xcode Firebase "library not loaded" -- Problem running Simulator
tagged with: objective-c
answer count: 0
tagged with: xcode
has body: I'm getting the following trying to run with Xcode's Simulator. The GTMSessionFetch framework is included in the project. I'm on an M3 (Apple Silicon) MacBook. Have had various problems trying to move code to this machine, so wondering if that's related. I simply added the Firebase frameworks to the project, added the -ObjC flag as suggested in the README.md. What is this "file does not start with MH_MAGIC[_64], fat file, but missing compatible architecture ..." stuff? Other questions seemingly related suggest it is a code signing problem. If I use Product->Build there's no problem. But running with the Simulator generates this in the console: dyld[70392]: Library not loaded: @rpath/GTMSessionFetcher.framework/GTMSessionFetcher Referenced from: <FFFF9F7B-88DA-3D82-B1CA-419DB7B97C71> /Users/charlesjohnson/Library/Developer/CoreSimulator/Devices/C6358852-2298-4226-8839-F15331073CD2/data/Containers/Bundle/Application/F3C202F4-900E-4214-A3E1-F922CB071CA9/ASSIST for iPad.app/ASSIST for iPad Reason: tried: '/Users/charlesjohnson/Documents/iOS_Projects/ASSIST-main/assist_ios/DerivedData/ASSIST for iPad/Build/Products/Debug-iphonesimulator/GTMSessionFetcher.framework/GTMSessionFetcher' (file does not start with MH_MAGIC[_64], file does not start with MH_MAGIC[_64], file does not start with MH_MAGIC[_64], fat file, but missing compatible architecture (have 'i386,x86_64,arm64', need 'arm64')), '/Library/Developer/CoreSimulator/Volumes/iOS_21E213/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/GTMSessionFetcher.framework/GTMSessionFetcher' (no such file), '/usr/lib/swift/GTMSessionFetcher.framework/GTMSessionFetcher' (no such file, not in dyld cache), '/Users/charlesjohnson/Library/Developer/CoreSimulator/Devices/C6358852-2298-4226-8839-F15331073CD2/data/Containers/Bundle/Application/F3C202F4-900E-4214-A3E1-F922CB071CA9/ASSIST for iPad.app/Frameworks/GTMSessionFetcher.framework/GTMSessionFetcher' (file does not…
score: 0
has comment: http://stackoverflow.com/comment/138040043
type: Question
type: UnansweredQuestion

http://stackoverflow.com/a/78266074
score: 0
answers question: http://stackoverflow.com/q/78192465
has body: I am also experiencing the same issue on iOS version 17.4.1. Since it doesn't occur when not debugging, it seems to be a bug in Xcode. -- Part of FIRDLJavaScriptExecutor from FirebaseDynamicLinks -- NSString *htmlContent = [NSString stringWithFormat:@&quot;&lt;html&gt;&lt;head&gt;&lt;script&gt;%@&lt;/script&gt;&lt;/head&gt;&lt;/html&gt;&quot;, _script]; _wkWebView = [[WKWebView alloc] init]; _wkWebView.navigationDelegate = self; [_wkWebView loadHTMLString:htmlContent baseURL:nil];
type: Answer

launchd
tags question: http://stackoverflow.com/q/78254753
type: Tag
tag name: launchd

http://stackoverflow.com/comment/137775841
score: 1
comment on: http://stackoverflow.com/q/78149183
has text: In your posted form data you see, to be sending `name` and `filename` but your server code is complaining that `file` is `null`. It looks like you have inconsistency between your server and client code
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/138013554
has text: Usually this is due to the order of libraries or objects during the link. The one who call the other must be first.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78282782
score: 0

http://stackoverflow.com/a/78159159
score: 0
type: Answer
answers question: http://stackoverflow.com/q/78158611
has comment: http://stackoverflow.com/comment/137801858
has body: Dear Pranjali Wagh First of all I recommends you to not use CERTIFICATE directly instead of it use PUBLICK KEY which don't have expiration issue. Now follow me step by step to integrate SSL Pinning Use trustkit for SSL Pinning in IOS, inside podfile add: pod 'TrustKit', '1.6.5' Inside ios/AlmanaDoctorsApp/AppDelegate.m add: #import <TrustKit/TrustKit.h> // Import TrustKit #import <TrustKit/TSKPinningValidator.h> // Import TSKPinningValidator #import <TrustKit/TSKPinningValidatorCallback.h> // Import TSKPinningValidatorCallback // in the end of Dynamic *t = [Dynamic new] before return // TrustKit configuration void (^loggerBlock)(NSString *) = ^void(NSString *message) { NSLog(@"TrustKit log: %@", message); }; [TrustKit setLoggerBlock:loggerBlock]; NSDictionary *trustKitConfig = @{ kTSKSwizzleNetworkDelegates: @YES, kTSKPinnedDomains: @{ @"pa-api.almanahospital.com.sa" : @{ kTSKIncludeSubdomains: @YES, kTSKEnforcePinning: @YES, kTSKDisableDefaultReportUri: @YES, kTSKPublicKeyHashes : @[ @"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", @"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB=" ], }, }, }; [TrustKit initSharedInstanceWithConfiguration:trustKitConfig]; [TrustKit sharedInstance].pinningValidatorCallback = ^(TSKPinningValidatorResult *result, NSString *notedHostname, TKSDomainPinningPolicy *policy) { if (result.finalTrustDecision == TSKTrustEvaluationFailedNoMatchingPin) { NSLog(@"TrustKit certificate matching failed"); // Handle certificate matching failure } }; Replace @"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" with actual PUBLICK KEY of your certificate. AND BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB= with your backup PUBLICK KEY NOTE: if you don't have BACKUP Public key, its ok just add your publick key with @"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" it will work fine. Now install all dependencies cd ios/ and pod update Hope it will work as you as expected.

launchctl
tags question: http://stackoverflow.com/q/78254753
tag name: launchctl
type: Tag

http://stackoverflow.com/comment/138032845
comment on: http://stackoverflow.com/q/78254730
score: 0
type: QuestionComment
type: Comment
has text: The actual text value is replaced. Interesting that others are unable to reproduce the issue (and zero customer feedback reporting the issue). I'm on M3 MacBook Pro running 14.4, I'll see if other devices are exhibiting the bug.

http://stackoverflow.com/comment/137819988
comment on: http://stackoverflow.com/q/78173482
score: 0
type: Comment
type: QuestionComment
has text: Thanks for you reply, I tried `afterMinimumDuration` but when I set it to `0` or something really small like `0.000001`, then it keeps rendering at 60fps, however, if I set it to 1, it renders at 1fps. I am not sure if it is Glfw's doing, on windows with Vulkan I get ridiculous frame rates with the exact same code (apart from Vulkan >< Metal). If on Mac, I comment out the metal api calls (drawing, buffers, etc.) the frame rate is nearly 1000fps.

http://stackoverflow.com/comment/137957215
comment on: http://stackoverflow.com/q/78252191
score: 0
type: Comment
has text: @Paulw11 – Yep, good catch. The stack trace shows `NSObject`. But the exception message says the name of the actual type for which this failed. E.g., [here](https://i.sstatic.net/R5Q1f.png) I called a `Baz` method on a `Bar` object, where the stack trace reports the error on `NSObject`, but the exception message makes it clear what type of object the failure occurred. E.g., in my example, the `bazMethodNotInBar` was defined in `Baz`, but I forced a call to it from an instance of `Bar` (via an imprudent cast). So, Ecuador, can you show us the actual exception message?
type: QuestionComment

http://stackoverflow.com/a/78283088
answers question: http://stackoverflow.com/q/78282950
downvote count: 0
score: 1
type: Answer
upvote count: 1
has body: According to the documentation: - (nullable CIImage *)apply:(CIKernel *)k arguments:(nullable NSArray *)args options:(nullable NSDictionary&lt;NSString *,id&gt; *)dict NS_AVAILABLE_MAC(10_4); - (nullable CIImage *)apply:(CIKernel *)k, ... NS_REQUIRES_NIL_TERMINATION NS_AVAILABLE_MAC(10_4) NS_SWIFT_UNAVAILABLE(&quot;&quot;); There are two apply methods, however both of them was marked with NS_AVAILABLE_MAC. So it will not available on iOS, you need to find another way. Maybe UIGraphicsBeginImageContextWithOptions then re-draw image with alpha will fit this.

http://stackoverflow.com/comment/137850840
type: QuestionComment
has text: Where you are loading the `WKWebView`
comment on: http://stackoverflow.com/q/78192465
type: Comment
score: 0

http://stackoverflow.com/comment/138029930
score: 0
type: Comment
has text: I can't reproduce your issue either, and this is _just a hunch_ but does the actual text get replaced, or is it only the visual feedback? In the latest macOS update Apple fixed a ton of weird layout issues in TextKit 1 compatibility mode, some of which sometimes caused glitches like this. The actual text value did get replaced, though.
type: QuestionComment
comment on: http://stackoverflow.com/q/78254730

http://stackoverflow.com/comment/137957187
type: QuestionComment
score: 0
has text: @Rob it is a standard session. I will add the rest of the code above for illustration, but session is just an `NSURLSession *`.
comment on: http://stackoverflow.com/q/78252191
type: Comment

http://stackoverflow.com/comment/137967522
has text: Thank you @Larme for your reply . I corrected the spell mistake and I was using code from postman only and it worked.
score: 0
comment on: http://stackoverflow.com/q/78254151
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/138066322
comment on: http://stackoverflow.com/q/78307909
has text: I tried with a timer, and the keyboard properly dismisses, and while the issue is reproducible with the code from the question, is this the real code from you app? Are you removing the webview based on some gestures?
type: QuestionComment
score: 0
type: Comment

mobile
tags question: http://stackoverflow.com/q/78158611
tag name: mobile
type: Tag

http://stackoverflow.com/a/78324286
answers question: http://stackoverflow.com/q/78307909
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/138097356
has body: This looks like a WebKit/UIKit bug, the console is full of warnings related to the Input system, and other autolayout warnings, though the latter ones are unlikely to be the culprit. But you can work around it if you remove the webview after the keyboard is dismissed. Add these to viewDidLoad: [NSNotificationCenter.defaultCenter addObserverForName:UIKeyboardWillShowNotification object:nil queue:nil usingBlock:^(NSNotification * _Nonnull notification) { self.keyboardIsVisible = YES; }]; [NSNotificationCenter.defaultCenter addObserverForName:UIKeyboardDidHideNotification object:nil queue:nil usingBlock:^(NSNotification * _Nonnull notification) { self.keyboardIsVisible = NO; [self removeWebView]; }]; , and update removeWebView to do its thing only if the keyboardIsVisible flag is off: - (void)removeWebView { if (!self.keyboardIsVisible) { [webView stopLoading]; webView.navigationDelegate = nil; webView.scrollView.delegate = nil; [webView removeFromSuperview]; webView = nil; webViewIsActive = NO; } } Also, one more thing, you'll need to [self.view endEditing:YES] instead of [webView endEditing:YES] for this to work: - (void)handleDoubleTap:(UITapGestureRecognizer *)gestureRecognizer { if (webViewIsActive) { [self.view endEditing:YES]; [self removeWebView]; } else { [self addWebView]; } } You will also need to handle the situations where the user double taps a second time during the interval the keyboard is being dismissed (which takes around 600ms from what I noticed).
has comment: http://stackoverflow.com/comment/138091869
has comment: http://stackoverflow.com/comment/138237607

http://stackoverflow.com/q/78303864
favorite count: 0
tagged with: audio
tagged with: ios
upvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/78304699
has title: Playing audio stream using audio unit, crackling sound occurs
tagged with: objective-c
tagged with: audio-streaming
accepted answer: http://stackoverflow.com/a/78304699
answer count: 1
tagged with: audiounit
has body: In iOS application, Playing audio stream from BLE, using TPCircularBuffer and Audio Unit. Sound plays well, but when buffer is empty and there are no bytes to play, it is causing crackling sound for instances. Here is my audio stream configuration, AudioStreamBasicDescription audioFormat; audioFormat.mSampleRate = 8000.00; audioFormat.mFormatID = kAudioFormatLinearPCM; audioFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kAudioFormatFlagIsPacked; // || kAudioFormatFlagsNativeFloatPacked || kAudioFormatFlagIsSignedInteger //kAudioFormatFlagIsSignedInteger audioFormat.mFramesPerPacket = 1; audioFormat.mChannelsPerFrame = 1; audioFormat.mBitsPerChannel = 32;// Update when required audioFormat.mBytesPerPacket = 4; // Update when required audioFormat.mBytesPerFrame = 4; // Update when required Below is a Playback function of Audio Unit static OSStatus playbackCallback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData) { //1 for (int i=0; i &lt; ioData-&gt;mNumberBuffers; i++) { IosAudioController *THIS = (__bridge IosAudioController *)inRefCon; int bytesAskingByPlayback = ioData-&gt;mBuffers[i].mDataByteSize; SInt16 *targetBuffer = (SInt16*)ioData-&gt;mBuffers[i].mData; // Pull audio from playthrough buffer int32_t availableBytesFromBuffer; SInt16 *sBuffer = TPCircularBufferTail(iosAudio.addressOfTPBuffer, &amp;availableBytesFromBuffer); int willRemainBytes = availableBytesFromBuffer - bytesAskingByPlayback; if (willRemainBytes &gt; 0) { memcpy(targetBuffer, sBuffer, bytesAskingByPlayback); TPCircularBufferConsume(iosAudio.addressOfTPBuffer,bytesAskingByPlayback); } else { //Note: Mostly need to update code here memcpy(targetBuffer, sBuffer, availableBytesFromBuffer); TPCircularBufferConsume(iosAudio.addressOfTPBuffer, availableBytesFromBuffer); } } return noErr; } Buffer size is 16384 Some solution said that i would fill the target buffer with 0s to …
score: 2
type: Question
downvote count: 0

http://stackoverflow.com/comment/137857040
score: 1
type: Comment
comment on: http://stackoverflow.com/q/78195402
has text: Are you trying to insert a `UIView` ***under*** a layer of another view? Pretty sure that's not how layers work...
type: QuestionComment

http://stackoverflow.com/comment/137963354
comment on: http://stackoverflow.com/q/78252191
has text: @PtitXav – FWIW, the replacing of self’s reference to the prior task would not cancel the prior one. The session, itself, keeps a strong reference to the data task, even if you don’t keep your own. The only way that a task will stop is if you explicitly cancel it, or you explicitly `invalidateAndCancel()` the session (or the app is terminated). And even then, none of those would generate this sort of stack trace, but merely call the completion handler with `URLError(.cancelled)`.
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/78160846
answer count: 0
tagged with: ios
score: 0
has body: I have an iOS SwiftUI project with the following hierarchy: Module hierarchy: AppTarget -&gt; depends on Experience Experience -&gt; depends on Lifecycle Lifecycle Content of each module: Lifecycle -- struct conforming App protocol (entry point) -- AppDelegate, SceneDelegate etc. Experience -- URLHandler (and other supporting classes to handle launch parameters (if app is launched by tapping an associated file, quick action etc..) and update the UI. I have a struct conforming to App protocol in the Lifecycle library. It defines the onOpenURL(perform:) method to handle all URL based launches (widgets, files, deep links, universal links etc.). // In Lifecycle library WindowGroup { ContentView() .onOpenURL(perform: { (url: URL) in // Handle URL with which the app is launched. }) } In the above method, I need to invoke the URL handler method in Experience library. Note that the Experience library is above Lifecycle in the hierarchy (as mentioned above), so I cannot simply directly invoke it. I'm thinking of using ObjC categories to achieve this. ObjC category is a way to add methods to an existing class. At runtime, all methods in the category would be under one single class, though they are defined in two files in different modules. In Lifecycle library, I define the class as below: // In header file, @interface URLHandler : NSObject // No methods defined here. // Experience extends this using the concept of // ObjC category and defines a handler method // to handle all URL handler launches. @end // In .mm file, @implementation URLHandler // Empty @end And in the Experience library, I'm extending them as shown below: // In header file, extend the base class in Lifecycle library // by creating a category. @interface URLHandler (Experience) + (void) handleURL:(NSURL *) url; @end // In .mm file, @implementation URLHandler (Experience) + (void) handleURL:(NSURL *) url { Log([NSString stringWithFormat:@&quot;(ObjC++) url = %@&quot;, [url absoluteString]]); // Update the UI …
tagged with: objective-c-category
tagged with: objective-c
type: Question
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/137794737
has comment: http://stackoverflow.com/comment/137795710
tagged with: swift-extensions
has title: ObjC categories not recognised from a different target

http://stackoverflow.com/comment/138003887
has text: Thanks for help. Just added the property and problem resolved..
comment on: http://stackoverflow.com/q/78270748
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/137855872
comment on: http://stackoverflow.com/q/78195287
has text: Don't forget the following in the documentation for `UIView frame`: *"Warning If the transform property is not the identity transform, the value of this property is undefined and therefore should be ignored."*.
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/comment/137858710
type: Comment
has text: @DonMag Why though? Aren't UIViews essentially just controllers for layers, so I'm just organizing my layers in the order I need them. I have some CAShapeLayers that are just graphic paths so I don't really need to attach them to a UIView.
comment on: http://stackoverflow.com/q/78195402
score: 0
type: QuestionComment

http://stackoverflow.com/comment/137989814
type: Comment
comment on: http://stackoverflow.com/q/78270748
score: 0
type: QuestionComment
has text: You have `self.webView` which means that the class that the code is in must have a property named `webView`. The error indicates that you do not.

http://stackoverflow.com/comment/138022532
has text: I can't reproduce your issue. I created a new project, put your second set of code in the supplied view controller, and built it for Mac Catalyst. In the code I set the text view's text property to the three lines of text mentioned in your question. Running the app on an M3 MacBook Pro with macOS 14.4.1 resulted in no issues when highlighting the text.
type: Comment
comment on: http://stackoverflow.com/q/78254730
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138097356
comment on: http://stackoverflow.com/a/78324286
has text: What do you mean by “makes it hard to actually actually use”?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/137890073
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78214819
score: 0
has text: I didn't say you can't use UICollectionView. I said you can't statically get the cells by way of an IBOutlet. And you did not ask whether there is another way to lay out the buttons in the way you describe. I answered the question you actually asked.

http://stackoverflow.com/comment/137818017
type: QuestionComment
has text: Actually, I don't think it matters how what glfw does. If you have an `MTLCommandBuffer`, you can just present after minimum duration and it should pace the app. Unless glfw internally does some additional pacing, then you will get a weird double pacing that might or might not work.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78173482

textkit
tags question: http://stackoverflow.com/q/78254730
type: Tag
tag name: textkit

http://stackoverflow.com/comment/137855858
type: Comment
has text: Try working with centers. Something like `CGPoint convertedTargetImageViewCenter = [v1 convertPoint:v4.center fromView:v4];`. Then set the `center` property of the image view to `convertedTargetImageViewCenter`.
comment on: http://stackoverflow.com/q/78195287
score: 1
type: QuestionComment

http://stackoverflow.com/a/78267801
has body: Having the same runtime isn't a necessary condition for interoperability, but it certainly makes interoperating two languages a lot easier. Arguably, Kotlin and Java don't have the same runtime either. Kotlin has its own runtime built on top of the JDK/JVM. This is what makes suspend functions, Kotlin reflection, and other Kotlin-specific features work. All that matters is that Kotlin's compiler can output binaries that Java's compiler can understand, and Java's compiler can output binaries that Kotlin's compiler can understand. That is, the compilers follow each other's ABI. With both of them running on the JVM, lots of this is given "for free". Kotlin's compiler can just output a Kotlin method as a JVM method, a Kotlin class as a JVM class, calling a Java method from Kotlin generates basically the same bytecode as calling a Java method from Java, etc. Similarly, when you call a Objective-C method in Swift, swiftc just outputs the same instructions clang would output for that method call, as if some Objective-C code had called it. If a class is marked @objc in Swift, swiftc generates Objective-C headers for that class, as if it were an Objective-C class, and so on. In theory, Swift could be made to interoperate with Java. One can write a Swift compiler that outputs Java bytecode. Having the same runtime isn't a sufficient condition for interoperability either. Kotlin's compiler generates synthetic members to implement some of Kotlin's language features, which are ignored by Java's compiler. Similarly, not every Swift declaration can be made visible to Objective-C (e.g. protocols with associated types), and Objective-C macros that are not just simple constants, are not visible to Swift either.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/78259397

http://stackoverflow.com/comment/137957453
has text: @Ecuador Could this issue be related to the specific URL (or specific URL scheme) being requested? Perhaps internal to the implementation of `NSURLSession`, it tries to call some method that doesn't actually exist if the wrong kind of URL request is provided. You have an `NSString` named `fileURL`. Where does that come from? What limits are put on its value?
comment on: http://stackoverflow.com/q/78252191
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/78277788
answer count: 0
has title: Issue finding #import <FxPlug/FxPlugSDK.h> in Xcode following Apple tutorial
type: Question
tagged with: objective-c
type: UnansweredQuestion
has body: I'm following Apple's tutorial to build an FXPlug plugin manually: Building an FXPlug Plug-In Manually. I've followed every step detailed in the tutorial, but I'm having trouble finding the #import &lt;FxPlug/FxPlugSDK.h&gt; header in Xcode. I've double-checked that I've followed all instructions correctly, including installing the necessary SDK files, but Xcode still can't find this header. I've reviewed my header search paths and inclusion paths configuration, but it doesn't seem to resolve the issue. Has anyone had a similar experience or have any idea why Xcode can't find this header even after following the tutorial step-by-step? Any help would be greatly appreciated. Thanks in advance.
tagged with: xcode
score: 0

http://stackoverflow.com/a/78293581
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/78291071
has body: This is a great question that touches on some subtle details of how NSRunLoop works. The -run method is not intended to ever return. It may if there are no sources or timers, but this is explicitly not promised (emphasis added): Manually removing all known input sources and timers from the run loop is not a guarantee that the run loop will exit. macOS can install and remove additional input sources as needed to process requests targeted at the receiver’s thread. Those sources could therefore prevent the run loop from exiting. If you want the run loop to terminate, you shouldn't use this method.... When you call -performSelector:onThread:..., the system will attach a __NSThreadPerformPerform run lop source if one does not already exist (this is an undocumented, internal type). Once attached, this source is never removed, but it is added lazily the first time it's needed. Timers are attached to run loops like sources. They are removed when they are invalidated (such as after they fire, if they do not repeat). Putting all these facts together explains the behavior. When there is no -performSelector:onThread:... call, then after the timer fires there are no sources or timers left on the run loop, and -run exits, terminating the thread, releasing the NSThread object, and calling -dealloc. When you do call -performSelector:onThread:..., then there is a __NSThreadPerformPerform source on the thread. It will never be removed, and so -run will never return. The thread will never terminate, and the NSThread object will never be released. If you want the thread terminate, you shouldn't use -run. Instead, use -runMode:beforeDate:. For example: NSRunLoop *loop = [NSRunLoop currentRunLoop]; // The docs don't warn you to do this. This adds a dummy source so that // the loop always has at least one. You can also use a repeating timer. [loop addPort:[NSMachPort new] forMode:NSDefaultRunLoopMode]; // Infinite loop until `shouldKeepRunning` is false. // `runMode:beforeDate:` will proc…
answers question: http://stackoverflow.com/q/78291071
type: AcceptedAnswer
type: Answer
upvote count: 1

http://stackoverflow.com/comment/137962009
comment on: http://stackoverflow.com/q/78252191
type: Comment
has text: I always keep a strong reference to the session - just saying. You only need one, not one per task. Also as @PtitXav said - instead of a per task ivar use a mutable set or dictionary to hold the tasks - on completion they can remove themselves. Note completion is on a background queue!
score: 0
type: QuestionComment

http://stackoverflow.com/q/78169320
score: 1
tagged with: ios
tagged with: objective-c
has body: I get this error &quot;this file must be compiled as obj-C++. If I downgrade to react-native 0.73.4, seems to work. I'm using the new React Native Architecture. How do make latest versions of react native and bugsnagreactnative work together?
tagged with: react-native
has title: how to compile ios app using react native >= 0.73.5 , bugsnagreactnative >= 0.72.3?
type: Question
upvote count: 1
downvote count: 0
tagged with: bugsnag
tagged with: xcode
type: UnansweredQuestion
answer count: 0
favorite count: 0

http://stackoverflow.com/comment/137970873
type: Comment
comment on: http://stackoverflow.com/q/78252191
has text: @PtitXav no, each startDownload call is on a new instance. I've also tried maintaining the same instance, and making sure to cancel the datatask before starting a new one, but that also produces the same type of errors... :(
score: 0
type: QuestionComment

http://stackoverflow.com/comment/137992013
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78270238
has text: That's quite hacky, but it instantly worked. Thank you very much. But asking for accessibility permissions is a big question to ask, so I likely make this intended window positioning rather an optional feature.
score: 0

nstimer
tag name: nstimer
tags question: http://stackoverflow.com/q/78291071
type: Tag

http://stackoverflow.com/comment/137959982
type: Comment
comment on: http://stackoverflow.com/q/78254151
score: 0
type: QuestionComment
has text: May i know, what kind of information holding in nsdata

http://stackoverflow.com/comment/138298802
has text: I have the same issue. It is happening randomly.
score: 0
comment on: http://stackoverflow.com/q/78186819
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/138022357
comment on: http://stackoverflow.com/q/78282782
type: QuestionComment
score: 1
type: Comment
has text: What if you declare `GetInputSizeFromUsage` in the `.h` file with C linkage (using `extern "C"`)?

http://stackoverflow.com/comment/138010857
comment on: http://stackoverflow.com/q/78282950
type: QuestionComment
score: 0
has text: Look at the documentation for `CIFilter` and the `apply:` methods. They are both clearly marked as only being available on macOS. Since you are building for iOS you can't use macOS-only methods.
type: Comment

uitoolbar
tags question: http://stackoverflow.com/q/78290210
tag name: uitoolbar
type: Tag

.net-core
tags question: http://stackoverflow.com/q/78149183
tag name: .net-core
type: Tag

launch
tags question: http://stackoverflow.com/q/78192465
tag name: launch
type: Tag

cashapelayer
type: Tag
tags question: http://stackoverflow.com/q/78195402
tag name: cashapelayer

exponent
type: Tag
tags question: http://stackoverflow.com/q/78234249
tag name: exponent

http://stackoverflow.com/comment/137992152
comment on: http://stackoverflow.com/q/78269843
score: 0
type: QuestionComment
has text: In more recent MacOS versions it seems that the Accessibility API has become more restrictive and more focussed on supporting an individual application. Methods like mentioned in the following post do not seem to work anymore: https://stackoverflow.com/questions/6684278/getting-the-position-of-my-applications-dock-icon-using-cocoas-accessibility-a
type: Comment

http://stackoverflow.com/comment/138022259
type: QuestionComment
comment on: http://stackoverflow.com/q/78254730
type: Comment
has text: Yes, the issue still occurs with just a normal text view added to the view hierarchy, with setting the text container and layout manager. I'll edit the question to include this mode of re-recreating the issue.
score: 0

swift-extensions
tag name: swift-extensions
type: Tag
tags question: http://stackoverflow.com/q/78160846

http://stackoverflow.com/comment/137980560
has text: No, I haven't thought about the permission. I will do some search on how to grant root permission for my app. Thanks for the comment!
comment on: http://stackoverflow.com/q/78254753
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/137987583
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78269843
score: 0
has text: Have you tried the Accessibility API?

asynchronous
tag name: asynchronous
type: Tag
tags question: http://stackoverflow.com/q/78252191
tags question: http://stackoverflow.com/q/79151429

dock
type: Tag
tag name: dock
tags question: http://stackoverflow.com/q/78269843

http://stackoverflow.com/comment/138920593
type: QuestionComment
score: 0
type: Comment
has text: I think Maps SDK v8.3.1 fixes the issue. Can you confirm?
comment on: http://stackoverflow.com/q/78186819

http://stackoverflow.com/comment/137896675
score: 0
comment on: http://stackoverflow.com/q/78218464
type: QuestionComment
type: Comment
has text: macOS command line application. `e` is an instance of `EndpointInterface` class.

http://stackoverflow.com/comment/137960040
has text: NSDictionary converted into nsdata and then nsdata converted to json string like below : NSMutableDictionary *paramsDic = [[NSMutableDictionary alloc] init]; [paramsDic setValue:@"testTrial@5." forKey:@"password"]; [paramsDic setValue:@"9123456789" forKey:@"loginId"]; [paramsDic setValue:@"Mobile" forKey:@"loginType"]; [paramsDic setValue:@"91" forKey:@"phoneCode"]; [paramsDic setValue:@"Us" forKey:@"language"]; [paramsDic setValue:@"4.3.12" forKey:@"version"]; [paramsDic setValue:@"1711680146397" forKey:@"timestamp"];
type: Comment
comment on: http://stackoverflow.com/q/78254151
score: 0
type: QuestionComment

objective-c-blocks
tag name: objective-c-blocks
type: Tag
tags question: http://stackoverflow.com/q/78218464

qlpreviewcontroller
tags question: http://stackoverflow.com/q/78290210
type: Tag
tag name: qlpreviewcontroller

http://stackoverflow.com/comment/138091869
score: 0
comment on: http://stackoverflow.com/a/78324286
type: AnswerComment
has text: I was elated for a moment. You dispose of the webview when the keyboard is hidden, which makes it hard to actually actually use. If I remove that automatic removal, it all goes bad again. I'll update the question with some random observations, but I may just be sunk. I appreciate your time none the less!
type: Comment

ssl-certificate
type: Tag
tag name: ssl-certificate
tags question: http://stackoverflow.com/q/78158611
tags question: http://stackoverflow.com/q/78153217

http://stackoverflow.com/comment/137818021
type: QuestionComment
has text: But glfw is opensource so it should be pretty easy to figure out what it does.
comment on: http://stackoverflow.com/q/78173482
type: Comment
score: 0

http://stackoverflow.com/comment/137967500
type: QuestionComment
type: Comment
has text: Thank you @NewbieiOS for your reply but I got the solution - it was by public key which I was using for encryption was wrong . Once I changed it , the app works smoothly ,
comment on: http://stackoverflow.com/q/78254151
score: 0

http://stackoverflow.com/comment/137968777
type: QuestionComment
has text: Does your app have permission to run launchctl? Second, I think you need the excact path for your .plist, add that from your bundle.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/78254753

chromakey
tag name: chromakey
type: Tag
tags question: http://stackoverflow.com/q/78283285

http://stackoverflow.com/comment/137890021
score: 0
has text: Thanks for firm answer, matt I'm just trying to display 4 static buttons. Each with different width, and I want it to fill horizontal space first, then move to next row if it is full. Thats why I want to use UICollectionView This could be done with UITableView without error, but it can't fill horizontal space
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78214819

frame-rate
tags question: http://stackoverflow.com/q/78173482
type: Tag
tag name: frame-rate

http://stackoverflow.com/comment/137821647
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78173482
type: Comment
has text: On macOS, you can disable vsync by setting `displaySyncEnabled` on `CAMetalLayer`. On other platforms, you can't tear the screen.

cgpoint
tags question: http://stackoverflow.com/q/78195287
tag name: cgpoint
type: Tag

audiounit
tag name: audiounit
tags question: http://stackoverflow.com/q/78303864
type: Tag
tags question: http://stackoverflow.com/q/79092218

http://stackoverflow.com/comment/137808781
type: AnswerComment
has text: thanks Scott will review this on Monday and feed back
type: Comment
comment on: http://stackoverflow.com/a/78168282
score: 0

http://stackoverflow.com/q/78360107
has comment: http://stackoverflow.com/comment/138156933
has comment: http://stackoverflow.com/comment/138154646
score: 0
has comment: http://stackoverflow.com/comment/138150607
has comment: http://stackoverflow.com/comment/138148069
type: Question
has comment: http://stackoverflow.com/comment/138148523
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/138150123
tagged with: appkit
tagged with: macos
has title: Cocoa application produces a lot of "inactive" memory
has body: I am developing software in Objective-C that reads files in chunks and processes them. I noticed with very large files it slows down a lot. Looking in activity monitor it's pretty clear what's going on. When in the system memory tab, the pie chart shows what the memory is used for. When running my application, the blue part of the chart fills up entirely until there is no green left. Once the green is gone, it starts doing a ton of page-outs and the disk starts being used to it's maximum. From my understanding the inactive memory is memory that was used by an application and is left allocated when that application closes and given back to the application when it opens again. I am using ARC and for every malloc and calloc I use free to make sure everything is freed as soon as possible. When I look in Instruments, it shows the memory is all freed and there are no leaks. I assume Mac OS is marking the memory I used as inactive, maybe it thinks my application is going to need it again. The loop that's causing the problem is an auto-release pool so I would expect it to free up the memory properly. Here's code that replicates the issue: // // main.m // memory issue // // Created by Lasse Lauwerys on 21/04/24. // Copyright (c) 2024 Lasse Lauwerys. All rights reserved. // #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { NSLog(@"Reading file..."); UInt32 bufferSize = 200000000; NSFileHandle *fileHandle = [NSFileHandle fileHandleForReadingAtPath:@"/path/to/large/file"]; UInt64 bytesToProcess; NSData *data; do @autoreleasepool { // This loop reads the file into ram in chunks of 200MB and frees it after each iteration. bytesToProcess = [data = [fileHandle readDataOfLength:bufferSize] length]; } while (bytesToProcess); NSLog(@"Finsihed!"); } return 0; } It fills the inactive memory to 100% even with just a 2GB file. I can't find any helpful info about this on Google. I don't think it's a memory leak as the inactive memory is supposed…
tagged with: objective-c
tagged with: malloc
tagged with: automatic-ref-counting

http://stackoverflow.com/comment/138060609
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78309419
has text: **Never run a run loop in a dispatch queue callback.** A run loop needs a dedicated thread, and GCD queues don't have dedicated threads (except the main queue, which always uses the main thread). You should only ever run a run loop on the main thread, or on a thread you created. A dispatch queue is not a thread.
type: QuestionComment

http://stackoverflow.com/a/78356963
has body: Why one isn't working in your situation requires more details to answer definitively. What is the difference between char buffer[10]; and char *buffer = malloc(10);? I thought it was the same thing. This question is more answerable. In the former case, ten bytes are automatically allocated on the stack if located within a function. Attempting to return a pointer to that memory outside of the function will result in undefined behavior as that memory may be reused by another function call on the stack and therefore is no longer valid outside the function call. In the latter case using malloc, the memory is dynamically allocated. A pointer to it can be returned from a function and used in another function. However, the memory is not automatically reclaimed and must be deliberately freed with free. Depending on how you're using this memory, this may very well explain why using malloc works and char buffer[10]; doesn't. I strongly suggest compiling with warnings on. Stack space With your edited code, where bufferSize is 200000000 we can now see that in readFile2 and readFile4 you're trying to put two hundred million bytes on the stack. This is a situation where you really would need dynamic allocation. Even with dynamic memory allocation, you're trying to allocate two hundred million bytes in one block. That's a lot of memory. You may want to rethink your approach to see if you can work in smaller chunks.
has comment: http://stackoverflow.com/comment/138143956
has comment: http://stackoverflow.com/comment/138144516
answers question: http://stackoverflow.com/q/78356799
score: 3
has comment: http://stackoverflow.com/comment/138143675
has comment: http://stackoverflow.com/comment/138143962
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/78356799
upvote count: 3
has comment: http://stackoverflow.com/comment/138144610
downvote count: 0

http://stackoverflow.com/q/78324556
downvote count: 0
score: 3
has answer: http://stackoverflow.com/a/78324740
favorite count: 0
tagged with: ios
has title: Why does my app hang when breakpoints are disabled?
type: AnsweredQuestion
tagged with: ipad
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/78324740
tagged with: xcode
tagged with: core-data
answer count: 1
has body: I have an app that uses several ManagedObjectContexts. I am using Objective-C. One MOC is created with NSPrivateQueueConcurrencyType. The rest are created with NSMainQueueConcurrencyType. I am using [performBlockAndWait:] whenever I work with my MOCs. When I run my app with breakpoints disabled, the app will hang. The stack trace says that there are 2 threads trying to run performBlockAndWait. If I run my app with breakpoints enabled and I have several breakpoints that will interrupt my code, the app will not hang. I have searched online and while I have seen some entries about hangs, nothing has helped nor have I found anything that matches my situation. I am clearly missing something (or a lot of somethings) in how performBlockAndWait works and when it is or is not appropriate to use. Very much would like some help/hints. This is very frustrating. Xcode version is 15.3, deployment target for iOS/iPadOS is 16.4.
upvote count: 3
type: Question

http://stackoverflow.com/comment/138273323
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78417644
type: QuestionComment
has text: Some things (edibility of text field) I want for both states (popover or torn-window). Others (resizability) I only want for the "torn" (detached) state.

http://stackoverflow.com/q/78356910
has comment: http://stackoverflow.com/comment/138144392
has answer: http://stackoverflow.com/a/78360039
has answer: http://stackoverflow.com/a/79332502
answer count: 2
has comment: http://stackoverflow.com/comment/138144386
linked to: http://stackoverflow.com/q/41680004
tagged with: objective-c
has title: Objective C - freopen command creates file but does not redirect output
has body: I'm using the following lines in my app delegate didFinishLaunchingWithOptions method to attempt to redirect NSLog output to a file. This is code that's in many SO answers. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *logPath = [documentsDirectory stringByAppendingPathComponent:@"mylog.txt"]; freopen([logPath fileSystemRepresentation],"a+",stderr); The file is getting created, but it's empty. Also, from what I understand this should stop the NSLog messages from appearing in the Xcode console but they still show up. All help appreciated.
score: 0
tagged with: nslog
type: Question
has comment: http://stackoverflow.com/comment/138143253
type: UnansweredQuestion

http://stackoverflow.com/comment/138711058
has text: ok nvm I am dumb. Objective-c inherits its functions from C, so when im defining a function in objective-c, im actually creating a C function. So in this case, I am trying to hook a C function
type: AnswerComment
comment on: http://stackoverflow.com/a/78671487
type: Comment
score: 0

http://stackoverflow.com/a/78331787
answers question: http://stackoverflow.com/q/78329532
has body: Not all devices support multi-camera sessions (even though the AVCaptureMultiCamSession can still be instantiated). You can determine at runtime whether or not they're supported via the multiCamSupported class property: if ( !AVCaptureMultiCamSession.multiCamSupported ) { // can't add multiple inputs }
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/78329532

http://stackoverflow.com/comment/138140391
has text: @JWWalker I cant tell. How do i find out?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78353070
type: Comment

http://stackoverflow.com/q/78366079
has comment: http://stackoverflow.com/comment/138158297
has comment: http://stackoverflow.com/comment/138158044
type: Question
tagged with: objective-c
type: UnansweredQuestion
has body: I am working on a project in which I have added an SDK using pod. There are some logs within the SDK code they have added using NSLog wrapper as: #define LogDebug(message, ...) { \ [LogObjcWrapper logDebug:[NSString stringWithFormat: message, ##__VA_ARGS__] file:@__FILE__ function:[NSString stringWithFormat:@"%s", __FUNCTION__] line:__LINE__]; \ } I want the logs, printed using above wrapper, in my project debug console in Xcode. I am not sure how to get that logs. Eg. that I want to get in the debug console is : LogDebug(@"[FileModule.m] removeExtraFilesFromCount: %@. removeItemAtPath: %@\n", @(count), <fiel_path>); Here the FileModule.m is a file from SDK in which the SDK developer have added the code as above to show the log. I want to retrieve that log, which currently I am not able to get. Expected Output: "[FileModule.m] removeExtraFilesFromCount: 0. removeItemAtPath: /Users/apple/Library/Developer/Xcode/DerivedData/..." SDK is Developed in Objective-C. I am using Xcode 15.2 on macOS 14.4.1. The wift version in my app is Swift 5.
score: 0
has comment: http://stackoverflow.com/comment/138158228
has comment: http://stackoverflow.com/comment/138157988
has comment: http://stackoverflow.com/comment/138157771
tagged with: nslog
has comment: http://stackoverflow.com/comment/138158257
tagged with: swift
has comment: http://stackoverflow.com/comment/138158253
has comment: http://stackoverflow.com/comment/138158013
answer count: 0
has comment: http://stackoverflow.com/comment/138157969
has title: NSLog wrapper in Objective-C not working in Swift

http://stackoverflow.com/q/78417644
has comment: http://stackoverflow.com/comment/140003449
has comment: http://stackoverflow.com/comment/138273323
has title: Is it possible to change behavior and attributes of the window of an NSPopover?
has body: I'm working on a MacOS Cocoa app written solely in Objective-C. The app is a "Status Item" app, with tiny visual footprint as an icon on the menu-bar (NSStatusItem), which opens an NSMenu. One of the NSMenuItem objects in this NSMenu shows/hides a popover. This is the IBAction: -(IBAction)showPreventionStatus:(id)sender { if (self.statusPopover.isShown) { // hide it [self.statusPopover performClose:self]; [(NSMenuItem *)sender setTitle:@"Show Prevention State"]; } else { [self.statusPopover showRelativeToRect:[self.statusItem.button bounds] ofView:self.statusItem.button preferredEdge:NSMaxYEdge]; [(NSMenuItem *)sender setTitle:@"Hide Prevention State"]; } } Where @property (strong) IBOutlet NSPopover *statusPopover; is defined in my XIB and connected to this property of my AppDelegate. Almost all of the UI is defined in a single .XIB, including the NSPopover, its NSPopoverController, and the NSView hierarchy presented by this NSPopover. Most objects are connected to my AppDelegate.m which contains all the IBActions etc. When open, the popover looks like this (removed some of the details): This NSPopover (configured to be transient) can be torn off, and then it looks like a floating window/panel. The popover displays an NSView which is defined and attached to the popover in a normal .xib file (see screenshot above) I can obtain the underlying window object from the NSPopover like this: NSWindow *statusWindow = [self.statusIconView window]; where self.statusIconView can be ANY NSView in the view hierarchy of the pop-over. The statusWindow looks like a normal NSWindow - but any attempt to change its attributes (I'm trying to make it resizable for instance) is ignored. I tried to inspect it in the debugger - and found out that its class is special: NSPopoeverWindow : NSPanel : NSWindow NSPopoeverWindow seems to be a private Cocoa class, since I can't find it in the AppKit headers. However, it subclasses NSPanel which in turn is a subclass of NSWindow. I suspect this spe…
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138248277
has comment: http://stackoverflow.com/comment/138273375
tagged with: cocoa
has comment: http://stackoverflow.com/comment/138277357
type: Question
has answer: http://stackoverflow.com/a/78420434
has comment: http://stackoverflow.com/comment/138254746
accepted answer: http://stackoverflow.com/a/78420434
favorite count: 0
score: -1
downvote count: 1
type: AnsweredQuestion
answer count: 1
has comment: http://stackoverflow.com/comment/138273693
tagged with: macos
upvote count: 0

http://stackoverflow.com/q/78426105
answer count: 0
has body: I'm attempting to seize focus on a USB card reader such that only my program interacts with the card read events. With the code below, it is registering when the card reader is connected or removed correctly, but it does not log card read events. I know they are happening though, because the machine makes a noise for each character read. I got most of this code from here #import <Foundation/Foundation.h> #import <IOKit/hid/IOHIDManager.h> #import <IOKit/hid/IOHIDUsageTables.h> #include <IOKit/hid/IOHIDValue.h> #define KEYS 4 const char* keyboard_map(int scancode) { //char * letter; switch (scancode) { case 0x04: return "a"; case 0x05: return "b"; case 0x06: return "c"; case 0x07: return "d"; case 0x08: return "e"; case 0x09: return "f"; case 0x0A: return "g"; case 0x0B: return "h"; case 0x0C: return "i"; case 0x0D: return "j"; case 0x0E: return "k"; case 0x0F: return "l"; case 0x10: return "m"; case 0x11: return "n"; case 0x12: return "o"; case 0x13: return "p"; case 0x14: return "q"; case 0x15: return "r"; case 0x16: return "s"; case 0x17: return "t"; case 0x18: return "u"; case 0x19: return "v"; case 0x1A: return "w"; case 0x1B: return "x"; case 0x1C: return "y"; case 0x1D: return "z"; case 0x1E: return "1"; case 0x1F: return "2"; case 0x20: return "3"; case 0x21: return "4"; case 0x22: return "5"; case 0x23: return "6"; case 0x24: return "7"; case 0x25: return "8"; case 0x26: return "9"; case 0x27: return "0"; case 0x28: return "Return (Enter)"; default: return ""; } return ""; } void Handle_InputCallback(void* inContext, IOReturn inResult, void* inSender, IOHIDValueRef value) { IOHIDElementRef elem = IOHIDValueGetElement(value); uint16_t scancode = IOHIDElementGetUsage(elem); if (scancode < 4 || scancode > 231) return; printf("%s\n", keyboard_map(scancode)); NSLog(@"Key event received"); } static void Handle_DeviceMatchingCallback(void * inContext, IOReturn inResult, void * inSender, IOHIDDeviceRef inIOHIDDeviceRef) { NSLog(@"Connected"); } static void Handle_Re…
has comment: http://stackoverflow.com/comment/138266221
linked to: http://stackoverflow.com/q/70673002
duplicate of: http://stackoverflow.com/q/70673002
tagged with: objective-c
tagged with: hid
score: 0
linked to: http://stackoverflow.com/q/8676135
type: Question
has title: Seize Device and Work with input on MacOS
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138281792
has comment: http://stackoverflow.com/comment/138293609
tagged with: macos

http://stackoverflow.com/q/78435889
tagged with: ios
tagged with: javascript
type: AnsweredQuestion
tagged with: objective-c
score: 4
has answer: http://stackoverflow.com/a/78446806
upvote count: 5
accepted answer: http://stackoverflow.com/a/78446806
tagged with: cross-platform
downvote count: 1
tagged with: react-native
type: Question
answer count: 1
has title: Module 'SquareReaderSDK' not found in IOS (React Native)
has body: I'm encountering an issue with integrating the SquareReaderSDK into my iOS project. Despite following the documentation and ensuring that I've properly added the SDK to my project, Xcode still reports that it cannot find the SquareReaderSDK module. Here are the steps I've taken so far: I've added the SquareReaderSDK framework to my project by dragging it into the "Frameworks, Libraries, and Embedded Content" section of my target settings. I've made sure that the framework is listed under "Link Binary With Libraries" in the "Build Phases" settings for my target. I've imported the SquareReaderSDK module in the appropriate files where I need to use it. I've tried cleaning the build folder, deleting derived data, and restarting Xcode, but the issue persists. Is there anything else I might be missing or any additional steps I need to take to properly integrate the SquareReaderSDK into my project? Any help or insights would be greatly appreciated. Versions: "react-native": "0.72.3", "react-native-square-reader-sdk": "^1.4.3" Device: IOS simulator: IPhone 15 Error Screenshot: I have followed the documnentation of sqaure reader sdk. https://github.com/square/react-native-square-reader-sdk/blob/master/docs/get-started.md#step-5-install-reader-sdk-for-ios
favorite count: 0

http://stackoverflow.com/comment/138252044
comment on: http://stackoverflow.com/q/78412848
has text: You haven't told us anything about *when and how* you are trying to execute this code. Is your `ProgressBarView` already visible? Are you trying to do this too early? Either inside your custom view's init or inside the controller's `viewDidLoad`?
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/a/78423733
score: 0
type: Answer
answers question: http://stackoverflow.com/q/78412848
has body: Fixed it by adding [self setNeedsLayout] after calling [self layoutIfNeeded]. [self layoutIfNeeded]; [self setNeedsLayout]; [UIView animateWithDuration:1.5 animations:^{ progressForegroundWidthConstraint.constant = progressBarWidth * progressPercentage / 100; [self layoutIfNeeded]; } ];
accepted answer of: http://stackoverflow.com/q/78412848
type: AcceptedAnswer

http://stackoverflow.com/comment/138656302
type: AnswerComment
type: Comment
has text: %hookf can also be used to hook into swift functions, but why not objective-c too?
comment on: http://stackoverflow.com/a/78617722
score: 0

http://stackoverflow.com/comment/138158253
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78366079
has text: Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/257506/discussion-between-er-vihar-and-trojanfoe).
type: QuestionComment

http://stackoverflow.com/comment/138143956
type: AnswerComment
type: Comment
has text: You can only `free` that which has been allocated using `malloc`, `realloc`, or `calloc`.
comment on: http://stackoverflow.com/a/78356963
score: 0

http://stackoverflow.com/comment/138150123
type: QuestionComment
has text: @Willeke I created a sample code and tested it. This is all the code necessary to fill up the inactive RAM in just a couple seconds. If you set activity monitor to refresh fast you can see the allocated memory grow to 200MB and immediately free that 200MB after having loaded it. The inactive memory grows at the same rate but is never freed.
type: Comment
comment on: http://stackoverflow.com/q/78360107
score: 0

http://stackoverflow.com/comment/138158044
has text: OK so if you must use `LogDebug` etc. then you will need to create those functions yourself, which mimic what the macros do. Otherwise use `LogObjcWrapper` directly.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78366079
type: QuestionComment

http://stackoverflow.com/comment/138150607
type: QuestionComment
comment on: http://stackoverflow.com/q/78360107
type: Comment
has text: @PtitXav I'm not using CoreGraphics. I'm pretty sure the "inactive" memory is not allocated memory anymore but it's memory that is reserved in case the application is closed and opened again but it's freed when other applications need it. The problem is that it's producing so much inactive memory while running that it starts paging immediately and that ruins the file read speeds. The only solution I have now is constantly running the `purge` command to clean the inactive memory, but that's a bad solution.
score: 0

http://stackoverflow.com/comment/138248277
has text: Do you want to change the attributes before or after the window is torn off? How is the popover created?
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78417644

http://stackoverflow.com/q/78354823
has comment: http://stackoverflow.com/comment/138157398
has body: I have created UITabbar for my app and as per the requirements all the information will come from the API. Once I received the response I have downloaded the image and set to UITabbar Item. I have used the following code to download the image. for (int i=0; i&lt;[tabbarItemImageArray count]; i++) { NSURLSession *session = [NSURLSession sharedSession]; [[session dataTaskWithURL:[tabbarItemImageArray objectAtIndex:i] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { UIImage *imagemain=[UIImage imageWithData:data]; dispatch_async(dispatch_get_main_queue(), ^(){ if (i &lt; 5) { if (imagemain != nil) { UIImage *resizedImage = [[WSUtils sharedObject] resizeImageForTabbarItem:imagemain scaledToSize:CGSizeMake(25,25)]; self.tabBarController.tabBar.items[i].image = [resizedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; self.tabBarController.tabBar.items[i].selectedImage = resizedImage; } self.tabBarController.tabBar.items[i].title = [tabbarItemNameArray objectAtIndex:i]; self.tabBarController.tabBar.unselectedItemTintColor = [UIColor colorWithRed:35/255.0 green:63/255.0 blue:136/255.0 alpha:1.0]; } }); }] resume]; tabbarItemImageArray is Array of NSURL object which contains the image url. I have created UITabbarController programmatically. These are the properties I have used. self.tabBarController = [[UITabBarController alloc] init]; self.tabBarController.delegate = self; self.tabBarController.view.backgroundColor = [UIColor whiteColor]; self.tabBarController.viewControllers = tabbarArray; self.tabBarController.tabBar.backgroundColor = [UIColor whiteColor]; self.tabBarController.tabBar.layer.shadowColor = [UIColor blackColor].CGColor; self.tabBarController.tabBar.layer.shadowOffset = CGSizeMake(0.0, 0.0); self.tabBarController.tabBar.layer.shadowRadius = 5; self.tabBarController.tabBar.layer.shadowOpacity = 0.3; self.tabBarController.tabBar.layer.masksToBounds = NO; self.tabBarController.tabBar.layer.cornerRadius = 30; self.tabB…
tagged with: ios
has comment: http://stackoverflow.com/comment/138137588
tagged with: objective-c
tagged with: uitabbaritem
score: 0
tagged with: nsurlsessiondownloadtask
has answer: http://stackoverflow.com/a/78370156
has comment: http://stackoverflow.com/comment/138139010
type: Question
linked to: http://stackoverflow.com/q/32612760
answer count: 1
type: UnansweredQuestion
has title: UITabbar item image Downloaded from server shows blur but if use same image from assets folder it works fine
has comment: http://stackoverflow.com/comment/138157458

http://stackoverflow.com/comment/138221536
comment on: http://stackoverflow.com/q/78402517
has text: When you access `foo` you are accessing the ivar directly. When you use `[self foo]` or `self.foo` you access the property via the getter. This is why it is a bad idea to use `foo` instead of `self.foo` in Objective-C unless you specifically need to bypass the getter. TLDR: change `foo` to `self.foo` in your objective c code.
type: QuestionComment
score: 2
type: Comment

http://stackoverflow.com/q/78329532
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/78331787
answer count: 1
score: 0
type: Question
has body: I'm just getting started using AVFoundation to capture video from an iPhone's cameras. I've been successful in capturing from either front or back camera individually. However, I've run into trouble when attempting to capture from both simultaneously: bool addDevice(AVCaptureSession *session, bool front) { AVCaptureDevicePosition position = front? AVCaptureDevicePositionFront: AVCaptureDevicePositionBack; AVCaptureDevice *device; AVCaptureDeviceInput *input; NSError *error; device = [AVCaptureDevice defaultDeviceWithDeviceType:AVCaptureDeviceTypeBuiltinWideAngleCamera mediaType:AVMediaTypeVideo position:position]; if ( !device ) { NSLog(@"Cannot create %s device", front? "front" : "back"); return false; } input = [AVCaptureDeviceInput deviceInputWithDevice:device error&error]; if ( !input ) { NSLog(@"Cannot create input for %s device: %@", front? "front" : "back", [error localizedDescription]); return false; } if ( ![session canAddInput:input] ) { NSLog(@"Cannot add input for %s device", front? "front" : "back"); return false; } [session addInput:input]; return true; } AVCaptureSession * startSession() { AVCaptureMultiCamSession *session; session = [AVCaptureMultiCamSession new]; if ( !addDevice(session, true) || !addDevice(session, false) ) { return nil; } // add output [session startRunning]; return session; } The front device is added successfully but [session canAddInput:input] fails for the back device. As I mentioned before, I can take pictures from either device individually. I've tried reversing the order in which I add the cameras and then it's the front camera that can't be added. So, the issue does appear to be adding multiple inputs.
has title: Cannot add multiple inputs to AVCaptureMultiCamSession
has answer: http://stackoverflow.com/a/78331787
tagged with: ios
type: AnsweredQuestion
tagged with: avcapturesession

http://stackoverflow.com/comment/138180169
type: Comment
has text: Post code as text
score: 0
comment on: http://stackoverflow.com/q/78378834
type: QuestionComment

http://stackoverflow.com/comment/138138517
score: 0
has text: Thanks for the reply; I am reviewing where I have preformBlockAndWait.
comment on: http://stackoverflow.com/a/78324740
type: AnswerComment
type: Comment

http://stackoverflow.com/a/78331320
has comment: http://stackoverflow.com/comment/138256402
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/78328208
upvote count: 1
has comment: http://stackoverflow.com/comment/138101244
downvote count: 1
has body: Found the answer. Changed the "Fonts provided by application" key in the .plist file with "UIAppFonts" and the font started to work
answers question: http://stackoverflow.com/q/78328208

http://stackoverflow.com/comment/138273369
score: 0
comment on: http://stackoverflow.com/a/78420434
type: AnswerComment
type: Comment
has text: Thank you. It seems like this is what I was looking for - only it will probably (untested yet) help the "torn off: (detached) window - not the behavior of the standard popover window (before detached). I'm talking about making a text-field editable, and becoming "key" window)

http://stackoverflow.com/q/78309419
has title: Need some clarifications about dispatch_queue_create and RunLoop. Sharing RunLoop between them
linked to: http://stackoverflow.com/q/38000727
has comment: http://stackoverflow.com/comment/138059854
tagged with: grand-central-dispatch
type: Question
linked to: http://stackoverflow.com/q/38030490
upvote count: 1
downvote count: 0
tagged with: cfrunloop
answer count: 1
tagged with: runloop
has answer: http://stackoverflow.com/a/78311318
has body: I'm developing iOS framework with Objective-C. I create a dispatch_queue_t by using dispatch_queue_create. And call CFRunLoopRun() for run the runloop in the queue. But, It looks like the dispatch_queue_t has share the RunLoop. Some classes has add an invalid timer, and when I call the CFRunLoopRun(), It crashed on my side. - (void)viewDidLoad { [super viewDidLoad]; self.queue1 = dispatch_queue_create("com.queue1", DISPATCH_QUEUE_CONCURRENT); self.queue2 = dispatch_queue_create("org.queue2", DISPATCH_QUEUE_CONCURRENT); } - (IBAction)btnButtonAction:(id)sender { dispatch_async(self.queue1, ^{ NSString *runloop = [NSString stringWithFormat:@"%@", CFRunLoopGetCurrent()]; runloop = [runloop substringWithRange:NSMakeRange(0, 22)]; NSLog(@"Queue1 %p run: %@", self.queue1, runloop); //NSTimer *timer = [[NSTimer alloc] initWithFireDate:[NSDate date] interval:1 target:self selector:@selector(wrongSeletor:) userInfo:nil repeats:NO]; //[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; }); dispatch_async(self.queue2, ^{ NSString *runloop = [NSString stringWithFormat:@"%@", CFRunLoopGetCurrent()]; runloop = [runloop substringWithRange:NSMakeRange(0, 22)]; NSLog(@"Queue2 %p run: %@", self.queue2, runloop); CFRunLoopRun(); }); } Some time they take same RunLoop: https://i.sstatic.net/wGcv3.png ===== You can see the crash by uncomment the code of NSTimer. The NSTimer has been added in queue1, but it still running when call CFRunLoopRun() in queue2. I have read some description like: need some clarifications about dispatch queue, thread and NSRunLoop They told that: system creates a run loop for the thread. But, in my check, they are sharing the RunLoop. This is sad for me, because I facing that crashes happen when calling CFRunLoopRun() on production.
score: 1
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/138060609
tagged with: objective-c
tagged with: nsrunloop
has comment: http://stackoverflow.com/comment/138061483
accepted answer: http://stackoverflow.com/a/78311318

http://stackoverflow.com/q/78313766
linked to: http://stackoverflow.com/q/28806423
type: Question
tagged with: swift
type: UnansweredQuestion
tagged with: lldb
has comment: http://stackoverflow.com/comment/138066879
has comment: http://stackoverflow.com/comment/138074701
tagged with: objective-c
has body: I added a Swift file to an old OC project and called the Swift method in the OC file. During the debugging process, I found that the po command of lldb could not print the contents of the NSDictionary and could only tell me how many files there were elements， As you can see from the console, the print method in the code is not affected. enter image description here and the e command also reported a generic error enter image description here But when the same object is returned to the OC file, the po command of lldb can print out the content, and the e command will not report an error. enter image description here Then I created a new OC project, integrated all third-party libraries of the old project, and performed the same operation, and found that this problem did not occur. enter image description here Has anyone encountered the same problem? I hope someone can help solve it.
answer count: 0
tagged with: xcode
score: 0
has title: Swift lldb cannot print NSDictionary and NSArray
has comment: http://stackoverflow.com/comment/138066166

http://stackoverflow.com/q/78328208
has comment: http://stackoverflow.com/comment/138096082
has body: I'm trying to add a custom font to my app but it doesn't appear when the app is running: Added the files to the project Checked the font is within the Target Membership Added the fonts to the app plist under the "Fonts provided by application": Checked the fonts are within the Target/ Build Phases/ Copy Bundle Resources: Installed the fonts in the Font Book After that, when I run the app: for (NSString* family in [UIFont familyNames]) { NSLog(@"FONT FAMILY: %@", family); for (NSString* name in [UIFont fontNamesForFamilyName: family]) { NSLog(@"FONT: %@", name); } } All fonts except the JetBrains ones are available. What am I missing?
has comment: http://stackoverflow.com/comment/138092185
accepted answer: http://stackoverflow.com/a/78331320
tagged with: ios
type: AnsweredQuestion
tagged with: fonts
has title: Custom Font (.ttf) added to project not available within app
tagged with: objective-c
upvote count: 1
tagged with: xcode
answer count: 1
has answer: http://stackoverflow.com/a/78331320
favorite count: 0
type: Question
downvote count: 0
score: 1

hook
tags question: http://stackoverflow.com/q/78416750
type: Tag
tag name: hook

http://stackoverflow.com/comment/138129664
type: QuestionComment
has text: Always use `FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask)` don't hard code urls
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78350245

http://stackoverflow.com/comment/140003449
comment on: http://stackoverflow.com/q/78417644
type: QuestionComment
type: Comment
score: 0
has text: My text fields get to become editable, but 1. Command-C won't copy its value, even after "Select All" from the "Edit" menu, Cmd-A will intermittently select text - many times it won't.

http://stackoverflow.com/comment/138142423
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/78356799
type: Comment
has text: Your code doesn't compile, post real code please (probably `[data getBytes:buffer length:10]`). Does `NSFileHandle *handle = […]` crash? I don't see a property in your code.

http://stackoverflow.com/comment/138074701
has text: Please provide enough code so others can better understand or reproduce the problem.
type: Comment
comment on: http://stackoverflow.com/q/78313766
score: 0
type: QuestionComment

cross-platform
type: Tag
tags question: http://stackoverflow.com/q/78435889
tag name: cross-platform
tags question: http://stackoverflow.com/q/78492779

http://stackoverflow.com/comment/138212087
type: QuestionComment
score: 0
has text: @JWWalker: Please answer this question, so i can accept it.
comment on: http://stackoverflow.com/q/78353070
type: Comment

http://stackoverflow.com/q/78353070
score: 0
tagged with: qt
has comment: http://stackoverflow.com/comment/138198193
type: Question
has comment: http://stackoverflow.com/comment/138212087
has comment: http://stackoverflow.com/comment/138201637
has comment: http://stackoverflow.com/comment/138210069
answer count: 1
accepted answer: http://stackoverflow.com/a/78398596
tagged with: macos
has comment: http://stackoverflow.com/comment/138140391
has comment: http://stackoverflow.com/comment/138141745
type: AnsweredQuestion
has title: How to open file with a specific Application Bundle?
has answer: http://stackoverflow.com/a/78398596
tagged with: objective-c
tagged with: cocoa
has comment: http://stackoverflow.com/comment/138137342
has body: I wrote an application in Qt for macOS & Windows. Now we want to communicate with that app from the browser using custom protocols. As it seems not possible to add this to Qt I tried to build a Cocoa helper app that just receives the message created in the browser from macOS using a custom protocol. That so far works and was simple. But I can't manage to get it to open a document in my (separate Qt) application. Trial 1: void launchApplicationBundleWithArguments(NSString *bundleIdentifier, NSString *executablePath, NSArray<NSString *> *arguments) { NSWorkspace *workspace = [NSWorkspace sharedWorkspace]; NSURL *url = [workspace URLForApplicationWithBundleIdentifier:bundleIdentifier]; if (url) { NSError *error = nil; NSDictionary *configuration = @{NSWorkspaceLaunchConfigurationArguments: launchArguments}; if (![workspace launchApplicationAtURL:url options:NSWorkspaceLaunchDefault configuration:configuration error:&error]) { NSLog(@"Error launching application: %@", error); } } else { NSLog(@"Application bundle with identifier %@ not found", bundleIdentifier); } } This launches my application, but won't send the file's path (stored in arguments) to the command line of my main application. No error is reported. Trial 2: NSWorkspaceOpenConfiguration* configuration = [NSWorkspaceOpenConfiguration new]; [configuration setArguments: launchArguments]; [configuration setPromptsUserIfNeeded: YES]; [workspace openApplicationAtURL: [NSURL fileURLWithPath: executablePath] configuration: configuration completionHandler:^(NSRunningApplication* app, NSError* error) { if (error) { NSLog(@"Failed to run the app: %@", error.localizedDescription); } }]; This fails with a message box saying that my helper application does not have sufficient access rights to start the other application. How can this be done?

http://stackoverflow.com/comment/138158228
type: Comment
comment on: http://stackoverflow.com/q/78366079
type: QuestionComment
score: 0
has text: @trojanfoe, I have updated my question which might help you to get clear idea about my requirements

http://stackoverflow.com/comment/138198193
has text: Excuse the delay - i now checked in the Activity Monitor - and the application reports being NOT sand boxed. I can start the application from a terminal with parameters successfully. Any ideas?
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78353070

http://stackoverflow.com/q/78378913
answer count: 0
tagged with: ios
score: 0
tagged with: objective-c
type: Question
tagged with: swift
has body: I am probably missing something as usual. But I am still not sure why it would crash with unrecognized method crash. I have the following snippet: NSObject *obj = [NSObject new]; if (@available(iOS 17.0, *)) { if (obj.isAccessibilityElementBlock != nil) { BOOL flag = obj.isAccessibilityElementBlock(); } } else { NSLog(@"Not ios 17 "); } The crash happens on that line: if (obj.isAccessibilityElementBlock != nil) [NSObject isAccessibilityElementBlock]: unrecognized selector sent to instance the property is defined and exists at least in public header (and in dynamic method list): @property (nullable, nonatomic, copy) AXBoolReturnBlock isAccessibilityElementBlock trying to do similar in swift: let obj: NSObject = NSObject() let fun = obj.isAccessibilityElementBlock() I get a compile error: Static member 'isAccessibilityElementBlock' cannot be used on instance of type 'NSObject' BUT its not static, (a little bit strange error) So my question is appropriate behaviour? and what will be the correct way to use those api?
has title: Usage of Accessibility blocks in iOS 17 (isAccessibilityElementBlock)
type: UnansweredQuestion

http://stackoverflow.com/a/78324740
has comment: http://stackoverflow.com/comment/138275432
has body: performBlockAndWait is an easy source of deadlocks. Many deadlocks are timing-sensitive, so if you add breakpoints, you can completely change the timing and create or avoid deadlocks that may happen in other cases. Even so, the race conditions exist and must be addressed. Your stack trace will show you exactly how this is happening, so start there. It is critical that anything in a performBlockAndWait be very simple and not itself rely on any other blocking operations that might re-enter. If your peformBlockAndWait calls any non-trivial method, you need to explore whether that method could also block. Ideally, you should entirely avoid performBlockAndWait and use the simpler perform instead.
score: 2
downvote count: 0
upvote count: 2
accepted answer of: http://stackoverflow.com/q/78324556
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/78324556
type: Answer
has comment: http://stackoverflow.com/comment/138138517

http://stackoverflow.com/comment/138277357
score: 1
type: QuestionComment
type: Comment
has text: I tried your code and the text field is editable.
comment on: http://stackoverflow.com/q/78417644

http://stackoverflow.com/a/78360039
downvote count: 1
has comment: http://stackoverflow.com/comment/138149671
upvote count: 0
answers question: http://stackoverflow.com/q/78356910
has comment: http://stackoverflow.com/comment/138148567
type: Answer
has body: The following source code creates a C function called MyLog(). You would need to include this function inline in your project and call it just like you would NSLog(), ie MyLog(@"Some text."); . Multiple strings from this function are then written to your log file by adding an NSMutableArray. NSMutableArray *strings; // At the top of your app void MyLog( NSString *formatString, ... ) { va_list ap; va_start( ap, formatString ); NSString *format = [[NSString alloc] initWithFormat:@"%@\n", formatString]; NSString *string = [[NSString alloc] initWithFormat:format arguments:ap]; [strings addObject:string]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *logPath = [documentsDirectory stringByAppendingPathComponent:@"mylog.txt"]; NSString *arrayStr = [strings componentsJoinedByString:@""]; NSData* data = [arrayStr dataUsingEncoding:NSUTF8StringEncoding]; [[NSFileManager defaultManager] createFileAtPath:logPath contents:data attributes:nil]; va_end( ap ); } Initialize the function with 'strings = [NSMutableArray array];' called at the beginning of your app // eg in AppDelegate's -applicationDidFinishLaunching: method Alternative method to remove 'logPath' code from logging function: NSMutableArray *strings; NSString *logPath; // At the top of your app void MyLog( NSString *formatString, ... ) { va_list ap; va_start( ap, formatString ); NSString *format = [[NSString alloc] initWithFormat:@"%@\n", formatString]; NSString *string = [[NSString alloc] initWithFormat:format arguments:ap]; [strings addObject:string]; NSString *arrayStr = [strings componentsJoinedByString:@""]; NSData* data = [arrayStr dataUsingEncoding:NSUTF8StringEncoding]; [[NSFileManager defaultManager] createFileAtPath:logPath contents:data attributes:nil]; va_end( ap ); } Use AppDelegate's method -applicationDidFinishLaunching to initialize NSMutableArray and obtain the logPath: - (void) applicat…
score: -1

http://stackoverflow.com/a/78398596
accepted answer of: http://stackoverflow.com/q/78353070
answers question: http://stackoverflow.com/q/78353070
has body: According to the documentation of the arguments property of the NSWorkspaceOpenConfiguration class, a sandboxed app cannot pass arguments to another app that it is launching. So make sure that your helper application is not sandboxed.
downvote count: 0
upvote count: 1
score: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/138118860
type: Comment
score: 1
comment on: http://stackoverflow.com/q/78333515
has text: Objective-C enums can't have functions or computed properties. This might be the reason behind the crash. The best option would be to pass the raw value through the `userInfo` and convert it to an enum value on the recipient side, which you have already done.
type: QuestionComment

http://stackoverflow.com/comment/138266221
comment on: http://stackoverflow.com/q/78426105
type: QuestionComment
type: Comment
score: 0
has text: Does `CFRunLoopGetMain` work before `CFRunLoopRun`?

http://stackoverflow.com/q/78402517
has title: How to access Objective-C @property with name instead of self.name?
has answer: http://stackoverflow.com/a/78402733
has body: TL;DR What was the correct way to access an Objective-C @property (...) foo as foo instead of self.foo? Details: One of my iOS projects still uses some Objective-C code I have written several years ago. // SomeObject.h @interface SomeObject : NSObject @property (nonatomic, readonly) NSString *foo; @end // SomeObject.m @implementation SomeObject { ... } @synthesize foo; - (void)someMethod { foo = @"bar"; } - (void)otherMethod { NSLog(@"Foo: %@", foo); // ---> "bar" } @end This works fine as intended. Now I would like to use a getter to access some new Swift code instead of setting foo manually: // SomeObject.m @implementation SomeObject { ... } @synthesize foo; - (NSString *)foo { return [SwiftObject getFoo]; } - (void)otherMethod { NSLog(@"Foo: %@", foo); // ---> nil NSLog(@"Foo: %@", self.foo); // ---> "swiftBar" } @end So, using the getter only works correct when using self.foo instead of just foo. This is not a big problem but it would require to replaces all usage of foo with self.foo in the existing code. Is there a clean way to avoid this, use the foo getter and still use foo instead of self.foo?
type: Question
has comment: http://stackoverflow.com/comment/138229376
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/78402733
has comment: http://stackoverflow.com/comment/138229364
upvote count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/138221536
type: AnsweredQuestion
score: 1
answer count: 1

http://stackoverflow.com/comment/138259001
type: Comment
has text: Sorry about that, @DonMag. Yes, `ProgressBarView` is already visible by the super view. This code is being called after initializing the views in `initWithFrame` of `ProgressBarView`. I've managed to fix the issue by calling `[self setNeedsLayout]` after calling `[self layoutIfNeeded]`.
comment on: http://stackoverflow.com/q/78412848
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138144610
comment on: http://stackoverflow.com/a/78356963
type: AnswerComment
has text: I recompiled the code and now free suddenly works like it should, I looked in Instruments and it makes a clear difference, the memory immediately drops to almost 0 when I free everything up as soon as it's not necessary anymore. I don't know why Xcode describes it as being a thing for IOAudioPort since it works for everything. Apple's documentation says 10.13 and higher but it works fine for me and I wouldn't know why some C functions aren't available in Objective-C. I'm finally starting to understand the stack and heap a bit more. Thanks a lot for the help!
type: Comment
score: 0

http://stackoverflow.com/q/78378834
tagged with: sfspeechrecognizer
answer count: 0
has comment: http://stackoverflow.com/comment/138180169
tagged with: ios
has comment: http://stackoverflow.com/comment/138180586
tagged with: objective-c
score: 0
tagged with: voice-to-text
type: Question
has body: I uploaded a 2-minute audio file, and the transcript results began after half of the audio was processed. However, the result.formattedString started a new string instead of appending to the already transcribed text. This issue occur only onDeviceTranscript, How to fix it? NSLocale *locale =[[NSLocale alloc] initWithLocaleIdentifier:[[NSLocale preferredLanguages] firstObject]]; SFSpeechRecognizer* recognizer = [[SFSpeechRecognizer alloc] initWithLocale:locale]; SFSpeechURLRecognitionRequest* request = [[SFSpeechURLRecognitionRequest alloc] initWithURL:[NSURL fileURLWithPath:filePath]]; if(device){ request.requiresOnDeviceRecognition = YES; } [recognizer recognitionTaskWithRequest:request resultHandler:^(SFSpeechRecognitionResult * _Nullable result, NSError * _Nullable error) { if (error) { convertedString(textString); } else { textString = [[result bestTranscription] formattedString]; } if (result.isFinal) { convertedString([[result bestTranscription] formattedString]); } }];
type: UnansweredQuestion
has title: In objective-c SFSpeechRecognizer resultHandler is not work properly when request type is OnDeviceTranscript?

voice-to-text
tags question: http://stackoverflow.com/q/78378834
type: Tag
tag name: voice-to-text

http://stackoverflow.com/comment/138143962
has text: In C you can have variable length arrays on the stack, where the length is determined by a variable. Keep in mind, though, that stack space is limited, so ensure that variable is relatively small.
comment on: http://stackoverflow.com/a/78356963
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/comment/138158013
score: 0
type: QuestionComment
has text: The SDK is developed in Objective-C. I am using Swift in which I want the logs of SDK. I hope I make my self clear.
type: Comment
comment on: http://stackoverflow.com/q/78366079

http://stackoverflow.com/comment/138092185
has text: Double-check everything... I just downloaded the JetBrains fonts, added them to my project - https://i.sstatic.net/VStT4.png - defined them in "Fonts provided by application" - https://i.sstatic.net/r1bzc.png - and no problems - https://i.sstatic.net/vbe6v.png ---- As a side note - no need to install the fonts in Font Book.
comment on: http://stackoverflow.com/q/78328208
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138275432
comment on: http://stackoverflow.com/a/78324740
type: AnswerComment
score: 1
type: Comment
has text: After careful review and corrections, my problem appears to be resolved! Thanks!

http://stackoverflow.com/q/78383595
favorite count: 0
tagged with: uikit
has title: Circular progress bar in iOS with alpha long progress
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/78383889
tagged with: objective-c
has answer: http://stackoverflow.com/a/78383889
tagged with: ios
downvote count: 2
score: -1
type: Question
tagged with: swift
upvote count: 1
answer count: 1
has body: There are some ways for creating a circular progress bar in iOS (Example). But I'd like to achieve an effect where the head of the progressbar is rounded and the progress alpha fades along the way. Something like this: Any ideas how can achieve this kind of effects?

http://stackoverflow.com/q/78356799
has comment: http://stackoverflow.com/comment/138145110
accepted answer: http://stackoverflow.com/a/78356963
has answer: http://stackoverflow.com/a/78356963
type: AnsweredQuestion
has title: Objective-C char array initialization causes EXC_BAD_ACCESS when accessing property
tagged with: objective-c
tagged with: malloc
has comment: http://stackoverflow.com/comment/138144898
answer count: 1
has comment: http://stackoverflow.com/comment/138143641
score: 0
has body: I was getting an error EXC_BAD_ACCESS for seemingly no reason. After a lot of debugging I found the problem but I have no idea why it occurs. Here's some examples of when it happens: MyObject.h @interface MyFile : NSObject @property (strong) NSFileHandle *handle; @end @interface MyClass : NSObject { int bufferSize; NSMutableArray *files; } - (void)readFile1; - (void)readFile2; - (void)readFile3; - (void)readFile4; @end MyObject.m @implementation MyObject - (id)init { bufferSize = 200000000; // Initialize files array, add a file object and open the file handle. } - (void)readFile1 { UInt64 bytesToProcess; file = [files objectAtIndex:0]; char *buffer = malloc(bufferSize); do @autoreleasepool { NSFileHandle *handle = [file handle]; bytesToProcess = [data = [handle readDataOfLength:bufferSize] length]; [data getBytes:buffer length:bytesToProcess]; // This works fine. // Modify the buffer. } while (bytesToProcess); } - (void)readFile2 { UInt64 bytesToProcess; file = [files objectAtIndex:0]; char buffer[bufferSize]; do @autoreleasepool { NSFileHandle *handle = [file handle]; // This throws EXC_BAD_ACCESS. bytesToProcess = [data = [handle readDataOfLength:bufferSize] length]; [data getBytes:buffer length:bytesToProcess]; // Modify the buffer. } while (bytesToProcess); } - (void)readFile3 { UInt64 bytesToProcess; file = [files objectAtIndex:0]; char buffer[10]; do @autoreleasepool { NSFileHandle *handle = [file handle]; bytesToProcess = [data = [handle readDataOfLength:10] length]; [data getBytes:buffer length:bytesToProcess]; // This works fine. // Modify the buffer. } while (bytesToProcess); } - (void)readFile4 { UInt64 bytesToProcess; file = [files objectAtIndex:0]; do @autoreleasepool { NSFileHandle *handle = [file handle]; bytesToProcess = [data = [handle readDataOfLength:bufferSize] length]; char buffer[bufferSize]; [data getBytes:buffer length:bytesToProcess]; // This throws EXC_BAD_ACCESS. // Modify the buffer. } while (bytesToProcess); } @end I don't understand why…
tagged with: arrays
type: Question
tagged with: memory
has comment: http://stackoverflow.com/comment/138142423

http://stackoverflow.com/q/78317060
type: Question
linked to: http://stackoverflow.com/q/29938938
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/43463996
answer count: 0
tagged with: ip-address
has comment: http://stackoverflow.com/comment/138136225
linked to: http://stackoverflow.com/q/65700070
tagged with: ios
has body: I've been looking through questions and solutions to my problem (getting hostnames from a set of IPs on iOS) for a few days. Only three IP resolution methods seem to be listed for anyone, and neither worked for me, for different reasons. Method 1: using NSHost [[NSHost currentHost] names] Problem with method 1: NSHost is NOT useable on iOS - only macOS Method 2: using POSIX getaddrinfo +(NSString *)getHostFromIPAddress:(NSString*)ipAddress { struct addrinfo *result = NULL; struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_NUMERICHOST; hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; int error; struct addrinfo *results = NULL; error = getaddrinfo([ipAddress cStringUsingEncoding:NSASCIIStringEncoding], NULL, NULL, &results); if (error != 0) { NSLog (@"Could not get any info for the address"); return @""; // or exit(1); } NSString *resString = @""; for (struct addrinfo *r = results; r; r = r->ai_next) { char hostname[NI_MAXHOST] = {0}; error = getnameinfo(r->ai_addr, r->ai_addrlen, hostname, sizeof hostname, NULL, 0 , 0); if (error != 0) { continue; // try next one } else { NSLog (@"Found hostname: %s", hostname); return [NSString stringWithUTF8String:hostname];; break; } } freeaddrinfo(results); return @""; } @end Problem with method 2: instead of hostnames, it returns the same IP address it was given. Method 3: using CFHostRef (the most popular method) +(NSString *)getHostFromIPAddress:(NSString*)ipAddress { struct addrinfo *result = NULL; struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_NUMERICHOST; hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; int errorStatus = getaddrinfo([ipAddress cStringUsingEncoding:NSASCIIStringEncoding], NULL, &hints, &result); if (errorStatus != 0) { return nil; } CFDataRef addressRef = CFDataCreate(NULL, (UInt8 *)result->ai_addr, result->ai_addrlen); if (addressRef == nil) { return nil; } freeaddrinfo(result); C…
has comment: http://stackoverflow.com/comment/138073487
tagged with: objective-c
tagged with: network-programming
has title: Getting hostname from IP (on LAN) programmatically. Tried three methods, neither worked
score: 0
has comment: http://stackoverflow.com/comment/138100911
has comment: http://stackoverflow.com/comment/138073444
has comment: http://stackoverflow.com/comment/138100928

http://stackoverflow.com/q/78333515
has comment: http://stackoverflow.com/comment/138118860
has comment: http://stackoverflow.com/comment/138107768
score: 0
type: Question
has comment: http://stackoverflow.com/comment/138100588
tagged with: swift
tagged with: bridging-header
type: UnansweredQuestion
answer count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/138099861
has body: I'm facing an issue that occurs on iOS 14.6, when trying to pass an @objc enum ConnectState to dictionary value, the app will crash with malloc error: AppName(645,0x16f61f000) malloc: can't allocate region :*** mach_vm_map(size=1152921504606863360, flags: 100) failed (error code=3) AppName(645,0x16f61f000) malloc: *** set a breakpoint in malloc_error_break to debug @objc enum ConnectState: UInt8 { case connected = 0x00 case disConnected = 0x01 var description: String { switch self { case .connected: return "connected" case .disConnected: return "disConnected" } } } struct ConstValue { static let connectState = "connectState" } I set a malloc_error_break breakpoint, and it stopped at userInfo[ConstValue.connectState] = connectState.rawValue, func connectStateChange(_ connectState: ConnectState, _ serialNumber: String) { var userInfo: [String: Any] = [:] //ConstValue.connectState is a string declared in ConstValue struct userInfo[ConstValue.connectState] = connectState.rawValue//breakPoint userInfo[ConstValue.serialNumber] = serialNumber NotificationCenter.default.post(name: Notification.Name(Global.HomeDeviceStateChange), object: nil, userInfo: userInfo) } I also tried to init a ConstValue enum by it's rawValue and pass it to userInfo's value, sadly didn't workout. guard let connectStateItem = ConnectState(rawValue: connectState.rawValue) else { uniLogger.error(TAG, "\(#function) Error, Failed to init a ConnectState item from it's rawValue: \(connectState.rawValue)") return } userInfo[ConstValue.connectState] = connectStateItem userInfo[ConstValue.serialNumber] = serialNumber If I simply pass the parameter to notification's userInfo would work fine, but I need post both serialNumber and ConnectState, and why would this work? func connectStateChange(_ connectState: ConnectState, _ serialNumber: String) { NotificationCenter.default.post(name: Notification.Name(Global.HomeDeviceStateChange), object: nil, userInfo: [ConstValue.connectState:connectState]) }
tagged with: enums
has title: Passing an @objc enum to dictionary value will causes an allocate issue?
tagged with: objective-c

http://stackoverflow.com/q/78373313
has answer: http://stackoverflow.com/a/78373484
tagged with: objective-c
score: 0
tagged with: iphone-privateapi
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/138177407
has body: I can call a private API's method by getClassFromString: and performSelector: in Objective-C, or use the Dynamic library to call them easily in Swift. However, I can't set a delegate for a private API because I can't get a protocol dynamically and make a class conform it. I've tried to copy the procotol's define and make a class conform it, then used [/*id*/ performSelector:NSSelectorFromString(@"setDelegate") withObject:[[MyDelegate alloc] init]]; in Objective-C. But it seems no effect.
answer count: 1
has title: How to set delegate for a private API in Swift or Objective-C?
accepted answer: http://stackoverflow.com/a/78373484
tagged with: ios
type: AnsweredQuestion

http://stackoverflow.com/a/78328105
score: 0
has body: It turns out I need to transform TrackID ranther than cast it to int directly - (void)startVideoCompositionRequest:(AVAsynchronousVideoCompositionRequest *)request { // Extract source pixel buffer NSArray *sourceTrackIDs = request.sourceTrackIDs; if (sourceTrackIDs.count == 0) { NSLog(@"No source track IDs found in the request"); return; } CMPersistentTrackID trackID = [sourceTrackIDs[0] intValue]; // Assuming only one track ID is provided CVPixelBufferRef sourcePixelBuffer = [request sourceFrameByTrackID: trackID]; if (!sourcePixelBuffer) { NSLog(@"Failed to extract source pixel buffer for track ID: %d", trackID); return; } [request finishWithComposedVideoFrame:sourcePixelBuffer];
type: Answer
answers question: http://stackoverflow.com/q/78323748

http://stackoverflow.com/comment/138201637
has text: There are two applications here, the one being launched and the one doing the launching. Which one are you saying is not sandboxed?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78353070
type: Comment

http://stackoverflow.com/comment/138066879
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78313766
has text: Yes, `po` doesn't work in Swift. See [What's the difference between "p" and "po" in Xcode's LLDB debugger?](https://stackoverflow.com/questions/28806423/whats-the-difference-between-p-and-po-in-xcodes-lldb-debugger).

http://stackoverflow.com/comment/138144516
has text: thanks for the information, it's probably indeed be the size that's causing problems on the stack. I don't think free exists in Objective-C for SDK versions for Mac OS older than 10.13 High Sierra. I can't find any information on how to use free in Objective-C for an SDK older than that. There has to be another way to free the memory, if I run my application in instruments I see a lot of memory kept by malloc that doesn't appear to be freed after the function finishes and only goes away when the application restarts. ARC doesn't see the malloc stuff and I can't use standard C functions.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78356963

http://stackoverflow.com/comment/138066166
type: Comment
comment on: http://stackoverflow.com/q/78313766
score: 1
has text: Post code and errors as text and avoid using homemade abbreviations.
type: QuestionComment

http://stackoverflow.com/comment/138148069
type: QuestionComment
comment on: http://stackoverflow.com/q/78360107
has text: What's inside/outside the auto-release pool loop? Post a [mre] please.
score: 0
type: Comment

http://stackoverflow.com/a/78351330
upvote count: 1
score: 1
has body: The problem is not Swift vs Objective-C. Try the two from within a same app and you will receive the folder. The problem is app vs widget, each of which has a unique, separate sandbox. You can use an “app group” if you want the app and widget access a shared container. See Configuring App Groups for information about adding the app group capability in Xcode. You access this container with containerURLForSecurityApplicationGroupIdentifier: from Objective-C: NSURL *baseUrl = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:@"group.com.domain.foo"]; And from Swift, use containerURL(forSecurityApplicationGroupIdentifier:): guard let baseUrl = FileManager.default .containerURL(forSecurityApplicationGroupIdentifier: "group.com.domain.foo") else { fatalError("app group container not found") }
has comment: http://stackoverflow.com/comment/138136693
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/138136549
answers question: http://stackoverflow.com/q/78350245
downvote count: 0
accepted answer of: http://stackoverflow.com/q/78350245

http://stackoverflow.com/comment/138273375
type: Comment
score: 0
has text: Of course not... Debugger doesn't have such output. This is an "Objective-C"-like definition of inheritance. What I do in debugger is "po [popoverWindow super] to know it's superclass, and it outputs NSPanel class. Then - in the headers of Cocoa NSPanel publicly inherits NSWindow
type: QuestionComment
comment on: http://stackoverflow.com/q/78417644

uikeyboard
tag name: uikeyboard
tags question: http://stackoverflow.com/q/78373566
type: Tag

http://stackoverflow.com/comment/138156933
has text: I tried your code and I don't see any memory issues. Do you have any diagnostic tools enabled like zombies? What "activity monitor" do you mean, where is the pie chart? What is your macOS version and hardware?
comment on: http://stackoverflow.com/q/78360107
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/138059854
comment on: http://stackoverflow.com/q/78309419
type: QuestionComment
has text: Use `dispatch_source` for creating timers. Forget about `NSTimer`
score: 0
type: Comment

http://stackoverflow.com/comment/138149671
comment on: http://stackoverflow.com/a/78360039
type: AnswerComment
has text: @trojanfoe Thank you for your comments. The format string is merely to add a line feed so that the entries don't run together; each is on a separate line. I will edit the answer to add an NSMutableArray so that it will trap multiple entries. I couldn't tell from the initial post how many strings were involved.
type: Comment
score: 0

http://stackoverflow.com/a/78402733
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has body: TL;DR What was the correct was to access a Objective-C @property (...) foo as foo instead of self.foo? It's not possible to access an Objective-C property using a bare name, without a target (i.e., without self.) — this is because @property is a shorthand for generating getter + setter methods on a type, and method calls always require an object to be called on. Instead, your first snippet of code works for an unrelated reason: By default, declaring a bare @property without a corresponding @synthesize directive will generate an instance variable for you to store the actual value in the property. In the case of a property like foo, the default generated ivar will be _foo However, you can provide your own name for the variable with an explicit @synthesize directive, and when you do that, you can access the ivar with any name that you want: Leaving out the @synthesize directive is equivalent to @synthesize foo=_foo; (i.e., map the foo property to a _foo ivar) @synthesize foo; on its own is equivalent to @synthesize foo=foo; (i.e., map the foo property to a foo ivar) @synthesize foo=bar; maps the foo property to a bar ivar It happens to be that in Objective-C classes, ivars are accessed by their bare name directly — in the case of your SomeObject class, writing foo refers to the ivar itself, not to the property. In your original code, because the foo property is actually using the foo ivar (because you're not implementing the foo method yourself), foo and self.foo happen to return the same value In your updated code, you explicitly synthesize a foo ivar with the @synthesize directive, but then provide your own implementation for the foo getter, which is what's called when you write self.foo. Because the foo ivar is never set, it gets a nil value by default In other words, you can't avoid writing self.foo when referring to properties, and in general, it's recommended you avoid @synthesize foo; in order to avoid possible mixups when accessing the method vs. the ivar direc…
accepted answer of: http://stackoverflow.com/q/78402517
answers question: http://stackoverflow.com/q/78402517
upvote count: 2
has comment: http://stackoverflow.com/comment/138223703

http://stackoverflow.com/a/78373484
accepted answer of: http://stackoverflow.com/q/78373313
has body: Objective-C doesn't really care if the object that gets set as delegate actually conforms to the protocol. If it doesn't, there will be a run-time crash, but as long as your class implements the protocol methods correctly, you can assign it as a delegate. What is most likely happening with your code is that the private class' delegate is declared weak and since nothing else is retaining it, it is immediately deallocated. If you keep a strong reference to MyDelegate, then assign that to the private class, it will likely work.
answers question: http://stackoverflow.com/q/78373313
score: 2
downvote count: 0
type: AcceptedAnswer
upvote count: 2
type: Answer

malloc
tags question: http://stackoverflow.com/q/78360107
tags question: http://stackoverflow.com/q/78356799
type: Tag
tag name: malloc

http://stackoverflow.com/comment/138157458
type: Comment
has text: @Rob Thank you for your consideration. I have added an image in question which I have downloaded from API url. I have used same image in assets folder. I have added 50x50 image in 1x, 2x and 3x for testing purpose and run the app. It gives clear icon as you can see attached above screen shot no 2. As you mentioned I have used 50x50 and 75x75 and resize them to smaller size like 25x25 but result is same.
comment on: http://stackoverflow.com/q/78354823
score: 0
type: QuestionComment

http://stackoverflow.com/q/78412848
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138240869
accepted answer: http://stackoverflow.com/a/78423733
has answer: http://stackoverflow.com/a/78423733
upvote count: 0
has comment: http://stackoverflow.com/comment/138259001
score: -1
linked to: http://stackoverflow.com/q/42168704
has title: Missing animation on constraint change using UIKit and Objective-C
downvote count: 1
type: Question
answer count: 1
linked to: http://stackoverflow.com/q/12622424
has body: I have a parent UIView called ProgressBarView. Inside, I've setup a UIView called progressForeground that is responsible for showing the actual percentage of the progress bar. I want progressForeground to animate to its set width constraint. This is how I setup the view: UIView *progressForeground = [[UIView alloc] init]; [self addSubview:progressForeground]; progressForeground.translatesAutoresizingMaskIntoConstraints = NO; [progressForeground.heightAnchor constraintEqualToConstant:frame.size.height].active = YES; progressForeground.backgroundColor = [UIColor colorWithWhite:1.0 alpha:1.0]; [progressForeground.leadingAnchor constraintEqualToAnchor:progressBackground.leadingAnchor].active = YES; [progressForeground.centerYAnchor constraintEqualToAnchor:progressBackground.centerYAnchor].active = YES; progressForeground.layer.cornerRadius = 5; After I've setup the neccessary constraint, I've added a width constraint and changed its value inside an animation block like so: NSLayoutConstraint *progressForegroundWidthConstraint = [NSLayoutConstraint constraintWithItem:progressForeground attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0 ]; progressForegroundWidthConstraint.active = YES; [self layoutIfNeeded]; [UIView animateWithDuration:5 animations:^{ progressForegroundWidthConstraint.constant = 60; [self layoutIfNeeded]; } ]; As it was mentioned here, I've made sure to call layoutIfNeeded method on the parent view to flush any pending animations. I expect the width of the progressForegroundView to change with an animation, however it just directly jumps to the value of 60 without any animation. What's wrong here? I've tried to animate the progressForegroundView, however it only jumped to the designated value without any animation
has comment: http://stackoverflow.com/comment/138252044
favorite count: 0
tagged with: uikit
type: AnsweredQuestion

http://stackoverflow.com/comment/138141745
score: 0
type: QuestionComment
has text: Usually you would know whether it is sandboxed because you set that option when you built the app. But it is also possible to show a column in the Activity Monitor utility to see which running apps are sandboxed.
comment on: http://stackoverflow.com/q/78353070
type: Comment

http://stackoverflow.com/q/78416750
has body: I am trying to hook a function called addition. The implementation looks something like this: NSNumber *addition(NSNumber *num1, NSNumber *num2) { double result = [num1 doubleValue] + [num2 doubleValue]; return @(result); } Reading the theos documentation here, I have written a theos tweak as follows: #import <UIKit/UIKit.h> NSInteger addition(NSInteger num1, NSInteger num2); %hookf(NSInteger, addition, NSInteger num1, NSInteger num2) { return 99; } However, it results in this error: ==> Linking tweak objchooker (armv7)… ld: warning: -multiply_defined is obsolete Undefined symbols for architecture armv7: "_addition", referenced from: __logosLocalInit in Tweak.x.f54e192c.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: *** [/Users/hnin.sin/Desktop/objchooker/.theos/obj/debug/armv7/objchooker.dylib] Error 1 make[2]: *** [/Users/hnin.sin/Desktop/objchooker/.theos/obj/debug/armv7/objchooker.dylib] Error 2 make[1]: *** [internal-library-all_] Error 2 make: *** [objchooker.all.tweak.variables] Error 2 %hook and %hookf both works on my swift test app but only %hook works on this objective-c app. Am I doing something wrongly for %hookf or does %hookf not work in objective-c apps?
has answer: http://stackoverflow.com/a/78671487
score: 0
accepted answer: http://stackoverflow.com/a/78671487
type: Question
tagged with: hook
has title: How to use theos %hookf to hook an objective-c function in an iOS app?
answer count: 2
has answer: http://stackoverflow.com/a/78617722
tagged with: theos
tagged with: ios
possible better answer: http://stackoverflow.com/a/78617722
type: AnsweredQuestion
tagged with: objective-c

http://stackoverflow.com/comment/138099861
has text: Cannot reproduce. Please show a [mcve].
comment on: http://stackoverflow.com/q/78333515
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/138137588
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78354823
has text: What size is the blurry image? Maybe it's a tiny image and it's blurry because it's being scaled bigger.

http://stackoverflow.com/comment/138100911
has text: @Paulw11 thank you. is it possible to do this indirectly? to read the whole hostname-to-ip table for the local network, then reverse and use it? And I am already reading mDNS advertisements, but they still don't give hostnames for most devices on LAN
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78317060
type: Comment

http://stackoverflow.com/q/78323748
tagged with: ios
score: 0
has body: I tried to write a IOS app to understand how customVideoCompositorClass works. However after my code, I got a black video with correct sound. sourcePixelBuffer is always nil. Where did I miss? My video source: MPEG-4 AAC、H.264 My code: #import <AVFoundation/AVFoundation.h> #import "AAPLViewController.h" @implementation CustomVideoCompositor - (nullable id<AVVideoCompositionInstruction>)requiredSourceTrackIDsForFrame:(CMTime)frameTime { return nil; } - (NSArray<AVVideoCompositionInstruction *> *)requiredPixelBufferAttributesForRenderContext { return nil; } - (void)startVideoCompositionRequest:(AVAsynchronousVideoCompositionRequest *)request { // Extract source pixel buffer NSArray *a = request.sourceTrackIDs; CVPixelBufferRef sourcePixelBuffer = [request sourceFrameByTrackID: (int)a[0]]; [request finishWithComposedVideoFrame:sourcePixelBuffer]; } - (NSDictionary *)sourcePixelBufferAttributes { return @{ (id)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA) }; } - (void)renderContextChanged:(AVVideoCompositionRenderContext *)newRenderContext { } @end - (void)viewDidLoad { [super viewDidLoad]; NSURL *url = [[NSBundle mainBundle] URLForResource:@"1" withExtension:@"mov"]; AVAsset *asset = [AVAsset assetWithURL:url]; AVMutableVideoComposition *videoComposition = [AVMutableVideoComposition videoCompositionWithPropertiesOfAsset:asset]; videoComposition.customVideoCompositorClass = [CustomVideoCompositor class]; AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:asset]; playerItem.videoComposition = videoComposition; AVPlayer *player = [AVPlayer playerWithPlayerItem:playerItem]; AVPlayerViewController *controller = [[AVPlayerViewController alloc] init]; self.playerViewController = controller; CGSize videoSize = [[[asset tracksWithMediaType:AVMediaTypeVideo] firstObject] naturalSize]; [self addChildViewController:controller]; [self.view addSubview:controller.view]; controller.view.frame = CGRectMake(-70, 270, videoSize.width * SCALE, videoSize.height *…
tagged with: objective-c
tagged with: avfoundation
type: Question
answer count: 1
has title: HelloWorld of "customVideoCompositorClass" but get black video
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/78328105

http://stackoverflow.com/comment/138157988
type: Comment
has text: They use `LogDebug` in Swift code? I don't see how.
comment on: http://stackoverflow.com/q/78366079
type: QuestionComment
score: 0

http://stackoverflow.com/comment/138136225
score: 0
comment on: http://stackoverflow.com/q/78317060
type: QuestionComment
has text: @Paulw11 can you write it as an answer so I can accept it?
type: Comment

http://stackoverflow.com/q/78422435
type: Question
tagged with: swift
answer count: 1
tagged with: method-swizzling
tagged with: swizzle
has title: Swift + Objective C swizzling class_getInstanceMethod is returning nil
tagged with: ios
type: AnsweredQuestion
tagged with: objective-c
has body: I am using AsyndDisplayKit/Texture where: https://github.com/TextureGroup/Texture/blob/923901a1cebf0b6c51627aca2a6748dee84af143/Source/ASTextNode.mm#L934 ASTextNode has this function: + (CGColorRef)_highlightColorForStyle:(ASTextNodeHighlightStyle)style { return [UIColor colorWithWhite:(style == ASTextNodeHighlightStyleLight ? 0.0 : 1.0) alpha:1.0].CGColor; } Unfortunately, it's not exposed. So I am unable to change the highlight color. So I am trying to swizzle it using this: extension ASTextNode { @objc func swizzledHighlightColor() -> CGColor { return UIColor.red.cgColor } static func swizzle() { let originalSelector = NSSelectorFromString("_highlightColorForStyle:") let swizzledSelector = #selector(ASTextNode.swizzledHighlightColor) print("originalSelector: \(originalSelector)") print("swizzledSelector: \(swizzledSelector)") let originalMethod = class_getInstanceMethod(self, originalSelector) let swizzledMethod = class_getInstanceMethod(self, swizzledSelector) print("originalMethod: \(String(describing: originalMethod))") print("swizzledMethod: \(String(describing: swizzledMethod))") if let originalMethod = originalMethod, let swizzledMethod = swizzledMethod { method_exchangeImplementations(originalMethod, swizzledMethod) } } } Here, method_exchangeImplementations fails because the originalMethod gotten by class_getInstanceMethod is returning nil. The output of above is: originalSelector: _highlightColorForStyle: swizzledSelector: swizzledHighlightColor originalMethod: nil swizzledMethod: Optional(0x00000001046b5e09) To debug, I printed this and it does work: let selectorPerformed = ASTextNode.perform(originalSelector) print("selectorPerformed: \(String(describing: selectorPerformed))") prints: selectorPerformed: Optional(Swift.Unmanaged<Swift.AnyObject>(_value: <CGColor 0x30333c8c0> [<CGColorSpace 0x303430120> (kCGColorSpaceICCBased; kCGColorSpaceModelMonochrome; Generic Gray Gamma 2.2 Profile; extended range)] ( 1 1 ))) So, the originalSelector is correct. Why…
score: 0
accepted answer: http://stackoverflow.com/a/78422450
has answer: http://stackoverflow.com/a/78422450

http://stackoverflow.com/a/78422450
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/78422435
has body: Nvm, I figured out the solution. I was mistakenly using class_getInstanceMethod. I needed to use class_getClassMethod instead because it's not a instance method. Here's the working solution: extension ASTextNode { @objc static func swizzledHighlightColor() -> CGColor { return UIColor.red.cgColor } static func swizzle() { let originalSelector = NSSelectorFromString("_highlightColorForStyle:") let swizzledSelector = #selector(ASTextNode.swizzledHighlightColor) print("originalSelector: \(originalSelector)") print("swizzledSelector: \(swizzledSelector)") let originalMethod = class_getClassMethod(self, originalSelector) let swizzledMethod = class_getClassMethod(self, swizzledSelector) print("originalMethod: \(String(describing: originalMethod))") print("swizzledMethod: \(String(describing: swizzledMethod))") if let originalMethod = originalMethod, let swizzledMethod = swizzledMethod { method_exchangeImplementations(originalMethod, swizzledMethod) } let selectorPerformed = ASTextNode.perform(originalSelector) print("selectorPerformed: \(String(describing: selectorPerformed))") } }
accepted answer of: http://stackoverflow.com/q/78422435

http://stackoverflow.com/comment/138612705
score: 0
type: AnswerComment
type: Comment
has text: see this: https://github.com/NightwindDev/Tweak-Tutorial/blob/main/hookf.md
comment on: http://stackoverflow.com/a/78617722

http://stackoverflow.com/comment/138256402
has text: UIAppFonts is the correct key. Xcode can show you English descriptions for known keys when you edit the file (in this case "Fonts provided by application"), but the raw key actually in the file should be UIAppFonts. If you typed in the English description as the raw key, then it won't work. If there was an accidental space or something in the key, it won't work either.
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/78331320

http://stackoverflow.com/comment/138157969
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78366079
has text: @trojanfoe, this code is from SDK. And I want to get the logs which they use to print using "LogDebug". I don't want to change any code from SDK.
type: Comment

http://stackoverflow.com/comment/138158257
type: Comment
comment on: http://stackoverflow.com/q/78366079
has text: OK so my understanding is that Xcode 15 no longer redirects `stderr` to its debug console; instead it gets the entries from the system log. So you are best to use `os_log` to write your log messages and ignore those macros.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/138145110
score: 0
type: QuestionComment
type: Comment
has text: A few orders of magnitude to consider what you should allocate on the stack vs heap: IIRC, the stack size is 1mb in iOS, and defaults to 8mb in macOS (though it can be overridden by linker options). Generally, I would shy away from stack allocations in excess of a kb or two except in the most extraordinary cases.
comment on: http://stackoverflow.com/q/78356799

http://stackoverflow.com/comment/138144386
score: 0
has text: I've seen that code used in answers up to 2020 or so. So, do you know of any other way of redirecting NSLog to a file I designate on the phone?
type: QuestionComment
comment on: http://stackoverflow.com/q/78356910
type: Comment

http://stackoverflow.com/comment/138061515
has text: Thanks, Rob. I will use it for the timer.
score: 0
comment on: http://stackoverflow.com/a/78311318
type: AnswerComment
type: Comment

http://stackoverflow.com/a/78383889
has body: One approach is to mask a CAGradientLayer with a CAShapeLayer. The shape layer should have an arc as its path, and a lineCap of .round. class FadingProgressView: UIView { let shapeLayer = CAShapeLayer() let gradientLayer = CAGradientLayer() override init(frame: CGRect) { super.init(frame: frame) backgroundColor = .clear layer.addSublayer(gradientLayer) gradientLayer.mask = shapeLayer gradientLayer.colors = [UIColor.blue.cgColor, UIColor.white.cgColor, UIColor.white.cgColor] gradientLayer.type = .conic gradientLayer.startPoint = CGPoint(x: 0.5, y: 0.5) gradientLayer.endPoint = CGPoint(x: 0.4, y: 0) gradientLayer.locations = [0, 0.75, 1] gradientLayer.backgroundColor = UIColor.clear.cgColor shapeLayer.fillColor = nil shapeLayer.strokeColor = CGColor(gray: 0, alpha: 1) shapeLayer.lineWidth = 5 shapeLayer.lineCap = .round let animation = CABasicAnimation(keyPath: "transform.rotation") animation.fromValue = CGFloat.pi * 2 animation.toValue = 0 animation.duration = 1 animation.repeatCount = .greatestFiniteMagnitude layer.add(animation, forKey: "transform.rotation") } override func layoutSubviews() { super.layoutSubviews() gradientLayer.frame = bounds shapeLayer.frame = bounds let path = UIBezierPath( arcCenter: .init(x: bounds.midX, y: bounds.midY), radius: bounds.width / 2 - 20, startAngle: 1.55 * .pi, endAngle: .pi, clockwise: true) shapeLayer.path = path.cgPath } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } } Usage: class MyViewController: UIViewController { override func viewDidLoad() { let progress = FadingProgressView(frame: CGRect(x: 200, y: 200, width: 100, height: 100)) view.addSubview(progress) } }
type: AcceptedAnswer
type: Answer
upvote count: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/78383595
answers question: http://stackoverflow.com/q/78383595
score: 1

http://stackoverflow.com/comment/138254746
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/78417644
type: Comment
has text: For the sake of clarity: please check if this is really your debuggger output: `NSPopoeverWindow : NSPanel : NSWindow`

http://stackoverflow.com/comment/138157771
comment on: http://stackoverflow.com/q/78366079
type: QuestionComment
type: Comment
score: 0
has text: Wouldn't you use `LogObjcWrapper` directly?

http://stackoverflow.com/a/78420434
downvote count: 0
upvote count: 2
type: AcceptedAnswer
type: Answer
has body: Sounds like you need to implement -[NSPopoverDelegate detachableWindowForPopover:] and provide a window of the kind you want.
has comment: http://stackoverflow.com/comment/138273369
score: 2
accepted answer of: http://stackoverflow.com/q/78417644
answers question: http://stackoverflow.com/q/78417644

http://stackoverflow.com/comment/138144392
comment on: http://stackoverflow.com/q/78356910
type: QuestionComment
type: Comment
has text: No, you would need to write your own logger code.
score: 0

http://stackoverflow.com/comment/138154646
score: 0
has text: Use `NSInputStream` instead of `NSData` for reading file. And buffer size should be equal to memory page size.
type: QuestionComment
comment on: http://stackoverflow.com/q/78360107
type: Comment

http://stackoverflow.com/comment/138180586
type: Comment
comment on: http://stackoverflow.com/q/78378834
has text: code added , please check @JoakimDanielson
type: QuestionComment
score: 0

http://stackoverflow.com/a/78446806
score: 4
upvote count: 4
downvote count: 0
has body: The framework will install in the current ios directory. Important Note:- Make sure your sdk is present in this directory project_root_directory/ios and add you sdk in xcode Step 1:- Move to project_root_directory/ios Step 2:- Run this command ruby &lt;(curl https://connect.squareup.com/readersdk-installer) install --app-id YOUR_SQUARE_READER_APP_ID --repo-password YOUR_SQUARE_READER_REPOSITORY_PASSWORD Make sure to replace YOUR_SQUARE_READER_APP_ID with your Square Reader application ID and YOUR_SQUARE_READER_REPOSITORY_PASSWORD with your Square Reader repository password.
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/78435889
answers question: http://stackoverflow.com/q/78435889

http://stackoverflow.com/comment/138144898
comment on: http://stackoverflow.com/q/78356799
score: 0
has text: It was the `char buffer[10]` crash in the original examples that threw us all off. Pushing 10 bytes on to the stack would invariably not be a problem. But 200mb would easily cause a problem. And `malloc`, accessing memory from the heap, avoids stack memory limitations. Thanks for clarifying the question. So, did Chris answer your question?
type: QuestionComment
type: Comment

cfrunloop
tags question: http://stackoverflow.com/q/78309419
type: Tag
tag name: cfrunloop

http://stackoverflow.com/comment/138143641
has text: @Willeke Thanks for letting me know, I did indeed mix that up while simplifying the code. I updated the provided code, now it's more like the original code but I still removed parts because there is a lot of it that isn't related to the problem. If you can't replicate the issue and want the full original code I can provide you it all.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/78356799

http://stackoverflow.com/comment/138148567
type: AnswerComment
type: Comment
has text: I didn't downvote your answer, but I can see why someone might have. This is terribly expensive logging code. Firstly open the log file _once_ per process, not every log call. Secondly what's going on with that `format` string?
comment on: http://stackoverflow.com/a/78360039
score: 0

http://stackoverflow.com/comment/138143675
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78356963
has text: Does the data on the stack need to be of a constant size or can the size be determined using a variable that can change depending on the previous code? Thanks for explaining the difference, it makes more sense now. I am experienced with managed languages so I'm not used to manual memory management. If I try to use `free(buffer)`I get an error "Expected expression" and the description of the free function is "free(void *) Frees all of the resources allocated by the IOAudioPort". Could it be that I have to use an alternative to free in Objective-C?

http://stackoverflow.com/comment/138061483
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78309419
has text: Thank everyone, your words mean a lot to me.

http://stackoverflow.com/comment/138229364
has text: That's why Apple recommend to use properties in Objective-C and doesn't allow use ivars in Swift
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78402517
type: Comment

http://stackoverflow.com/a/79332502
score: 0
has body: I believe, in this case, you need to redirect stdout to get NSLogs into a file. It's working for me (with Swift, with .log file, along with stderr)... You could try n check it like this: freopen([logPath fileSystemRepresentation],"a+",stderr); freopen([logPath fileSystemRepresentation],"a+",stdout); For more details: https://stackoverflow.com/a/41680336/5546312
answers question: http://stackoverflow.com/q/78356910
type: Answer

http://stackoverflow.com/q/78373566
type: Question
tagged with: objective-c
type: UnansweredQuestion
tagged with: ios-bluetooth
tagged with: react-native
has body: When a bluetooth keyboard is linked to an iPhone and being used, the virtual keyboard is hidden. How can I disable this behaviour? My app is built using React Native Expo and requires access to the soft keyboard and physical bluetooth keyboard simultaniously as functions need to be triggered remotely. However when the bluetooth keyboard is connected the virtual keyboard hides off screen until the keyboard is disconnected. I'm aware that some keyboards have a shortcut for bringing the keyboard back up, but this isn't a solution for me sadly- I need to find a way to prevent the keyboard from hiding at all. I've been playing with the native ios folder and Objective C files to see if there's a way to hard code this functionality, following various threads on SO but no success yet. I'm not familiar with the native code at all but I'm confident what I want can't be achieved in JSX. I will be looking for a solution on android too but I'm focusing on getting iOS working first. With the number of posts around this topic over the years already, someone must have found a solution? Any points in the right direction or tips on tackling the native code would be appreciated. Thank you. Here is one of the things I tried in AppDelegate.mm already: added these lines to AppDelegate.mm: #import &lt;React/RCTRootView.h&gt; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldBegan:) name:UITextFieldTextDidBeginEditingNotification object:nil]; - (void)textFieldBegan:(NSNotification *)theNotification { UITextField *theTextField = [theNotification object]; if (!inputAccessoryView) { inputAccessoryView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 1)]; } theTextField.inputAccessoryView = inputAccessoryView; [self performSelector:@selector(forceKeyboard) withObject:nil afterDelay:0]; } - (void)forceKeyboard { inputAccessoryView.superview.frame = CGRectMake(0, [UIScreen mainScreen].bounds.size.height - 265, [UIScreen ma…
score: 0
answer count: 0
has title: How to prevent the virtual keyboard from hiding when a physical bluetooth keyboard is connected? (iOS)
tagged with: keyboard
tagged with: uikeyboard

http://stackoverflow.com/comment/138273693
type: QuestionComment
comment on: http://stackoverflow.com/q/78417644
has text: @MottiShneor Are you sure the class is `NSPopoeverWindow` and not `_NSPopoverWindow`?
score: 1
type: Comment

http://stackoverflow.com/comment/138129574
type: Comment
score: 0
has text: I think the difference lies in the different executable types - one being an application, the other being an extension (which often operate via app groups)
comment on: http://stackoverflow.com/q/78350245
type: QuestionComment

http://stackoverflow.com/comment/138137342
type: Comment
score: 0
type: QuestionComment
has text: Are your apps sandboxed? Docs for the `arguments` property of `NSWorkspaceOpenConfiguration ` say "If the calling process is sandboxed, the system ignores the value of this property."
comment on: http://stackoverflow.com/q/78353070

http://stackoverflow.com/q/78350245
tagged with: ios
tagged with: objective-c
downvote count: 1
tagged with: react-native
type: Question
upvote count: 1
tagged with: swift
answer count: 1
has answer: http://stackoverflow.com/a/78351330
accepted answer: http://stackoverflow.com/a/78351330
tagged with: asyncstorage
has comment: http://stackoverflow.com/comment/138129574
favorite count: 0
has comment: http://stackoverflow.com/comment/138129664
score: 0
type: AnsweredQuestion
has title: Why does Swift FileManager.default.urls(...) return a different result than ObjC implementation (iOS simulator)?
has body: React Native Async Storage calls the following method to find an appropriate directory in the Simulator's file system: NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) .firstObject By opening Finder, it can be observed this evaluates on my machine to ~/Library/Developer/CoreSimulator/Devices/6A36BEDF-71DA-4A9B-9CDD-EBC6BCE11BC0/data/Containers/Data/Application/D258BA62-85FF-4288-95BF-D1318C63B947/Library/Application Support/ I now hope, in my SwiftUI extension widget for the same React Native iOS app, to access this folder. But when I call FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first, this evaluates to /Users/brandon/Library/Developer/CoreSimulator/Devices/6A36BEDF-71DA-4A9B-9CDD-EBC6BCE11BC0/data/Library/Application Support/ As you can see, the results for these are quite different. Why does the Swift method appear to find a different folder and how I can I alter it to access the one the ObjC method finds? I'm expecting the Swift code to evaluate to the same as that generated by React Native Async Storage in ObjC

memory
type: Tag
tags question: http://stackoverflow.com/q/78356799
tag name: memory

http://stackoverflow.com/comment/138240869
has text: https://stackoverflow.com/a/42168798/341994
comment on: http://stackoverflow.com/q/78412848
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/a/78370156
score: 0
has body: I have found the solution. Resize the image actually causing the issue. If you used following method it will resize the image with maintaining image quality. Swift 5.0 extension UIImage { func resize(targetSize: CGSize) -&gt; UIImage { return UIGraphicsImageRenderer(size:targetSize).image { _ in self.draw(in: CGRect(origin: .zero, size: targetSize)) } } } Objective C: -(UIImage*) resizeImage:(UIImage*)image scaledToSize:(CGSize)newSize { UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:newSize]; UIImage *resizedImage = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull context) { CGPoint point = CGPointZero; CGRect aRect = { point, newSize }; [image drawInRect:aRect]; }]; return resizedImage; } I have found the answer from the following link. https://stackoverflow.com/a/49060676/2384760
answers question: http://stackoverflow.com/q/78354823
type: Answer

http://stackoverflow.com/comment/138101244
comment on: http://stackoverflow.com/a/78331320
has text: What was the wrong key? How did Xcode *not* use the right key?
score: 0
type: AnswerComment
type: Comment

theos
tags question: http://stackoverflow.com/q/78416750
type: Tag
tag name: theos

http://stackoverflow.com/comment/138073487
type: QuestionComment
comment on: http://stackoverflow.com/q/78317060
type: Comment
score: 1
has text: Some devices may also support SNMP, but you need to know the appropriate community string to access the data. There may also be other methods such as Bonjour/mDNS advertisements from some devices but there is no general method apart from reverse dns.

hid
type: Tag
tag name: hid
tags question: http://stackoverflow.com/q/78426105

http://stackoverflow.com/comment/138157398
comment on: http://stackoverflow.com/q/78354823
score: 0
type: QuestionComment
has text: @HangarRash Thank you for your consideration. I have edited the question you can find the image in question. I have used 5 different sizes 25x25, 50x50, 75x75, 100x100, 150x150. As any image which has size greater then 25x25 not fit in Tabbar and go out of the tabbar so I have resized them. I am using bigger image and try to scal smaller but result is same.
type: Comment

http://stackoverflow.com/comment/138073444
comment on: http://stackoverflow.com/q/78317060
type: QuestionComment
has text: It is not generally possible to do this. To get a host name for an ip address requires that the reverse domain lookup (for a host `1.2.3.4` this is `4.3.2.1.in-addr.arpa`) is set up in DNS. This will not be the case for most home LANs. It may be set up in enterprise networks where the DHCP server can take care of this.
score: 1
type: Comment

http://stackoverflow.com/comment/138638891
type: AnswerComment
type: Comment
has text: This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/36155233)
comment on: http://stackoverflow.com/a/78617722
score: 0

http://stackoverflow.com/comment/138061762
score: 0
comment on: http://stackoverflow.com/a/78311318
type: AnswerComment
type: Comment
has text: Thanks, Rob. I very much appreciate your guidance.

http://stackoverflow.com/comment/138100588
type: Comment
comment on: http://stackoverflow.com/q/78333515
score: 0
has text: In the notification you pass the enum not its rawValue. Why do you want to use the rawValue as you declared it as objc which enable it to be shared with Objective-C ?
type: QuestionComment

nsurlsessiondownloadtask
tag name: nsurlsessiondownloadtask
tags question: http://stackoverflow.com/q/78354823
type: Tag

http://stackoverflow.com/comment/138136549
has text: It sounds like you're saying there is no way for my widget to know the file path to the directory created by my app, when the app calls the ObjC method mentioned in my OP, and that the solution is to either patch React Native Async Storage to write the file to a shared container or create a native module to accomplish the same. Is that right?
type: AnswerComment
comment on: http://stackoverflow.com/a/78351330
type: Comment
score: 0

http://stackoverflow.com/comment/138223703
score: 1
type: AnswerComment
has text: I'll add that the direct reference to the ivar `foo` is equivalent to `self->foo` which is of course quite different from `self.foo`.
type: Comment
comment on: http://stackoverflow.com/a/78402733

http://stackoverflow.com/comment/138100928
type: QuestionComment
comment on: http://stackoverflow.com/q/78317060
score: 1
type: Comment
has text: Most local networks don't have a forward dns either, but even if it did, no, you can't initiate a zone transfer without authentication.

http://stackoverflow.com/comment/138107768
score: 0
has text: @PtitXav Yes, I was intended to pass enum to notification, the rawValues is for testing, since the allocate error.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78333515

http://stackoverflow.com/comment/138143253
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78356910
has text: I assume you based that code on an SO answer from 2011? I believe that Xcode 15 no longer captures `stderr` to show `NSLog` entries, and instead gets it from the system log. So you could argue that the output is already going to file...
type: Comment

http://stackoverflow.com/comment/138096082
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78328208
has text: @DonMag is true, I created a project from scratch and the font is available. But there is no missing steps in my main project. Any ideas?

http://stackoverflow.com/comment/138210069
type: QuestionComment
comment on: http://stackoverflow.com/q/78353070
type: Comment
has text: The helper application was indeed sandboxed! Obviously that is the default setting! That was the problem. Work now as expected. @JWWalker Thank you so much.
score: 0

http://stackoverflow.com/comment/138177407
type: QuestionComment
comment on: http://stackoverflow.com/q/78373313
has text: You can get protocol dynamically with Objective-C runtime functions.
type: Comment
score: 0

http://stackoverflow.com/a/78617722
has comment: http://stackoverflow.com/comment/138612705
score: 0
has body: %hookf Used to hook into C functions, not Objective-C methods.
type: Answer
answers question: http://stackoverflow.com/q/78416750
has comment: http://stackoverflow.com/comment/138638891
has comment: http://stackoverflow.com/comment/138656302

asyncstorage
type: Tag
tag name: asyncstorage
tags question: http://stackoverflow.com/q/78350245

http://stackoverflow.com/comment/138281792
type: QuestionComment
score: 0
has text: I'm honestly unsure. I don't know how to see what lines have fired, when running the code.
type: Comment
comment on: http://stackoverflow.com/q/78426105

http://stackoverflow.com/comment/138293609
comment on: http://stackoverflow.com/q/78426105
has text: @Willeke That does indeed. So it's a permissions issue that I thought was supposed to be resolved within System Settings > Privacy and Security, but it appears it still has to be run as root. Thank you!
type: QuestionComment
score: 0
type: Comment

lldb
tags question: http://stackoverflow.com/q/78313766
type: Tag
tag name: lldb
tags question: http://stackoverflow.com/q/79455766

http://stackoverflow.com/a/78311318
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/138061515
has comment: http://stackoverflow.com/comment/138061762
accepted answer of: http://stackoverflow.com/q/78309419
answers question: http://stackoverflow.com/q/78309419
score: 0
has body: tl;dr There are several problems with this run loop code. But, if the intent was simply to run a timer on a dispatch queue, we would generally use a dispatch source timer, eliminating much of this confusion. The typical run loop pattern entails creating a dedicated thread, getting a run loop for that thread, and calling one of the “run” methods to spin on that thread, processing run loop events, such as timer events. (See point 2 in this answer for an example.) A dispatch queue is a different approach. When we dispatch a “work item” to a dispatch queue, that queue will fetch a (random) worker thread from a pool of threads, run that work item on that worker thread, and, when the work item is done, return that worker thread to the thread pool, making it available for future dispatches. So that leads us to several observations regarding your code snippet: The dispatch to queue1 makes no sense. You print a run loop, but do not “run” on it, but instead just finish, thereby returning the worker thread to the thread pool. That thread is now available to be used again by future GCD dispatches. It would have only made sense if you spun on that run loop with a “run” method, thereby tying that thread to that run loop and preventing GCD from reusing that thread. Using a concurrent queue in this context is confusing. Run loops spin on a given thread. Creating a concurrent queue for this purpose makes no sense. What work will be done concurrently on that queue while the run loop spins on one of the worker threads? It suggests a conceptual misunderstanding of how run loops work. The idea of indefinitely spinning on a run loop on a GCD worker thread, at all, is ill-advised. The general concept of dispatch queues is that they achieve efficiency by fetching an existing worker thread from the pool, performing the work item, and returning that thread to the pool. The idea of indefinitely tying up a worker thread is arguably antithetical to the motivating idea behind GCD. You can do it,…

http://stackoverflow.com/comment/138229376
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78402517
has text: You can use marcos but it's to dirty, better to use find+replace
type: Comment

http://stackoverflow.com/comment/138148523
score: 0
type: QuestionComment
has text: Are you using any CoreGraphics methods ? As the memory is not always release immediately and can lead to memory shortage .
comment on: http://stackoverflow.com/q/78360107
type: Comment

http://stackoverflow.com/comment/138139010
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78354823
type: Comment
has text: I’d recommend sharing, for one of the tabs, (a) the asset from the assets library; and (b) the corresponding asset downloaded by the data task (e.g., write the `Data` received to a file). But, in short, see [HIG – Tab bars – Target dimensions](https://developer.apple.com/design/human-interface-guidelines/tab-bars#Target-dimensions) for recommended asset dimensions. Your images look like they are some smaller size that has been scaled to fit the UI.

http://stackoverflow.com/comment/138158297
score: 0
comment on: http://stackoverflow.com/q/78366079
has text: You need read that SDK's documentation and find out how to enable longs in it. As we doesn't know which library you are using, we can't help you.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/78671487
has body: After much trial and error, I found out that it is actually possible to hook onto Objective-C functions. The thing that I was missing here that was causing this error: Undefined symbols for architecture armv7:"_addition", referenced from: __logosLocalInit in Tweak.x.f54e192c.o ld: symbol(s) not found for architecture armv7 was that I did not add this to the end of the tweak %ctor { %init(addition= MSFindSymbol(NULL, "_addition")); } and that is important because this function was created by me and THEOS doesn't really know where it is unless it searches for it during runtime with the help of the symbol I have provided. the whole tweak looks something like this #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> %hookf(NSNumber *, addition, NSNumber *num1, NSNumber *num2) { return @99; } %ctor { %init(addition= MSFindSymbol(NULL, "_addition")); }
type: AcceptedAnswer
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/138711058
accepted answer of: http://stackoverflow.com/q/78416750
answers question: http://stackoverflow.com/q/78416750

http://stackoverflow.com/comment/138136693
type: AnswerComment
comment on: http://stackoverflow.com/a/78351330
type: Comment
has text: I’m not a React Native Async Storage user, so I’m not sure I can advise you on this. FWIW, issue [#126](https://github.com/react-native-async-storage/async-storage/issues/126) seems to (a) have raised the question; and (b) has been marked as “complete”. So maybe there are some breadcrumbs you can follow from there to find the solution for your issue.
score: 0

ipad
type: Tag
tags question: http://stackoverflow.com/q/78324556
tag name: ipad

nsrunloop
tags question: http://stackoverflow.com/q/78309419
type: Tag
tag name: nsrunloop

ip-address
tags question: http://stackoverflow.com/q/78317060
type: Tag
tag name: ip-address

swizzle
tag name: swizzle
tags question: http://stackoverflow.com/q/78422435
type: Tag

presentmodalviewcontroller
tag name: presentmodalviewcontroller
type: Tag
tags question: http://stackoverflow.com/q/78501315

http://stackoverflow.com/q/78492779
type: Question
upvote count: 1
answer count: 1
linked to: http://stackoverflow.com/q/3684112
has comment: http://stackoverflow.com/comment/138381686
has title: Error building C++ code on MacOS using CMake. Error with Cocoa and Foundations
has answer: http://stackoverflow.com/a/78563382
favorite count: 0
tagged with: cross-platform
type: UnansweredQuestion
tagged with: cmake
downvote count: 0
tagged with: macos
has body: I am trying to build a cross platform application on MacOS which is written in C++. In my CMake I've included cmake_minimum_required(VERSION 3.28) project(lel LANGUAGES C CXX) if(APPLE) enable_language(OBJC) endif() In my .cpp file I've also included this: #if defined(SDL_PLATFORM_MACOS) #include &lt;Cocoa/Cocoa.h&gt; #include &lt;Foundation/Foundation.h&gt; #include &lt;QuartzCore/CAMetalLayer.h&gt; The error I get is the following: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:9: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:601:1: error: expected unqualified-id @class NSString, Protocol; I know the reason is that MacOS uses Objective C to build programs and the codebase is C++. But I don't know how to get around this issue. I've tried to wrap my includes with #ifdef __OBJC__ #include &lt;Cocoa/Cocoa.h&gt; #include &lt;Foundation/Foundation.h&gt; #include &lt;QuartzCore/CAMetalLayer.h&gt; #endif But it just causes errors saying it can't identify any of the 'Types' which would have been included from the includes. How do I get around this issue? Thanks in advance.
score: 1
has comment: http://stackoverflow.com/comment/138500222
tagged with: objective-c
tagged with: c++

http://stackoverflow.com/q/78565146
type: UnansweredQuestion
score: 1
favorite count: 0
tagged with: crash-dumps
tagged with: ios
tagged with: swiftui
has body: I have an iOS app and I receive some crashes related to _objc_msgSend. I only know that this crash happens when backgrounding the app. The crash log: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Codes: 0x0000000000000001, 0x0000000000000000 VM Region Info: 0 is not in any region. Bytes before following region: 4334944256 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---&gt; __TEXT 102620000-102628000 [ 32K] r-x/r-x SM=COW /var/containers/Bundle/Application/C85DDECD-E4EE-4590-B8AE-116E75F437A0 Termination Reason: SIGNAL 11 Segmentation fault: 11 Terminating Process: exc handler [32190] Triggered by Thread: 0 Thread 0 name: Thread 0 Crashed: 0 libobjc.A.dylib 0x000000019acf0c90 lookUpImpOrForward + 72 (objc-runtime-new.mm:7399) 1 libobjc.A.dylib 0x000000019acec0c4 _objc_msgSend_uncached + 68 (:-1) 2 UIKitCore 0x00000001a52d07d4 -[UIViewController dealloc] + 860 (UIViewController.m:3275) 3 UIKitCore 0x00000001a5398e14 -[UINavigationController dealloc] + 296 (UINavigationController.m:871) 4 UIKitCore 0x00000001a57909ec -[_UISplitViewControllerColumnContents .cxx_destruct] + 44 (UISplitViewControllerPanelImpl.m:439) 5 libobjc.A.dylib 0x000000019acec75c object_cxxDestructFromClass(objc_object*, objc_class*) + 116 (objc-class.mm:457) 6 libobjc.A.dylib 0x000000019acec490 objc_destructInstance + 80 (objc-runtime-new.mm:9125) 7 libobjc.A.dylib 0x000000019acec438 _objc_rootDealloc + 80 (NSObject.mm:2136) 8 CoreFoundation 0x00000001a2db63f8 cow_cleanup + 164 (NSDictionaryM.m:141) 9 CoreFoundation 0x00000001a2db6304 -[__NSDictionaryM dealloc] + 148 (NSDictionaryM.m:407) 10 libobjc.A.dylib 0x000000019acec75c object_cxxDestructFromClass(objc_object*, objc_class*) + 116 (objc-class.mm:457) 11 libobjc.A.dylib 0x000000019acec490 objc_destructInstance + 80 (objc-runtime-new.mm:9125) 12 libobjc.A.dylib 0x000000019acec438 _objc_rootDealloc + 80 (NSObject.mm:2136) 13 UIKitCore 0x0000…
has comment: http://stackoverflow.com/comment/138508042
tagged with: objective-c
answer count: 0
has title: _objc_msgSend crash swiftui
type: Question
upvote count: 1
tagged with: swift
downvote count: 0

http://stackoverflow.com/a/78516522
score: 1
type: AcceptedAnswer
type: Answer
upvote count: 1
has body: No, there are no common identifiers among the word processing file formats, except the very general public.item, public.content etc. You can view the UTType "tree" using the mdls command. These are the results for .doc, .docx, .pages: % mdls -name kMDItemContentTypeTree foo.pages kMDItemContentTypeTree = ( "com.apple.iwork.pages.sffpages", "public.data", "public.item", "public.composite-content", "public.content" ) % mdls -name kMDItemContentTypeTree foo.docx kMDItemContentTypeTree = ( "org.openxmlformats.wordprocessingml.document", "org.openxmlformats.openxml", "public.data", "public.item", "public.composite-content", "public.content" ) % mdls -name kMDItemContentTypeTree foo.doc kMDItemContentTypeTree = ( "com.microsoft.word.doc", "public.data", "public.item", "public.composite-content", "public.content" ) Spreadsheets on the other hand, have public.spreadsheet in common: % mdls -name kMDItemContentTypeTree foo.numbers kMDItemContentTypeTree = ( "com.apple.iwork.numbers.sffnumbers", "public.data", "public.item", "public.composite-content", "public.content", "public.spreadsheet" ) % mdls -name kMDItemContentTypeTree foo.xlsx kMDItemContentTypeTree = ( "org.openxmlformats.spreadsheetml.sheet", "org.openxmlformats.openxml", "public.data", "public.item", "public.composite-content", "public.content", "public.spreadsheet" )
downvote count: 0
accepted answer of: http://stackoverflow.com/q/78514283
answers question: http://stackoverflow.com/q/78514283

http://stackoverflow.com/q/78566066
tagged with: c++
has answer: http://stackoverflow.com/a/78587691
favorite count: 0
tagged with: swift
downvote count: 1
has body: I have tried integrating OpenCV in a native macOS app with Swift and it results in bunch of linker errors. I have an M1 Mac and below are the two ways in which I have tried. First Way: First I did brew install opencv , I created a native macOS app with swift using Xcode, I went to /usr/local/Cellar/opencv in finder and dragged and dropped all the opencv libraries in FrameWorks, Libraries and Embedded Content of my app from the lib folder of opencv. Then In Build Settings -> I searched for Header Search Path and added /usr/local/Cellar/opencv/4.9.0_8/include/opencv4 and kept it as recursive Then created OpenCVWrapper.h #import <Foundation/Foundation.h> #import <Cocoa/Cocoa.h> NS_ASSUME_NONNULL_BEGIN @interface OpenCVWrapper : NSObject + (NSImage *)convertToGrayscale:(NSImage *)image; @end NS_ASSUME_NONNULL_END Then created OpenCVWrapper.mm #import <opencv2/opencv.hpp> #import <opencv2/imgcodecs/macosx.h> #import "OpenCVWrapper.h" @implementation OpenCVWrapper + (NSImage *)convertToGrayscale:(NSImage *)image { // Convert NSImage to cv::Mat cv::Mat cvImage = [self cvMatFromNSImage:image]; // Convert to grayscale cv::Mat grayImage; cv::cvtColor(cvImage, grayImage, cv::COLOR_BGR2GRAY); // Convert cv::Mat back to NSImage NSImage *grayNSImage = [self nsImageFromCvMat:grayImage]; return grayNSImage; } // Helper function to convert NSImage to cv::Mat + (cv::Mat)cvMatFromNSImage:(NSImage *)image { CGImageRef imageRef = [image CGImageForProposedRect:NULL context:NULL hints:nil]; NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage:imageRef]; cv::Mat mat((int)bitmapRep.pixelsHigh, (int)bitmapRep.pixelsWide, CV_8UC4, (void *)bitmapRep.bitmapData, (int)bitmapRep.bytesPerRow); cv::Mat matBGR; cv::cvtColor(mat, matBGR, cv::COLOR_RGBA2BGR); return matBGR; } // Helper function to convert cv::Mat to NSImage + (NSImage *)nsImageFromCvMat:(const cv::Mat&)cvMat { NSData *data = [NSData dataWithBytes:cvMat.data length:cvMat.elemSize() * cvMat.total()]; CGColorSpaceRef c…
score: 1
answer count: 1
tagged with: macos
tagged with: opencv
has title: Integrating OpenCV in a native macOS app leads to Linker Errors
upvote count: 2
type: Question
tagged with: objective-c
type: UnansweredQuestion

uidocumentpickerviewcontroller
tags question: http://stackoverflow.com/q/78514283
tag name: uidocumentpickerviewcontroller
type: Tag

http://stackoverflow.com/q/78543490
favorite count: 0
has title: how search best epsilon and delta for lcs matrix(what object function)
downvote count: 0
tagged with: python
answer count: 0
tagged with: delta
score: 1
tagged with: epsilon
tagged with: function
has body: how search best epsilon and delta for lcs matrix(what object function) I want to use heuristic algorithms to search the value of epsilon and delta to find the best epsilon for time series data. I don't know how to write the objective function.
type: Question
upvote count: 1
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/a/78602999
has body: The .pch file is prepended to every file you compile (c, c++, or objc) for that target, so if you are importing an ObjC header, it should be inside the #ifdef __OBJC__ section. Otherwise the import will be unknown to non-objc files being compiled. Foundation/Foundation.h is an ObjC specific header.
answers question: http://stackoverflow.com/q/78585460
score: 0
type: Answer

http://stackoverflow.com/a/78964523
accepted answer of: http://stackoverflow.com/q/78505503
downvote count: 0
answers question: http://stackoverflow.com/q/78505503
type: AcceptedAnswer
upvote count: 2
type: Answer
has body: as I observed in my case, The Empty User Avatar comes when the remoteHandle's has an empty string as a value. so by checking if the remote handle value is not an empty string, you can avoid this issue. the case for an empty user's Avatar(in the dynamic island) let handle = &quot;&quot; let callUpdate = CXCallUpdate() callUpdate.remoteHandle = CXHandle(type: .phoneNumber, value: handle) The fix is simply check if handle is an empty string or nil if yes then replace it with any keyword or number like Unknown.
score: 2

http://stackoverflow.com/a/78593074
type: Answer
has body: So I finally found the problem. By adding the correct AID to Info.plist, the connection to the PIV card is established and APDU commands can be executed. <?xml version="1.0" encoding="UTF-8"?> NFCReaderUsageDescription Need NFC to scan com.apple.developer.nfc.readersession.iso7816.select-identifiers A00000030800001000
score: 0
accepted answer of: http://stackoverflow.com/q/78586930
answers question: http://stackoverflow.com/q/78586930
has comment: http://stackoverflow.com/comment/140064550
type: AcceptedAnswer

http://stackoverflow.com/comment/138441217
type: Comment
has text: Yes, I think the autoupdating calendar isn't polling.
comment on: http://stackoverflow.com/a/78528011
score: 0
type: AnswerComment

http://stackoverflow.com/q/78585460
answer count: 1
tagged with: objective-c
tagged with: foundation
has title: Error: Unnamed type used 'BOOL' in iOS project XCode
score: 0
type: Question
tagged with: swift
tagged with: xcode
has comment: http://stackoverflow.com/comment/138572120
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/78602999
tagged with: uikit
has body: I am having project in XCode version: 15.4 using Swift for iOS development -> uiKit. I have added the c++ class to my project. MyStaticClass.h: #ifndef MYSTATICCLASS_H #define MYSTATICCLASS_H class MyStaticClass { public: static bool isEven(int number); }; #endif MyStaticClass.cpp #include "MyStaticClass.h" #include <iostream> bool MyStaticClass::isEven(int number) {return (number % 2 == 0);} Then i created wrapper for this class in objective C as // MyStaticClass_Wrapper.h #import <Foundation/Foundation.h> @interface MyStaticClassWrapper : NSObject + (BOOL)isEven:(int)number; @end // MyStaticClass_Wrapper.mm #import <Foundation/Foundation.h> #import "MyStaticClass_Wrapper.h" #include "MyStaticClass.h" @implementation MyStaticClassWrapper + (BOOL)isEven:(int)number { // Uncomment the line below to use the C++ implementation // return MyStaticClass::isEven(number); return true; } @end **Note: ** The objective file is .mm not .m I added the bridging Header file as: #import "MyStaticClass_Wrapper.h" and i added its path in Build Setting -> Objective-C Bridging Header Added PrefixHeader.pch: // PrefixHeader.pch //#import <Foundation/Foundation.h> #ifndef PrefixHeader_pch #define PrefixHeader_pch #import <Availability.h> #ifdef __OBJC__ #import <UIKit/UIKit.h> #import <CoreData/CoreData.h> #endif typedef enum{ bFileTypeDefault = 1, bFileTypePhoto, bFileTypeVideo, bFileTypeAudio, bFileTypeDocuments, } baseFileType; BOOL \_isFakeAccount; #endif then added the prefix header path to Build Setting -> Prefix Header in setting. when i build it: Error : Unnamed type used 'BOOL' when i uncomment "#import <Foundation/Foundation.h>" Error : Along with Unnamed type used 'BOOL' .... 'NSString' also encounters same error How to resolve it, am stucked with this error. i tried commenting the BOOl, creating .m file to declare global variable seperately. Didn't worked. When i comment .pch file content it works fine.
has comment: http://stackoverflow.com/comment/138564390

http://stackoverflow.com/comment/138486428
has text: uploaded i tried swift code
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78553036
type: Comment

http://stackoverflow.com/comment/138410757
has text: yes, I used UISheetPresentationController
type: Comment
comment on: http://stackoverflow.com/q/78505516
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138553319
has text: I don't have knowledge of cmake. Also in my command I have specified --macos_archs but not sure like you said why it cross-compiled binaries for Linux. Are you sure?
comment on: http://stackoverflow.com/a/78587691
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/78538010
answers question: http://stackoverflow.com/q/78535483
upvote count: 1
has comment: http://stackoverflow.com/comment/138501234
accepted answer of: http://stackoverflow.com/q/78535483
has comment: http://stackoverflow.com/comment/138500530
has comment: http://stackoverflow.com/comment/138507132
has body: I think you've got your arrows reversed, it should be inputNode -&gt; sinkNode not sinkNode -&gt; inputNode, so try this instead [m_engine connect: m_engine.inputNode to:sinkNode format:inputFormat];
downvote count: 0
score: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/78481020
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/138360118
accepted answer: http://stackoverflow.com/a/78496679
downvote count: 0
linked to: http://stackoverflow.com/q/78492959
has answer: http://stackoverflow.com/a/78494809
has comment: http://stackoverflow.com/comment/138370551
score: 1
has comment: http://stackoverflow.com/comment/138368011
answer count: 2
linked to: http://stackoverflow.com/q/17920169
tagged with: ios
has answer: http://stackoverflow.com/a/78496679
has comment: http://stackoverflow.com/comment/138360140
has comment: http://stackoverflow.com/comment/138360212
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/138359962
has comment: http://stackoverflow.com/comment/138369182
tagged with: objective-c
has body: I am doing some experiment based on this answer: https://stackoverflow.com/a/17921058/767653 This is my minimum reproducible code: - (void)viewDidLoad { [super viewDidLoad]; __block BOOL completed = NO; [self doMyWork:^{ completed = YES; }]; while (!completed) { [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]]; } } My understanding is that, this code has a deadlock. Because the completion block is run on main thread, so in order for the completion block to run, viewDidLoad must return. And in order for viewDidLoad to return, completion block must be run to toggle the completed flag (hence circular wait). However, when I run it, there's no deadlock in this code. Where I did understand wrongly?
has comment: http://stackoverflow.com/comment/138368839
favorite count: 0
has comment: http://stackoverflow.com/comment/138360113
has comment: http://stackoverflow.com/comment/138370826
possible better answer: http://stackoverflow.com/a/78494809
has title: Is run loop synchronous or asynchronous?

http://stackoverflow.com/q/78543725
has comment: http://stackoverflow.com/comment/138468807
has comment: http://stackoverflow.com/comment/138612487
tagged with: ios
score: 0
tagged with: objective-c
tagged with: react-native
type: Question
upvote count: 1
favorite count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/138612191
has title: Use of Insecure iOS Coding Functions - React Native, MobSF
has body: We created an iOS .ipa file to upload it on MobSF's Static Analysis to analyze the security of the app. However, we found that there are 2 High Severity issues. Here is the report that is generated by MobSF IPA Binary Code analysis report. We haven't used these APIs in our code. How do we fix this vulnerability in React Native?
downvote count: 1
tagged with: mobsf
tagged with: security
type: UnansweredQuestion

http://stackoverflow.com/comment/138492857
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78556827
type: QuestionComment
has text: It's cell based.

http://stackoverflow.com/q/78559718
has title: How to save a part of a string that does not have a fixed lenght in objective C?
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138500160
upvote count: 1
has comment: http://stackoverflow.com/comment/138498677
tagged with: xcode
score: 0
tagged with: arrays
has body: I have text that has no fixed length, like: NSString *stringToSplit = @"0.01 EUR sent from sender.email@domain.com. Hi. I'm sending you a free credit. Talk to you."; I need to save in a string only the part after the “.com. “ The problems are as follows: stringToSplit does not have a fixed length. the domain of the internet addresses can vary (.com/.org/.it etc...) What I tried to do was this: NSString *stringToSplit = @"0.01 EUR sent from sender.email@domain.com. Hi. I'm sending you a free credit. Talk to you."; NSArray *firstSeparatedText = [stringToSplit componentsSeparatedByString:@"@"]; NSArray *secondSeparatedText = [[firstSeparatedText lastObject] componentsSeparatedByString:@"."]; NSMutableArray *arr = [NSMutableArray arrayWithArray:secondSeparatedText]; NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 2)]; [arr removeObjectsAtIndexes:indexSet]; NSMutableString *textToShow = [[NSMutableString alloc] init]; for (NSObject * obj in arr) { [textToShow appendString:[obj description]]; } The problem is precisely that using the componentsSeparatedByString: method, the saved text would be “Hi I'm sending you a free credit Talk to you” but I need to save the dots as well. Basically I would like to save only the text that is after the email address (followed by the dot).
type: Question
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138500411
answer count: 0
has comment: http://stackoverflow.com/comment/138498116
favorite count: 0
tagged with: split
tagged with: ios
downvote count: 1
linked to: http://stackoverflow.com/q/8413291

http://stackoverflow.com/q/78553036
has comment: http://stackoverflow.com/comment/138486346
tagged with: datetimepicker
has body: i need to show time format in dateTimePicker is 12/24 hour time format based on my app settings not show based on device time format General-> time -> 12/24 hour, i try to change Locale also like " return timeFormat.isEqual("HH:mm") ? Locale(identifier: "en_GB") : Locale(identifier: "en_US_POSIX") " but its work in Gregorian calendar, when i set japanese calendar in device setting dateTimePicker shows wrong year like doesn't show "Reiwa" prefix of the year. how to fix it, anyone face this problem import UIKit class ViewController: UIViewController { let dateTextField = UITextField() let datePickerContainer = UIView() let datePicker = UIDatePicker() let toolbar = UIToolbar() override func viewDidLoad() { super.viewDidLoad() setupDateTextField() setupDatePickerContainer() setupToolbar() setupDatePicker() } func setupDateTextField() { dateTextField.placeholder = "Select date and time" dateTextField.borderStyle = .roundedRect dateTextField.translatesAutoresizingMaskIntoConstraints = false view.addSubview(dateTextField) // Constraints NSLayoutConstraint.activate([ dateTextField.centerXAnchor.constraint(equalTo: view.centerXAnchor), dateTextField.centerYAnchor.constraint(equalTo: view.centerYAnchor), dateTextField.widthAnchor.constraint(equalToConstant: 200), dateTextField.heightAnchor.constraint(equalToConstant: 40) ]) dateTextField.addTarget(self, action: #selector(showDatePicker), for: .editingDidBegin) } func setupDatePickerContainer() { datePickerContainer.backgroundColor = .white datePickerContainer.layer.cornerRadius = 10 datePickerContainer.layer.shadowColor = UIColor.black.cgColor datePickerContainer.layer.shadowOpacity = 0.3 datePickerContainer.layer.shadowOffset = CGSize(width: 0, height: 5) datePickerContainer.layer.shadowRadius = 10 datePickerContainer.translatesAutoresizingMaskIntoConstraints = false view.addSubview(datePickerContainer) // Constraints NSLayoutConstraint.activate([ datePickerContainer.centerXAnchor.constraint(equalTo: view.centerXAnchor), dat…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138487049
answer count: 0
tagged with: ios
score: 0
tagged with: calendar
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138486428
has comment: http://stackoverflow.com/comment/138486781
has comment: http://stackoverflow.com/comment/138487487
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/138487190
has title: In Swift DateTimePicker how can i set 12 or 24 hour time format? based on my app settings not Device setting

tauri
type: Tag
tag name: tauri
tags question: http://stackoverflow.com/q/78586575

http://stackoverflow.com/q/78475779
type: UnansweredQuestion
score: 0
has title: Objective-c conforming protocols property attributes conflict
answer count: 0
has body: Can I make a class conforms to two protocols with same property but different access level attribute? E.g. @interface Test () &lt;ProtocolA, ProtocolB&gt; { } @end @protocol ProtocolA &lt;NSObject&gt; @property(nonatomic, readwrite) id prop; @end @protocol ProtocolB &lt;NSObject&gt; @property(nonatomic, readonly) id prop; What I'm trying to achieve is to expose prop only in test environment. In test cases, I'll set prop to be a mocked object. Thanks! I tried to expose prop in ProtocolB to be readwrite and set it successfully in tests, however, this is less ideal since I sacrifice the access level.
type: Question
tagged with: objective-c

http://stackoverflow.com/q/78476414
type: Question
tagged with: swift
type: UnansweredQuestion
answer count: 0
has title: How to serve a React production build using Telegraph iOS Server Library?
tagged with: ios
tagged with: objective-c
tagged with: wkwebview
score: 0
has body: Loading a React production build directly through Bundle.main.url and WKWebView is causing my server requests Origin header to be set as "file://" due to which I get CORS Error. We are using Telegraph server as well in our app and according to their documentation: // You can also serve custom urls, for example the Demo folder in your bundle let demoBundleURL = Bundle.main.url(forResource: "Demo", withExtension: nil)! server.serveDirectory(demoBundleURL, "/demo") We want to know if it is possible to serve a React production build using the above syntax and if yes, how? Any guidance would be appreciated. Thanks. WHAT WE TRIED:- We tried loading our React production build directly through WKWebView but the Origin header of the requests get set to "file://" which leads to CORS issue. We tried serving our React production build using the syntax mentioned in Telegraph's GitHub repo but that leads to a white screen on my app. (My guess is that Telegraph is not capable of serving React production builds this way). We were expecting this method to serve our React production build so that we can workaround the WKWebView Origin Header "file://" issue. This is our code (not complete code, just relevant parts, for reference): import Telegraph public var server: Server! public var webView: WKWebView! // other code let buildURL = Bundle.main.url(forResource: "build", withExtension: nil)! server.serveDirectory(buildURL, "/build") let url = URL(string: "https://**-MY IP HERE-**:9999/build") let request = URLRequest(url: url!) webView.load(request)

http://stackoverflow.com/a/78617515
has body: the issue seems to be that objective-c doesn't have an equivalent to content.updating(from: intent) Try contentByUpdatingWithProvider:error:. It should be equivalent to updating(from:).
score: 0
type: Answer
answers question: http://stackoverflow.com/q/78582894

http://stackoverflow.com/comment/138461641
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78537820
has text: Nope. NSLog(@"%@",mainWindow); says <NSWindow: 0x12c606490> or, next run, <NSWindow: 0x135f07dd0> Which I interpret as “This is an NSWindow object starting at address 0x135f07dd0.”

http://stackoverflow.com/q/78514283
tagged with: uidocumentpickerviewcontroller
has body: I'm updating some old code to avoid deprecated stuff and to use new APIs with UIDocumentPickerViewController. I used to have to list a bunch of custom strings for various file types like so: NSArray<NSString*> *types = @[ (__bridge NSString *)kUTTypePDF, (__bridge NSString *)kUTTypeText, @"com.microsoft.word.doc", @"org.openxmlformats.wordprocessingml.document", @"com.microsoft.excel.xls", @"org.openxmlformats.spreadsheetml.sheet", @"com.microsoft.powerpoint.ppt", @"org.openxmlformats.presentationml.presentation", @"com.apple.iwork.pages.sffpages", @"com.apple.iwork.numbers.sffnumbers", @"com.apple.keynote.key", @"public.zip-archive", ]; UIDocumentPickerViewController *picker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:types inMode:UIDocumentPickerModeImport]; But I want to use the newer -initForOpeningContentTypes and use UTType which has many more built-in types that also cover lots of forms of those types. For example, instead of having to declare com.microsoft.excel.xls and org.openxmlformats.spreadsheetml.sheet in order to cover xls and xlsx files, I can just declare: NSArray<UTType*> *types = @[ UTTypePDF, UTTypeText, UTTypePresentation, UTTypeSpreadsheet, UTTypeZIP, [UTType typeWithIdentifier:@"com.microsoft.word.doc"], [UTType typeWithIdentifier:@"org.openxmlformats.wordprocessingml.document"], [UTType typeWithIdentifier:@"com.apple.iwork.pages.sffpages"], ]; UIDocumentPickerViewController *picker = [[UIDocumentPickerViewController alloc] initForOpeningContentTypes:types asCopy:YES]; However, I cannot find a built-in UTType that will cover "word processing documents" like doc, docx, and pages. As far as I can tell, I still need to use raw string constants for those, but I'm hoping there is a built-in type I can use and maybe I'm just missing it in the documentation. Is there a word-processing doc UTType that covers doc, docx, pages, etc, similar to how UTTypeSpreadsheet covers xls, xlsx, numbers, etc?
score: 1
has comment: http://stackoverflow.com/comment/138417223
has comment: http://stackoverflow.com/comment/138473226
tagged with: ios
has comment: http://stackoverflow.com/comment/138473193
type: AnsweredQuestion
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/78516522
favorite count: 0
has title: Standard UTType for Word Docs with UIDocumentPickerViewController?
accepted answer: http://stackoverflow.com/a/78516522
has comment: http://stackoverflow.com/comment/138440729
type: Question
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/140064550
type: Comment
comment on: http://stackoverflow.com/a/78593074
has text: Is Capability of "Near Field Communication Tag Reading" is enougf for reading NFC ?
score: 0
type: AnswerComment

freeze
tag name: freeze
type: Tag
tags question: http://stackoverflow.com/q/78501315

http://stackoverflow.com/q/78448106
downvote count: 0
tagged with: ios-frameworks
has answer: http://stackoverflow.com/a/79497631
tagged with: kotlin-multiplatform
has title: Kotlin multi platform project can't find iOS Framework
type: Question
has answer: http://stackoverflow.com/a/78757575
tagged with: objective-c
type: UnansweredQuestion
favorite count: 0
has body: I'm following the documentation for adding a iOS framework without cocoapods to a KMM project, And I'm getting this error when syncing the gradle, and of course is not integrating the framework, the error is :shared:iosArm64Main: cinterop file: /Users/luis.garcia/Desktop/kmp-crash/shared/build/classes/kotlin/iosArm64/main/cinterop/shared-cinterop-luismafw.klib does not exist Exception in thread "main" java.lang.Error: /var/folders/h_/qb6wf4y90lz8c2blq8d3xbk80000gq/T/15310463132579371666.m:1:9: fatal error: module 'luismafw' not found at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:275) at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:83) at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:15) at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:564) at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:307) at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLibSafe(main.kt:243) at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.access$processCLibSafe(main.kt:1) at org.jetbrains.kotlin.native.interop.gen.jvm.Interop.interop(main.kt:101) at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:47) at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:23) at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:45) Here is how I got all setup File structure: the build.gradle.kts configuration: listOf( iosX64(), iosArm64(), iosSimulatorArm64() ).forEach { it.compilations.getByName("main") { val luismafw by cinterops.creating { defFile("src/nativeInterop/cinterop/luismafw.def") compilerOpts( "-framework", "luismafw", "-F/Users/luis.garcia/Desktop/kmp-crash/iosApp/luismafw.framework" ) } } it.binaries.framework { baseName = "shared" isStatic = true } it.binaries.all { linkerOpts( "-framework", "luismafw", "-F/Users/luis.garcia/Desktop/kmp-cra…
tagged with: kotlin
upvote count: 2
score: 2
answer count: 2
tagged with: swift

applepay
type: Tag
tag name: applepay
tags question: http://stackoverflow.com/q/78537820

http://stackoverflow.com/comment/138404265
type: QuestionComment
type: Comment
has text: Did you use [UISheetPresentationController](https://developer.apple.com/documentation/uikit/uisheetpresentationcontroller)?
comment on: http://stackoverflow.com/q/78505516
score: 0

http://stackoverflow.com/q/78578910
tagged with: combine
favorite count: 0
possible better answer: http://stackoverflow.com/a/78578959
type: Question
tagged with: swift
has body: In a larger ObjC/Swift-mixed codebase I have an ObjC protocol MyObjCProtocol &lt;NSObject&gt; that other ObjC classes need to conform to. It declares a string property @property (copy) NSString *myString. Now, one of my Swift objects has a property conformsToObjCProtocol that is declared conforming to this protocol: let conformsToObjCProtocol: MyObjCProtocol This all works well. But when I try to observe myString using Combine like this: let cancellable = conformsToObjCProtocol.publisher(for: \.myString).sink { print($0) } I get an error Value of type 'any MyObjCProtocol' has no member 'publisher'. I believe it should work because MyObjCProtocol is declared conforming to NSObject. I did add MyObjCProtocol.h to the bridging header too so that's not it. I can't rewrite the protocol in Swift because I need ObjC classes to conform to it. What can I do about this?
accepted answer: http://stackoverflow.com/a/78579129
linked to: http://stackoverflow.com/q/60381905
has answer: http://stackoverflow.com/a/78578959
has title: Swift property conforming to ObjC protocol has no member 'publisher'
upvote count: 0
answer count: 2
score: -1
tagged with: protocols
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/78579129
tagged with: objective-c

unit-testing
tag name: unit-testing
type: Tag
tags question: http://stackoverflow.com/q/78583708

http://stackoverflow.com/comment/138508042
has text: Looks like a threading issue related to navigation
type: Comment
comment on: http://stackoverflow.com/q/78565146
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138400037
type: Comment
comment on: http://stackoverflow.com/q/78504557
type: QuestionComment
has text: This is not possible. Do you realise that `@objc public func description() -> String` doesn't even compile?
score: 0

http://stackoverflow.com/a/78587691
answers question: http://stackoverflow.com/q/78566066
score: 0
has comment: http://stackoverflow.com/comment/138555835
has body: Your build is completely wrong. The script you use is from here, and this directory contains only the scripts intended to be used for cross-compilation for the platform that differs from your actual hardware. From your CLI, I would suppose that your build tries to create arm64 cross-compiled binaries for Linux, but packages them into the MacOS-native X-Framework distribution archive. In this situation it is highly recommended to remove the current build, and then install cmake via homebrew, run it like this: mkdir build &amp;&amp; cd build cmake -LAH .. ...and inspect the printed variables with their developer hints. Then you may set everything up and prepare your XFramework archive with the architecture properly deducted.
type: Answer
has comment: http://stackoverflow.com/comment/138553319

http://stackoverflow.com/a/78525331
has comment: http://stackoverflow.com/comment/138463611
accepted answer of: http://stackoverflow.com/q/78501315
answers question: http://stackoverflow.com/q/78501315
has body: Your post is lacking some details -- however... I'm assuming you have your Storyboard / Segues setup like this: That "works" -- well, it doesn't crash (right away) -- because each button is presenting a new instance of the next view controller. If you cycle through your 3 "present" segues a couple times, then go into Debug View Hierarchy, it will look something like this: When you try to do this via code, you stated: "VC1, VC2, and VC3, that are instantiated when the app starts" So, let's say you have _vc1, _vc2 and _vc3, and you present _vc1. _vc1 then presents _vc2, which presents _vc3, which then tries to present _vc1. But, that instance of _vc1 is already in the view hierarchy, presenting _vc2 presenting _vc3 ... and you end up with (effectively) an infinite loop. A "carousel of presents" is a bit of an unusual interface... but, if that's what your goal is, you'll need to take another approach. One option would be to present a single view controller, which would instantiate and load the 3 VCs as child view controllers. Each child's view would be overlaid. When you want to go from VC1 to VC2, you can simulate the presentation by: align VC2's view's Top to "main" view's bottom bring VC2's view to the front animate VC2's view up to the Top If you're interested, I posted a quick example of that approach here: https://github.com/DonMag/PresentCarousel
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/78466384
answer count: 0
score: 1
tagged with: crashlytics
tagged with: ios
has body: I integrated Firebase Crashlytic into my iOS app and got this crash report from other user. Looking at stack trace, I don't know what the issue is. I'm also unable unable to replicate the crash issue at my own device. Does anybody have idea what should I check or fix?
has comment: http://stackoverflow.com/comment/138333052
type: Question
has comment: http://stackoverflow.com/comment/138365249
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138948252
upvote count: 1
favorite count: 0
has title: Crash issue in iOS related to fopen_s(__sFILE**, char const*, char const*)
linked to: http://stackoverflow.com/q/78122789
has comment: http://stackoverflow.com/comment/138365271
tagged with: swift
downvote count: 0

http://stackoverflow.com/comment/138354267
score: 0
type: Comment
has text: Please show the actual code that "is not working for me". Explain, with reference to that code, what you are hoping to do and what is happening instead.
comment on: http://stackoverflow.com/q/78478022
type: QuestionComment

http://stackoverflow.com/q/78582894
has body: I am trying to get iOS communication notifications working in objective-C and no matter which variations I try, the icon keeps getting attached as attachment and not as notification icon #import <OneSignalFramework/OneSignalFramework.h> #import <Intents/Intents.h> #import <UserNotifications/UserNotifications.h> #import "NotificationService.h" @interface NotificationService () @property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver); @property (nonatomic, strong) UNNotificationRequest *receivedRequest; @property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent; @end @implementation NotificationService - (INSendMessageIntent *)genMessageIntentFromRequest:(UNNotificationRequest *)request { NSDictionary *custom = request.content.userInfo[@"custom"]; if (![custom isKindOfClass:[NSDictionary class]]) { return nil; } NSDictionary *a = custom[@"a"]; if (![a isKindOfClass:[NSDictionary class]]) { return nil; } NSString *name = a[@"name"]; NSString *urlString = a[@"url"]; if (!name || !urlString) { return nil; } NSURL *url = [NSURL URLWithString:urlString]; if (!url) { return nil; } INPersonHandle *handle = [[INPersonHandle alloc] initWithValue:nil type:INPersonHandleTypeUnknown]; INImage *avatar = [INImage imageWithURL:url]; INPerson *sender = [[INPerson alloc] initWithPersonHandle:handle nameComponents:nil displayName:name image:avatar contactIdentifier:nil customIdentifier:nil]; if (@available(iOSApplicationExtension 14.0, *)) { return [[INSendMessageIntent alloc] initWithRecipients:nil outgoingMessageType:INOutgoingMessageTypeOutgoingMessageText content:nil speakableGroupName:nil conversationIdentifier:nil serviceName:nil sender:sender attachments:nil]; } else { // Fallback on earlier versions return nil; } } - (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler { self.receivedRequest = request; self.contentHandler = conte…
tagged with: ios
type: Question
upvote count: 1
tagged with: swift
downvote count: 0
has answer: http://stackoverflow.com/a/78617515
type: UnansweredQuestion
tagged with: apple-push-notifications
score: 1
has title: iOS Communication Notification icon
favorite count: 0
tagged with: onesignal
answer count: 1
tagged with: objective-c

http://stackoverflow.com/q/78586930
has body: I´ve created a basic iPhone application for iOS 17.5 using XCode where I would like to scan a PIV card (ID06) and just log the result. I´ve tried to minimize the code as much as possible, but whatever I do I receive: -[NFCTagReaderSession _connectTag:error:]:744 Error Domain=NFCError Code=2 "Missing required entitlement" UserInfo={NSLocalizedDescription=Missing required entitlement} after I`ve connected to the card. I`ve tripplechecked the signing certificate to include NFC option in Apple developer portal, and also deleted the certificate locally on my computer to be sure it uses the latest. Here´s my ViewController: ViewController.h #import <UIKit/UIKit.h> #import <CoreNFC/CoreNFC.h> @interface ViewController : UIViewController <NFCTagReaderSessionDelegate> @property (nonatomic, strong) NFCTagReaderSession *nfcSession; @end Viewcontroller.m #import "ViewController.h" @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; [self startScanning]; } - (void)startScanning { self.nfcSession = [[NFCTagReaderSession alloc] initWithPollingOption:NFCPollingISO14443 delegate:self queue:nil]; self.nfcSession.alertMessage = @"Hold your iPhone near the NFC tag."; [self.nfcSession beginSession]; } - (void)tagReaderSession:(NFCTagReaderSession *)session didDetectTags:(NSArray<__kindof id<NFCTag>> *)tags { id<NFCTag> tag = [tags firstObject]; [session connectToTag:tag completionHandler:^(NSError * _Nullable error) { if (error != nil) { [session invalidateSessionWithErrorMessage:@"Connection failed"]; return; } id<NFCISO7816Tag> iso7816Tag = [tag asNFCISO7816Tag]; NSLog(@"Connected: %@", iso7816Tag); // FOLLOWING APDU COMMAND CAN BE REMOVED, THE RESULT IS THE SAME NSData *readCertCommandData = [NSData dataWithBytes:(unsigned char[]){0x00, 0xB0, 0x00, 0x00, 0x10} length:5]; NFCISO7816APDU *readCertCommand = [[NFCISO7816APDU alloc] initWithInstructionClass:0x00 instructionCode:0xB0 p1Parameter:0x00 p2Parameter:0x00 data:readCertCommandData expectedResponseLength:256…
tagged with: objective-c
tagged with: xcode
answer count: 1
type: Question
tagged with: nfc
has answer: http://stackoverflow.com/a/78593074
accepted answer: http://stackoverflow.com/a/78593074
has title: "Missing required entitlement" after connecting to ID06 (ISO-DEV)
tagged with: ios
tagged with: entitlements
type: AnsweredQuestion
score: 0

http://stackoverflow.com/comment/138360113
has text: How is it possible to pause the execution of `viewDidLoad` while in the middle of it? I thought you have to complete this function in order for main queue to pick up the next task. Or am i understanding it incorrectly? Also what did I do differently from the link I provided?
type: Comment
comment on: http://stackoverflow.com/q/78481020
score: 0
type: QuestionComment

combine
tags question: http://stackoverflow.com/q/78578910
type: Tag
tag name: combine

http://stackoverflow.com/comment/138323061
has text: Now I follow you! I can reuse entityObj after I save a record by writing: entityObj = [NSEntityDescription insertNewObjectForEntityForName:@"MyEntity" inManagedObjectContext:myContext]; Then fill the record with new data and save it again. Still, this Core Data stuff is hard to wrap your head around.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78457497
score: 0

http://stackoverflow.com/q/78457453
tagged with: objective-c
has body: I am trying to create a simple database table of records using Core Data and Objective-C. I understand that instances of NSManagedObject is what I store those records in, but how many entity records can I store in a single NSManagedObject? If only one, then how do I declare multiple instances of NSManagedObjects with unique identifiers for, in this example 'entityObj', which must be provided by the user at runtime? In this example, MyEntity contains three NSString attributes (city, county, name). Here's how I'm declaring an NSManagedObject. NSManagedObject *entityObj = [NSEntityDescription insertNewObjectForEntityForName:@"MyEntity" inManagedObjectContext:myContext]; // fill the entityObj with data [entityObj setValue:@"Edmonton" forKey:@"city"]; [entityObj setValue:@"Canada" forKey:@"country"]; [entityObj setValue:@"Bill" forKey:@"name"]; This stores one record of data, but I need to store more of them. How can I specify the value of 'entityObj' at runtime? I tried saving one record, reusing the same 'entityObj' with new data and saving again, but that just replaces the contents of the previous record. Is there a way I can store more than one of these records in a single NSManagedObject? Intuitively, I'm thinking I might be able to make my NSManagedObject an array of MyEntity records. `
type: Question
answer count: 1
has title: How do I create a simple database table of attributes of NSManagedObjects using Core Data and Objective-C?
linked to: http://stackoverflow.com/q/32153397
has answer: http://stackoverflow.com/a/78457497
score: 0
type: UnansweredQuestion
tagged with: core-data
has comment: http://stackoverflow.com/comment/138319056

http://stackoverflow.com/q/78586575
tagged with: macos-sonoma
type: UnansweredQuestion
downvote count: 2
tagged with: macos
score: -1
has title: MacOS: How do I give my program permissions during development?
answer count: 1
tagged with: objective-c
tagged with: tauri
has answer: http://stackoverflow.com/a/78595555
favorite count: 0
type: Question
upvote count: 1
has body: I&quot;m developing an app on macOS. It's a tauri app which links to a custom library (written in objective-C so I can access some system functionality). The issue is, some of the functionality in the custom library, requires permissions in order to work. How do I give my tauri program permissions? Because this is a dev program and not an installed program, I can't give the program permissions via system Privacy &amp; Security in the System Settings. I've also tried to give the library permissions via xcode but because this is a library and not a app, I don't have the Signing &amp; Capabilities tab, so I can't give the library permissions through xcode.

http://stackoverflow.com/a/78579129
answers question: http://stackoverflow.com/q/78578910
score: 2
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/78578910
upvote count: 2
has body: The Objective-C protocol is imported into Swift as a protocol that requires conformance to NSObjectProtocol. It does not require the conformer to inherit NSObject. If you declare the property like this: let conformsToObjCProtocol: MyObjCProtocol &amp; NSObject then this can be observed using a NSObject.KeyValueObservingPublisher. NSObject.KeyValueObservingPublisher( object: conformsToObjCProtocol, keyPath: \.myString, options: [] ).sink { ... } The publisher method unfortunately cannot be used here because of how it is declared. The declaration requires that you call it on a concrete type.
type: Answer

http://stackoverflow.com/a/78563382
has body: If you want to code objective-c or include objective-c headers in a C++ file, you need to rename the .cc or .cpp file extension to .mm. In my .cpp file I've also included this: #if defined(SDL_PLATFORM_MACOS) #include &lt;Cocoa/Cocoa.h&gt; #include &lt;Foundation/Foundation.h&gt; #include &lt;QuartzCore/CAMetalLayer.h&gt; You're including objective-c headers in a c++ file. I recommend following the link in this stackoverflow answer
type: Answer
score: 0
answers question: http://stackoverflow.com/q/78492779

http://stackoverflow.com/q/78516082
type: Question
upvote count: 1
type: UnansweredQuestion
tagged with: macos
favorite count: 0
has comment: http://stackoverflow.com/comment/138421101
tagged with: exception
has comment: http://stackoverflow.com/comment/138429288
tagged with: objective-c
downvote count: 0
tagged with: cocoa
has comment: http://stackoverflow.com/comment/138419874
answer count: 0
has comment: http://stackoverflow.com/comment/138420524
has comment: http://stackoverflow.com/comment/138500469
score: 1
has comment: http://stackoverflow.com/comment/138428019
has title: uncaughtExceptionHandler failed to catch exceptions in objective-c on Mac OS
has body: Hi and I'm working on handling exceptions in an app. My exception handler code is as below. In AppDelegate.h @interface AppDelegate : NSObject <NSApplicationDelegate> static void uncaughtExceptionhandler(NSException* exception); In AppDelegate.m @implementation AppDelegate static void uncaughtExceptionhandler(NSException* exception) { //log related information } -(void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSSetUncaughtExceptionHandler(&uncaughtExceptionhandler); } In order to test this handler, I raised an expection in my code. In MyWindowController.m - (void)testHandler { @throw [NSException exceptionWithName:@"TestException" reason:@"TestOnly" userInfo:nil]; } But noting was logged and it seemed uncaughtExceptionhandler function was not triggered. I'm not sure if my exception handler code is right.

http://stackoverflow.com/comment/138486073
type: QuestionComment
has text: I want to send it every Sunday at 10:30 am only. But if the user takes any reading (or skips today's notification) and skips upcoming notification, then it will show next Sunday. @Rob
type: Comment
comment on: http://stackoverflow.com/q/78541807
score: 0

http://stackoverflow.com/q/78535483
type: AnsweredQuestion
answer count: 1
tagged with: objective-c
favorite count: 0
has title: Crash when connecting an AVAudioSinkNode to my AVAudioEngine
has answer: http://stackoverflow.com/a/78538010
tagged with: core-audio
tagged with: avfoundation
has body: I have tried to get audio input (and output at the same time) using the AVAudioSourceNode and AVAudioSinkNode. The problem is, I haven't been able to find a proper sample on how to set it up, even on Apple's website. I do basically this: AVAudioEngine* m_engine = [AVAudioEngine new]; AVAudioSession* m_avSession = AVAudioSession.sharedInstance; if (![m_avSession setCategory:AVAudioSessionCategoryPlayAndRecord error:&error] || ![m_avSession setActive:true withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:&error]) { m_logger.Error("Could not activate Audio Session: ", error.description); } AVAudioSinkNode* CreateInputNode(AVAudioFormat* format) { AVAudioSinkNodeReceiverBlock block = [checker, format] (const AudioTimeStamp* timestamp, AVAudioFrameCount frameCount, const AudioBufferList* inputData) { ProcessAudioForInput(format, inputData, frameCount); return OSStatus(noErr); }; return [[AVAudioSinkNode alloc] initWithReceiverBlock:block]; } AVAudioSessionRouteDescription* route = m_avSession.currentRoute; AVAudioFormat* inputFormat = [m_engine.inputNode inputFormatForBus:FIRST_AUDIO_BUS]; auto sinkNode = CreateInputNode(inputFormat); if (sinkNode) { [m_engine attachNode:sinkNode]; [m_engine connect:sinkNode to:m_engine.inputNode format:inputFormat]; channelCount = inputFormat.channelCount; } else { m_logger.Error("Could not create input node"); } The [m_engine connect:sinkNode line generates an exception, which I have strictly no idea how to debug: *** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: inSrcImpl->NumberOutputs() > 0' Could anyone help or point me to proper resources explaining how to set this up, instead of going blind. Note that I have watched some videos from the WWC, like https://developer.apple.com/videos/play/wwdc2019/510/ but the source code and explanations are not helping me solve this problem.
type: Question
upvote count: 1
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/78538010

http://stackoverflow.com/q/78467796
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
downvote count: 0
has body: For my cross-platform project (Mac & Windows), I coded a generic C++ collection view (i.e. table view) leveraging the NSStackView from the AppKIt in Objective-C (as I can mix ObjC and C++ together easily) on the Mac. The individual rows are themselves a horizontal NSStackView, both for the header displaying the column titles and the data rows. I also embed a search box and a scroll view to manage large number of data rows. The actual view hierarchy is as following: NSStackView(vertical) L NSSearchField L NSStackView(horizontal) - the header row L NSScrollView(vertical) L NSStackView(vertical) L NSStackView(horizontal) - the data row L ... Here's how it looks: The collection view is within a split view on the right. When I resize the left view, the collection view stick to the split line except for the header row which remains on the RIGHT (see below): To display hierarchical information, I customized the NSStackView for both collection and list of rows with isFlipped returning YES. Here's my code: @interface FlippedStackView : NSStackView { } - ( id ) initWithBackground: ( BOOL ) value; - ( BOOL ) isFlipped; @end @implementation FlippedStackView - ( id ) initWithBackground: ( BOOL ) value { self = [ super init ]; if( self ) { if( value == YES ) { self.spacing = 0.0; [ self.layer setBackgroundColor:[ NSColor windowBackgroundColor ].CGColor ]; } } return self; } - ( BOOL ) isFlipped { return YES; } @end // -------------------- @implementation MacUICollectionView - ( id ) initWithBackground: ( BOOL ) value { M_LOG_FUNCTION( MacUICollectionView::initWithBackground ) self = [ super init ]; if( self ) { // General layout setting self.translatesAutoresizingMaskIntoConstraints = NO; self.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; self.orientation = NSUserInterfaceLayoutOrientationVertical; self.wantsLayer = YES; self.spacing = 0.0; if( value == YES ) { self.spacing = 0.0; [ self.layer setBackgroundColor:[ NSColor windowBackgroundColor ].CGColor ]; } // Ini…
favorite count: 0
has comment: http://stackoverflow.com/comment/138341027
upvote count: 1
score: 1
tagged with: appkit
tagged with: macos
tagged with: nsstackview
has answer: http://stackoverflow.com/a/78479352
type: Question
has title: Problem of alignment with NSStackView in a custom table view

http://stackoverflow.com/q/78526615
has body: This is a follow on question from this question. I have this test program that I am using to debug a larger cross-language program (Go/Obj-C). #include <Foundation/Foundation.h> int main() { while (1) { const char *tz = [[[NSCalendar autoupdatingCurrentCalendar] timeZone] name] UTF8String]; printf("%s\n", tz); sleep(1); } } From the documentation Settings you get from this calendar do change as the user’s settings change (contrast with currentCalendar). Note that if you cache values based on the calendar or related information those caches will of course not be automatically updated by the updating of the calendar object. I would expect running this program and then, while it is running changing the time zone in settings, would result in the printed time zone identifier to follow the changes. This does not happen (Running a single iteration and looping in the shell does work as expected since presumably the program is obtaining an environment at program start). I am not caching anything here. Is there something that I need to do to make this follow the the current time zone?
type: Question
accepted answer: http://stackoverflow.com/a/78528011
has title: How to get time zone from autoupdatingCurrentCalendar to update?
linked to: http://stackoverflow.com/q/78478022
type: AnsweredQuestion
answer count: 1
has answer: http://stackoverflow.com/a/78528011
tagged with: objective-c
score: 0

http://stackoverflow.com/q/78556827
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/138493114
has body: I have an NSTableView where the user clicks a button to add a new row. This goes to an IBAction that inserts an object in the NSArrayController and then uses editColumn:row:withEvent:select: to put the new row into edit mode for the user. The problem is that once editColumn:row:withEvent:select: is fired all rows in the tableview turn gray, ie the tableview loses focus. I've tried reseting first responder before and after calling editColumn but nothing works. Once the new row is inserted and everything turns gray I have to select rows one at a time before their text will turn normal (black) again. How can I programmatically set a row/column to edit mode without this happening? -(IBAction)addAttribute:(id)sender { TKSpecialObject *theObject = [TKSpecialObject new]; [self.myArrayController insertObject:theObject atArrangedObjectIndex:self.myArrayController.count]; [self.view.window makeFirstResponder:theTableView]; [self.myTableView editColumn:0 row:[self.myTableView selectedRow] withEvent:nil select:YES]; }
has answer: http://stackoverflow.com/a/78557075
has comment: http://stackoverflow.com/comment/138492857
answer count: 1
duplicate of: http://stackoverflow.com/q/77822954
tagged with: nstableview
score: 0
type: Question
accepted answer: http://stackoverflow.com/a/78557075
has comment: http://stackoverflow.com/comment/138492849
tagged with: objective-c
tagged with: cocoa
has title: NSTableView Loses Focus After Calling editColumn
linked to: http://stackoverflow.com/q/77822954

http://stackoverflow.com/comment/138360140
score: 0
has text: I may have some trouble understanding "transferred the execution back to the run loop". Can the execution of a function be paused (and then execute another function) without switching thread? I am always under the impression that the execution of a function can be paused when switching thread (aka thread context switch), but didn't know that it's also possible within one thread. that's surprising.
type: QuestionComment
comment on: http://stackoverflow.com/q/78481020
type: Comment

http://stackoverflow.com/a/78479376
has comment: http://stackoverflow.com/comment/138445491
has comment: http://stackoverflow.com/comment/138429906
has comment: http://stackoverflow.com/comment/138445733
accepted answer of: http://stackoverflow.com/q/78478022
has comment: http://stackoverflow.com/comment/138446052
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/138360655
type: Answer
answers question: http://stackoverflow.com/q/78478022
has body: From Objective-C, you want to use the classes that start with NS (e.g., NSCalendar rather than Swift’s Calendar, NSTimeZone rather than Swift’s TimeZone, etc.). Thus, in Objective-C (for me in Los Angeles, CA): NSString *name = NSCalendar.autoupdatingCurrentCalendar.timeZone.name; NSLog(@"timezone name %@", name); // America/Los_Angeles NSString *name2 = [[[NSCalendar autoupdatingCurrentCalendar] timeZone] name]; NSLog(@"timezone name %@", name2); // America/Los_Angeles NSString *abbreviation = NSCalendar.autoupdatingCurrentCalendar.timeZone.abbreviation; NSLog(@"timezone abbreviation %@", abbreviation); // PDT (aka, “Pacific Daylight Time”) NSString *abbreviation2 = [[[NSCalendar autoupdatingCurrentCalendar] timeZone] abbreviation]; NSLog(@"timezone abbreviation %@", abbreviation2); // PDT NSString *abbreviation3 = [NSCalendar.autoupdatingCurrentCalendar.timeZone abbreviationForDate:[NSDate now]]; NSLog(@"timezone abbreviation %@", abbreviation3); // PDT NSString *abbreviation4 = [[[NSCalendar autoupdatingCurrentCalendar] timeZone] abbreviationForDate:[NSDate now]]; NSLog(@"timezone abbreviation %@", abbreviation4); // PDT I include both the contemporary “dot syntax”, as well as the legacy Objective-C […] syntax. I assume you would use the former, the “dot syntax”, from Go, but I am not familiar with how these “Foundation” types are exposed. But, hopefully, the above helps. You reference struct TimeZone. That is a Swift struct. I gather you are not interested in Swift interfaces, but if you were, here are demonstrations of the Swift API: let name = Calendar.autoupdatingCurrent.timeZone.identifier print("timezone name", name); // America/Los_Angeles if let abbreviation = Calendar.autoupdatingCurrent.timeZone.abbreviation(for: .now) { print("timezone abbreviation", abbreviation); // PDT } FWIW, you reference autoupdatingCurrent.identifier. That is the identifier for the calendar (e.g. gregorian vs chinese), not the timezone. And that is Swift. In Objective-C, it woul…
has comment: http://stackoverflow.com/comment/138357628
has comment: http://stackoverflow.com/comment/138446294

http://stackoverflow.com/q/78505503
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/78964523
answer count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138402562
has body: We have VoIP feature in our iOS app which uses CallKit to handle calls. In new iOS devices with dynamic island I'm seeing an avatar in incoming call with nothing in it. I want to disable this but I don't know how to do it. Either remove this avatar or populate it, but having empty avatar doesn't look good. CXCallUpdate has a property _localizedCallerImageURL but it is private. I don't see any other way to set or remove this avatar. CXCallUpdate *update = [[CXCallUpdate alloc] init]; update.localizedCallerName = aCall.callerIdString; update.localizedCallerImageURL = nil; // Not accessible [self.cxProvider reportNewIncomingCallWithUUID:aCall.cxUUID update:update completion:^(NSError *error) { if (error) {
score: 0
has title: iOS devices with dynamic island shows empty user avatar. How to disable it?
type: Question
tagged with: swift
accepted answer: http://stackoverflow.com/a/78964523
tagged with: dynamic-island
tagged with: callkit
tagged with: ios

http://stackoverflow.com/a/78595555
has comment: http://stackoverflow.com/comment/138563639
score: 0
has comment: http://stackoverflow.com/comment/138563735
answers question: http://stackoverflow.com/q/78586575
has body: You have to add an Entitlements.plist file to your Tauri app and define the path to that file in the tauri.bundle.macOS.entitlements setting. See the macOS Bundle page in the Tauri guide. You will also find a link to the description of the various entitlements there. The Entitlements.plist file could look like this: <?xml version="1.0" encoding="UTF-8"?> com.apple.security.app-sandbox <true/> com.apple.security.files.user-selected.read-write <true/> com.apple.security.print <true/>
type: Answer

http://stackoverflow.com/a/79497631
score: 0
type: Answer
has body: I was able to fix that error by including my framework directory inside the cinterop iosTarget.compilations["main"].apply { val opencv2 by cinterops.creating{ includeDirs("src/iosMain/opencv2.framework") # This line }
answers question: http://stackoverflow.com/q/78448106

http://stackoverflow.com/comment/138360655
type: Comment
has text: For others with equally limited Objective C background, the required header is `<Foundation/Foundation.h>`.
comment on: http://stackoverflow.com/a/78479376
type: AnswerComment
score: 1

http://stackoverflow.com/comment/138368839
type: QuestionComment
has text: Indirectly, yes. Your completion block is in the run loop timer queue. Because you are keeping the RunLoop running it will eventually call your completion handler. As I said, use `Thread.sleep` instead and you will see a deadlock because you will have blocked the thread and prevented the RunLoop from running.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78481020

http://stackoverflow.com/comment/138487049
type: QuestionComment
has text: Now you can check, code updated
type: Comment
comment on: http://stackoverflow.com/q/78553036
score: 0

http://stackoverflow.com/comment/138357611
comment on: http://stackoverflow.com/q/78478022
type: QuestionComment
type: Comment
has text: Gerd and Rob, thank you both. That looks like it will have been the issue. I'll try with that (correct) documentation.
score: 1

http://stackoverflow.com/comment/138370551
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78481020
type: QuestionComment
has text: No matter how fancy the GCD is, it's still built on top of threads tho. This means there can only be 1 call stack per thread. So in my example, if `runUntilDate` doesn't call my closure, then it would deadlock for sure.

http://stackoverflow.com/comment/138357020
has text: kortschak, FWIW, when you are looking at the Apple documentation, in the upper right hand corner, it will tell you whether it is Swift documentation or Objective-C documentation (and if it is some type available from both languages, you can toggle back and forth between them).
score: 0
comment on: http://stackoverflow.com/q/78478022
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/138417223
has text: All of the types are listed in the docs. Maybe https://developer.apple.com/documentation/uniformtypeidentifiers/uttype/3551579-text ?
score: 0
comment on: http://stackoverflow.com/q/78514283
type: QuestionComment
type: Comment

http://stackoverflow.com/q/78478022
has comment: http://stackoverflow.com/comment/138357020
has answer: http://stackoverflow.com/a/78479376
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/78479376
has comment: http://stackoverflow.com/comment/138354267
answer count: 1
tagged with: macos
favorite count: 0
score: 0
has title: How to obtain updated timezone identifiers on MacOS?
tagged with: objective-c
has body: I am trying to get the updated timezone identifier for a cross-platform application. I have the Linux side handled, but am having difficulty finding information around how to get this on MacOS (not my native OS) using Objective-C (not my native language). (The application is written in Go, so the foreign calls need to be to Objective-C rather than Swift). I have found the documentation for struct TimeZone and autoupdatingCurrent which look to be the things that I want. It looks to me like I want to get autoupdatingCurrent.identifier, but I am unable to find any clear example of how to do this. As far as I can see from the documentation, I should just be able to reference autoupdatingCurrent.identifier to get the string, but this is not working for me, so I am obviously missing something. Can someone either point me to good documentation for this, or point to/provide a brief example that I can learn from?
has comment: http://stackoverflow.com/comment/138355269
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/138357611

http://stackoverflow.com/comment/138459369
type: QuestionComment
type: Comment
has text: Is `mainWindow.contentViewController` `nil`?
comment on: http://stackoverflow.com/q/78537820
score: 0

http://stackoverflow.com/q/78537820
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138463860
has title: How to get the Apple Pay Pane in Objective-C on MacOS
has comment: http://stackoverflow.com/comment/138459369
has comment: http://stackoverflow.com/comment/138466473
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/138878851
has comment: http://stackoverflow.com/comment/138461641
tagged with: applepay
tagged with: macos
has body: I’m a bit stumped, because we rarely use objective-c in our project (QT crossplatform,no X-Code at all, signing, entitlements, etc all done with commandline tools) and, up to now, no window stuff at all. (Except what gets triggered automatically, like Permission panes for Photokit, folders, etc.) I built the PaymentRequest and according to NSLog it works. if ([PKPaymentAuthorizationViewController canMakePayments]) { NSLog(@"Can Make Payments"); } else { NSLog(@"Cannot Make Payments"); } Removing or adding the supported card from the request also works. if ([PKPaymentAuthorizationViewController canMakePaymentsUsingNetworks:paymentNetworks capabilities:(PKMerchantCapabilityDebit | PKMerchantCapabilityCredit) ]) { NSLog(@"Card Supported"); } else { NSLog(@"Card Not Supported"); } So I do get Can Make Payments and Card Supported This also works in compile and execution, PKPaymentAuthorizationViewController *paymentPane = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:request]; But I don’t manage to raise the request NSWindow *mainWindow = [NSApplication sharedApplication].windows[0]; [mainWindow.contentViewController presentViewControllerAsModalWindow:paymentPane]; My code is in - (void)applicationDidFinishLaunching:(NSNotification *)aNotification I do get a window, as expected, but that’s all. The payment request is basically just the “supported cards” and the total, i.e. all we need is the authorisation token we would then send to the backend. The mobile team up has this up and running, but of course, they are all Swift these days and couldn’t help more than they already did.
type: Question

http://stackoverflow.com/q/78563449
score: 0
accepted answer: http://stackoverflow.com/a/78565821
type: Question
has comment: http://stackoverflow.com/comment/138509030
has answer: http://stackoverflow.com/a/78565821
has comment: http://stackoverflow.com/comment/138505308
tagged with: nstableview
type: AnsweredQuestion
tagged with: nsscrollview
answer count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138509045
has body: i am on macOS, objective-C. Not Swift, not ios. I have a programmatically created NSScrollView with a nested NSTableView. The scrollbar shows some kind of square element. This element lies above the scrollbar, but is not visible in the view hierarchy debugger. I want it to not show up. Here is a video: Here is a screenshot from the view hierarchy: Here's the code creating the scrollView and and tableView: // Create tableView NSTableView* tableView = [[NSTableView alloc] initWithFrame:NSZeroRect]; tableView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleNone; tableView.translatesAutoresizingMaskIntoConstraints = NO; tableView.backgroundColor = [NSColor clearColor]; tableView.delegate = self.delegate ? self.delegate : weakSelf; tableView.dataSource = self.delegate ? self.delegate : weakSelf; tableView.rowHeight = height; // predefined tableView.intercellSpacing = NSMakeSize(2, 2); tableView.headerView = [[NSTableHeaderView alloc] initWithFrame:NSMakeRect(0, 0, 0, CGFLOAT_MIN)]; tableView.columnAutoresizingStyle = NSTableViewUniformColumnAutoresizingStyle; if (@available(macOS 11.0, *)) {tableView.style = NSTableViewStylePlain;} self.tableView = tableView; // Create Scroll View NSScrollView* scrollView = [[NSScrollView alloc] initWithFrame:NSZeroRect]; scrollView.verticalScrollElasticity = NSScrollElasticityAutomatic; // Setup scrollView scrollView.drawsBackground = NO; scrollView.hasVerticalScroller = YES; scrollView.hasHorizontalScroller = YES; scrollView.autohidesScrollers = YES; scrollView.translatesAutoresizingMaskIntoConstraints = NO; scrollView.documentView = tableView; scrollView.scrollerStyle = NSScrollerStyleLegacy; // Must be legacy (!) scrollView.automaticallyAdjustsContentInsets = NO; scrollView.contentInsets = insets; scrollView.scrollerInsets = NSEdgeInsetsMake(-(insets.top), -(insets.left), -(insets.bottom), -(insets.right)); // insets are predefined self.scrollView = scrollView; [self.view addSubview:scrollView]; Any help appreciated
has title: Weird Scrollbar UI element in programmatically created NSScrollView (objective-c)

http://stackoverflow.com/q/78541807
upvote count: 1
tagged with: notifications
has comment: http://stackoverflow.com/comment/138475833
type: Question
tagged with: swift
downvote count: 0
type: UnansweredQuestion
has title: How can I send an iOS local push to a specific date and schedule it weekday for a particular time?
has body: I want to add and send an iOS local push notification to a specific date and want to schedule it by weekday for a specific time (hour, minute). I wanted to send this reminder weekday-wise but want to remove today's if use already took/achieved his today's goal. I've tried with the code below but failed to send it, please check the code below. import UIKit import UserNotifications public extension Date { func noon(using calendar: Calendar = .current) -> Date { calendar.date(bySettingHour: 12, minute: 0, second: 0, of: self)! } func day(using calendar: Calendar = .current) -> Int { calendar.component(.day, from: self) } func weekday(using calendar: Calendar = .current) -> Int { calendar.component(.weekday, from: self) } func hour(using calendar: Calendar = .current) -> Int { calendar.component(.hour, from: self) } func minute(using calendar: Calendar = .current) -> Int { calendar.component(.minute, from: self) } func second(using calendar: Calendar = .current) -> Int { calendar.component(.second, from: self) } func adding(_ component: Calendar.Component, value: Int, using calendar: Calendar = .current) -> Date { calendar.date(byAdding: component, value: value, to: self)! } func monthSymbol(using calendar: Calendar = .current) -> String { calendar.monthSymbols[calendar.component(.month, from: self)-1] } func addDay(n: Int) -> Date { let calendar = Calendar.current return calendar.date(byAdding: .day, value: n, to: self)! } } class ViewController: UIViewController, UNUserNotificationCenterDelegate { private let categoryID = "Category" override func viewDidLoad() { super.viewDidLoad() UNUserNotificationCenter.current().delegate = self let actionShowSomething = UNNotificationAction(identifier: "ShowSomething", title: "Show Something", options: []) let category = UNNotificationCategory(identifier: categoryID, actions: [actionShowSomething], intentIdentifiers: [], options: []) UNUserNotificationCenter.current().setNotificationCategories([category]) } @IBAction func addNotif…
score: 1
has comment: http://stackoverflow.com/comment/138486073
favorite count: 0
has answer: http://stackoverflow.com/a/78547381
tagged with: unusernotificationcenter
tagged with: ios
has comment: http://stackoverflow.com/comment/138468998
linked to: http://stackoverflow.com/q/35997059
has comment: http://stackoverflow.com/comment/138468728
answer count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138468030

http://stackoverflow.com/comment/138429906
score: 0
comment on: http://stackoverflow.com/a/78479376
type: AnswerComment
type: Comment
has text: I have a follow up. `autoupdatingCurrentCalendar` does not appear to be doing what I expect; I expect it to provide the current, potentially updated, time zone ID. However, when I run a program that polls this value (for example here https://go.dev/play/p/3mNSP4mrZs9) and then change the time zone via settings, the returned value does not change.

http://stackoverflow.com/comment/138355269
comment on: http://stackoverflow.com/q/78478022
score: 0
has text: Your question is tagged Objective-C but you link to Swift-only constructs. For ObjcC check here, the intro spells it pretty much out: https://developer.apple.com/documentation/foundation/nstimezone?language=objc
type: QuestionComment
type: Comment

http://stackoverflow.com/a/78496679
score: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/78481020
answers question: http://stackoverflow.com/q/78481020
upvote count: 1
downvote count: 0
has body: You said: My understanding is that, this code has a deadlock. Because the completion block is run on main thread, so in order for the completion block to run, viewDidLoad must return. And in order for viewDidLoad to return, completion block must be run to toggle the completed flag (hence circular wait). Yes and no. Technically, it is not a deadlock, as the run loop is still processing events. Your UI may appear to be responsive. But because viewDidLoad is not returning, some other events (like viewDidAppear) will not be called. There will be other consequences, too. This code interferes with the normal sequence of UI events, but is not technically a “deadlock”. Bottom line, you must allow viewDidLoad (and all UIKit events) to promptly return. So, either dispatch this asynchronously (but avoid using the same serial queue for both the dispatch_async and the dispatch_after), or better, lose this spinning on the run loop, altogether. Nowadays, spinning on the main run loop is almost always a mistake. GCD offers nice contemporary solutions. We would need more details regarding why you are spinning at all, though, to answer this broader question.

http://stackoverflow.com/comment/138445733
has text: Thanks Rob. In the C code I have a second sleep, which should give things enough time to update, and in the actual Go program, we have sleep and numerous syscalls and GC that would also be relinquishing time to the OS, so I would have thought we'd see the expected behaviour, but we don't.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78479376

http://stackoverflow.com/comment/138318371
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78457497
score: 0
has text: Core Data is doing that for you already, `NSManagedObjectID`. If you need a unique identifier that you control, add that property and set it in `awakeFromInsert()`. I'm wondering if you have a good understanding of the way Core Data works? One of the books by Donny Wals, Paul Hudson, or Florian Kugler/Daniel Eggert is probably worth working through (they're all going to be outdated though, see WWDC videos).

http://stackoverflow.com/comment/138468030
score: 0
type: Comment
has text: Please check https://stackoverflow.com/a/35999230/833395 you might missed something, for testing just put dateComponents.seconds = 5, so every 5 seconds local notification will trigger
type: QuestionComment
comment on: http://stackoverflow.com/q/78541807

http://stackoverflow.com/q/78511969
has body: I'm building a Swift Package distributed in the form of an XCFramework. Importing the resulting binary inside a Swift application works just fine, but trying to import it inside of an Objective-c application does not. (file not found or module not found at import statement). For testing purpose, I just drag n drop the XCFramework into my projects to import it. What am I missing? Here is the Swift Package definition: let package = Package( name: "MySDK", platforms: [.iOS(.v14)], products: [ .library( name: "MySDK", type: .dynamic, targets: ["MySDK"]), ], targets: [ .target( name: "MySDK"), .testTarget( name: "MySDKTests", dependencies: ["MySDK"]), ] ) and here is the build script, using xcodebuild (there is no intermediate Xcode project): # Build for iOS simulator xcodebuild \ -workspace ${WORKSPACE} \ -scheme ${SCHEME} \ -configuration ${CONFIGURATION} \ -destination "generic/platform=iOS Simulator" \ -archivePath "${BUILD_DIR}/archives/${SCHEME}-Simulator" \ BUILD_DIR=${BUILD_DIR} \ SKIP_INSTALL=NO \ DEFINES_MODULE=YES \ SWIFT_INSTALL_OBJC_HEADER=YES \ BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ OTHER_SWIFT_FLAGS="-DCOCOAPODS" # Build for iOS device xcodebuild \ -workspace ${WORKSPACE} \ -scheme ${SCHEME} \ -configuration ${CONFIGURATION} \ -destination "generic/platform=iOS" \ -archivePath "${BUILD_DIR}/archives/${SCHEME}-Device" \ BUILD_DIR=${BUILD_DIR} \ SKIP_INSTALL=NO \ DEFINES_MODULE=YES \ SWIFT_INSTALL_OBJC_HEADER=YES \ BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ OTHER_SWIFT_FLAGS="-DCOCOAPODS" ###################### # Create universal xcframework ###################### xcodebuild -create-xcframework \ -framework ${SCHEME}/${BUILD_DIR}/Release-iphoneos/PackageFrameworks/${SCHEME}.framework \ -framework ${SCHEME}/${BUILD_DIR}/Release-iphonesimulator/PackageFrameworks/${SCHEME}.framework \ -output ${SCHEME}/${BUILD_DIR}/${SCHEME}.xcframework # Add SwiftModules to XCframework mkdir ${SCHEME}/${BUILD_DIR}/${SCHEME}.xcframework/ios-arm64/${SCHEME}.framework/Modules cp -r ${SCH…
tagged with: swift-package-manager
has answer: http://stackoverflow.com/a/78512638
type: Question
upvote count: 1
tagged with: swift
answer count: 1
type: UnansweredQuestion
score: 1
downvote count: 0
tagged with: xcodebuild
favorite count: 0
tagged with: objective-c
has title: Building a Swift XCFramework compatible with Objective-c

http://stackoverflow.com/comment/138445862
type: AnswerComment
type: Comment
score: 0
has text: Watching the memory held by this process shows no indication of reduction. https://gist.github.com/kortschak/a3a12186f3b3a8f6f4c409e92fa3c6f0. Though its slow so I'd have to wait for days for it to crash.
comment on: http://stackoverflow.com/a/78528011

http://stackoverflow.com/q/78505516
has comment: http://stackoverflow.com/comment/138410757
downvote count: 3
score: -3
tagged with: ios
has comment: http://stackoverflow.com/comment/138404265
type: Question
has comment: http://stackoverflow.com/comment/138413369
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138438715
favorite count: 0
has body: I need to present a viewcontroller that present 2/3 of the screen from the bottom, remaining part of the screen is blur view. How can I set this? I need in objective c. tried modelPresentaionStyle with different values but did not get it.
has answer: http://stackoverflow.com/a/78526744
upvote count: 0
has title: How to set detents values to a viewcontroller in objective C

http://stackoverflow.com/a/78757575
answers question: http://stackoverflow.com/q/78448106
upvote count: 2
type: Answer
has body: The .def file you showed is missing the entry for headers =. See step 5 in the section on Add a library without CocoaPods. Provide values for two mandatory properties: headers describes which headers will be processed by cinterop. package sets the name of the package these declarations should be put into. For example: headers = DateTools.h package = DateTools
score: 2
downvote count: 0

notifications
tags question: http://stackoverflow.com/q/78541807
type: Tag
tag name: notifications
tags question: http://stackoverflow.com/q/78672092

http://stackoverflow.com/comment/138486781
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78553036
has text: your code does not seem to be related to the pictures you show. Can you show the code you have that produces the pictures.

http://stackoverflow.com/q/78502092
score: 0
answer count: 0
tagged with: bluetooth
tagged with: tuya
tagged with: ios
type: Question
tagged with: objective-c
type: UnansweredQuestion
has body: I am having some trouble using Tuya Smart Life app SDK in my React Native application. I am using this library to bridge between Tuya's native SDK and React Native. Using the SDK I successfully created a user, a home and then started the bluetooth scan, in the logs i can see that is discovers my device. After following Tuya Docs i see the discovered device should be returned from the "didDiscoveryDeviceWithDeviceInfo" but it doesn't happen for me. Not sure if its connected but in the logs i see this: [ThingRequest] request: domain = a1-us.iotbing.com, url = https:// a1-us.iotbing.com/api.json, api = smartlife.m.device.bind.status.get, commonParams = { "lang" : "en", "bizData" : "{\"nd\":1,\"customDomainSupport\":\"1\"}", "deviceId" : "229A6B7E-D000-46B5-96F7-8FA1D39246F2", "et" : "0.0.2", "osSystem" : "17.4.1", "bundleId" : "com.loopump.app", "time" : "1715584371", "lon" : 0, "channel" : "sdk", "nd" : 1, "appVersion" : "1.0.0", "ttid" : "appstore_d", "os" : "IOS", "v" : "1.1", "sid" : "az171557r6264723dJPjtCF38dfad8b6ed4cd012febe985129302799", "sign" : "e48995f2513ccefae9936cfe387f3cb100606a3e22bd7a02f07aa6c424dd6f32" , "platform" : "iPhone 13", "requestId" : "326662BA-85AC-4C63-A94B-7D7E77D70E57", "sdkVersion" : "5.2.0", "timeZoneId" : "Asia\/Manila", "lat" : 0, "clientId" : "nwvrfnnvnd5kxvrss55x", "deviceCoreVersion" : "5.7.0", "a" : "smartlife.m.device.bind.status.get", "cp" : "gzip" }, businessParams = { "encryptValue" : "4A536DA0ECEBAEE5", <...> [ThingRequest] response: api = smartlife.m.device.bind.status.get, data = { "success" : false, "errorCode" : "PERMISSION_DENIED", "status" : "error", "errorMsg" : "No access", "t" : 1715584370720 } The device id here is not of the bluetooth device i am trying to pair but its the actual Iphone that is scanning for devices. This is the Objective-C code that starts the scan and should return the discovered device: static TuyaBLERNScannerModule * scannerInstance = nil; @interface TuyaBLERNScannerModule()<ThingSmartBLEManage…
tagged with: react-native
has title: Cannot discover a Tuya powered bluetooth device using Tuya Smart Life app SDK in a React Native environment

http://stackoverflow.com/comment/138413369
score: 0
type: QuestionComment
type: Comment
has text: In this case please provide the code and describe what you're actually getting as a result, otherwise it's impossible to guess.
comment on: http://stackoverflow.com/q/78505516

http://stackoverflow.com/comment/138341027
type: Comment
score: 0
has text: How is the header stack view created? Post a [mre] please.
comment on: http://stackoverflow.com/q/78467796
type: QuestionComment

rust
tags question: http://stackoverflow.com/q/78544062
type: Tag
tag name: rust
tags question: http://stackoverflow.com/q/78715945
tags question: http://stackoverflow.com/q/79310010

http://stackoverflow.com/comment/138438715
has text: I got the solution, added as answer for the question. thank you Vadim Belyaev.
comment on: http://stackoverflow.com/q/78505516
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138948252
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78466384
type: Comment
has text: @Blurzschyter This seems to be Firebase dependency issue as highlighted in below to links. 1) https://github.com/firebase/firebase-ios-sdk/issues/12632 2) https://github.com/firebase/firebase-ios-sdk/issues/11403 I would recommend you to update your firebase dependency to 10.28.1 version as mentioned by Firebase Team that this issue has been fixed.

http://stackoverflow.com/comment/138420524
has text: Hi @trojanfoe, I have debugged it with break point in XCODE. testHandler was called but uncaughtExceptionhandler wasn't.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78516082
type: QuestionComment

http://stackoverflow.com/comment/138498116
score: 1
comment on: http://stackoverflow.com/q/78559718
type: QuestionComment
type: Comment
has text: Why not use a regexp? https://developer.apple.com/documentation/foundation/nsregularexpression

http://stackoverflow.com/a/78819188
upvote count: 1
downvote count: 0
has body: I was able to get a solution working for Capacitor 6 by following the steps listed here: https://capacitorjs.com/docs/ios/custom-code Create a file under App/plugins/SwipeGesture called SwipeGesturePlugin.swift by adding the file via xcode. // SwipeGesturePlugin.swift import Foundation import Capacitor @objc(SwipeGesturePlugin) public class SwipeGesturePlugin: CAPPlugin, CAPBridgedPlugin { public let identifier = "SwipeGesturePlugin" public let jsName = "SwipeGesture" public let pluginMethods: [CAPPluginMethod] = [] override public func load() { if let webView = bridge?.webView as? WKWebView { webView.allowsBackForwardNavigationGestures = true } } } Now we need to add a view controller file to the xcode project. Right click on your App project folder, click "New File..." Select "Cocoa Touch Class" then click "Next" Name the file whatever you want, I named it PluginViewController Change Subclass of to "UIViewController" Change Language to Swift and next until the file is created Replace the file contents with the following: // PluginViewController.swift import UIKit import Capacitor class PluginViewController: CAPBridgeViewController { override open func capacitorDidLoad() { bridge?.registerPluginInstance(SwipeGesturePlugin()) } } Now we need to change the Main.storyboard to reference our new PluginViewController based on this documentation: https://capacitorjs.com/docs/ios/viewcontroller#edit-mainstoryboard Double click on Main.storyboard Expand "Plugin View Controller Scene" Click on Bridge View Controller In your menu bar click View > Inspectors > Identity (⌥ ⌘ 4) Change the class to PluginViewController If you have any .m files from your previous version of the plugin, that can safely be deleted.
score: 1
answers question: http://stackoverflow.com/q/78545844
type: Answer

http://stackoverflow.com/comment/138365249
comment on: http://stackoverflow.com/q/78466384
type: Comment
has text: You are not reading that stacktrace correctly; it actually crashed in `pb_check_proto3_default_value + 342`. Expand the arrow between frames 0 and 23 to get more context that will help you track it down.
score: 0
type: QuestionComment

http://stackoverflow.com/q/78544062
score: 0
tagged with: rust
tagged with: objective-c
tagged with: nsautoreleasepool
tagged with: objc2
answer count: 0
has title: When need to call the Objective C nsautoreleasepool() on Rust side?
has body: I use the objc2 library and their AppKit bindings in my project. Everything is good but I am not an Objective C developer and a little confused by the Rust implementation of autoreleasepool. For example, fn set_icon(&amp;self, icon: Option&lt;&amp;Icon&gt;) { autoreleasepool(|_| { let mtm = MainThreadMarker::from(self); let app = NSApp(mtm); match icon { Some(icon) =&gt; { let ns_image = icon.get_impl().get_native(); unsafe { app.setApplicationIconImage(Some(&amp;ns_image)) }; } None =&gt; unsafe { app.setApplicationIconImage(None) }, } }); } macOS Icon implementation: struct IconImpl { mtm: MainThreadMarker, native: MainThreadBound&lt;Id&lt;NSImage&gt;&gt;, } impl IconImpl { fn get_native(&amp;self) -&gt; &amp;Id&lt;NSImage&gt; { self.native.get(self.mtm) } } Should I use the autoreleasepool in such cases? Theoretically there can be an existed icon which will be replaced by a new one and it will lead to memory leaks (at least I think so). On the other hand, the previous icon can be set from the Icon instance too and then I don't need to release it cuz my Icon implementation will release it automatically on drop().
type: Question
type: UnansweredQuestion

http://stackoverflow.com/comment/138319056
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/78457453
type: Comment
has text: Does this answer your question? [steps for use core data as database in my iOS app in Objective C](https://stackoverflow.com/questions/32153397/steps-for-use-core-data-as-database-in-my-ios-app-in-objective-c)

twitterkit
tags question: http://stackoverflow.com/q/78523045
tag name: twitterkit
type: Tag

http://stackoverflow.com/comment/138564390
has text: what happens when you put the #import <Foundation/Foundation.h> inside the #if __OBJC__ section? If there are straight C or C++ files being compiled they may not know what BOOL or other ObjC stuff is.
type: QuestionComment
comment on: http://stackoverflow.com/q/78585460
type: Comment
score: 0

dynamic-island
tags question: http://stackoverflow.com/q/78505503
tag name: dynamic-island
type: Tag

http://stackoverflow.com/a/78528011
has comment: http://stackoverflow.com/comment/138446811
score: 0
has comment: http://stackoverflow.com/comment/138441469
has body: I think, without a runloop, the calendar isn't updated. If you just want to get the current time zone then use CFTimeZone. CFTimeZoneResetSystem(); CFTimeZoneRef timeZone = CFTimeZoneCopySystem(); const char *tz = CFStringGetCStringPtr(CFTimeZoneGetName(timeZone), kCFStringEncodingUTF8); CFRelease(timeZone);
has comment: http://stackoverflow.com/comment/138441410
has comment: http://stackoverflow.com/comment/138446531
has comment: http://stackoverflow.com/comment/138445862
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/78526615
has comment: http://stackoverflow.com/comment/138442666
has comment: http://stackoverflow.com/comment/138441092
has comment: http://stackoverflow.com/comment/138441217
has comment: http://stackoverflow.com/comment/138445750
accepted answer of: http://stackoverflow.com/q/78526615

http://stackoverflow.com/q/78583708
has answer: http://stackoverflow.com/a/78629024
upvote count: 2
linked to: http://stackoverflow.com/q/56027178
type: Question
tagged with: swift
answer count: 1
type: UnansweredQuestion
favorite count: 0
tagged with: unit-testing
has title: Mock AVCaptureDeviceInput for unit tests
tagged with: ios
score: 2
has body: I have a class that receives an AVCaptureDevice object as a parameter and I'd like to test it. I found the swizzle method to create an instance of AVCaptureDevice extension AVCaptureDevice { class func swizzle() { // Exchange class methods [ ( #selector(AVCaptureDevice.default(_:for:position:)), #selector(AVCaptureDevice.mockDefaultDevice(position:)) ), ( #selector(AVCaptureDevice.authorizationStatus(for:)), #selector(AVCaptureDevice.mockAuthorizationStatus) ), ( #selector(AVCaptureDevice.requestAccess(for:completionHandler:)), #selector(AVCaptureDevice.mockRequestAccess) ) ].forEach { if let original = class_getClassMethod(self, $0), let mock = class_getClassMethod(self, $1) { method_exchangeImplementations(original, mock) } } // Add NSObject.init implementation to init(mock:) [ ( #selector(AVCaptureDevice.init(mock:)), #selector(NSObject.init) ) ].forEach { if let original = class_getInstanceMethod(self, $0), let mock = class_getInstanceMethod(self, $1) { print("Mock:::Init Exchange impl \(original) <-> \(mock)") method_setImplementation(original, method_getImplementation(mock)) } } } @objc convenience init(mock: String) { fatalError("Fake method that should be replaced by NSObject.init") } @objc class func mockRequestAccess(completionHandler handler: @escaping (Bool) -> Void) { handler(true) } @objc class func mockAuthorizationStatus() -> AVAuthorizationStatus { return .authorized } } It worked well to create an instance of AVCaptureDevice using AVCaptureDevice.default(_:for:position:), but inside my class, this instance is used to create an AVCaptureDeviceInput object as follows: let deviceInput = try AVCaptureDeviceInput(device: deviceCamera) and passing the mocked instance of deviceCamera to AVCaptureDeviceInput is resulting in the error "Error Domain=AVFoundationErrorDomain Code=-11852 "Não pode usar (null)" UserInfo={NSLocalizedFailureReason=Este app não tem autorização para usar (null)., AVErrorDeviceKey=<AVCaptureDevice: 0x600000cf49c0 [(null)][]>, NSLocal…
tagged with: objective-c
downvote count: 0

http://stackoverflow.com/comment/138359962
has text: You haven't blocked the main thread because at no time did you call a blocking `wait`. `RunUntilDate` will prevent further execution within `viewDidLoad` but the main run loop is still processing. You have certainly made the UI of your app non-responsive for three seconds. For a deadlock to occur you need three things - Mutual exclusion, no preemption and hold & wait - You don't have "hold & wait" in this case.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78481020
type: Comment

datetimepicker
type: Tag
tags question: http://stackoverflow.com/q/78553036
tag name: datetimepicker

http://stackoverflow.com/comment/138493114
type: QuestionComment
has text: @Willeke Yes, thank you! I didn't need to sub-class, as you mentioned in your solution, but rather took note that you mentioned "The cell-based NSTableView draws all cells in placeholder style when an empty cell is edited" and just added a default value to the inserted object and it works great.
score: 0
comment on: http://stackoverflow.com/q/78556827
type: Comment

http://stackoverflow.com/q/78545844
favorite count: 0
tagged with: capacitor
type: UnansweredQuestion
tagged with: swift
has title: Backswipe with Capacitor 6
has body: Following this tutorial around january of 2024 with Capacitorjs version 5 helped me to add navigating back using backswipe on ios devices. However now, using Capacitor 6, I'm no longer able to make it work. I looked up Capacitor's custom plugin docs, to see if anything changed. I followed their steps, creating group called plugins, under it group Backswipe. Backswipe group contains 3 files, but when I run the code, backswipe to navigate doesn't work. What else could I do? // App/App/plugins/Backswipe/BackswipePlugin.m #import <Foundation/Foundation.h> #import <Capacitor/Capacitor.h> CAP_PLUGIN(BackswipePlugin, "BackswipePlugin",) // App/App/plugins/Backswipe/BackswipePlugin.swift import Foundation import Capacitor @objc(BackswipePlugin) public class BackswipePlugin: CAPPlugin { override public func load() { bridge?.webView?.allowsBackForwardNavigationGestures = true; } } // App/App/plugins/Backswipe/App Name-Bridging-Header.h // I also tried renaming BackswipePlugin.m to Backswipe.m, didn't help. My other guess is if the space in autogenerated bridging header could be causing the problems. Any help is welcome, thank you.
score: 1
upvote count: 2
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/78819188
answer count: 1
tagged with: objective-c

http://stackoverflow.com/comment/138441469
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78528011
score: 0
has text: Even when I do, this seems to leak.

http://stackoverflow.com/comment/138486346
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78553036
type: Comment
has text: what's a `DateTimePicker`? Do you mean a `DatePicker` with a `.datePickerStyle(.wheel)`?

http://stackoverflow.com/comment/138441410
score: 0
comment on: http://stackoverflow.com/a/78528011
has text: Final query (not an ObjC dev). I need to CFRelease the timeZone. Correct? And since CFStringGetCStringPtr is AFAIUI returning a ref to inside that struct, this will also release//free tz?
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/138466473
type: Comment
has text: Huh. That's actually NULL. So progress, of sorts.
comment on: http://stackoverflow.com/q/78537820
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138360212
type: Comment
has text: if you call `someOtherFunction()` in `viewDidLoad` is execution paused? No, you have transferred it to `someOtherFunction`. In your case you have transferred it to `runUntilDate` and that function will continue to perform tasks in the run loop
comment on: http://stackoverflow.com/q/78481020
type: QuestionComment
score: 0

http://stackoverflow.com/comment/138612191
type: QuestionComment
has text: How do i do that?
score: 0
comment on: http://stackoverflow.com/q/78543725
type: Comment

nsautoreleasepool
type: Tag
tags question: http://stackoverflow.com/q/78544062
tag name: nsautoreleasepool

http://stackoverflow.com/q/78471322
type: Question
type: UnansweredQuestion
has title: How to Call API without open app when user click action from interactive notification?
has body: I'm building app using expo, and integrated notification using expo-notification. Also, I made the interactive notification using setNotificationCategoryAsync. I added postpone action to action of notification, and I want to send postpone event to server side. Please explain how can we do it with expo. if impossible with expo, native solution that using objective-c also good for me.
tagged with: expo-notifications
tagged with: objective-c
tagged with: expo
answer count: 0
score: 0

tuya
tag name: tuya
tags question: http://stackoverflow.com/q/78502092
type: Tag

http://stackoverflow.com/comment/138463860
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78537820
type: QuestionComment
has text: Try `NSLog(@"%@", mainWindow.contentViewController);`.

http://stackoverflow.com/comment/138381686
type: QuestionComment
has text: Worth taking a look at what glfw does. Since they handle this exact type of dilemma in their CMake code: https://github.com/glfw/glfw/blob/master/src/CMakeLists.txt
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78492779

http://stackoverflow.com/a/78565821
accepted answer of: http://stackoverflow.com/q/78563449
answers question: http://stackoverflow.com/q/78563449
type: AcceptedAnswer
type: Answer
score: 0
has body: When a table header isn't needed you just can set it to nil. This removes the glitch. Credits to @willeke for pushing me to the right direction

http://stackoverflow.com/q/78494830
answer count: 0
tagged with: ios
tagged with: objective-c
has title: PJSIP Outgoing call
has body: I'm developing an iOS app using Swift and PJSIP for SIP calling. I want to dynamically update the phone number displayed in the app when a call is initiated. Here's the relevant part of my code: import PJSUA2 void make_call(char* name, char* sip_id, char* sip_server){ pj_status_t status; /* If URL is specified, make call to the URL. */ char sip_uri[80]; sprintf(sip_uri, "\"%s\" <sip:%s@%s>",name, sip_id, sip_server); pj_str_t uri = pj_str(sip_uri); pjsua_call_setting call_set; pjsua_call_setting_default(&call_set); status = pjsua_call_make_call(account_id, &uri, &call_set, NULL, NULL, NULL); if (status != PJ_SUCCESS) error_exit("Error making call", status); }
score: 0
type: Question
tagged with: swift
type: UnansweredQuestion

http://stackoverflow.com/comment/138509030
type: Comment
has text: The manual insets are required cause this is a scrollview inside a bigger outter scrollview (to adjust views). In this case insets are (0,0,0,0). They are not responsible for the "glitch" (already tried). The headers are not used in my tables. (dont need any sort or drag/drop functions).
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78563449

http://stackoverflow.com/comment/138428019
type: Comment
has text: @Willeke I have checked the timing and place for `testHandler` and found something. If I call `testHandler` just after `NSSetUncaughtExceptionHandler`, `uncaughtExceptionhandler` can catch this exception. But if I call `testHandler` in other function like `applicationWillTerminate`, `uncaughtExceptionhandler` failed to catch the exception.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78516082

http://stackoverflow.com/a/78457497
has comment: http://stackoverflow.com/comment/138318371
answers question: http://stackoverflow.com/q/78457453
type: Answer
has body: Each instance of NSManagedObject holds the data for one single "record". You can store as many NSManagedObject instances in your ManagedObjectContext as you like. Best practice in Core Data is to define NSManagedObject subclasses for each kind of data, to allow type checking and to generate accessors. In your example, MyEntity would be a subclass of NSManagedObject. If you create an owning "Data Model" class, that's the place to hang entities, but they're managed for you by NSPersistentContainer/NSPersistentStoreCoordinator. There are recent WWDC videos from Apple on modern Core Data. Much of the attribute and relationship generation is handled automatically for you now. See https://developer.apple.com/documentation/coredata/core_data_stack.
has comment: http://stackoverflow.com/comment/138323061
score: 0
has comment: http://stackoverflow.com/comment/138318145

capacitor
tag name: capacitor
tags question: http://stackoverflow.com/q/78545844
type: Tag
tags question: http://stackoverflow.com/q/78945375

http://stackoverflow.com/q/78504557
favorite count: 0
upvote count: 0
score: -1
has answer: http://stackoverflow.com/a/78504627
downvote count: 1
type: AnsweredQuestion
tagged with: enums
tagged with: objective-c
has title: How to call a Swift enum function to get string in objc?
tagged with: enumeration
has comment: http://stackoverflow.com/comment/138401129
answer count: 1
accepted answer: http://stackoverflow.com/a/78504627
has comment: http://stackoverflow.com/comment/138400037
has body: I have this enum in Swift SDK, and need to print the description as a debug message. @objc public enum ResultCode : UInt16 { case noError = 0x0000 @objc public func description() -> String { switch self { case .noError: return "No Error" } } } The description can not be called in Objc like this: [taskManager.sendRequest requestWithCompletion:^(ResultCode resultCode) { NSString *resultCodeDescription = [resultCode description];//Bad receiver type 'ResultCode' (aka 'enum ResultCode') NSLog(@"Result code description: %@", resultCodeDescription); }]; I know that adding a ResultCode extension in Swift file and a @objc function is a solution, but I prefer to solve this in objc file, how can I approach this?
type: Question
tagged with: swift

http://stackoverflow.com/comment/138446811
score: 0
comment on: http://stackoverflow.com/a/78528011
type: AnswerComment
type: Comment
has text: That works perfectly; solid as a rock under 700kb. Thanks.

http://stackoverflow.com/comment/138468728
type: Comment
has text: But I want to skip today and want to reschedule it for next weekday, is it possible?
score: 0
comment on: http://stackoverflow.com/q/78541807
type: QuestionComment

http://stackoverflow.com/comment/138633436
has text: I need the AVCaptureDevice to create the AVCaptureDeviceInput, how will I mock it? The init method of AVCaptureDeviceInput needs a valid AVCaptureDevice. See other question that follows your method: https://stackoverflow.com/questions/56027178/mock-avcapturedeviceinput-for-testing
comment on: http://stackoverflow.com/a/78629024
type: AnswerComment
type: Comment
score: 0

enumeration
tag name: enumeration
type: Tag
tags question: http://stackoverflow.com/q/78504557

http://stackoverflow.com/a/78512638
score: 0
answers question: http://stackoverflow.com/q/78511969
has body: It turns out that, the same way xcodebuild create-xcframework does not copy the .modulemap, it also not not copy the Swift headers. Here is a working script that copies both from the derived data. It also make it easy to add platforms. for PLATFORM in "iOS" "iOS Simulator"; do case $PLATFORM in "iOS") RELEASE_FOLDER="Release-iphoneos" ;; "iOS Simulator") RELEASE_FOLDER="Release-iphonesimulator" ;; esac ARCHIVE_PATH=$RELEASE_FOLDER xcodebuild archive \ -workspace $WORKSPACE \ -scheme $SCHEME \ -destination "generic/platform=$PLATFORM" \ -archivePath $ARCHIVE_PATH \ -derivedDataPath ".build" \ SKIP_INSTALL=NO \ BUILD_LIBRARY_FOR_DISTRIBUTION=YES FRAMEWORK_PATH="$ARCHIVE_PATH.xcarchive/Products/usr/local/lib/$SCHEME.framework" MODULES_PATH="$FRAMEWORK_PATH/Modules" mkdir -p $MODULES_PATH HEADERS_PATH="$FRAMEWORK_PATH/Headers" mkdir -p $HEADERS_PATH BUILD_PRODUCTS_PATH=".build/Build/Intermediates.noindex/ArchiveIntermediates/$SCHEME/BuildProductsPath" INTERMEDIATE_BUILD_FILES_PATH=".build/Build/Intermediates.noindex/ArchiveIntermediates/$SCHEME/IntermediateBuildFilesPath" RELEASE_PATH="$BUILD_PRODUCTS_PATH/$RELEASE_FOLDER" SWIFT_MODULE_PATH="$RELEASE_PATH/$SCHEME.swiftmodule" RESOURCES_BUNDLE_PATH="$RELEASE_PATH/${SCHEME}_${SCHEME}.bundle" # Copy Swift modules if [ -d $SWIFT_MODULE_PATH ] then cp -r $SWIFT_MODULE_PATH $MODULES_PATH fi SWIFT_HEADER="$INTERMEDIATE_BUILD_FILES_PATH/$SCHEME.build/$RELEASE_FOLDER/$SCHEME.build/Objects-normal/arm64/$SCHEME-Swift.h" if [ -f "$SWIFT_HEADER" ] then cp -p $SWIFT_HEADER $HEADERS_PATH || exit -2 fi # Copy resources bundle, if exists if [ -e $RESOURCES_BUNDLE_PATH ] then cp -r $RESOURCES_BUNDLE_PATH $FRAMEWORK_PATH fi done xcodebuild -create-xcframework \ -framework Release-iphoneos.xcarchive/Products/usr/local/lib/$SCHEME.framework \ -framework Release-iphonesimulator.xcarchive/Products/usr/local/lib/$SCHEME.framework \ -output $SCHEME.xcframework
type: Answer

objc2
type: Tag
tags question: http://stackoverflow.com/q/78544062
tag name: objc2

http://stackoverflow.com/q/78523045
score: 0
answer count: 0
has body: [[Twitter sharedInstance] logInWithCompletion:^(TWTRSession *session, NSError *error) { if (session) { dispatch_async(dispatch_get_main_queue(), ^{ [self presentViewController:composer animated:YES completion:nil]; }); } else { [self showAlertWithMessage:@"You must log in before presenting a composer." andTitle:@"No Twitter Accounts Available"]; } }]; trying to login to twitter to share image. My Twitter ConsumerKey and ConsumerSecret both are correct and valid And the redirect url in developer portal is also according to guidelines like twitterkit-consumerkey://. But I am unable to login and get the session details. The error shown is: [TWTRURLSessionDelegate] Cancelling API request, SSL certificate is invalid. [TwitterKit] Cannot verify session credentials. [TWTRURLSessionDelegate] Cancelling API request, SSL certificate is invalid. [TwitterKit] Error obtaining user auth token. Error code is: -999(cancelled) It is redirect back to app saying the above error details. Any kind of lead or help is highly appreciated.
tagged with: twitterkit
has title: Twitter Login error obtaining user auth token
tagged with: ios
type: Question
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/comment/138440729
has text: Just `typeWithFilenameExtension:` doesn't work?
type: Comment
comment on: http://stackoverflow.com/q/78514283
score: 0
type: QuestionComment

http://stackoverflow.com/a/78494809
has body: Your's [NSRunLoop.currentRunLoop runUntilDate... is doing main's runloop job, so deadlock doesn't occur. It's secret technic of converting asynchronous functions to synchronous. But you should use it only in emergency cases where converting code to asynchronous is not possible.
answers question: http://stackoverflow.com/q/78481020
score: 0
type: Answer

http://stackoverflow.com/a/78578959
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/138540346
has body: The issue you're facing is due to the fact that even though your protocol MyObjCProtocol inherits from NSObject, Combine doesn't automatically recognize the properties for publishing. The publisher(for:) method is an extension provided by Combine for objects that support key-value observing (KVO), which doesn't directly apply to protocols in Objective-C. Here is a solution in Swift to address this problem: Create an extension for NSObject: You can create an extension for NSObject that provides a publisher method for KVO-compatible properties. Use AnyObject instead of MyObjCProtocol: Since Combine requires a concrete reference and your protocol is just an abstraction, you need to use AnyObject and ensure that your concrete object conforms to the protocol. Here is an example of how you can do this: Extension for NSObject: import Combine import Foundation extension NSObject { func publisher<T>(for keyPath: KeyPath<NSObject, T>) -> AnyPublisher<T, Never> { Publishers.KVObservablePublisher(object: self, keyPath: keyPath) .eraseToAnyPublisher() } } Observing the property: import Combine // Ensure your concrete object is an NSObject and conforms to the protocol let objcObject: AnyObject = conformsToObjCProtocol as AnyObject // Force cast objcObject to NSObject to use the extension guard let nsObject = objcObject as? NSObject else { fatalError("The object is not an NSObject") } // Create the publisher and subscribe to it let cancellable = nsObject.publisher(for: \.myString).sink { newValue in print(newValue) } Ensure that myString is properly exposed for KVO in your Objective-C class. This should resolve the issue and allow you to observe changes in the property using Combine.
score: 0
answers question: http://stackoverflow.com/q/78578910
downvote count: 1

http://stackoverflow.com/comment/138500222
comment on: http://stackoverflow.com/q/78492779
has text: Could you clarify why in project written in C++ you are including Objective-C headers? How C++ should work with `NSString` for example?
type: QuestionComment
type: Comment
score: 0

delta
tags question: http://stackoverflow.com/q/78543490
tag name: delta
type: Tag

http://stackoverflow.com/comment/138500530
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78538010
has text: Thank you a lot, looks like it worked! ✨ Was a hard catch!

http://stackoverflow.com/comment/138368011
type: Comment
score: 0
has text: There's only 1 call stack per thread. After calling `someOtherFunction`, the activation record (or "frame") of `viewDidLoad` is still in the call stack, and the new record for `someOtherFrame` simply sits on top of it. In my example, the only way this is possible is that `runUntilDate` actually calls my completion block. Am I understanding it correct?
type: QuestionComment
comment on: http://stackoverflow.com/q/78481020

http://stackoverflow.com/comment/138442666
type: AnswerComment
type: Comment
has text: Sorry, I forgot memory management. `timeZone` must be released. If a function name contains the word "Get", you do not own the object. Does the test app continue to leak if you let it run a little longer?
score: 0
comment on: http://stackoverflow.com/a/78528011

http://stackoverflow.com/comment/138333052
comment on: http://stackoverflow.com/q/78466384
has text: Click o keys and the logs tab you can sometimes get more info in those
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/comment/138878851
comment on: http://stackoverflow.com/q/78537820
has text: The problem was that the code was in applicationDidFinishLaunching. Once we set up a probleme UI with a button linked to calling Apple Pay, the Pane appeared.
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138612487
has text: I don't know. You are the one using the tool
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78543725

http://stackoverflow.com/comment/138468998
type: Comment
has text: you can schedule the date by miniusing some seconds from current date like ?
comment on: http://stackoverflow.com/q/78541807
type: QuestionComment
score: 0

http://stackoverflow.com/comment/138401129
has text: Lol, that code is coming from gpt and I'm not confirm yet, sry
comment on: http://stackoverflow.com/q/78504557
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/138446531
type: AnswerComment
type: Comment
has text: [Using Autorelease Pool Blocks](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmAutoreleasePools.html) might help.
comment on: http://stackoverflow.com/a/78528011
score: 0

expo
tags question: http://stackoverflow.com/q/78471322
type: Tag
tag name: expo

http://stackoverflow.com/comment/138540346
has text: Thanks for the great in-depth answer! Are you sure about 'KVObservablePublisher'? Compiler complains about it and I can't find any symbol with that name anywhere ...
comment on: http://stackoverflow.com/a/78578959
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/138468807
score: 0
has text: The answer is in the last column. Turn off the pointless warnings
type: QuestionComment
comment on: http://stackoverflow.com/q/78543725
type: Comment

http://stackoverflow.com/q/78501315
has body: I have 3 view controllers, VC1, VC2, and VC3, that are instantiated when the app starts. I want to present them modally in a loop, like this: VC1 -> VC2 -> VC3 -> VC1 On each view controller, I'm presenting the next view controller like this: [self presentModalViewController:nextViewController animated:TRUE]; The issue is when I execute that line from VC3, for presenting again the first view controller VC1, the app hangs and becomes completely unresponsive. As soon as that line is executed, I can see on Xcode CPU usage jumping from 0% to 99% and memory from 20MB to 1GB. I cannot even pause execution using the debugger, I can only quit the process. No errors on the console either. My project doesn't have anything else, it's just these 3 view controllers, each with a button to present the next view controller in the loop. Is this navigation flow not supported by the system or am I doing something wrong? I tried doing the same thing using segues on the storyboard, and that works fine. But I need to understand why it doesn't work using UIViewController.presentModalViewController. This is basically the code for each view controller: #import "VC2.h" @implementation VC2 - (IBAction)onNextButtonClicked:(id)sender { [self presentModalViewController:_nextViewController animated:TRUE]; } @end
tagged with: uiviewcontroller
tagged with: freeze
type: Question
tagged with: presentmodalviewcontroller
favorite count: 0
upvote count: 0
score: -1
tagged with: ios
type: AnsweredQuestion
has title: UIViewController.presentModalViewController hangs indefinitely
tagged with: objective-c
downvote count: 1
has answer: http://stackoverflow.com/a/78525331
accepted answer: http://stackoverflow.com/a/78525331
answer count: 1

http://stackoverflow.com/a/78504627
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/78504557
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/78504557
has body: @objc for bridging Swift enum to Objective-c enum only supports integer types as the raw value. @objc public func description() -&gt; String { ... } The above code will throw an error at compile time: @objc can only be used with members of classes, @objc protocols, and concrete extensions of classes You can try this approach, define a class in Swift to add objc annotation: @objc class ResultCodeReader: NSObject { @objc static func getDescription(from resultCode: ResultCode) -&gt; String { resultCode.description() } } Then you're able to get the ResultCode description from Objective-c: NSString *desc = [ResultCodeReader getDescriptionFrom:ResultCodeNoError];
score: 1

http://stackoverflow.com/comment/138501234
type: AnswerComment
score: 1
type: Comment
has text: Sounds like your question has been answered!
comment on: http://stackoverflow.com/a/78538010

http://stackoverflow.com/comment/138419874
type: Comment
has text: Debug it and add a breakpoint in `uncaughtExceptionhandler` to see if it's being called.
score: 0
comment on: http://stackoverflow.com/q/78516082
type: QuestionComment

http://stackoverflow.com/a/78629024
answers question: http://stackoverflow.com/q/78583708
has comment: http://stackoverflow.com/comment/138633436
type: Answer
has comment: http://stackoverflow.com/comment/138633948
score: 0
has body: I think we need to make some changes inside the code and take help of protocols. As you say "I have a class that receives an AVCaptureDevice object as a parameter and I'd like to test it" and "inside my class, this instance is used to create an AVCaptureDeviceInput object as follows:" So pass both AVCaptureDevice and AVCaptureDeviceInput as parameters. And make use of protocols to create mockCaptureDevice and mockCaptureDeviceInput. like as follows => protocol CaptureDeviceInputAbility {} extension AVCaptureDeviceInput: CaptureDeviceInputAbility {} protocol CaptureDeviceAbility {} extension AVCaptureDevice: CaptureDeviceAbility {} // Mock objects class MockCaptureDeviceInput: CaptureDeviceInputAbility {} class MockCaptureDevice: CaptureDeviceAbility {} Note use protocols as types , instead on concrete types to add mockings! like below func yourMethod(captureDevice: CaptureDeviceAbility, captureDeviceInput: CaptureDeviceInputAbility) { } let mockDevice = MockCaptureDevice() let mockInput = MockCaptureDeviceInput() yourMethod(captureDevice: mockDevice, captureDeviceInput: mockInput)

nfc
tag name: nfc
tags question: http://stackoverflow.com/q/78586930
type: Tag

crash-dumps
tags question: http://stackoverflow.com/q/78565146
tag name: crash-dumps
type: Tag

expo-notifications
tags question: http://stackoverflow.com/q/78471322
tag name: expo-notifications
type: Tag

function
tags question: http://stackoverflow.com/q/78543490
type: Tag
tag name: function

http://stackoverflow.com/comment/138360118
comment on: http://stackoverflow.com/q/78481020
score: 0
type: QuestionComment
has text: Replace `[NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]];` with `Thread.sleep(1)` and see what happens. That is the difference between blocking the thread and delaying the return of `viewDidLoad` but still running the RunLoop. Your current code has blocked UI updates and so is a bad idea, but the thread itself is not blocked because you have transferred execution back to the RunLoop.
type: Comment

http://stackoverflow.com/comment/138463611
comment on: http://stackoverflow.com/a/78525331
has text: Yes, exactly, that's how my Storyboard was set up. Thanks for the detailed explanation, this is the answer I was looking for.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/138500160
type: QuestionComment
has text: You can use `NSDataDetector`
score: 1
type: Comment
comment on: http://stackoverflow.com/q/78559718

http://stackoverflow.com/comment/138473193
comment on: http://stackoverflow.com/q/78514283
type: QuestionComment
has text: @Cy-4AH I'm not sure you understand the point. I know how I can force it to work, I'm trying to figure out if there is an -elegant- and -proper- way to make it work. Sure, I could add `xls` and `xlsx` and `numbers`, etc with `typeWithFilenameExtension:`, but I would much rather use the conceptual type of `UTTypeSpreadsheet` so that iOS can handle every type of spreadsheet it knows instead of just the filename extensions that I could think of at the time... and then have users screw me over by removing the file extensions from their docs or something. They've been known to do weird stuff.
type: Comment
score: 0

http://stackoverflow.com/comment/138498677
score: 1
type: Comment
comment on: http://stackoverflow.com/q/78559718
has text: So the question is more: Find the email address + dot (optional ?), then from that range, keep only what's after? So this question might help: https://stackoverflow.com/questions/8413291/extract-emails-from-string-in-objective-c
type: QuestionComment

http://stackoverflow.com/comment/138446294
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78479376
has text: Thanks again. Yes, I was thinking that the problem is essentially two concurrency models that are fighting each other. The real application has the polling happen in a goroutine, so it looks like I need to add `C.dispatch_main()` somewhere sensible. As a non-mac dev, I find this horrifying, but I guess if it has to happen, it has to happen. Thank you so much for digging into this. I'll also play with the auto-updating part.
score: 0

http://stackoverflow.com/comment/138505308
type: QuestionComment
has text: Where is the header view? Which setting causes the issue? What are you trying to accomplish with the insets and the `CGFLOAT_MIN` header view?
score: 1
type: Comment
comment on: http://stackoverflow.com/q/78563449

http://stackoverflow.com/comment/138365271
type: QuestionComment
comment on: http://stackoverflow.com/q/78466384
has text: Also perhaps [this helps](https://stackoverflow.com/questions/78122789/crash-in-nanopb-ios-17-4-0)?
type: Comment
score: 0

split
tags question: http://stackoverflow.com/q/78559718
tag name: split
type: Tag

http://stackoverflow.com/q/78499204
type: Question
type: UnansweredQuestion
tagged with: python
tagged with: flutter
tagged with: macos
has title: App crashes when running Python code from Flutter/Native MACOS application
score: 0
has body: Backgroud Running python code using Beeware - Briefcase tool and call Python code from Flutter/Native MACOS application. Issue The code runs completely fine on MAC machines powered with Intel processors but breaks on Apple processors. (Crashing on M1 and M2 processors) How it’s implemented and what Root cause has been analyzed so far for Apple processors? The Python code is hosted by making use of Uvicorn and since Unicorn keeps a hold of a Thread and never returns. So the same is executed on a background thread from Xcode making use of dispatch_queue MacOS Code - (void) trigger_python_main_init { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [self python_main_init]; }); } The Python code further makes use of Pickle file which when loaded of a bigger size anything more than 1MB (for instance) creates this issue Note: Smaller size files work fine. with open(self.vocab_path, "rb") as handle: self.vocab = pickle.load(handle) self.vocab = {element: None for element in self.vocab} When you run python code in man thread it works fine in M1 and M2 as well. Below code works fine - (void) trigger_python_main_init { [self python_main_init]; } We want to run the python code in a background thread/process as its a heavy processing task (Python code is responsible of hosting local webserver)
tagged with: objective-c
tagged with: apple-m1
answer count: 0

http://stackoverflow.com/comment/138357628
type: AnswerComment
comment on: http://stackoverflow.com/a/78479376
type: Comment
has text: Thank you Rob. I'll check this out and when confirmed accept this outstanding answer.
score: 0

http://stackoverflow.com/comment/138445750
comment on: http://stackoverflow.com/a/78528011
has text: It appears to grow monotonically over minutes. I haven't checked for longer periods. I don't know what I should expect in terms of memory management response for ref counted memory here, so I will see if I can get it to crash with OoM.
type: AnswerComment
type: Comment
score: 0

epsilon
tag name: epsilon
type: Tag
tags question: http://stackoverflow.com/q/78543490

http://stackoverflow.com/comment/138421101
has text: AppKit catches exceptions. From where or when do you call `testHandler`? Have you tried an exception breakpoint?
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78516082

http://stackoverflow.com/comment/138509045
has text: @Willeke This took me to the right direction. When a table header isn't needed you just can set it to nil. This removes the glitch. Thank you
comment on: http://stackoverflow.com/q/78563449
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/a/78479352
score: 0
has body: Thank you, @Willeke, for your suggestion. In fact, I just realized that I don't understand at all how the auto layout feature of AppKit is working ! So, instead of loosing my hair with endless attempts, I just created a copycat of UWP's StackPanel in ObjC. And it is now working as intended: Here's my code for MacUIStackPanel just in case: enum MacUIStackPanelOrientation { MacUIVerticalStack, MacUIHorizontalStack }; enum MacUIStackPanelAlignment { MacUICenterStack, MacUILeftStack, MacUIRightStack, MacUITopStack, MacUIBottomStack }; // -------------------- @interface MacUIStackPanel : MacUIFlippedView { MacUIStackPanelOrientation orientation; MacUIStackPanelAlignment alignment; BOOL autoResize; NSSize size; BOOL hasBackground; NSColor * backgroundColor; BOOL hasBorder; CoreServices::Coordinate borderThickness; NSColor * borderColor; CoreServices::Coordinate padding; CoreServices::Coordinate spacing; CoreServices::List< NSView * > children; } - ( id ) init; - ( BOOL ) autoResize; - ( void ) autoResize: ( BOOL ) value; - ( MacUIStackPanelOrientation ) orientation; - ( void ) orientation: ( MacUIStackPanelOrientation ) value; - ( MacUIStackPanelAlignment ) alignment; - ( void ) alignment: ( MacUIStackPanelAlignment ) value; - ( BOOL ) hasBackground; - ( void ) hasBackground: ( BOOL ) value; - ( NSColor * ) backgroundColor; - ( void ) backgroundColor: ( NSColor * ) value; - ( BOOL ) hasBorder; - ( void ) hasBorder: ( BOOL ) value; - ( CoreServices::Coordinate ) borderThickness; - ( void ) borderThickness: ( CoreServices::Coordinate ) value; - ( NSColor * ) borderColor; - ( void ) borderColor: ( NSColor * ) value; - ( CoreServices::Coordinate ) padding; - ( void ) padding: ( CoreServices::Coordinate ) value; - ( CoreServices::Coordinate ) spacing; - ( void ) spacing: ( CoreServices::Coordinate ) value; - ( void ) addView: ( NSView * ) view; - ( void ) insertView: ( NSView * ) view atIndex: ( CoreServices::Index ) index; - ( void ) removeView: ( NSView * ) view; - ( void ) …
answers question: http://stackoverflow.com/q/78467796
type: Answer

http://stackoverflow.com/comment/138572120
type: QuestionComment
score: 0
type: Comment
has text: Thankyou, the error was resolved by putting all objective c guards and code inside the #if OBJC section
comment on: http://stackoverflow.com/q/78585460

http://stackoverflow.com/comment/138473226
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78514283
has text: @Paulw11 Yes, I know the types are listed in the docs, which is where I got the several that I referenced in the original question (and I already included `UTTypeText` in my accepted types, but when I include `UTTypeText` it doesn't match against Word Docs). I couldn't find anything for document types in the list and that seemed like a weird oversight since there was a UTType for Spreadsheet and Presentation. That's why I was asking here, because maybe I missed something in the UTType documentation.

http://stackoverflow.com/comment/138487190
has text: Click that textField then calendar will be open and click month and year section top left corner of calendar. now will show the wheel of month and year now you can notice year is not contains "Reiwa" prefix only showing a number only thats my issue
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78553036
type: Comment

http://stackoverflow.com/comment/138563735
comment on: http://stackoverflow.com/a/78595555
score: 0
has text: From the Tauri page: "Entitlements control what APIs your app will have access to". Yes, they are not the same, but sandboxed apps need to state which capabilities they want to have. The question does not tell which permissions are required, but if the library needs the network, camera, USB or whatever, it is worth a try.
type: AnswerComment
type: Comment

mobsf
type: Tag
tags question: http://stackoverflow.com/q/78543725
tag name: mobsf

http://stackoverflow.com/comment/138441092
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78528011
score: 0
has text: Thank you. That does what I want. So from what you are saying, we are depending on a system hook via a runloop to update in the approach that I posted above. Is that correct?

http://stackoverflow.com/comment/138446052
has text: See [this](https://gist.github.com/robertmryan/98669fcb526c37e449551521e90f91d5?permalink_comment_id=5068140#gistcomment-5068140) for example that works in Go (using `dispatch_main`). There might be other ways, too: I'm not a Go programer. But the problem is not the calendar, per se, but rather the interaction with Go’s threading model. BTW, re `autoUpdatingCurrent`, but you don't need that. You aren't referring to the same calendar instance on every call, so it doesn't matter if it is auto-updating or not.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78479376
score: 0

http://stackoverflow.com/comment/138429288
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78516082
type: Comment
has text: `-[NSApplication terminate:]` catches this exception.

http://stackoverflow.com/comment/138507132
has text: Yes sorry I forgot to mark it as such!
comment on: http://stackoverflow.com/a/78538010
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/comment/138492849
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78556827
type: Comment
has text: Is the table view cell-based or view-based?

http://stackoverflow.com/comment/138445491
score: 0
has text: The `autoupdatingCurrentCalendar` *is* auto-updating. See [this Swift example](https://gist.github.com/robertmryan/98669fcb526c37e449551521e90f91d5). The problem here is not with the auto-updating calendar, but I am guessing that it is a result that you are spinning on the main thread, which never gives the calendar to get updated with the new timezone.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78479376

http://stackoverflow.com/a/78526744
upvote count: 0
answers question: http://stackoverflow.com/q/78505516
has body: I got the solution for my question. It is available only from iOS 16. if (@available(iOS 16.0, *)) { UISheetPresentationControllerDetent *mediumDetentOne = [UISheetPresentationControllerDetent customDetentWithIdentifier:@"semifullScreen" resolver:^CGFloat(id<UISheetPresentationControllerDetentResolutionContext> _Nonnull context) { return self.view.frame.size.height-90; }]; sheet.detents = @[ mediumDetentOne, ]; }
type: Answer
score: -1
downvote count: 1

entitlements
type: Tag
tag name: entitlements
tags question: http://stackoverflow.com/q/78586930

http://stackoverflow.com/a/78557075
type: AcceptedAnswer
score: 0
type: Answer
has body: @Willeke pointed out in a comment above that there is a thread regarding this behavior – NSArrayController 'Add' function now causes saved NSTableView listed entries to temporarily lose focus. In that thread the accepted answer instructs you to sub-class a private method in NSTextFieldCell. However, I didn't need to do that because this only happens when the edited cell is empty. I simply added a string value of "untitled" to the property of the object that is bound to the cell and all works as expected. -(IBAction)addAttribute:(id)sender { TKSpecialObject *theObject = [TKSpecialObject new]; [TKSpecialObject setMyTitle:@"untitled"]; // added this line to fix [self.myArrayController insertObject:theObject atArrangedObjectIndex:self.myArrayController.count]; [self.view.window makeFirstResponder:theTableView]; [self.myTableView editColumn:0 row:[self.myTableView selectedRow] withEvent:nil select:YES]; }
accepted answer of: http://stackoverflow.com/q/78556827
answers question: http://stackoverflow.com/q/78556827

http://stackoverflow.com/comment/138563639
has text: I don't think the question is asking about entitlements. It's about access permissions, which is a different thing entirely.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/78595555
type: Comment

http://stackoverflow.com/comment/138369182
comment on: http://stackoverflow.com/q/78481020
type: Comment
score: 0
type: QuestionComment
has text: "There's only 1 call stack per thread"; that's also not exactly true. The dispatch model in iOS is much more complex than simple threads. You have grand central dispatch queues that are mapped to threads and runloops which manage the work that is dispatched.

http://stackoverflow.com/comment/138370826
comment on: http://stackoverflow.com/q/78481020
type: Comment
has text: Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/257703/discussion-between-paulw11-and-omgpop).
score: 0
type: QuestionComment

calendar
tags question: http://stackoverflow.com/q/78553036
type: Tag
tag name: calendar

http://stackoverflow.com/comment/138633948
score: 0
has text: Yes, I have consider that scene too. Instead of creating AVCaptureDeviceInput from AVCaptureDevice. You should try changing your code implementation by creating a method and having two parameters , one for captureDevice and one for CaptureDeviceInput. In testing pass two mock objects using protocols like I have explained in my previous comment and in actual code you should pass real objects. For that you need to modify your actual code.
type: AnswerComment
comment on: http://stackoverflow.com/a/78629024
type: Comment

http://stackoverflow.com/a/78547381
has body: I gather that you intend to add a recurring user notification (say, every Sunday at 10:30 a.m.), but you want the ability to optionally skip the first one. A single, repeating, user notification is incapable of that: It will fire on every match of the date components, including the first one you may have wanted to skip. In this case, I would suggest scheduling a series of individual, non-repeating notifications. But, because there is a limit as to how many non-repeating notifications you can schedule (64 the last time I checked), I might fallback to a single repeating notification if you do not need to skip the first one: nonisolated func schedule( title: String, subtitle: String, body: String, skipFirst: Bool = false, weekday: Int, hour: Int, minute: Int ) async throws { UNUserNotificationCenter.current().removeAllPendingNotificationRequests() if skipFirst { try await scheduleMultipleIndividualSkippingFirst( title: title, subtitle: subtitle, body: body, weekday: weekday, hour: hour, minute: minute ) } else { try await scheduleSingleRepeating( title: title, subtitle: subtitle, body: body, weekday: weekday, hour: hour, minute: minute ) } } Where you have two renditions, one that schedules a single repeating user notification, and another that schedules a series of non-repeating user notifications, one for each of the future dates: private nonisolated func scheduleSingleRepeating( title: String, subtitle: String, body: String, weekday: Int, hour: Int, minute: Int ) async throws { let components = DateComponents(hour: hour, minute: minute, weekday: weekday) let trigger = UNCalendarNotificationTrigger(dateMatching: components, repeats: true) let request = notificationRequest( identifier: Bundle.main.bundleIdentifier! + ".repeating", title: title, subtitle: subtitle, body: body, trigger: trigger ) try await UNUserNotificationCenter.current().add(request) } private nonisolated func scheduleMultipleIndividualSkippingFirst( title: String, subtitle: String, body: String, wee…
upvote count: 2
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/78541807

http://stackoverflow.com/comment/138318145
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78457497
has text: But that means I would have to uniquely identify each object, and I need to do that at runtime.
score: 0

http://stackoverflow.com/comment/138555835
has text: As I don't see your CLI, I cannot be completely sure, but these scripts are intended to be helpers for cross-compilation, as Clang which is the default Mac compiler is a cross-compiler in nature. Anyhow, `cmake` seems a pretty easy tool to learn and use
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78587691

nsstackview
tags question: http://stackoverflow.com/q/78467796
type: Tag
tag name: nsstackview

http://stackoverflow.com/comment/138487487
type: QuestionComment
has text: You should build your own date picker.
comment on: http://stackoverflow.com/q/78553036
type: Comment
score: 0

unusernotificationcenter
tag name: unusernotificationcenter
tags question: http://stackoverflow.com/q/78541807
type: Tag

http://stackoverflow.com/comment/138402562
type: Comment
score: 1
has text: Reading a few other answers it seems that you need to have a contact whose details match the `handle` for the call. The image from that contact will be used.
comment on: http://stackoverflow.com/q/78505503
type: QuestionComment

http://stackoverflow.com/comment/138500411
type: QuestionComment
has text: Parsing email addresses correctly is very hard, there are so many edge cases. As @Cy-4AH suggested `NSDataDetector` is a better solution. This is a non-trivial problem!
score: 1
type: Comment
comment on: http://stackoverflow.com/q/78559718

http://stackoverflow.com/comment/138500469
score: 0
type: QuestionComment
has text: May be some 3rd party lib also calling `NSSetUncaughtExceptionHandler` to.
comment on: http://stackoverflow.com/q/78516082
type: Comment

http://stackoverflow.com/comment/138475833
comment on: http://stackoverflow.com/q/78541807
type: QuestionComment
score: 0
has text: @AMIT – in my answer below, I assumed that when you said “weekday-wise”, that you meant it in the everyday use of the term (e.g., Mon-Fri in common Gregorian calendars). Is that correct? Or did you want the notification to fire every day, both “weekdays” and “weekends”? (The `Calendar` API’s use of the term `weekday` is confusing, IMHO, actually meaning “day of the week”, including weekends.)
type: Comment

http://stackoverflow.com/comment/138815472
score: 1
type: Comment
comment on: http://stackoverflow.com/q/78733679
type: QuestionComment
has text: You mean you are trying to open a new URL *while your app is in the background*?

http://stackoverflow.com/comment/138862414
has text: Look's like it's allowed when used as function argument, because compiler can automatically decide what to use `__bride` or `__bridge_retained`. `CFStringGetLength(static_cast<CFStringRef>([@"hello" mutableCopy]));` works without additional compiler settings.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78733543
type: QuestionComment

http://stackoverflow.com/comment/138816659
score: 0
comment on: http://stackoverflow.com/q/78733946
type: QuestionComment
type: Comment
has text: I'm using .p8 file, I need help asper.

http://stackoverflow.com/comment/138651221
has text: To be safer in my suggestion `containsWhere`, call you could do `if ([obj respondsToSelector:@selector(integerValue)]) { return [obj integerValue] == [@2 integerValue]; } else { NSLog(@"Element %@ from array to analyze doesn't responds to integerValue -> Skipped", obj); return FALSE; }` else you might get a `unrecognized selector sent to` crash error.
comment on: http://stackoverflow.com/q/78642014
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/q/78610273
has body: I received a date string and a timezone from a web service and I am needing to convert into an NSDate. When setting the format and timezone, I get nil: NSString *timeZoneString = @"Europe/Paris"; NSString *dateString = @"2024-03-31T02:40:21.000"; NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; [dateFormat setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]]; [dateFormat setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SS"]; NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:timeZoneString]; [dateFormat setTimeZone:timeZone]; NSDate *date = [dateFormat dateFromString:dateString];// return nil Is there a reason why this specific date string, and using Europe/Paris returns nil when trying to create my date?
tagged with: nsdate
downvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/138591711
upvote count: 0
tagged with: ios
accepted answer: http://stackoverflow.com/a/78610300
type: AnsweredQuestion
tagged with: objective-c
has title: NSDateFormatter returns nil for date string from server
type: Question
favorite count: 0
tagged with: nsdateformatter
has answer: http://stackoverflow.com/a/78610300
linked to: http://stackoverflow.com/q/23833038
has comment: http://stackoverflow.com/comment/138620565
score: -1

http://stackoverflow.com/q/78614160
has answer: http://stackoverflow.com/a/78614717
score: 0
tagged with: cgcontext
type: Question
tagged with: uibezierpath
type: UnansweredQuestion
has title: UIBezierPath stroke with alpha issue / artifact
tagged with: ios
tagged with: objective-c
tagged with: uigraphicsimagerenderer
answer count: 1
has body: I need to draw a curve with a translucent color. But if the curve contains many points, then you can get a strange effect. How to get rid of it? UIBezierPath * bezierPath = [ UIBezierPath bezierPath ]; bezierPath.lineCapStyle = kCGLineCapRound; bezierPath.lineJoinStyle = kCGLineJoinRound; bezierPath.lineWidth = 80.0; [ bezierPath moveToPoint:CGPointMake(50.0, 50.0) ]; for (int i = 0; i &lt; 900; i++) { [ bezierPath addLineToPoint:CGPointMake(50.0 + i, 50.0) ]; } UIGraphicsImageRendererFormat * format = [ UIGraphicsImageRendererFormat defaultFormat ]; format.scale = 1.0; format.opaque = NO; format.preferredRange = UIGraphicsImageRendererFormatRangeStandard; CGSize size = CGSizeMake(1000.0, 100.0); UIGraphicsImageRenderer * renderer = [ [ UIGraphicsImageRenderer alloc ] initWithSize:size format:format ]; UIImage * image = [ renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) { [ [ UIColor clearColor ] setFill ]; [ [ UIColor colorWithWhite:0.0 alpha:0.5 ] setStroke ]; [ bezierPath stroke ]; } ];

http://stackoverflow.com/q/78618633
has body: I want to use the library https://github.com/philipturner/metal-float64, and successfully built and ran tests, next copied the built MetalFloat64 folder into Xcode, but I do not know how to properly include it, the docs say to use #include <metal_float64> however the file cannot be found, any help would be appreciated tried pointing it at the file #include "MetalFloat64/usr/include/metal_float64" but that resulted in there being several errors I cannot find, making me think Im doing something wrong, the errors are: there is also no atomic.h file I can find. Build phase settings: Build Settings search paths:
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138620371
downvote count: 0
favorite count: 0
tagged with: metal
tagged with: objective-c
answer count: 0
tagged with: xcode
score: 1
has title: Why can I not include metal_float64 library in Xcode
type: Question
upvote count: 1
tagged with: swift

http://stackoverflow.com/q/78705702
score: 0
type: Question
has comment: http://stackoverflow.com/comment/138765320
type: UnansweredQuestion
tagged with: cmake
linked to: http://stackoverflow.com/q/49695234
answer count: 0
has body: I’m trying to generate Xcode project file of some libraries with CMake. I want to generate dSYM file in all build config type. I set values in all my CMakelists.txt as below: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym") After CMake generate my xcodeproj file, I find out “Generate Debug Symbols” is set to true in Debug but set to false in Release build type enter image description here I only find it happened in one library, and other libraries worked perfectly. Does anyone have a clue? I found relevant question and tried, but not valid: cmake-with-xcode-target-generate-debug-symbols-setting-ignored-for-release-conf What I expect is as below image. Actually cmake works good with other library. enter image description here
has comment: http://stackoverflow.com/comment/138766033
tagged with: objective-c
tagged with: c++
tagged with: xcode
has title: CMake sets “Generate Debug Symbols” - a Xcode build setting to wrong value

http://stackoverflow.com/q/78733543
has body: Consider the code at the bottom. I am convinced it’s broken and should not compile. Line 224 has a static_cast from NSURL* to CFURLRef with no bridging which I believe will break the reference count. Line 42 even enforces the use of ARC which should statically detect such a cast and result in a hard compilation error. It certainly won’t compile for me which seems like the correct behaviour. (Side note, there’s an obvious fix by replacing the static_cast with a bridge cast, but this isn’t too relevant to the question). However, the code is taken from the public VST3 SDK code, a very popular audio programming framework with thousands of users worldwide and it’s been like this for the past 3 years which tells me it can’t be that broken after all. It seems impossible the VST3 SDK should have been unbuildable for such a long when the fix is obvious. My question is, under what set of circumstances will this code compile that I’m clearly missing? Other than conditionally compiling the code out which doesn’t seem to be the case? https://github.com/steinbergmedia/vst3_public_sdk/blob/3f20bcbf36283b1e5c450e088571be6226cd4e64/source/vst/hosting/module_mac.mm#L224 // line 42 #if !__has_feature(objc_arc) #error this file needs to be compiled with automatic reference counting enabled #endif // line 219 for (NSURL* url in enumerator) { if ([[[url lastPathComponent] pathExtension] isEqualToString:@"vst3"]) { CFPtr<CFArrayRef> archs ( CFBundleCopyExecutableArchitecturesForURL (static_cast<CFURLRef> (url))); if (archs) result.emplace_back ([url.path UTF8String]); }
tagged with: audio
has comment: http://stackoverflow.com/comment/138862414
tagged with: objective-c
type: Question
tagged with: vst
upvote count: 1
downvote count: 0
tagged with: objective-c++
type: UnansweredQuestion
answer count: 0
score: 1
favorite count: 0
has title: Broken `static_cast` from `NSURL*` to `CFURLRef`

macos-system-extension
tags question: http://stackoverflow.com/q/78648329
type: Tag
tag name: macos-system-extension

http://stackoverflow.com/comment/138816298
comment on: http://stackoverflow.com/q/78733946
type: Comment
score: 0
has text: Does [this](https://stackoverflow.com/a/73731707/13944750) help you ?
type: QuestionComment

http://stackoverflow.com/q/78700937
answer count: 0
has title: The request signature we calculated does not match the signature you provided. Check your key and signing method in objective-c in iOS , Xcode 15
tagged with: ios
tagged with: objective-c
tagged with: xcode15
has body: We are using AWS-IOS-SDK to upload images and text. error occurred in Xcode 15 but working good in Xcode 14 ,we used the same source code for both versions. Please check the error message AWSiOSSDKv2 [Verbose] AWSURLResponseSerialization.m line:263 | -[AWSXMLResponseSerializer responseObjectForResponse:originalRequest:currentRequest:data:error:] | Response body: [ <Code>SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your key and signing method.AWERFJUIOLPRTBDUTYAWS4-HMAC-SHA256 20240702T113658Z 20240702/us-east-1/s3/aws4_request 5526a3fb62da4bea59eeb780deef64e9d943168388e7bfed6e2f47335fb6a1878d45a2e2d81869e6b734bc4cf9a95717df7286c41fb84e842d79d0e5be3ca7a641 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 32 34 30 37 30 32 54 31 31 33 36 35 38 5a 0a 32 30 32 34 30 37 30 32 2f 75 73 2d 65 61 73 74 2d 31 2f 73 33 2f 61 77 73 34 5f 72 65 71 75 65 73 74 0a 35 35 32 36 61 33 66 62 36 32 64 61 34 62 65 61 35 39 65 65 62 37 38 30 64 65 65 66 36 34 65 39 64 39 34 33 31 36 38 33 38 38 65 37 62 66 65 64 36 65 32 66 34 37 33 33 35 66 62 36 61 31 38 37PUT Thank you for your help support.
upvote count: 1
score: 0
favorite count: 0
type: Question
tagged with: swift
downvote count: 1
type: UnansweredQuestion

http://stackoverflow.com/comment/138783216
type: Comment
comment on: http://stackoverflow.com/q/78715945
type: QuestionComment
score: 0
has text: Seems like i found the issue. It seems to work if i run it this way : ```RUSTFLAGS="-C link-arg=-lobjc -C link-arg=-framework -C link-arg=AppKit" cargo run --release```

http://stackoverflow.com/q/78663202
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/78663559
favorite count: 0
accepted answer: http://stackoverflow.com/a/78663559
score: 0
has comment: http://stackoverflow.com/comment/138688600
type: AnsweredQuestion
tagged with: swift
has body: What is the actual difference between String in Swift and NSString in Foundation(Objective C). I have seen all functions of NSString can be applied to String in swift. For example componentsSeparatedBy is function of NSString but works with String also. So what exactly is difference between them? Tried running NSString functions on Strings.
downvote count: 2
has comment: http://stackoverflow.com/comment/138688705
upvote count: 2
linked to: http://stackoverflow.com/q/24038629
has comment: http://stackoverflow.com/comment/138695494
tagged with: ios
has title: Difference between String in Swift and NSString in Foundation(Objective C)
type: Question

http://stackoverflow.com/a/78608773
answers question: http://stackoverflow.com/q/78607223
has body: addChildViewController is not strictly necessary. You can simply instantiate a controller and add its view as a subview. However -- if you have any code in vcb, that code will be lost if you do not add the controller as a child.
score: 0
type: Answer

http://stackoverflow.com/q/78607713
has answer: http://stackoverflow.com/a/78617348
score: 0
tagged with: frameworks
type: UnansweredQuestion
tagged with: macos
has title: How can I use a private-framework's function in Xcode?
tagged with: objective-c
has body: I am trying to understand how to use private frameworks in Xcode. Specifically I want to call the MTDeviceCreateList() from the MultitouchSupport-Framework to create a minimal working example. I created this Github-Repo to share what I have tried. The workingButUglyMain.m uses dynamic linking and successfully calls the function, but I saw many people write custom headers to make a private-framework's functions accessible without that complicated linking. I fail to understand and replicate it though. I tried creating such a header with MultitouchSupport.h and linking the framework by adding it to the frameworks and setting the Other Linker Flags in build-settings. I also tried dynamic loading using NSBundle's bundleWithPath(). I always get Undefined symbol: _MTDeviceCreateList error. The framework should be stored in /System/Library/PrivateFrameworks/MultitouchSupport. Here are some of the sources I used: https://www.jviotti.com/2023/11/20/exploring-macos-private-frameworks.html#approach-3-hopper-disassembler https://github.com/NilStack/HelloPF/tree/master https://medium.com/swiftworld/swift-world-how-to-use-private-framework-in-swift-b369209e25be
type: Question
has comment: http://stackoverflow.com/comment/138593712
tagged with: xcode
answer count: 1

http://stackoverflow.com/comment/138783105
type: QuestionComment
type: Comment
has text: Did not know that , thanks!
comment on: http://stackoverflow.com/q/78715945
score: 0

http://stackoverflow.com/comment/138783130
has text: Class with name NsApplication could not be found. Will try the objc2 maybe this one is just abandonded as you suggested.
comment on: http://stackoverflow.com/q/78715945
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/a/78614717
type: Answer
score: 2
downvote count: 0
has body: Curious... From experience, UIBezierPath can be rather quirky. In this case, I'm guessing this particular quirk is caused by internal optimizations. The reason I believe that to be the case is because if we generate a path with 256 points -- 1 moveTo + 255 addLineTo commands -- we don't see the problem: However, as soon as we use 1 moveTo + 256 addLineTo commands -- for a total of 257 points, we get this: One option to get around that would be to render a temporary image with clear background and 100% opaque stroke, and then render that image with 50% alpha: // create image with solid stroke UIImage * tmpImage = [ renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) { [ [ UIColor clearColor ] setFill ]; [ [ UIColor colorWithWhite:0.0 alpha:1.0 ] setStroke ]; [ bezierPath stroke ]; } ]; // create image2 by rendering tmpImage at 50% alpha UIImage * image2 = [ renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) { [tmpImage drawAtPoint:CGPointZero blendMode:kCGBlendModeNormal alpha:0.5]; } ]; Here's a complete, runnable example -- starts with 250 addLineTo commands... each tap anywhere increments that by 1: #import <UIKit/UIKit.h> @interface AlphaPathVC : UIViewController @end @interface AlphaPathVC () { NSInteger nPoints; UIImageView *imgView1; UIImageView *imgView2; UILabel *infoLabel; } @end @implementation AlphaPathVC - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = UIColor.systemYellowColor; imgView1 = [UIImageView new]; imgView2 = [UIImageView new]; imgView1.backgroundColor = UIColor.whiteColor; imgView2.backgroundColor = UIColor.whiteColor; infoLabel = [UILabel new]; infoLabel.backgroundColor = UIColor.whiteColor; infoLabel.numberOfLines = 0; infoLabel.text = @"Tap anywhere to increase number of points and re-generate images..."; [self.view addSubview:imgView1]; [self.view addSubview:imgView2]; [self.view addSubview:infoLabel]; nPoints = 250; } - (void)viewDidLayoutSubviews…
upvote count: 2
answers question: http://stackoverflow.com/q/78614160

http://stackoverflow.com/q/78712177
has body: I'm encountering an issue with SQLCipher in my iOS app after updating to a new version, which involves different workspaces of my app. The app uses SQLCipher(version: 3.1) to manage an encrypted SQLite database.The previous version (workspace2) had SQLCipher code that worked correctly. However, after updating to the new version (workspace1), I'm now receiving the error "file is not a database" when trying to access the database file. Workspace Dependencies: Previous Version: Workspace1: There is no db related code here Workspace2: Contains SQLCipher integration code and database operations. App: Dependent on Workspace1 & 2 which includes additional app logic and functionality. New Version: Workspace1: Contains SQLCipher integration code and database operations. Workspace2: Depending on workspace1 and using few db operations. App: Dependent on Workspace1 & 2 which includes additional app logic and functionality. Steps Taken: Checked Database Path: Confirmed that the database file exists at the specified path in the Documents directory. Ensured that the path is correct and the file is not missing. Encryption Key: Verified that the correct encryption key is used to open the database. The encryption key hasn't changed between app versions. Database File Integrity: Considered the possibility of database file corruption after the update. Not sure how to verify or fix any potential corruption.
has comment: http://stackoverflow.com/comment/138791778
tagged with: objective-c
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/138792416
tagged with: sqlcipher
has comment: http://stackoverflow.com/comment/138791955
has comment: http://stackoverflow.com/comment/138792378
has comment: http://stackoverflow.com/comment/138791808
has comment: http://stackoverflow.com/comment/138792342
type: Question
has title: SQLCipher "file is not a database" Error After Updating iOS App
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138797889
has comment: http://stackoverflow.com/comment/138791294
tagged with: ios

http://stackoverflow.com/comment/138783097
has text: Note that `extern crate` is redundant in modern versions of Rust.
comment on: http://stackoverflow.com/q/78715945
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/78624020
type: Answer
answers question: http://stackoverflow.com/q/78616083
has body: By default GitHub uses Jekyll to build github.io pages and this renders Markdown differently than on the github.com page. To overcome another such difference (Jekyll does not allow HTML markup like &lt;li&gt; inside Markdown table cells), I switched the page builder workflow from Jekyll to pandoc on the GitHub repo (see https://github.com/oasis-tcs/odata-vocabularies/blob/main/.github/workflows/gh-pages.yml). Perhaps you can do something similar. Both github.com and pandoc 3.1.13 highlight your code properly, but only when I enclose it in ```objectivec instead of ```objc.
score: 0

http://stackoverflow.com/q/78648329
tagged with: macos-system-extension
tagged with: objective-c
answer count: 0
has title: How can I update running(activated) system extension in mac?
score: 0
has body: Now we are trying to update our security solution. The solution is built with endpoint security extension, and it's already distributed for all clients, and we want to update them. But it seems like updating the existing system extension is a hard work. Below are the tasks that we did. Modify Extension Manager class - (OSSystemExtensionReplacementAction)request:(OSSystemExtensionRequest OS_UNUSED *)request actionForReplacingExtension:(OSSystemExtensionProperties *)existing withExtension:(OSSystemExtensionProperties *)extension { NSLog(@"Got the upgrade request (%@ -> %@); answering replace.", existing.bundleVersion, extension.bundleVersion); os_log(OS_LOG_DEFAULT, "Got the upgrade request (%@ -> %@); answering replace", existing.bundleVersion, extension.bundleVersion); return OSSystemExtensionReplacementActionReplace; } We modified OSSystemExtensionReplacementAction to replace current extension program. Modify CFBundleVersion / CFBundleShortVersionString CFBundleShortVersionString 1.3 CFBundleVersion 2 we modified version codes in the info.plist file to get updated Checked System settings We also checked for system settings. Becuase there could be "Allow extension" alike buttons enabled. But there were none buttons enabled related to system extensions. We tried all of them, but existed activated extension is still running, and version is not updated What could be the reason?
type: Question
tagged with: swift
type: UnansweredQuestion
tagged with: macos
tagged with: kernel

http://stackoverflow.com/q/78656106
favorite count: 0
has comment: http://stackoverflow.com/comment/138686143
has comment: http://stackoverflow.com/comment/138678630
has comment: http://stackoverflow.com/comment/138679395
has comment: http://stackoverflow.com/comment/138686132
answer count: 0
score: 0
has body: No prior knowledge for using external library in Swift. I was trying to include sf-proj-ios in my empty project named "Test". I followed instruction on the library GitHub, used commands on MacOS terminal.app: (installed CocoaPods) brew install automake brew install libtool cd /Users/MYNAME/Documents/Test pod init Podfile in project folder: platform :ios, '15.0' target 'Test' do pod 'sf-proj-ios', '~> 6.0.3' use_frameworks! target 'TestTests' do inherit! :search_paths end target 'TestUITests' do end end pod install Notes: I did not make any changes to the bridging header build settings as I don't really understand where to import it as stated in the GitHub guide. i.e. where to put the line: #import "sf-proj-ios-Bridging-Header.h" Tried to add sf-proj-ios-Bridging-Header.h in Objective-C Bridging Header in project Build Settings but error prevailed. Opened Test.xcworkspace with Xcode and added test() function to ViewController import UIKit import proj_ios class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() test() } func test(){ let projection1: PROJProjection = PROJProjectionFactory.projection(withAuthority: PROJ_AUTHORITY_EPSG, andIntCode: PROJ_EPSG_WEB_MERCATOR) } } Built and ran Test, resulted in error Use of undeclared identifier 'nullptr' and 'crs.hpp' file not found with <angled> include; use "quotes" instead occurred at library file optargpm.h and proj.cpp . Tried to fix the "angled" with "quotes" as suggested by the compiler but it did not help. Tried comment and uncomment use_frameworks! in the podfile then re-install pod but also not helping. Searched online and found out that nullptr is available after C++11. Checked Build Settings of the project but all Clang dialects are 17 or above. Suspected that the problem was due to improper installation of the library. Please advice how should it be done correctly. Project environment: Mac Mini with M2 Chip macOS: 14.0 (23A344) Xcode: Version 15.4 (15F31d) Attached project Test…
tagged with: objective-c
linked to: http://stackoverflow.com/q/32827389
tagged with: c++
downvote count: 1
type: Question
upvote count: 1
tagged with: swift
tagged with: xcode
type: UnansweredQuestion
has title: Undeclared identifier 'nullptr' and Obj-C error while using Obj-C library in Swift

http://stackoverflow.com/q/78638545
type: Question
has body: Here is how i have configured the profile view, -(void)addProfileView { if(!_profileView) { _profileView = [ProfileView new]; _profileView.clipsToBounds = YES; _profileView.delegate=self; _profileView.alpha = 1.0; _profileView.opaque = YES; _profileView.translatesAutoresizingMaskIntoConstraints = false; [self.view addSubview:_profileView]; NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:_profileView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:0 constant:160]; NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:_profileView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeWidth multiplier:1 constant:0]; NSLayoutConstraint *leftConstraint = [NSLayoutConstraint constraintWithItem:_profileView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1 constant:0]; NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:_profileView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1 constant:-64]; [NSLayoutConstraint activateConstraints:@[heightConstraint, widthConstraint, leftConstraint, topConstraint]]; } } Now, why is the profile view's height not changing after the animation? Should I add the constraints to the superview? What's the difference between adding constraints directly to the superview and using [NSLayoutConstraint activateConstraints:@[]] ? -(void)animateProfileViewBasedOnOffset:(BOOL)isTop { __block NSLayoutConstraint *heightConstraint; for (NSLayoutConstraint * constraint in [_profileView constraints]) { if (constraint.firstAnchor == NSLayoutAttributeHeight) { heightConstraint = constraint; break; } } [UIView animateWithDuration:0.3 animations:^{ if (isTop) { heightConstraint.constant = 64; } else { h…
answer count: 1
linked to: http://stackoverflow.com/q/21953459
tagged with: objective-c
tagged with: xcode
has comment: http://stackoverflow.com/comment/138643391
score: 0
type: AnsweredQuestion
tagged with: nslayoutconstraint
has answer: http://stackoverflow.com/a/78642764
has comment: http://stackoverflow.com/comment/138643481
has title: I was trying to update the height constraint of my view during an animation. Its not getting updated why..?
accepted answer: http://stackoverflow.com/a/78642764
tagged with: ios
has comment: http://stackoverflow.com/comment/138643687

page-lifecycle
tag name: page-lifecycle
tags question: http://stackoverflow.com/q/78607223
type: Tag

http://stackoverflow.com/q/78642014
has comment: http://stackoverflow.com/comment/138651221
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/138650551
answer count: 1
tagged with: objective-c
has body: I'm having troubles checking if an array contains an object. The @property(nonatomic) NSArray<NSNumber*>* apiArray; array is returned as a parameter from an API model while the object of which I want to check the presence in the array is returned from another API model @property(nonatomic) NSNumber* localObject;. When I check for it [apiArray containsObject: localObject] it outputs 0 even though the value is there.. So I checked the types and on localObject the type is effectively an NSNumber, while If i'm not mistaking the array results being an NSString array as by the prints below. NSLog(@"$$$$$$$$$$$ [apiArray containsObject: localObject]: %d", [apiArray containsObject: localObject] ); NSLog(@"apiArray types are: %@", [apiArray valueForKey:@"class"]); NSLog(@"localObject type is: %@", [localObject valueForKey:@"class"]); NSLog(@"apiArray is: %@", apiArray); NSLog(@"localObject is: %@", localObject); $$$$$$$$$$$ [apiArray containsObject: localObject]: 0 apiArray types are: ( "__NSCFString" ) localObject type is: __NSCFNumber apiArray is: ( 5717271485874176 ) localObject is: 5717271485874176 API NSNumber array types are: ( "__NSCFString" ) The models are generated via swagger-codegen.jar but as the parameters are shown they both seem correct. As a test I did create an array myself and indeed the types are both NSNumber and containsObject actually works as expected NSMutableArray<NSNumber*>* apiArray = [NSMutableArray<NSNumber*> array]; NSNumber *localObject = [NSNumber numberWithInt: -1]; [apiArray addObject: localObject]; NSLog(@"$$$$$$$$$$$ [apiArray containsObject: localObject]: %d", [apiArray containsObject: localObject] ); NSLog(@"apiArray types are: %@", [apiArray valueForKey:@"class"]); NSLog(@"localObject type is: %@", [localObject valueForKey:@"class"]); NSLog(@"apiArray is: %@", apiArray); NSLog(@"localObject is: %@", localObject); $$$$$$$$$$$ [apiArray containsObject: localObject]: 1 apiArray types are: ( "__NSCFNumber" ) localObject type is: __NSCFNumb…
has comment: http://stackoverflow.com/comment/138651145
has answer: http://stackoverflow.com/a/78643150
has comment: http://stackoverflow.com/comment/138650722
has comment: http://stackoverflow.com/comment/138650641
has comment: http://stackoverflow.com/comment/138651150
score: 0
has comment: http://stackoverflow.com/comment/138650302
has comment: http://stackoverflow.com/comment/138651242
has title: NSNumber array containsObject fails as types are different but they should be the same
has comment: http://stackoverflow.com/comment/138651154
has comment: http://stackoverflow.com/comment/138649962
type: Question
has comment: http://stackoverflow.com/comment/138651174
has comment: http://stackoverflow.com/comment/138650569
has comment: http://stackoverflow.com/comment/138657569
accepted answer: http://stackoverflow.com/a/78643150
tagged with: swagger-codegen

http://stackoverflow.com/q/78650783
score: 0
has title: sharing pdf to my ios react native app from gallery/files issue
tagged with: ios8-share-extension
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138703667
answer count: 0
tagged with: ios
tagged with: objective-c
tagged with: react-native
type: Question
has body: Recently I implemented ShareExtension in my ios app built using react-native. coming straight to the point. added below code to info.plist of ShareExtension app to support sharing of any kind of file/attachments available NSExtensionActivationRule NSExtensionActivationSupportsText <true/> NSExtensionActivationSupportsWebURLWithMaxCount 1 NSExtensionActivationSupportsImageWithMaxCount 10 NSExtensionActivationSupportsMovieWithMaxCount 10 NSExtensionActivationSupportsFileWithMaxCount 10 NSExtensionActivationSupportsAttachmentsWithMaxCount 10 and now I opened Photos selected an image to share from list of apps shown to share, I chose my app from the below code I got the url details but could not repeat the same while sharing PDFs NSExtensionItem *inputItem = self.extensionContext.inputItems.firstObject; NSItemProvider *itemProvider = inputItem.attachments.firstObject; if ([itemProvider hasItemConformingToTypeIdentifier:(NSString *)kUTTypeImage]) { [itemProvider loadItemForTypeIdentifier:(NSString *)kUTTypeImage options:nil completionHandler:^(NSURL *url, NSError *error) { if (url) { NSLog(@"Shared file URL: %@", url); [self uploadFileWithURL:url]; } else { NSLog(@"Error loading shared file: %@", error); } }]; } My trials - for sharing PDFs in the same manner, if ([itemProvider hasItemConformingToTypeIdentifier:(NSString *)kUTTypeFileURL]) { [itemProvider loadItemForTypeIdentifier:(NSString *)kUTTypeFileURL options:nil completionHandler:^(NSURL *url, NSError *error) { if (error) { NSLog(@"Error loading PDF: %@", error.localizedDescription); } else if (url) { NSLog(@"Shared PDF URL: %@", url); } }]; } just changed kUTTypeImage --> kUTTypeFileURL but everytime its throwing error saying Failed to resolve item of class `NSURL` for type `public.file-url` with error: Error Domain=NSPOSIXErrorDomain Code=3 "No such process" UserInfo={NSLocalizedDescription=Cannot issue a sandbox extension for file "/Users/demouser/Library/Developer/CoreSimulator/Devices/{ID}/data/Containers/Dat…

http://stackoverflow.com/comment/138679395
comment on: http://stackoverflow.com/q/78656106
score: 0
has text: Sorry, it was late, but I still don't know how I missed it. I will delete my comment as it's irrelevant.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/138593712
type: Comment
type: QuestionComment
has text: Post a [mre] in the question please. How/where did you add the MultitouchSupport framework? When do you get the `Undefined symbol: _MTDeviceCreateList` error?
score: 0
comment on: http://stackoverflow.com/q/78607713

http://stackoverflow.com/comment/138792416
score: 0
type: QuestionComment
type: Comment
has text: Sounds like a SQLCipher integration issue or conflicting dependencies with standard SQLite. Try to make a simple test project to reproduce the problem and narrow down what could be causing it. You can add dependencies one at a time to determine if one of them is causing the issue.
comment on: http://stackoverflow.com/q/78712177

http://stackoverflow.com/comment/138640958
type: Comment
has text: There is missing comma after aps's closing brace. May be that's the reason, why APNS server is sending just part of JSON, because JSON is invalid.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78637226

http://stackoverflow.com/q/78616083
answer count: 1
has title: Github Markdown highlights text with @ in it
score: 0
type: Question
type: UnansweredQuestion
tagged with: markdown
has answer: http://stackoverflow.com/a/78624020
tagged with: objective-c
has body: I am writing documentation using Github Markdown for Objective-C, and everytime I write @weakify(self) or strongify(self) and publish my documentation, these two writings appear in highlighted red and the text is white. In Github preview everything seems fine, yet when I publish it and go to the documentation website, I see that red highlight. This is how I am writing my documentation (I found on the internet that objc is how I should mark that the code is in Objective-C, I tried using objective-c, but then the code is just plain grey): ```objc @weakify(self); [self.bannerAdUnit fetchDemandWithAdObject:gamRequest completion:^(enum ResultCode resultCode) { @strongify(self); }];
tagged with: github

http://stackoverflow.com/comment/138694725
comment on: http://stackoverflow.com/q/78664431
has text: I tried and it compiled. I just had to add `@available(iOS 15.0, *)` above `@objcMembers public class Store:...`
score: 0
type: QuestionComment
type: Comment

ios8-share-extension
tag name: ios8-share-extension
type: Tag
tags question: http://stackoverflow.com/q/78650783
tags question: http://stackoverflow.com/q/78813110

http://stackoverflow.com/q/78602533
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/78607502
tagged with: osx-lion
score: 0
type: Question
downvote count: 1
type: UnansweredQuestion
has body: i've read the great question here Is NSObject class a part of the Objective-C runtime library today (instead of being a Foundation component)? about how NSObject was moved from runtime into its own class between 10.7 and 10.8. i was hoping to get assistance on how i can use an NSObject with &gt;=10.8 SDKs and a 10.7 build target. if i try to use a 10.7 target with the modern SDK, it will complain about NSObject being an undefined symbol: ld64.lld: error: undefined symbol: OBJC_CLASS_$_NSObject &gt;&gt;&gt; referenced by /Users/Gagan/Downloads/mozilla-unified/toolkit/mozapps/update/updater/launchchild_osx.mm &gt;&gt;&gt; launchchild_osx.o:(symbol OBJC_CLASS_$_ElevatedUpdateServer+0x8) &gt;&gt;&gt; referenced by /Users/Gagan/Downloads/mozilla-unified/toolkit/mozapps/update/updater/progressui_osx.mm &gt;&gt;&gt; progressui_osx.o:(symbol OBJC_CLASS_$_UpdaterUI+0x8) ld64.lld: error: undefined symbol: OBJC_METACLASS_$_NSObject &gt;&gt;&gt; referenced by /Users/Gagan/Downloads/mozilla-unified/toolkit/mozapps/update/updater/launchchild_osx.mm &gt;&gt;&gt; launchchild_osx.o:(symbol OBJC_METACLASS_$_ElevatedUpdateServer+0x8) &gt;&gt;&gt; referenced by /Users/Gagan/Downloads/mozilla-unified/toolkit/mozapps/update/updater/launchchild_osx.mm &gt;&gt;&gt; launchchild_osx.o:(symbol OBJC_METACLASS_$_ElevatedUpdateServer+0x0) &gt;&gt;&gt; referenced by /Users/Gagan/Downloads/mozilla-unified/toolkit/mozapps/update/updater/progressui_osx.mm &gt;&gt;&gt; progressui_osx.o:(symbol OBJC_METACLASS_$_UpdaterUI+0x8) i understand why this is the case (because it was in the runtime), but i really want a 10.7 target and not 10.8 (where this error goes away). how would i link an objective c files that use NSObject for a 10.7 target and a modern SDK? i tried -framework Foundation and -framework CoreFoundation to no avail. there must be some way to handle this.
answer count: 1
tagged with: objective-c-runtime
tagged with: macos
has title: using NSObject with modern OS X SDK (14.4) and 10.7 MACOSX_DEPLOYMENT_TARGET
tagged with: nsobject
linked to: http://stackoverflow.com/q/15456974
tagged with: objective-c

http://stackoverflow.com/comment/138792342
type: Comment
comment on: http://stackoverflow.com/q/78712177
has text: Did you pull the encrypted database off the device and attempt to open it with DB Browser for SQLite using SQLCipher 3 default encryption settings? What was the result?
score: 0
type: QuestionComment

http://stackoverflow.com/q/78733679
has comment: http://stackoverflow.com/comment/138817973
tagged with: objective-c
type: Question
upvote count: 1
score: 0
answer count: 0
favorite count: 0
tagged with: swift
downvote count: 1
has title: How can I initiate a new URL request using an already loaded WKWebView?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138815472
has body: I have opened a WKWebView with "https://www.google.com", for example. After that, I put my app in the background. When I try to open a new URL request in the same web view with a new link, like "https://www.youtube.com", by redirecting the app, it doesn't work. I've put a listener function to detect the new URL and called "webView.load(newURLRequest)". However, the web view never loads the new URL request. I have tried to solve this issue by adding a delay through DispatchQueue. Adding a delay sometimes works and sometimes doesn't. I also tried using NavigationDelegate, but it still didn't help. Below is my code: override func viewDidLoad() { super.viewDidLoad() NotificationCenter.default.addObserver(self, selector: #selector(self.refreshData), name: NSNotification.Name("refreshweb"), object: nil) } @objc func refreshData() { let url = URL (string: "https://www.youtube.com") let requestObj = URLRequest(url: url!) webview.load(requestObj) }
tagged with: ios

http://stackoverflow.com/a/78607502
answers question: http://stackoverflow.com/q/78602533
score: 0
type: Answer
has body: resident expert phil dennis-jordan and another person named 'krackers' have gotten to the bottom of the issue. for others: be careful with lld. it is used by default for compiling firefox, and this issue will arise when linking with the -fuse-ld=lld flag. when i set the linker to ld64. the problem went away.

nsobject
tag name: nsobject
tags question: http://stackoverflow.com/q/78602533
type: Tag
tags question: http://stackoverflow.com/q/78757372

http://stackoverflow.com/q/78715945
has title: Calling NSApplication from Rust using objc
has answer: http://stackoverflow.com/a/79539066
type: Question
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/138783479
has answer: http://stackoverflow.com/a/78717642
score: 1
has comment: http://stackoverflow.com/comment/138783097
tagged with: macos
possible better answer: http://stackoverflow.com/a/79539066
favorite count: 0
has comment: http://stackoverflow.com/comment/138783116
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/138783107
tagged with: rust
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138783216
has comment: http://stackoverflow.com/comment/138783130
has body: I am trying to learn by doing a project of allowing AppKit certain functions , related with App and Window creation to be called from Rust using objc. extern crate objc; use objc::runtime::{Class,Object}; use objc::{msg_send, sel, sel_impl}; pub fn create_app(){ unsafe { let app_class =Class::get("NSApplication").unwrap(); let app:&Object = msg_send![app_class,sharedApplication]; let _:&Object = msg_send![app_class,run]; } } However if i try to run this an main.rs I get the following: thread 'main' panicked at src/lib.rs:7:52: called `Option::unwrap()` on a `None` value I guess the objective-c is unable to find the NSApplication Class of AppKit but why and how can i resolve such an issue? I am running all of this from a M3 MacOs just to give insight on my machine.
accepted answer: http://stackoverflow.com/a/78717642
has comment: http://stackoverflow.com/comment/138783105
answer count: 2

http://stackoverflow.com/q/78633101
has title: How does the NSWindow isReleasedWhenClosed property work when using ARC?
tagged with: objective-c
tagged with: automatic-ref-counting
has body: In Objective-C with ARC or Swift (which always uses ARC), what difference does it make whether isReleasedWhenClosed is true or not? Won't a window be kept alive as long as my code has strong references to it, and automatically destroyed when the last strong reference is gone? So why is this setting needed at all?
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/78633102
score: 0
tagged with: swift
type: UnansweredQuestion
tagged with: appkit

http://stackoverflow.com/a/78717642
score: 2
has comment: http://stackoverflow.com/comment/138792759
downvote count: 0
type: AcceptedAnswer
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/138786905
accepted answer of: http://stackoverflow.com/q/78715945
answers question: http://stackoverflow.com/q/78715945
has body: I dont have the full knowledge to explain as to why the below solution was correct , if anyone could explain it better you are more then welcome. Seems like running it using the following command helps it succesfully find the AppKit classes using the objc2 crate. RUSTFLAGS="-C link-arg=-lobjc -C link-arg=-framework -C link-arg=AppKit" cargo run --release

http://stackoverflow.com/q/78733946
tagged with: in-app-purchase
has title: Generating a signature for promotional offers in Objective-c
tagged with: signature
tagged with: ios
score: 0
type: Question
tagged with: subscription
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138816298
linked to: http://stackoverflow.com/q/73709703
has body: My requirements are to generate a signature for a promotional offer in the iOS app code (Objective-C), but I'm getting nil every time with the error: 'The operation couldn’t be completed. (OSStatus error -50 - EC private key creation from data failed).' Please refer to my code below and suggest how I can get the signature. The privateKeyPath is a .p8 file saved in the Xcode project's main folder: + (NSString *)generateSignatureWithKeyId:(NSString *)keyId bundleId:(NSString *)bundleId productId:(NSString *)productId offerId:(NSString *)offerId nonce:(NSUUID *)nonce timestamp:(NSTimeInterval)timestamp privateKeyPath:(NSString *)privateKeyPath { // Load the private key NSString *privateKeyString = [NSString stringWithContentsOfFile:privateKeyPath encoding:NSUTF8StringEncoding error:nil]; if (!privateKeyString) { NSLog(@"Failed to load private key"); return nil; } // Remove the header and footer privateKeyString = [privateKeyString stringByReplacingOccurrencesOfString:@"-----BEGIN PRIVATE KEY-----" withString:@""]; privateKeyString = [privateKeyString stringByReplacingOccurrencesOfString:@"\n" withString:@""]; privateKeyString = [privateKeyString stringByReplacingOccurrencesOfString:@"\r" withString:@""]; privateKeyString = [privateKeyString stringByReplacingOccurrencesOfString:@"-----END PRIVATE KEY-----" withString:@""]; // Convert to NSData NSData *privateKeyData = [[NSData alloc] initWithBase64EncodedString:privateKeyString options:NSDataBase64DecodingIgnoreUnknownCharacters]; NSLog(@"NSDATA private key: %@", [privateKeyData base64EncodedStringWithOptions:0]); if (!privateKeyData) { NSLog(@"Failed to decode private key"); return nil; } // Create the payload string NSString *payloadString = [NSString stringWithFormat:@"%@\u2063%@\u2063%@\u2063%@\u2063%@\u2063%@\u2063%.0f", bundleId, keyId, productId, offerId, @"", // appAccountToken is optional, leave empty if not used [nonce UUIDString], timestamp]; NSData *payloadData = [payloadString dataUsingEncoding:NSUTF8String…
has comment: http://stackoverflow.com/comment/138816659
answer count: 0

http://stackoverflow.com/q/78672092
tagged with: objective-c
answer count: 0
tagged with: notifications
tagged with: ios
score: 0
tagged with: react-native
type: Question
upvote count: 1
tagged with: xcode
has body: I am using react native for an app.Just added NotificationService Extension for rich notifications and trying building my project Getting these unnecessary log in console when hit to run on simulator. 1)tried cleaning the derived data. 2)pod deintegrate and integrate. 3)closing xcode and reopening again. These types of logs getting export HEADER_SEARCH_PATHS=/Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/include\ \ /Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/ReactCommon-Samples/ReactCommon_Samples.framework/Headers\ /Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\ /Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios\ /Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\ /Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\ "/Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/AppAuth/AppAuth.framework/Headers"\ "/Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Build/Products/Debug-iphonesimulator/BVLinearGradient/BVLinearGradient.framework/Headers"\ "/Users/manish.kumar/Library/Developer/Xcode/DerivedData/Medikabazaar-dplnuuermlmktvaimqgotsinmaoj/Buil…
type: UnansweredQuestion
has title: Getting unnecessary log while adding NotificationService Extension in IOS
favorite count: 0
downvote count: 1

http://stackoverflow.com/comment/138651150
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78642014
has text: You could create an extension on `NSArray`: `-(BOOL)containsWhere:(BOOL (^)(id obj))predicate { NSInteger index = [self indexOfObjectPassingTest:^BOOL(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { return predicate(obj); }]; return index != NSNotFound; }`, and then call it like that: `BOOL contains = [array containsWhere:^BOOL(id _Nonnull obj) { return [obj integerValue] == [localObject integerValue]; }];`
type: Comment

http://stackoverflow.com/comment/138766033
type: Comment
comment on: http://stackoverflow.com/q/78705702
score: 0
has text: @AlanBirtles I finally solved it. The reason is the library includes *.c file, and I should add `set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")` :(
type: QuestionComment

http://stackoverflow.com/comment/138650302
type: Comment
has text: @Cy-4AH I updated the question with the prints for the values. Apparently i do get an array of NSNumber from the server, still I don't understand why the containsObject returns 0 when the object is in fact present and the type of the array prints NSString..
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78642014

http://stackoverflow.com/comment/138711883
type: Comment
has text: Maybe you can clarify if the anonymous edit was done by you or someone else. If not please roll back.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78664431

http://stackoverflow.com/q/78723321
answer count: 0
tagged with: flutter
type: Question
tagged with: nullability
tagged with: objective-c
has title: Issue with nullability specifiers in Xcode when developing Flutter app
score: 0
has body: I'm developing a Flutter application and encountering an issue with nullability specifiers in Xcode. Specifically, I have methods in my Objective-C files where Xcode is reporting conflicts with existing specifiers like 'nullable' and 'nonnull'. Here's an example of the code causing the issue: - (instancetype)init { return [self initWithPresentingViewController:nil]; } - (instancetype)initWithPresentingViewController:(UIViewController *)presentingViewController { NSAssert(presentingViewController != nil, @"presentingViewController cannot be nil on iOS 13"); self = [super init]; if (self) { _presentingViewController = presentingViewController; } return self; } - (instancetype)initWithPresentingViewController:(UIViewController *)presentingViewController prefersEphemeralSession:(BOOL)prefersEphemeralSession { NSAssert(presentingViewController != nil, @"presentingViewController cannot be nil on iOS 13"); self = [super init]; if (self) { _presentingViewController = presentingViewController; _prefersEphemeralSession = prefersEphemeralSession; } return self; } Xcode highlights these lines and shows errors like: Nullability specifier 'nonnull' conflicts with existing specifier 'nullable'. and Flutter Terminal: Nullability Issue (Xcode): Nullability specifier 'null_unspecified' conflicts with existing specifier 'nullable' Could not build the application for the simulator. Error launching application on iPhone 14. I've tried correcting the nullability specifiers, but the error persists. How can I resolve this issue? Additional Information: Developing a Flutter application. Running into nullability specifier conflicts specifically in Objective-C files.
type: UnansweredQuestion
tagged with: xcode

http://stackoverflow.com/comment/138657569
has text: Use xml: it doesn't have numbers in strings problem
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78642014
type: Comment

http://stackoverflow.com/q/78644961
has title: Xcode 15.4 always popup to click "Trust and Open" when open workspace
tagged with: popup
upvote count: 1
answer count: 1
tagged with: objective-c
favorite count: 0
type: Question
has body: I just upgrade my macOS from Monterey to Sonoma. And then I also downloaded and installed the new XCode version 15.4. I'm also git clone my project from my BitBucket repo after upgraded to macOS Sonoma. The issue started when I opened my project workspace after clone the repo. I always popup "" is a workspace downloaded from the Internet. Are you sure you want to open it? Opening, building, or running a project containing malicious code can harm your Mac or compromise your privacy. Be sure you trust the source of the project before opening it." Once I click "Trust and Open" btn, it open the workspace file normally. However, after close the XCode and open the project workspace again, it displayed the same popup. Does anyone have any idea how to remove this popup. Thank you ^_^
type: UnansweredQuestion
tagged with: swift
downvote count: 0
tagged with: xcode
has answer: http://stackoverflow.com/a/78647316
score: 1

http://stackoverflow.com/comment/138650641
has text: One is String, one is number, and to be able to "fully compare" `NSNumber`, I'd use `integerValue` instead.
type: Comment
comment on: http://stackoverflow.com/q/78642014
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138797889
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78712177
has text: Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/258066/discussion-between-bathi-and-r4n).

http://stackoverflow.com/q/78637226
type: UnansweredQuestion
has body: I am working as iOS developer and now working to handle the Apple Push Notification Payload contains custom tag like this: { "aps": { "alert": { "title": "Title of APN", "body": "Body of APN" }, "badge": 32 }, "context": { "site_name": "***", "path": "***", "uid": "***", "site_id": "example.com", "type": "***", "entity_id": "***" } } The notification with the above Payload format is send from the Drupal backend. The problem is that while receiving the notification and Log the userInfo dictionary in delegate method: I see only this part: "aps": { "alert": { "title": "Title of APN", "body": "Body of APN" }, "badge": 32 } And the custom tags "context" part is missing. Is there any mechanism in Apple site to check the data received by the APNS from the Drupal backend? Thanks in advance!
answer count: 0
has comment: http://stackoverflow.com/comment/138640994
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138640958
tagged with: apple-push-notifications
score: 0
has title: How to check what data is received by APNS sent from backend?
type: Question

http://stackoverflow.com/q/78664431
upvote count: 1
downvote count: 0
favorite count: 0
tagged with: linker-errors
has body: I am trying to reference a variable in a Swift class from an Objective-C view controller. I can reference functions and variables in other Swift Classes from this Objective-C class. However, when I try to reference variables in this class in particular, which is a Store class containing Storekit2 when I try to build, it generates two errors: Undefined symbol: _OBJC_CLASS_$__TtC5myapp5Store Linker command failed with exit code 1 (use -v to see invocation) I believe the issue has something to do with Objective-C not being able to see every type of Swift Class. It can see classes with which it is familiar such as UIView Controllers but not new ones such as the Store. Here is the beginning of the Store file in Swift (which has all the Storekit functions. I think the Store_from_Objc was an unfinished effort to make the class observable from Swift but the documentation done by a previous programmer does not go into any detail. //Store.swift import StoreKit //CLASS STUB FOR TESTING ObjC @available(iOS 15.0, *) @objcMembers public class Store_from_Objc: NSObject,ObservableObject { static var shared = Store_from_Objc() @objc var teststring1 = "hello from store_from_objc class" public func initAndLoad () { Store.shared.initAndLoad() } } //FULL CLASS WITH METHODS FOR STORE @objcMembers public class Store: NSObject, ObservableObject { typealias Transaction = StoreKit.Transaction typealias RenewalInfo = StoreKit.Product.SubscriptionInfo.RenewalInfo typealias RenewalState = StoreKit.Product.SubscriptionInfo.RenewalState static var shared = Store() @objc var testing2 = "hello from actual Store" //LOTS MORE CODE } Here is the Obj-c file from which I'm trying to reach Swift variable. //import bridging header so that obj-c file knows about swift files #import "myapp-Swift.h" if (@available(iOS 15.0, *)) { NSString *test1 = [Store_from_Objc shared].teststring1; NSString *test2 = [Store shared].teststring2; NSLog(@"%@",test1); NSLog(@"%@",test2); } else { // Fallback on earlier version…
type: Question
tagged with: swift
type: UnansweredQuestion
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/138694725
tagged with: storekit
has comment: http://stackoverflow.com/comment/138700585
has title: Reference variable in Store.swift class from Objective-C file using singleton pattern giving Linker command failed error
tagged with: singleton
has comment: http://stackoverflow.com/comment/138711883
tagged with: objective-c

nsdate
type: Tag
tags question: http://stackoverflow.com/q/78610273
tag name: nsdate

http://stackoverflow.com/q/78607223
favorite count: 0
has title: A viewcontroller(vca) and another vcb, I need to add vcb.view to vca.view as a subview
has answer: http://stackoverflow.com/a/78608773
tagged with: page-lifecycle
upvote count: 0
has comment: http://stackoverflow.com/comment/138585810
downvote count: 3
score: -3
tagged with: viewcontroller
has body: Here is a viewcontroller(vca) and another vcb, I need to add vcb.view to vca as a subview. but I did not use addChildViewController, instead, I directly calls [vca.view addSubview:vcb.view], and vcb's viewWillAppear, viewDidAppear just get called automatically. really want to know why. Is addChildViewController necessarily while adding another vc's view as subview? `ViewControllerA.m (void)showVCBView { ViewControllerB *vcb = [[ViewControllerB alloc] init]; [self.view addSubview:vcb.view]; }`
type: Question
answer count: 1
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/comment/138783479
type: QuestionComment
score: 0
has text: If the problem is solved, either delete the question or add an Answer to it.
type: Comment
comment on: http://stackoverflow.com/q/78715945

http://stackoverflow.com/q/78692256
score: 0
tagged with: qt
tagged with: swift
has title: How to Reactivate the Last Focused Window After My Qt App Closes on macOS
answer count: 0
has body: I'm developing a screenshot-taker application using Qt and need some assistance with macOS-specific behavior. Here’s the scenario: When I take a screenshot, my application becomes focused to allow the user to draw over the screenshot. After editing, the user can copy the edited screenshot. The problem is that the previously focused window (for example, a Chrome window) loses focus and remains unfocused even after my application closes. What I want to achieve: Programmatically refocus the last focused window that was active before my application became active. Is there any way to achieve this using macOS APIs? Specifically, I’m looking for a method to track and reactivate the previously focused window from my application. Any guidance, suggestions, or code snippets would be greatly appreciated!
tagged with: macos
type: Question
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/a/78647316
score: 0
type: Answer
has body: Apple provides Gatekeeper, if the app wasn't properly signed, the warning would be different - "[ExampleApp] is from an unidentified developer" or "[ExampleApp] is damaged and cannot be opened." Thus, the fact that you're seeing "[ExampleApp] is an application downloaded from the Internet" is typical and indicates that your app is correctly signed. This warning is the same one users will encounter when downloading any application from the internet. For instance, if you download Google Chrome, you'll see the identical message. If you want to remove this warning still you can check this post
answers question: http://stackoverflow.com/q/78644961

http://stackoverflow.com/comment/138585810
has text: `UIViewController` or `NSViewController`? Storyboard? How are the view controllers and views instantiated? Post a [mre] please.
type: Comment
comment on: http://stackoverflow.com/q/78607223
score: 0
type: QuestionComment

http://stackoverflow.com/q/78728592
tagged with: ios
tagged with: onedrive
type: Question
tagged with: objective-c
has title: microsoft.identitymode.tokens.audienceurivalidationfailedexception was thrown while trying to open One Drive document in WKWebView in iOS app
type: UnansweredQuestion
tagged with: sharepoint
has body: I am working in iOS app needs to be opened One Drive attachments in WKWebView. Sample One Drive document is https://\*\*\*.sharepoint.com/personal/\*\*\*\*\*\_onmicrosoft_com/\_layouts/15/Doc.aspx?sourcedoc=%7B756B3139-9729-49D2-A325-9D3B150C6A78%7D&file=export.csv&action=default&mobileredirect=true I got the this error "microsoft.identitymode.tokens.audienceurivalidationfailedexception was thrown" inside the loaded WKWebView Please suggest me to fix the issue. Thanks in Advance To load the document in the WKWebView, here is the code snippet: WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init]; if([[NSUserDefaults standardUserDefaults] objectForKey:[TMEUserDefaultKeys cdnSetCookie]]) { WKUserContentController *userContentController = WKUserContentController.new; WKUserScript *cookieScript = [[WKUserScript alloc] initWithSource:[NSString stringWithFormat:@"document.cookie = '%@';", [[NSUserDefaults standardUserDefaults] objectForKey:[TMEUserDefaultKeys cdnSetCookie]]] injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO]; [userContentController addUserScript:cookieScript]; [configuration setUserContentController:userContentController]; } WKPreferences *preferences = [[WKPreferences alloc] init]; preferences.javaScriptEnabled = YES; configuration.preferences = preferences; configuration.allowsInlineMediaPlayback = YES; configuration.allowsPictureInPictureMediaPlayback = YES; configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll; NSArray<NSHTTPCookie *> *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]; for(NSHTTPCookie *cookie in cookies) { [configuration.websiteDataStore.httpCookieStore setCookie:cookie completionHandler:nil]; } self.webView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:configuration]; self.webView.UIDelegate = self; self.webView.navigationDelegate = self; self.webView.translatesAutoresizingMaskIntoConstraints = false; self.webView.scroll…
tagged with: wkwebview
score: 0
answer count: 0

signature
tag name: signature
tags question: http://stackoverflow.com/q/78733946
type: Tag

http://stackoverflow.com/q/78633210
type: Question
tagged with: swift
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/138642592
has title: Sandboxed macOS app not able to launch the PiP window via Javascript, why?
tagged with: javascript
tagged with: objective-c
has comment: http://stackoverflow.com/comment/140280833
upvote count: 1
downvote count: 0
tagged with: xcode
favorite count: 0
has body: I have a macOS app which has a WKWebView which can load sites and if they have a video player, it can show the native PiP video window which the app invokes via a Javascript action to the WKWebView. This app is sandboxed for submitted to the Mac app store. The launch of native PiP window works well in the debug version while running from Xcode but not the release version. I want to upload to the Mac App Store, so it has to be sandboxed. Does the sandboxed app not able to launch the PiP Agent? Or what is missing and why does it works well when running from Xcode in Debug version but not in Release mode as a direct app? Any help is appreciated.
tagged with: wkwebview
answer count: 0
has comment: http://stackoverflow.com/comment/138639803

http://stackoverflow.com/comment/138591711
score: 2
type: Comment
has text: Unrelated but all single quotes except the ones around the `T` are redundant.
type: QuestionComment
comment on: http://stackoverflow.com/q/78610273

http://stackoverflow.com/a/78707072
score: 0
has body: I've tested with the following structure (shared implements shared-ui-models): And this Model.kt file: package com.sample.models import kotlin.experimental.ExperimentalObjCName import kotlin.native.ObjCName @OptIn(ExperimentalObjCName::class) @ObjCName(swiftName = "MyTestScreen") data class Screen(val name: String) The output is: __attribute__((swift_name("Shared_ui_modelsMyTestScreen"))) Or just Shared_ui_modelsScreen if I remove the @ObjCName. I'm inclined to assume that the logic is: Module name capitalised + "-" replaced by "_" + class/protocol name. I would like to get some confirmation on this because when applying this logic to the SerializersModuleCollector.kt file in the OP, we see that its module is simply core. However, the result is Kotlinx_serialization_coreSerializersModuleCollector, which leads me to wonder where the Kotlinx_serialization part comes from.
accepted answer of: http://stackoverflow.com/q/78706424
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/78706424
type: Answer

http://stackoverflow.com/q/78706424
has body: What logic is used to create class and protocol names when Kotlin code is exported to Objective-C? Additionally, where can I find detailed information about this process? Where code like: package kotlinx.serialization.modules public interface SerializersModuleCollector {...} from: core/commonMain/src/kotlinx/serialization/modules/SerializersModuleCollector.kt Is transformed into: Kotlinx_serialization_coreSerializersModuleCollector Kotlinx_serialization_coreKSerializer Kotlinx_serialization_coreSerializationStrategy ... Full Example: public protocol Kotlinx_serialization_coreSerializersModuleCollector { func contextual(kClass: any KotlinKClass, provider: @escaping ([any Kotlinx_serialization_coreKSerializer]) -> any Kotlinx_serialization_coreKSerializer) func contextual(kClass: any KotlinKClass, serializer: any Kotlinx_serialization_coreKSerializer) func polymorphic(baseClass: any KotlinKClass, actualClass: any KotlinKClass, actualSerializer: any Kotlinx_serialization_coreKSerializer) @available(*, deprecated, message: "Deprecated in favor of function with more precise name: polymorphicDefaultDeserializer") func polymorphicDefault(baseClass: any KotlinKClass, defaultDeserializerProvider: @escaping (String?) -> (any Kotlinx_serialization_coreDeserializationStrategy)?) func polymorphicDefaultDeserializer(baseClass: any KotlinKClass, defaultDeserializerProvider: @escaping (String?) -> (any Kotlinx_serialization_coreDeserializationStrategy)?) func polymorphicDefaultSerializer(baseClass: any KotlinKClass, defaultSerializerProvider: @escaping (Any) -> (any Kotlinx_serialization_coreSerializationStrategy)?) }
has answer: http://stackoverflow.com/a/78707072
tagged with: kotlin-multiplatform
tagged with: cinterop
type: Question
answer count: 1
tagged with: objective-c
has title: Kotlin Multiplatform objective-c export file name convention
score: 0
accepted answer: http://stackoverflow.com/a/78707072
tagged with: kotlin
type: AnsweredQuestion

http://stackoverflow.com/comment/138643391
comment on: http://stackoverflow.com/q/78638545
type: Comment
has text: Stick to `activateConstraints`: it knows better than you do what to add each constraint to. Instead of hunting for the height constraint at animation time, just keep a reference to it at the time you create it.
score: 0
type: QuestionComment

http://stackoverflow.com/a/78617348
type: Answer
answers question: http://stackoverflow.com/q/78607713
score: 0
has body: I solved it. My first mistake was to not properly add the framework-dependency. You need to add the whole folder so in my case: /System/Library/PrivateFrameworks/MultitouchSupport.framework. The second problem was that it does not work if the project is in SANDBOX-mode. Might be use-case-specific though.

http://stackoverflow.com/comment/138642592
type: Comment
comment on: http://stackoverflow.com/q/78633210
score: 0
has text: @Cy-4AH Yes, I did set it to true.
type: QuestionComment

http://stackoverflow.com/comment/138783107
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78715945
has text: Also note that `objc` appears abandoned, last commit 4 years ago. Maybe the author just considers it complete, but consider switching to a different crate, probably [`objc2`](https://lib.rs/crates/objc2).

linker-errors
tags question: http://stackoverflow.com/q/78664431
tag name: linker-errors
type: Tag
tags question: http://stackoverflow.com/q/79027410

http://stackoverflow.com/comment/138791808
type: Comment
has text: In both workspace 1 and workspace 2 implementations? My initial guess without seeing your code would be that it's some sort of issue with the way you've integrated SQLCipher. As mentioned in my previous comment, you should pull the database off the device, download DB Browser for SQLite and attempt to open it with that. Then if you're still stuck create a minimal project that reproduces the issue, upload it to GitHub and then post a link to it.
comment on: http://stackoverflow.com/q/78712177
type: QuestionComment
score: 0

http://stackoverflow.com/comment/138703667
comment on: http://stackoverflow.com/q/78650783
has text: is anybody alive on stack overflow ????????????????????????????????????????????
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/138620383
comment on: http://stackoverflow.com/a/78610300
score: 0
type: AnswerComment
has text: @Paulw11: 31st of March
type: Comment

http://stackoverflow.com/comment/138817973
type: Comment
score: 0
has text: Yes. Basically, I am trying to scan a QR code with the camera and load the URL obtained from the scan in an app that is running in the background. However, I am unable to load the new URL.
type: QuestionComment
comment on: http://stackoverflow.com/q/78733679

http://stackoverflow.com/comment/138792378
comment on: http://stackoverflow.com/q/78712177
score: 0
type: QuestionComment
type: Comment
has text: I am able to open db file by using DB Browser. It has old data as well.

http://stackoverflow.com/comment/138649962
type: Comment
score: 0
has text: You receive numbers in double quotes from server?
type: QuestionComment
comment on: http://stackoverflow.com/q/78642014

http://stackoverflow.com/a/78643150
downvote count: 0
accepted answer of: http://stackoverflow.com/q/78642014
answers question: http://stackoverflow.com/q/78642014
score: 1
type: AcceptedAnswer
type: Answer
upvote count: 1
has body: In Objective-C, it's not because it's declared as such NSArray<NSNumber*>* apiArray that apiArray will contains only NSNumber: NSArray<NSNumber*>* apiArray; NSArray *t = @[@[], @"", @2]; apiArray = t;` This will compile just fine, and the elements of apiArray are an array, a string and a number. It's a common cause of unrecognized selector sent to instance crash error. NSArray<NSNumber*>* apiArray is just a small helper: It tells you that apiArray SHOULD only have NSNumber elements (even if it's not the case), so when you populate it, populate it accordingly, and when retrieving elements from it, it would expect them to be NSNumber. So NSArray *first = [apiArray firstObject]; will produce a warning Incompatible pointer types initializing 'NSArray *' with an expression of type 'NSNumber * _Nullable', but that's it, just a warning. And in my case, the first element is really a NSArray, not a NSNumber. After a few feedbacks on your end, it seems that the back-end send NSString instead of NSNumber. It's up to you to change it in your JSON parsing or not, or change your local model for localObject be a NSString. If you want to keep both API/local as such, since you have NSString and NSNumber to compare, a possible way is to use integerValue. It's a little more verbose, but this should do the trick: NSInteger index = [self indexOfObjectPassingTest:^BOOL(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { return [obj integerValue] == [localObject integerValue]; }]; BOOL contains = index != NSNotFound; If you want to create a contains(where:) (in a more "Swift" code) you can create a category on NSArray: NSArray+Custom.h @interface NSArray<ObjectType> (Addon) -(BOOL)containsWhere:(BOOL (^)(id obj))predicate; @end NSArray+Custom.m @implementation NSArray (Addon) -(BOOL)containsWhere:(BOOL (^)(id obj))predicate { NSInteger index = [self indexOfObjectPassingTest:^BOOL(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { return predicate(obj); }]; return index != NSNot…
has comment: http://stackoverflow.com/comment/138652033
has comment: http://stackoverflow.com/comment/138652061

nullability
tag name: nullability
tags question: http://stackoverflow.com/q/78723321
type: Tag

http://stackoverflow.com/comment/140280833
score: 1
type: Comment
has text: How? `allowsPictureInPictureMediaPlayback` is [unavailable on native macOS](https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/allowspictureinpicturemediaplayback). Is says "iOS 9.0+ iPadOS 9.0+ Mac Catalyst 13.1+ visionOS 1.0+".
comment on: http://stackoverflow.com/q/78633210
type: QuestionComment

http://stackoverflow.com/comment/138650569
score: 0
type: Comment
has text: yes it would appear so
comment on: http://stackoverflow.com/q/78642014
type: QuestionComment

http://stackoverflow.com/comment/138620565
score: 0
type: QuestionComment
has text: Duplicate of https://stackoverflow.com/a/23839955/341994
comment on: http://stackoverflow.com/q/78610273
type: Comment

http://stackoverflow.com/comment/138686132
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78656106
has text: `nullptr` is from C++. you need import it's headers inside `#ifdef _cplusplus #endif` block

http://stackoverflow.com/comment/138652061
has text: Meanwhile I was just looking in to making an extension on NSArray to solve the problem as my for loop solution isn't the most elegant way to solve it, so once again thanks for the gigantic help
score: 0
comment on: http://stackoverflow.com/a/78643150
type: AnswerComment
type: Comment

http://stackoverflow.com/a/78642764
accepted answer of: http://stackoverflow.com/q/78638545
answers question: http://stackoverflow.com/q/78638545
has comment: http://stackoverflow.com/comment/138652521
score: 0
has comment: http://stackoverflow.com/comment/138652364
has body: You should check and confirm that you are, in fact, finding the Height constraint: for (NSLayoutConstraint * constraint in [_profileView constraints]) { if (constraint.firstAnchor == NSLayoutAttributeHeight) { heightConstraint = constraint; break; } } if (heightConstraint) { NSLog(@"Found Height Constraint: %@", heightConstraint); } else { NSLog(@"Did NOT find Height Constraint!"); } That code (in my quick test) does NOT find the Height constraint, so of course, no animation. This code: for (NSLayoutConstraint *constraint in _profileView.constraints) { // Check if the constraint is a height constraint if (constraint.firstAttribute == NSLayoutAttributeHeight && constraint.firstItem == _profileView) { // Found the height constraint heightConstraint = constraint; break; } } if (heightConstraint) { NSLog(@"Found Height Constraint: %@", heightConstraint); } else { NSLog(@"Did NOT find Height Constraint!"); } Does find the Height constraint, and the animation happens as expected. As a side note, you might want to look at the more modern way of setting up constraints. This matches your constraints, but I think you'd agree it is much more readable (and much easier to edit when needed): [NSLayoutConstraint activateConstraints:@[ [_profileView.heightAnchor constraintEqualToConstant:160.0], [_profileView.widthAnchor constraintEqualToAnchor:self.view.widthAnchor], [_profileView.leftAnchor constraintEqualToAnchor:self.view.leftAnchor], [_profileView.topAnchor constraintEqualToAnchor:self.view.topAnchor constant:-64.0], ]]; Edit As mentioned in comments by Matt, you are (almost always) better off adding a constraint property that you can update when desired. Here's an example of that approach: #import <UIKit/UIKit.h> @interface AnimSubViewController : UIViewController @end @interface AnimSubViewController () @property (strong, nonatomic) UIView *profileView; @property (strong, nonatomic) NSLayoutConstraint *heightConstraint; @end @implementation AnimSubViewController - (void)view…
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/138650551
has text: Your server is sending strings instead of numbers.
type: QuestionComment
comment on: http://stackoverflow.com/q/78642014
score: 0
type: Comment

http://stackoverflow.com/comment/138700585
type: Comment
has text: I was able to access a variable in Store_from_Objc from is just a stub of.a class but not in the full class Store. The code included above is just the beginning of the Store class. The actual one has hundreds of lines of code...It could be that some of the StoreKit2 methods may be the problem although that doesn't make that much sense since both the long version and the short version inherit from (NSObject, ObservableObject)
comment on: http://stackoverflow.com/q/78664431
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138620371
type: Comment
has text: Did you tried : « @import metal_float64 » . To import the module and its interface in Objective-C code ?
comment on: http://stackoverflow.com/q/78618633
score: 0
type: QuestionComment

http://stackoverflow.com/q/78681400
tagged with: getter-setter
has body: I have an NSManagedObject class that stores, among other things, a JSON string that comes from a WkWebView form. The form in the web view allows the user to add images to the form; when the form is submitted, it is passed to the Cocoa layer via userContentController:didReceiveScriptMessage as a JSON string. The images are included as Base64 encoded data URLs. This works, but users add more images and larger images than anticipated, and it is rather uncool to store BLOBs in a database, IMHO. So I want to save the images into files in the app doc dir and patch the JSON string to refer to the images via file URL. The sandbox directory (and thus the documents directory) changes on every app launch, so I cannot store absolute URLs in the database. Instead, I use a placeholder, [APP_DOC_DIR]. So basically the JSON data images have 3 states: Base64 data URLs as created by JS code in WkWebView File URLs with [APP_DOC_DIR] placeholder File URLs with correct absolute path when displaying the data in WkWebView To make the changes at the appropriate locations and moments, I override the form data setter and getter of my NSManagedObject instance. #define FORM_DATA_KEY @"formData" /// Form data setter - (void) setFormData:(NSString *)form_data { // abbreviated heavily, just showing the concept NSMutableString *data = form_data; for (;;) { // Find base64 data URL // Save resulting NSData in a file // Replace data URL with URL to the file, using [APP_DOC_DIR] placeholder } // Update the value Core Data sees [self willChangeValueForKey:FORM_DATA_KEY]; [self setPrimitiveValue:data forKey:FORM_DATA_KEY]; [self didChangeValueForKey:FORM_DATA_KEY]; } /// Form data getter - (NSString*) formData { NSMutableString *data = [self primitiveValueForKey:FORM_DATA_KEY]; NSString *docsUrl = [NSURL fileURLWithPath:thisApp.docDir].absoluteString; for (;;) { // Replace all occurrences of [APP_DOC_DIR] with docsUrl } return data; } Basically, that's it. The replacement code is fast and works. But the…
tagged with: objective-c
tagged with: cocoa
has title: Override NSManagedObject getter/setter to modify data
tagged with: core-data
score: 0
has answer: http://stackoverflow.com/a/78685499
type: Question
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/comment/138651174
score: 0
type: QuestionComment
type: Comment
has text: @Vincenzo How is really retrieved `apiArray`? In Objective-C, it's not because it's `NSArray<NSNumber*>*` that all element of the array will be `NSNumber`, it's more of a suggestion/reminder, there is in fact NO check.
comment on: http://stackoverflow.com/q/78642014

http://stackoverflow.com/q/78722607
downvote count: 1
type: UnansweredQuestion
tagged with: uisplitviewcontroller
tagged with: ios
has title: How do I replace detail view controller navigation stack when presenting
tagged with: objective-c
type: Question
upvote count: 1
favorite count: 0
score: 0
answer count: 0
has body: I'm working with a UISplitViewController that's using some storyboards but now moving to programmatic presentation (which is what I'm familiar with). I have a VC that's currently presenting as a push, but I'm trying to move out to presenting as a detail view on a split view controller. The problem is that it's presented correctly in the detail side, but the back button unravels to the most previous detail view controller. This messes up the navigation, especially when in the collapsed view. How can I present the detail view controller as the only VC on the detail stack? The rest of the app detail view controllers behave as though they are replacing the detail view controller stack. I'm currently trying: UIViewController *vc = [UIViewController new]; [self.splitViewController showDetailViewController:vc sender:self];

http://stackoverflow.com/comment/138639803
score: 0
has text: Did you set `allowsPictureInPictureMediaPlayback = true`?
type: QuestionComment
comment on: http://stackoverflow.com/q/78633210
type: Comment

http://stackoverflow.com/comment/138792759
type: AnswerComment
comment on: http://stackoverflow.com/a/78717642
type: Comment
has text: You can do that in a build script too.
score: 0

http://stackoverflow.com/comment/138791955
type: Comment
score: 0
has text: In both workspaces used 3.4 version only.
comment on: http://stackoverflow.com/q/78712177
type: QuestionComment

kernel
tag name: kernel
tags question: http://stackoverflow.com/q/78648329
type: Tag

http://stackoverflow.com/comment/138678630
comment on: http://stackoverflow.com/q/78656106
type: QuestionComment
has text: @Larme Just started learning. The line was there at the 3rd row in the podfile. Or am I missing some more?
score: 0
type: Comment

http://stackoverflow.com/comment/138651145
comment on: http://stackoverflow.com/q/78642014
score: 0
type: Comment
type: QuestionComment
has text: @Larme ok.. I did sort it out thanks to your suggestion. I started with a `BOOL containsObject` set to false. Then I loop on the array values and only when `containsObject` is false (not to override an eventual match ) I compare their `.integerValue` against the localObject `.integerValue` and assign the resulting BOOL value to `containsObject` itself. It works and suits my purpose but still I can't get why the types of the array's values returned from the server are NSString when both the model and the json we receive to compile it aren't.

http://stackoverflow.com/comment/138599578
comment on: http://stackoverflow.com/a/78610300
score: 0
has text: Thank you! In this case, should I still use `NSISO8601DateFormatter` has you previously suggested? It strips the time, which is what I would want here.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/138652033
type: AnswerComment
type: Comment
has text: Oh wow! Thank you very much for your answer, I really appreciate the in-depth explanation. I did check-out again with the back-end guys and indeed they're sending an array of strings..dough it shouldn't and they're looking into it because it shouldn't be the case looking at the OpenAPi yaml they're using to generate the endpoints
comment on: http://stackoverflow.com/a/78643150
score: 0

http://stackoverflow.com/comment/138651154
comment on: http://stackoverflow.com/q/78642014
type: QuestionComment
type: Comment
score: 0
has text: The other API model value ( the one I want to find out if is present in the array) does compile as an SNNumber dough

http://stackoverflow.com/a/78663559
downvote count: 0
score: 1
type: AcceptedAnswer
type: Answer
upvote count: 1
has body: For general advice on which to use and why, see Swift - which types to use? NSString or String. However, I believe you are aware of that, and this is a different question. What actually are the differences? The biggest difference that has the most impact is that NSString is uses UTF-16 as its preferred internal encoding and String prefers UTF-8. Both can encode things other ways, but that's their defaults, and this has a big impact on them. Since almost all modern work is done in UTF-8, String is more natural for this. While it's obvious that NSString is a class and String is a struct, it is less obvious that String has a SmallString storage which can store very short strings directly in two Ints avoiding heap memory allocations and reference counting entirely. This is the kind of optimization that is difficult to achieve with the design of NSString. NSString is fundamentally composed of UTF-16 code points. String is fundamentally composed of "extended grapheme clusters" (Character). This has major implications in how it works with Unicode. String is a much more "Unicode-aware" type than NSString. Alternately you can say it is a very "Unicode-pedantic" type. Between the use of UTF-8, which is variable width, and Character rather than code point as the element, finding the "nth" element of a String is a O(n) process. It's O(1) in NSString, but you then must do extra work to be sure you're not in the middle of a combined character. Ultimately while there is very handy bridging between the two types, they are very different, and String is much more powerful, especially when dealing with complex Unicode such as emoji.
accepted answer of: http://stackoverflow.com/q/78663202
answers question: http://stackoverflow.com/q/78663202

cinterop
tags question: http://stackoverflow.com/q/78706424
tag name: cinterop
type: Tag

http://stackoverflow.com/a/78610300
has comment: http://stackoverflow.com/comment/138599652
downvote count: 0
has comment: http://stackoverflow.com/comment/138599578
has comment: http://stackoverflow.com/comment/138620383
type: AcceptedAnswer
score: 3
accepted answer of: http://stackoverflow.com/q/78610273
has body: There was no 2:40 in the morning on the 31st of March in Paris - Daylight savings/summer time started at 02:00 on the 31st of March, meaning the clocks jumped forward to 03:00 at that time. nil is the correct result
answers question: http://stackoverflow.com/q/78610273
type: Answer
upvote count: 3

http://stackoverflow.com/a/78685499
score: 0
answers question: http://stackoverflow.com/q/78681400
type: Answer
has body: Answering my own question... I have not found why it failed overriding getter and setter. What finally solved it for me was to create dedicated getters and setters and leave the Core Data generated property with its getter and setter alone. I don't use it anymore at all, nowhere. - (void) setFormDataWithBlobs:(NSString*) data { // Store BLOBs as files // Replace BLOB base64 strings with file URLs using [APP_DOC_DIR] placeholder // Then save the whole thing in Core Data: [self willChangeValueForKey:FORM_DATA_KEY]; [self setPrimitiveValue:data forKey:FORM_DATA_KEY]; [self didChangeValueForKey:FORM_DATA_KEY]; } - (NSString*) getPatchedFormData { // Get form data with placeholders from Core Data NSString *s = [self primitiveValueForKey:FORM_DATA_KEY]; NSMutableString *data = [s mutableCopy]; // Replace [APP_DOC_DIR] with actual application docs dir // ... return data; }

http://stackoverflow.com/comment/138688705
score: 2
has text: That I am aware of. Wanted to know the difference technically as if using String functions will be better than using NSString functions in which sense ?
type: QuestionComment
comment on: http://stackoverflow.com/q/78663202
type: Comment

http://stackoverflow.com/comment/138650722
has text: @Larme I'm not sure I follow you. In my first code snippet I use the API model values, the print of the array doesn't show the value between `"`, its values type are NSString and containsObject returns 0. In my second snippet I use an Array which I populate myself, and the value gets printed between `"`, its value types are indeed NSNumber and containsObject returns 1 correctly. where should I use `integerValue`? on the object I want to know if is presente in the array from the API or where?
comment on: http://stackoverflow.com/q/78642014
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/138652364
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78642764
has text: I would urge the OP not to listen to this, but rather to do what I suggested in my comment, "Instead of hunting for the height constraint at animation time, just keep a reference to it at the time you create it." Constraint-hunting is a bad technique, even if you can get it to work. It's an anti-pattern. We know in advance that we're going to want to modify the constraint on this one constraint; therefore the correct pattern is to maintain a reference to it.
score: 0

http://stackoverflow.com/comment/138695494
type: QuestionComment
comment on: http://stackoverflow.com/q/78663202
type: Comment
has text: Does this answer your question? [Swift - which types to use? NSString or String](https://stackoverflow.com/questions/24038629/swift-which-types-to-use-nsstring-or-string)
score: 0

http://stackoverflow.com/comment/138786905
score: 0
type: AnswerComment
has text: The Objective C runtime was not linked, which leaded to failure to find the class. It is weird, even a bug, that `objc` didn't forced linking it.
type: Comment
comment on: http://stackoverflow.com/a/78717642

http://stackoverflow.com/comment/138791778
score: 0
type: QuestionComment
has text: but here I am using 3.4 version only.
type: Comment
comment on: http://stackoverflow.com/q/78712177

sharepoint
type: Tag
tags question: http://stackoverflow.com/q/78728592
tag name: sharepoint

uibezierpath
tag name: uibezierpath
tags question: http://stackoverflow.com/q/78614160
type: Tag

http://stackoverflow.com/comment/138651242
score: 0
has text: @Larme OOH I see.. thanks for the clarification on the array type I found myself having to make modifications to our Objective-c app, but I'm very new to it. So the problem then might reside in the API compilation with swagger I guess. The guys from the back-end told me they send longs, not strings, and checking the json we receive to compile the API the apiArray parameter is `"apiArray":{"type":"array","items":{"type":"integer","format":"int64"}}`.
type: QuestionComment
comment on: http://stackoverflow.com/q/78642014
type: Comment

http://stackoverflow.com/a/78633102
score: 1
upvote count: 2
has body: tl;dr? Scroll down all the way to the final summary. Yet if you want to know the history of that setting, how it really works and why it is even there, see below. The isReleasedWhenClosed property has been a major source of confusion for decades. Even in modern Swift code, people misunderstand this property and its purpose, or how it may or may not affect their code and application behavior. To understand why isReleasedWhenClosed even exists, we have to go back to a time when Swift didn't exist and Objective-C had no automatic memory management or garbage collection, it had no weak references and it didn't even have synthesized properties (@propertry), you had to write getter/setter methods yourself. Before ARC, you had to manage memory yourself in Obj-C. That is, if you created an object using a method starting with new... or alloc..., you had to release that object when you were done with it by calling release on it. Now, if you passed that object around and someone else wanted to keep a persistent reference to it, they had to retain the object, which would prevent it from being destroyed when its creator called release. But if you retained an object, you also had to offset that retention with another release, otherwise the object would never be destroyed. What happens if you keep a reference to an object without holding it? In this case, the object may be destroyed and your reference becomes a dangling pointer. A dangling pointer is a pointer to an address where an object used to be, but that object no longer exists, so there is either nothing or another object at that address, or the address points to the middle of some memory allocation. There's nothing wrong with having dangling object pointers, they're perfectly legal as long as you don't actually try to send them messages, because that will result in undefined behavior, meaning maybe it will cause your application to crash, maybe it will cause your application to behave in weird ways, just don't do it. So th…
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/78633101

swagger-codegen
type: Tag
tag name: swagger-codegen
tags question: http://stackoverflow.com/q/78642014

nsdateformatter
tags question: http://stackoverflow.com/q/78610273
type: Tag
tag name: nsdateformatter

http://stackoverflow.com/comment/138686143
comment on: http://stackoverflow.com/q/78656106
type: QuestionComment
score: 0
has text: Does this answer your question? [Force Header Files to Compile as C++ in Xcode](https://stackoverflow.com/questions/32827389/force-header-files-to-compile-as-c-in-xcode)
type: Comment

getter-setter
tags question: http://stackoverflow.com/q/78681400
type: Tag
tag name: getter-setter

http://stackoverflow.com/comment/138643481
comment on: http://stackoverflow.com/q/78638545
score: 0
type: QuestionComment
type: Comment
has text: During an animation you should use the `presentationLayer`. See https://stackoverflow.com/questions/21953459/get-current-frame-of-uiview-while-animated but I don't suggest to keep a reference to the constraint instead...

http://stackoverflow.com/comment/138783116
has text: If you use [the `class!()` macro](https://docs.rs/objc/latest/objc/macro.class.html), does it work?
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78715945

popup
tag name: popup
type: Tag
tags question: http://stackoverflow.com/q/78644961

subscription
type: Tag
tag name: subscription
tags question: http://stackoverflow.com/q/78733946
tags question: http://stackoverflow.com/q/79072182

http://stackoverflow.com/comment/138791294
has text: This sounds like: an issue with the way you've integrated SQLCipher or mismatched SQLCipher major versions (you won't be able to open SQLCipher 3.x databases with SQLCipher 4.x by default as the encryption settings are different -- you'll need to use cipher_migrate or open it with compatibility settings: https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283). I'd recommend pulling the database off the device and attempting to open it with DB Browser for SQLite: https://sqlitebrowser.org If you're still stuck, create an simple example project on GitHub and post a link to it.
comment on: http://stackoverflow.com/q/78712177
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/138643687
has text: It would also be useful to know _when_ all this is happening. I could incorporate your code pretty much as is into a demo project where I tap a button in the interface and alternate with animation between a 64 height and a 160 height, and your code pretty much as is would _work_. Therefore in order to know why your code is _not_ working we might need to know more about other aspects of the environment in which all this is happening.
comment on: http://stackoverflow.com/q/78638545
score: 0
type: QuestionComment
type: Comment

sqlcipher
tags question: http://stackoverflow.com/q/78712177
type: Tag
tag name: sqlcipher

osx-lion
type: Tag
tag name: osx-lion
tags question: http://stackoverflow.com/q/78602533

uisplitviewcontroller
tag name: uisplitviewcontroller
tags question: http://stackoverflow.com/q/78722607
type: Tag

http://stackoverflow.com/comment/138640994
comment on: http://stackoverflow.com/q/78637226
score: 0
type: QuestionComment
type: Comment
has text: In the Drupal code the Payload like this: { "aps": { "alert": { "title": "Title of APN", "body": "Body of APN" }, "badge": 32 }, "context": { "site_name": "***", "path": "***", "uid": "***", "site_id": "example.com", "type": "***", "entity_id": "***" } } I left the comma to type here.

github
tag name: github
type: Tag
tags question: http://stackoverflow.com/q/78616083

cgcontext
tag name: cgcontext
type: Tag
tags question: http://stackoverflow.com/q/78614160

http://stackoverflow.com/comment/138652521
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78642764
has text: @matt - I agree, "hunting for constraints" is a bad technique... although I wanted to explain the OP's error. Added an **Edit** to my answer with the "maintain a reference" approach.

http://stackoverflow.com/comment/138599652
has text: I would always suggest using NSISO8601DateFormatter when dealing with things that look like ISO8601 - It is simpler than having to define a custom format.
type: AnswerComment
comment on: http://stackoverflow.com/a/78610300
score: 1
type: Comment

http://stackoverflow.com/a/79539066
answers question: http://stackoverflow.com/q/78715945
has body: You can add the following code in your .cargo/config.toml : [build] rustflags = ["-Clink-arg=-lobjc", "-Clink-arg=-framework", "-Clink-arg=AppKit"] With this you don't have to pass arguments every time and can just do cargo run --release
score: 0
type: Answer

vst
tags question: http://stackoverflow.com/q/78733543
tag name: vst
type: Tag

onedrive
tag name: onedrive
tags question: http://stackoverflow.com/q/78728592
type: Tag

http://stackoverflow.com/comment/138688600
type: QuestionComment
has text: The difference is that String is a Swift native type and NSString is bridged from Objc-c
comment on: http://stackoverflow.com/q/78663202
score: 1
type: Comment

http://stackoverflow.com/comment/138765320
has text: please show a [mre]
type: QuestionComment
comment on: http://stackoverflow.com/q/78705702
score: 1
type: Comment

uigraphicsimagerenderer
tag name: uigraphicsimagerenderer
tags question: http://stackoverflow.com/q/78614160
type: Tag

http://stackoverflow.com/comment/138920701
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78772418
has text: I did think this but there are a good 30-40 fields, I mean I could save these in a plist or something - however in the controlAction function how would I reference the control to the correct initial value? I appeciate your help :) I'm surprised there is no notification for like field focus - that would have been easier as I could have just grabbed the value on field focus - and then saved that as oldValue.

voiceover
type: Tag
tags question: http://stackoverflow.com/q/78816893
tag name: voiceover

http://stackoverflow.com/q/78796285
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138951901
has comment: http://stackoverflow.com/comment/139038641
score: 0
has comment: http://stackoverflow.com/comment/138992712
tagged with: frameworks
tagged with: archive
has title: Unable to create framework in Xcode 15 with Objective-C throwing error "Command PhaseScriptExecution failed with a nonzero exit code"
answer count: 0
tagged with: ios
has body: I am trying to create objective C Network framework using Xcode 15 with minimum supported iOS version 14.0. Here are the steps I am following: I created New> Project> framework> Objective C> storyboard> Create. Made NetworkManager.h file created by project to public. Added two files MyNetworkRequest.h and MyNetworkRequest.m. Made MyNetworkRequest.h > Public from inspector. Added #import < NetworkManager/MyNetworkRequest.h> in the NetworkManager.h From Project > Target > Build Setting > set SKIP_INSTALL = NO and Build Libraries for distribution = YES Added script for making framework : select target from top bar> Edit scheme> Archive> Post action> Add run script> copy pasted following script: UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-Universal # Build Device and Simulator versions xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build # Copy the framework structure (from iphoneos build) to the universal folder cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/" # iOS - Copy the framework structure to the universal folder (clean it first) rm -rf "${UNIVERSAL_OUTPUTFOLDER}" # Make sure the output directory exists mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" # Copy Swift modules from iphonesimulator build (if it exists) to the copied framework directory BUILD_PRODUCTS="${SYMROOT}/../../../../Products" cp -R "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" # Create universal binary file using lipo and place the combined executable in the copied framework directory lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUIL…
type: Question
tagged with: objective-c
tagged with: xcode15

http://stackoverflow.com/comment/139059429
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78869590
has text: A minimal example would already require posting header and m files for the entity, as well as the core data model. To summarise I don't use an `NSTreeController`. I use standard datasource methods. `numberOfChildrenOfItem: returns `subfolders.count`, `childOfItem:AtIndex` returns the folder at the index in the `subfolders` relationship and `objectValueForTableColumn:byItem` returns the item (a folder). There is a single column, and the text field of a cell is bound to the `name` attribute of the cell's `objectValue` (which is a folder).

http://stackoverflow.com/comment/138863981
score: 1
type: Comment
comment on: http://stackoverflow.com/q/78757372
has text: @Willeke That basically is just to show that yes, Objective-C allocates everything on the heap, with a select few exceptions.
type: QuestionComment

http://stackoverflow.com/q/78756425
answer count: 0
tagged with: objective-c
type: Question
has comment: http://stackoverflow.com/comment/138856817
has body: I have an Objective-C class that is a proxy to an NSDictionary. @interface DictionaryProxy : NSProxy -(id)objectForKey:(id)key; -(void)setObject:(id)obj forKey:(id&lt;NSCopying&gt;)key; @end I have not genericized the class because I do not want the type parameters class-constrained in Swift. Swift imports the class as follows: class DictionaryProxy : NSProxy { func object(forKey key: any NSCopying) -&gt; Any func setObject(_ obj: Any, forKey key: any NSCopying) } Is there a way for me to customize how the return type for objectForKey: and the key parameter in setObject:forKey: are imported in Swift? After Swift changed to import id as Any, can I selectively import an id type as an AnyHashable or AnyObject?
score: 0
tagged with: swift
tagged with: bridging-header
type: UnansweredQuestion
has title: Can we customize how parameters and return types are imported from Objective-C into Swift?

http://stackoverflow.com/q/78766116
has answer: http://stackoverflow.com/a/78772418
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/138882295
answer count: 1
has body: Hello I have an application, it's very basic but has some fields for an address, so city, zip code, state etc... I want it so the user can undo the content across multiple fields, currently the default undo only works on the field you are using. I am using NSTextFields for my fields. I assume I need to use UndoManager but I am not sure how to implement it on my fields, my fields have ID's. Is there any documentation on how to do this, none of the fields have any functions - I just grab the data from all of the fields on one of my button events. I don't know swift so please responsd in Obj-c so I can undertstand what needs to be done.
tagged with: nstextfield
score: 0
accepted answer: http://stackoverflow.com/a/78772418
tagged with: objective-c
type: Question
tagged with: nsundomanager
has title: Undo manager with multiple fields

http://stackoverflow.com/comment/139069385
score: 0
comment on: http://stackoverflow.com/q/78869590
type: Comment
has text: I did a test: folders are turned into fault even if the outline view isn't populated (by specifying no datasource for the outline view). So the issue is not related to the outline view.
type: QuestionComment

http://stackoverflow.com/q/78811299
tagged with: objective-c
favorite count: 0
tagged with: core-audio
has answer: http://stackoverflow.com/a/78813656
tagged with: ffmpeg
type: Question
upvote count: 1
downvote count: 0
has title: Meaning of Timestamp Retrieved by AudioQueueGetCurrentTime() in AudioQueue Callback
type: UnansweredQuestion
score: 1
tagged with: audioqueue
tagged with: ios
has body: I'm working on an audio project and have a question regarding the meaning of the timestamp retrieved by AudioQueueGetCurrentTime(). According to the Apple Developer Documentation, the following calculation gives the audio time being played (since AudioQueueStart): - (Float64) GetCurrentTime { AudioTimeStamp c; AudioQueueGetCurrentTime(playState.queue, NULL, &c, NULL); return c.mSampleTime / _av->audio.sample_rate; } However, in a project I'm working on, I noticed the following code inside the fillAudioBuffer callback function of AudioQueue: static void fillAudioBuffer(AudioQueueRef queue, AudioQueueBufferRef buffer){ int lengthCopied = INT32_MAX; int dts= 0; int isDone = 0; buffer->mAudioDataByteSize = 0; buffer->mPacketDescriptionCount = 0; OSStatus err = 0; AudioTimeStamp bufferStartTime; AudioQueueGetCurrentTime(queue, NULL, &bufferStartTime, NULL); while(buffer->mPacketDescriptionCount < numPacketsToRead && lengthCopied > 0){ if (buffer->mAudioDataByteSize) { break; } lengthCopied = getNextAudio(_av,buffer->mAudioDataBytesCapacity-buffer->mAudioDataByteSize, (uint8_t*)buffer->mAudioData+buffer->mAudioDataByteSize,&dts,&isDone); if(!lengthCopied || isDone) break; if(aqStartDts < 0) aqStartDts = dts; if (dts>0) currentDts = dts; if(buffer->mPacketDescriptionCount ==0){ bufferStartTime.mFlags = kAudioTimeStampSampleTimeValid; bufferStartTime.mSampleTime = (Float64)(dts-aqStartDts) * _av->audio.frame_size; if (bufferStartTime.mSampleTime <0 ) bufferStartTime.mSampleTime = 0; PMSG2("AQHandler.m fillAudioBuffer: DTS for %x: %lf time base: %lf StartDTS: %d\n", (unsigned int)buffer, bufferStartTime.mSampleTime, _av->audio.time_base, aqStartDts); } buffer->mPacketDescriptions[buffer->mPacketDescriptionCount].mStartOffset = buffer->mAudioDataByteSize; buffer->mPacketDescriptions[buffer->mPacketDescriptionCount].mDataByteSize = lengthCopied; buffer->mPacketDescriptions[buffer->mPacketDescriptionCount].mVariableFramesInPacket = _av->audio.frame_size; buffer->mPacketDescript…
answer count: 1

http://stackoverflow.com/comment/138956838
has text: I want to share on my app. Like share WhatsApp message in my app.
type: QuestionComment
comment on: http://stackoverflow.com/q/78813110
score: 0
type: Comment

ckshare
tags question: http://stackoverflow.com/q/78863706
type: Tag
tag name: ckshare

http://stackoverflow.com/q/78869590
tagged with: objective-c
answer count: 0
has title: Core data inappropriately turns managed objects into faults
has comment: http://stackoverflow.com/comment/139062099
has comment: http://stackoverflow.com/comment/139055168
tagged with: core-data
has comment: http://stackoverflow.com/comment/139059429
score: 0
has comment: http://stackoverflow.com/comment/139063546
has comment: http://stackoverflow.com/comment/139069385
type: Question
type: UnansweredQuestion
has body: My app maintains Folder objects (an NSManagedObject subclass). Each folder may have subfolders of the same class (an ordered to-many relationship, the reciprocal relationship is called parent). Folders also have a name attribute (NSString). Problem: when a subfolder is added/removed to/from a parent folder, for instance via insertObject:inSubfoldersAtIndex: sent to the parent folder, the other subfolders are often turned into faults when the parent folder is saved (which happens when the context is saved). This has detrimental effect as their names disappear from the UI (folders show in an outline view, but this isn't related to the issue, which occurs even if the outline view is removed). I have no idea why code data sees fit to turn these subfolders into faults in this situation. It doesn't do it consistently and never does it when the names of folders are changed (which also requires a save). Note: the folder that was inserted into a parent is never turned into a fault. Only other subfolders of the same parent are. How can I prevent folders from being turned into faults? EDIT: Since the folders that turn into faults are those that are not saved (i.e., that have no pending changes), making changes to these folders prevents them for turning into faults during the next save. So I just make dummy changes to all subfolders (replacing their name with the same values) whenever one of them is inserted or removed. Not the best solution.

http://stackoverflow.com/a/78767321
type: Answer
answers question: http://stackoverflow.com/q/78767018
has body: This is a method to check if the file input is mp3 format. #import <UniformTypeIdentifiers/UniformTypeIdentifiers.h> - (BOOL)isMP3FileAtURL:(NSURL *)url { NSError *error = nil; NSDictionary *resourceValues = [url resourceValuesForKeys:@[NSURLContentTypeKey] error:&error]; if (error) { NSLog(@"Error retrieving file resource values: %@", error); return NO; } UTType *contentType = resourceValues[NSURLContentTypeKey]; return [contentType conformsToType:UTTypeMP3]; } Integrate it into your code, it will be like -(id)getAudioFileNamed: (NSString*) name { { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString* path = [documentsDirectory stringByAppendingPathComponent: [NSString stringWithString: name] ]; NSURL *url = [NSURL fileURLWithPath:path]; if ([self isMP3FileAtURL: url]) { AVPlayerItem* item = [AVPlayerItem playerItemWithURL:url]; return item; } else { return nil; } } return nil; } I adjust a bit, making it more readable, so finally it should be like. - (nullable AVPlayerItem *)getAudioFileNamed:(NSString *)name { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent: [NSString stringWithString: name]]; NSURL *url = [NSURL fileURLWithPath:path]; if ([self isMP3FileAtURL: url]) { return [AVPlayerItem playerItemWithURL:url]; } else { return nil; } }
score: 0

archive
type: Tag
tags question: http://stackoverflow.com/q/78796285
tag name: archive

http://stackoverflow.com/q/78757372
has comment: http://stackoverflow.com/comment/138864238
has comment: http://stackoverflow.com/comment/138864079
has comment: http://stackoverflow.com/comment/138867584
has comment: http://stackoverflow.com/comment/138864117
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138858895
has comment: http://stackoverflow.com/comment/138863975
answer count: 0
has title: Is there a way to force an NSObject to be allocated in stack or static memory?
tagged with: memory-management
has body: I am asking this out of curiosity, because even if this can technically be done, this is almost certainly unsupported by Apple. As far as I can tell, only NSString literals, and possibly NSDictionary literals can be allocated in static memory, because they can be used to initialize global/static NSString * objects, making them compile-time constants, whereas any behind-the-scenes dynamic allocation would be unsuitable for a compile-time constant initializer. For any other NSObject, the only supported way to have one is by using the alloc method. If you try to declare a non-pointer to an NSObject, as you would a normal C struct if you wanted one allocated on the stack, such as NSWindow my_window; rather than NSWindow *my_window; a compile-time error results. My question is, is there theoretically a way to have an NSObject allocated in stack or static memory? For example, to declare a stack or static buffer, and then 'trick' the Objective-C runtime into using that space for an NSObject? Something along the lines of: unsigned char buffer[sizeof(NSWindow)]; // sizeof(NSWindow) is a compile-time error but you get the idea NSWindow *window = buffer; [window init];
has comment: http://stackoverflow.com/comment/138864064
tagged with: nsobject
score: 0
has comment: http://stackoverflow.com/comment/138861450
linked to: http://stackoverflow.com/q/4326965
has comment: http://stackoverflow.com/comment/138863981
type: Question
type: UnansweredQuestion

http://stackoverflow.com/comment/138991095
has text: Follow this [SO](https://stackoverflow.com/questions/45997841/how-to-get-a-secidentityref-from-a-seccertificateref-and-a-seckeyref) for for SecIdentity
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78834398
type: AnswerComment

http://stackoverflow.com/q/78837902
answer count: 0
tagged with: xcode
score: 0
has title: Creating a xcframework with both Debug and Release libs?
has body: I'm building a library, and my goal is to provide a way for users to automatically get the right version depending on their configuration (Debug or Release). I used to do that with .a files, where, in their project, I'd set Linker Flags to -lMyLib1 -lMyLib2 ... and then set the Library Search Path to a different value for Debug and Release (two directories with the .a files compiled for Debug and Release respectively). Now I am switching to xcframeworks, but I find no way to do that. Should I bundle my release and debug libs together in the xcframework? Is that even possible? If not, how can I make xcode pick a different xcframework depending on the configuration, in my app? Am I missing something obvious here?
type: Question
type: UnansweredQuestion
tagged with: xcframework
tagged with: objective-c

http://stackoverflow.com/comment/138976329
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78826064
has text: I have downloaded your example project and run it and the exported PDF has a black background too - at least in Sonomo 14.3.1 is it exporting with the gradient for you?
type: AnswerComment

http://stackoverflow.com/comment/138976358
score: 0
has text: That is how it exports for me: https://imgur.com/a/SAF6oQU
type: Comment
comment on: http://stackoverflow.com/a/78826064
type: AnswerComment

http://stackoverflow.com/comment/139035299
score: 0
type: Comment
comment on: http://stackoverflow.com/q/78844651
type: QuestionComment
has text: @Sweeper I'm just worried that Combine will be deprecated soon due to the introduction of Observables, and then my code won't work anymore.

http://stackoverflow.com/comment/138864238
has text: (More philosophically, C and by extension ObjC don’t work like more modern languages. In eg Python, if your code runs without errors then ipso facto it’s valid Python. C is more like a bunch of rusty ancient power tools in a box, and ObjC is a set of rules around how to use them. You can break the rules if you want, but there’s no one to complain to if you accidentally cut off your foot.)
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78757372
type: Comment

http://stackoverflow.com/comment/138973530
type: Comment
has text: Cropping the image as suggested will also produce output which may be placed in an NSImageView after conversion from a CIImage to an NSImage.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78822765

http://stackoverflow.com/comment/139013453
type: QuestionComment
comment on: http://stackoverflow.com/q/78844651
type: Comment
has text: Tried to use it as a view model, as in the future I'd like to have a ViewModel with few published properties.
score: 0

http://stackoverflow.com/q/78863706
has comment: http://stackoverflow.com/comment/139213647
tagged with: cloudkit
tagged with: objective-c
downvote count: 1
tagged with: ckrecord
upvote count: 1
score: 0
has body: When i try to save CKRecord with CKShare using setModifyRecordsCompletionBlock NSOperationQueue * quwuw = [[NSOperationQueue alloc] init]; [quwuw setMaxConcurrentOperationCount:1]; [self createOrFetchZone:^(CKRecordZone *rzone, NSError *error) { CKRecordID *recordID = [[CKRecordID alloc] initWithRecordName:recordId zoneID:custZone.zoneID]; [[self privateCloudDatabase] fetchRecordWithID:recordID completionHandler:^(CKRecord *record, NSError *error) { if (error) { dispatch_async(dispatch_get_main_queue(), ^{ prephandler(nil, nil,error); }); return; } CKShare * share = [[CKShare alloc] initWithRootRecord:record]; share[CKShareTitleKey] = @"example"; [share setPublicPermission:CKShareParticipantPermissionReadWrite]; CKModifyRecordsOperation * op = [[CKModifyRecordsOperation alloc] initWithRecordsToSave:@[share, record] recordIDsToDelete:nil]; [op setModifyRecordsCompletionBlock:^(NSArray<CKRecord *> * _Nullable savedRecords, NSArray<CKRecordID *> * _Nullable deletedRecordIDs, NSError * _Nullable operationError) { if (operationError == nil) { dispatch_async(dispatch_get_main_queue(), ^{ prephandler(share, [CKContainer defaultContainer],operationError); }); } else { dispatch_async(dispatch_get_main_queue(), ^{ prephandler(share, [CKContainer defaultContainer],operationError); }); } }]; [op setDatabase:[self privateCloudDatabase]]; [quwuw addOperation:op]; }]; }]; I got error with userinfo : CKErrorDescription = "Failed to modify some records"; CKPartialErrors = { "<CKRecordID: 0x282af5da0; recordName=Share-76902C70-A6CD-4A12-B6DD-6371A1578FBD, zoneID=someCustomZoneName:__defaultOwner__>" = "<CKError 0x28242a670: \"Batch Request Failed\" (22/2024); server message = \"Atomic failure\"; op = 80E158204C153900; uuid = 81B2BAEB-5ADE-447C-A29C-F8D8D174107D; container ID = \"iCloud.com.xxxx.cloudkit-objC\">"; "<CKRecordID: 0x282af5b20; recordName=0CA7AA50-FCD0-4964-984D-237031BB7106, zoneID=someCustomZoneName:__defaultOwner__>" = "<CKError 0x28242a490: \"Invalid Arguments\" (12/2…
has title: How to share CKRecord with CKShare properly
favorite count: 0
type: Question
tagged with: ckshare
type: UnansweredQuestion
answer count: 0

http://stackoverflow.com/comment/138948214
type: Comment
has text: @ShilaiZhang As per your code snippet which you have added in the question, you have assigned "textField.textContentType = .password" due to which when textfield becomes first responder you are getting a suggestion of autofill password above numberpad keyboard.
score: 0
comment on: http://stackoverflow.com/a/78764845
type: AnswerComment

http://stackoverflow.com/comment/139063546
type: QuestionComment
comment on: http://stackoverflow.com/q/78869590
type: Comment
has text: I only fetch the "root" folder (which contains all folders) at the start of the app, and call `subflolders` in the datasource methods. When the user adds, deletes or moves a folder (via buttons, menus or drag&drop), the outline view delegate modifies the underlying model with `insertObject:inSubfoldersAtIndex:` for instance, and it then inserts/deletes/moves rows with NSOutlineView dedicated methods, to allow animation. I usually don't reload the table as it breaks animations. But I do reload rows after the managed object context is saved, to fire faults as mentioned in my post.
score: 0

http://stackoverflow.com/comment/139092174
type: Comment
has text: I see one issue in your code. The CGImage is not retained. You must retain it. Look at the comment: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/ui/snapshot/snapshot_mac.mm
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78846311

nstextfield
tags question: http://stackoverflow.com/q/78766116
tag name: nstextfield
type: Tag

http://stackoverflow.com/q/78825520
accepted answer: http://stackoverflow.com/a/78826037
score: -1
has title: Is there the equivalent of "fling" detection (Android) with UIGestureRecognizer on iOS?
tagged with: ios
type: Question
upvote count: 1
answer count: 1
tagged with: core-graphics
tagged with: objective-c
has body: Basically, fling designates the "energy" to apply after the finger is released from the screen after having swiped around (i.e. a panning event such as UIPanGestureRecognizer). It's like you swipe and then "throw" the object you have moved around: you get the force at which it has been thrown in the direction. It is useful for me to apply inertia after a panning event on a scroll view (from my own custom framework, not using UIScrollView). Is there any way to get the equivalent on iOS? I don't really understand how it is calculated. It is not giving good results to use the last translation from the UIPanGestureRecognizer as a value for inertia.
has answer: http://stackoverflow.com/a/78826037
tagged with: xcode
favorite count: 0
type: AnsweredQuestion
downvote count: 2

http://stackoverflow.com/q/78761078
favorite count: 0
tagged with: opengl-es
has answer: http://stackoverflow.com/a/78764265
downvote count: 0
tagged with: flutter
score: 1
has title: CGContextDrawImage: invalid context 0x0. Failed to bind EAGLDrawable to GL_RENDERBUFFER 2
has body: I'm working on a custom UIView subclass in my iOS project that involves using GLKView and CAEAGLLayer for camera rendering and applying beauty filters. The main goal is to capture video from the camera, process it with beauty filters, and render the output in a custom view. However, I'm encountering several issues related to setting the drawable properties of CAEAGLLayer and rendering the video frames correctly. Below is the code: #import "FUCameraPlatformView.h" #import "OverlayView.h" #import "GLView.h" #import <GLKit/GLKit.h> @interface FUCameraPlatformView() <FUCameraDelegate> @property (nonatomic, strong) EAGLContext *glContext; @property (nonatomic, strong) GLKView *glView; @property (nonatomic, strong) CIContext *ciContext; @property (nonatomic, strong) GLView *view; @property (nonatomic, strong) FUCamera *camera; @property (nonatomic, strong) MHBeautyManager *beautyManager; @property (nonatomic , strong) OverlayView *overlay; @end @implementation FUCameraPlatformView - (instancetype)initWithFrame:(CGRect)frame viewIdentifier:(int64_t)viewId arguments:(id)args cameraInstance:(FUCamera *)camera binaryMessenger:(NSObject<FlutterBinaryMessenger> *)messenger beautyManager:(MHBeautyManager *)manager { self = [super init]; if (self) { _beautyManager = manager; _beautyManager.delegate = self; _camera = camera; _camera.delegate = self; _view = [[GLView alloc] initWithFrame:frame]; [self setupGL]; [self setupCamera]; } return self; } - (void)setupGL { _glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; _glView = [[GLKView alloc] initWithFrame:_view.bounds context:self.glContext]; _glView.enableSetNeedsDisplay = NO; _glView.context = self.glContext; _glView.drawableDepthFormat = GLKViewDrawableDepthFormat24; _ciContext = [CIContext contextWithEAGLContext:_glContext]; // Ensure the drawable properties are set correctly CAEAGLLayer *eaglLayer = (CAEAGLLayer *)_view.layer; eaglLayer.opaque = YES; eaglLayer.contentsScale = [UIScreen mainScreen].scale…
tagged with: ios
type: Question
upvote count: 1
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
tagged with: glkit

drawing
tags question: http://stackoverflow.com/q/78824958
type: Tag
tag name: drawing

http://stackoverflow.com/q/78844651
tagged with: swift
tagged with: swiftui
has comment: http://stackoverflow.com/comment/139013645
score: 1
has comment: http://stackoverflow.com/comment/139012701
has comment: http://stackoverflow.com/comment/139031629
has comment: http://stackoverflow.com/comment/139035299
type: Question
has answer: http://stackoverflow.com/a/79067540
has comment: http://stackoverflow.com/comment/139031623
tagged with: observable
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
has body: I'm trying to use an Objective-C model via a SwiftUI code. This is a simple demo I made: @protocol CarProtocol <NSObject> @property (strong, readwrite) NSString * color; - (void)changeColor; @end @protocol PersonProtocol <NSObject> @property (strong, readwrite) NSString * name; - (void)changeName; @end @interface Car : NSObject <CarProtocol> @property (strong, readwrite) NSString * color; - (instancetype)initWithColor:(NSString *)color; - (void)changeColor; @end @implementation Car - (instancetype)init { if ((self = [super init])) { self.color = @""; } return self; } - (instancetype)initWithColor:(NSString *)color { if ((self = [super init])) { self.color = color; } return self; } - (void)changeColor { NSArray *colors = @[@"Red", @"Blue", @"Green", @"Yellow", @"Black", @"White"]; NSString *newColor = self.color; while (self.color == nil || [newColor isEqualToString:self.color]) { newColor = colors[arc4random_uniform((uint32_t)colors.count)]; } self.color = newColor; NSLog(@"The car color has been changed to %@", self.color); } @end Then, I'm trying to access the Car object via the CarProtocol from Objective-C. My goal is to be able to modify the Car instance properties from both Swift (say, from a Text Field) and from the ObjC code (say, by calling car.changeColor()). I've tried the following: import SwiftUI import Combine extension Car: ObservableObject { public var objectWillChange: AnyPublisher<Void, Never> { publisher(for: \.color, options: .prior) .map { _ in } .eraseToAnyPublisher() } public static func randomCar() -> Car { let colors = ["Red", "Blue", "Green", "Yellow", "Purple", "Orange"] return Car(color: colors.randomElement() ?? "Red") } } @Observable class ObservableCar<CarT> where CarT: CarProtocol { public var car: CarT public init(_ car: CarT) { self.car = car } } struct SwiftObservableView<CarT>: View where CarT: CarProtocol & ObservableObject { @State var car: ObservableCar<CarT> public init(car: CarT) { self.car = ObservableCar(car) } var body: som…
has comment: http://stackoverflow.com/comment/139013581
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/139013528
has comment: http://stackoverflow.com/comment/139013453
favorite count: 0
has comment: http://stackoverflow.com/comment/139032385
has comment: http://stackoverflow.com/comment/139036683
has title: Use Swift `#Observable` with Objective-C model

http://stackoverflow.com/comment/138882295
has text: Documentation: [NSUndoManager](https://developer.apple.com/documentation/foundation/nsundomanager) and [Undo Architecture](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/UndoArchitecture/UndoArchitecture.html#//apple_ref/doc/uid/10000010-SW1).
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78766116
type: QuestionComment

http://stackoverflow.com/comment/138974362
comment on: http://stackoverflow.com/a/78823984
type: AnswerComment
type: Comment
score: 0
has text: Thank you, I will look through the code when i'm at my Mac, appeciate the help - i'm always looking to learn!

http://stackoverflow.com/comment/138955303
type: Comment
comment on: http://stackoverflow.com/q/78813110
score: 0
has text: Why do you want multiple share extensions? Even if it were supported, it would be a confusing experience for the user, seeing your app more than once in the share sheet.
type: QuestionComment

http://stackoverflow.com/a/78772418
downvote count: 0
has body: Here's a small example to get you started. Start with the Xcode macOS App template. Add the code below to AppDelegate.m. Add some controls (NSTextField or another subclass of NSControl) to the window. Connect the action of the controls to controlAction:. @interface AppDelegate () @property (strong) IBOutlet NSWindow *window; // values before editing, the key is the identifier of the control @property (strong) NSMutableDictionary *data; @end @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { self.data = [[NSMutableDictionary alloc] init]; } - (void)undoControl:(NSControl *)control oldValue:(id)oldValue newValue:(id)newValue { // undo NSString *controlID = control.identifier; [control setObjectValue:oldValue]; self.data[controlID] = oldValue; if (control.acceptsFirstResponder) [self.window makeFirstResponder: control]; // register redo NSLog(@"register redo %@ old:'%@' new:'%@'", controlID, oldValue, newValue); [[self.window.undoManager prepareWithInvocationTarget:self] undoControl:control oldValue:newValue newValue:oldValue]; } - (IBAction)controlAction:(NSControl *)control { NSString *controlID = control.identifier; id oldValue = self.data[controlID]; id newValue = control.objectValue; if (oldValue != newValue && ![oldValue isEqual:newValue]) { // register undo NSLog(@"register undo %@ old:'%@' new:'%@'", controlID, oldValue, newValue); [[self.window.undoManager prepareWithInvocationTarget:self] undoControl:control oldValue:oldValue newValue:newValue]; self.data[controlID] = newValue; } } @end
score: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/138914800
has comment: http://stackoverflow.com/comment/138903887
type: Answer
accepted answer of: http://stackoverflow.com/q/78766116
answers question: http://stackoverflow.com/q/78766116
has comment: http://stackoverflow.com/comment/138920942
upvote count: 1
has comment: http://stackoverflow.com/comment/138908885
has comment: http://stackoverflow.com/comment/138920701
has comment: http://stackoverflow.com/comment/138902880
has comment: http://stackoverflow.com/comment/138913755
has comment: http://stackoverflow.com/comment/138919120

http://stackoverflow.com/comment/138914800
type: AnswerComment
comment on: http://stackoverflow.com/a/78772418
type: Comment
score: 0
has text: Hey Willeke, I took a look at NSControlTextDidBeginEditingNotification previously for text fields but I could only get it to fire after I had made a change so I couldn't get it to get the initial value but only the first changed value How do I initialise data correctly to get the initial values

http://stackoverflow.com/a/78764845
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/78763503
downvote count: 0
has comment: http://stackoverflow.com/comment/138948214
has comment: http://stackoverflow.com/comment/138874745
score: 1
has body: Have you set your associated domains? According to the Apple Developer Documentation You have to have some domains associated with your app to have the AutoFill functionality. When your app installs on an iOS device, the system attempts to associate the app with all the domains listed in the app’s Associated Domains Entitlement: The system takes each domain from the Associated Domains Entitlement. It tries to download the Apple App Site Association file (apple-app-site-association) for that domain. If all the steps succeed, the system associates the app with that domain, and enables Password AutoFill for that domain’s credentials.

http://stackoverflow.com/q/78824897
tagged with: azure-iot-hub
linked to: http://stackoverflow.com/q/45997841
tagged with: ios
has comment: http://stackoverflow.com/comment/138974345
type: Question
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
has title: How to add x509 certificate and private key in http request in swift?
tagged with: azure
score: 0
has answer: http://stackoverflow.com/a/78834398
has body: I want to add x509 certificate and private key in https request in swift. I am new in swift so I need help. I am not sure what should I use to achieve this. I want to call this API I have tried this till now. import UIKit import Foundation import Security @objc(AzureProvisionWithCertificate) class AzureProvisionWithCertificate: NSObject { @objc(provisionAndUploadFile:withRegistrationId:withKey:withCertificate:withProvisionHost:withFileNameWithFolder:withModelId:withResolver:withRejecter:) func provisionAndUploadFile(scopeId:String, registrationId:String, key:String, certificate:String, provisionHost:String, fileNameWithFolder:String, modelId:String, resolve:@escaping RCTPromiseResolveBlock, reject:@escaping RCTPromiseRejectBlock) -> Void { let url = URL(string: "https://global.azure-devices-provisioning.net/\(scopeId)/registrations/\(registrationId)/register?api-version=2021-06-01")! var request = URLRequest(url: url) request.httpMethod = "PUT" request.setValue("application/json", forHTTPHeaderField: "Content-Type") request.setValue("utf-8", forHTTPHeaderField: "Content-Encoding") let bodyData = ["registrationId": registrationId] let jsonData = try? JSONSerialization.data(withJSONObject: bodyData) request.httpBody = jsonData let sessionConfig = URLSessionConfiguration.default let session = URLSession(configuration: sessionConfig) let task = session.dataTask(with: request) { (data, response, error) in if let error = error { reject("Error", error.localizedDescription, error) } else if let data = data { let responseString = String(data: data, encoding: .utf8) resolve("Response data: \(responseString)") } else { reject("Error", "No data received", nil) } } task.resume() } }
tagged with: swift

http://stackoverflow.com/q/78791941
score: 0
type: Question
has comment: http://stackoverflow.com/comment/138917176
tagged with: push-notification
type: UnansweredQuestion
tagged with: ios
has comment: http://stackoverflow.com/comment/138917139
tagged with: objective-c
has title: How to corroct get notification permission in Objc?
has body: I have a way to get push permissions. But what I get every time is not the correct value. How can I rewrite this method? My push permission has been enabled, but it still prints out 555 first and then 111. But when I call this method outside, I have already obtained False first. How can I make the whole method normal? - (BOOL)getNotificationPermission { __block BOOL hasPermission; UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; [center getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings *settings){ switch (settings.authorizationStatus) { case UNAuthorizationStatusAuthorized: hasPermission = YES; NSLog(@"111"); break; case UNAuthorizationStatusDenied: hasPermission = NO; NSLog(@"222"); break; case UNAuthorizationStatusNotDetermined: hasPermission = NO; NSLog(@"333"); break; default: hasPermission = NO; NSLog(@"444"); break; } }]; NSLog(@"555"); return hasPermission; } Log 555 111
answer count: 0

http://stackoverflow.com/comment/139012701
type: Comment
has text: What's the point of `ObservableCar`? Why not just use `Car` directly?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78844651

http://stackoverflow.com/a/78813950
has body: An app can only contain a single share extension. While you could use "File->New->Target" multiple times to add multiple share extensions to your app, only one of these share extensions will be visible in the system "Share" dialog. Which one would appear is undefined.
accepted answer of: http://stackoverflow.com/q/78813110
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/138956406
answers question: http://stackoverflow.com/q/78813110
type: AcceptedAnswer

http://stackoverflow.com/q/78744919
type: Question
upvote count: 1
tagged with: mount
tagged with: http://stackoverflow.com/tag/c
has body: I've been trying to write an application for older versions of Mac OS X that mounts an NFS network share and ran into an interesting quirk when trying to use the mount(2) function. According to the documentation it should has the following prototype: int mount(const char *type, const char *dir, int flags, void *data); As the documentation is vague on the value of type, I've assumed that it was the network location, in the form of server.name:/some/location. So I've written the following test code: - (BOOL)mount:(NSString *)serverAddress mountPoint:(NSString *)path { int ret = mount([serverAddress UTF8String], [path UTF8String], 0, NULL); NSLog(@"mount = %d", ret); // Handle mounting errors. if (ret != 0) { NSString *errorMessage = [NSString stringWithUTF8String:strerror(errno)]; NSLog(@"errno = %d (%@)", errno, errorMessage); } return ret == 0; } When I run this example method under OS X Mavericks I get the following output from the console: mount = -1 errno = 3 (No such process) Failed to mount network share: No such process Most interestingly is that if I run the same example under OS X Leopard on a Power Mac G5 I get the following output: mount = -1 errno = 63 (File name too long) Failed to mount network share: File name too long On both machines I'm able to mount the network share using the mount(8) command supplying the same parameters as I did with the example method. By the way, the type location is 46 characters long and the dir path is located under the user's home folder. In order to try to replicate the issue on modern versions of macOS I've written the following test code: #include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <sys/param.h> #include <sys/mount.h> int main(int argc, char **argv) { const char *type = "nfsserver.lan:/some/path"; const char *mntp = "/Users/localuser/tmpmount"; int ret = mount(type, mntp, 0, NULL); printf("ret = %d\n", ret); printf("errno = %d (%s)\n", errno, strerror(errno)); return 0; } Upon …
tagged with: osx-leopard
favorite count: 0
tagged with: osx-mavericks
type: UnansweredQuestion
has title: Unable to mount NFS share using mount(2) on macOS
score: 1
downvote count: 0
answer count: 0
tagged with: objective-c

http://stackoverflow.com/a/78826037
has comment: http://stackoverflow.com/comment/138991949
downvote count: 0
score: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/78825520
has body: You are looking for velocity(in:), which gives you points per second at the moment of measurement (which should be the moment of the gesture's .ended). What I do is convert this "momentum" into a spring animation's initialVelocity to bring the motion gently to a halt. Alternatively, depending on what you're trying to do here, you might find UIKit Dynamics a better fit for your use case.
upvote count: 1
answers question: http://stackoverflow.com/q/78825520

http://stackoverflow.com/q/78813110
tagged with: share-extension
has answer: http://stackoverflow.com/a/78813950
favorite count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/138955303
type: Question
tagged with: objective-c
tagged with: swift
upvote count: 0
has body: in swift ios share extension possible multiple share extension in one project. if yes then how ? and how to access swift file in share extension inside used ? please tell me? I try to file &gt; new file &gt; target &gt; create share extension multiple but not work only one share extension show in gallery inside share option
accepted answer: http://stackoverflow.com/a/78813950
type: AnsweredQuestion
has title: in swift ios share extension possible multiple share extension in one project. if yes then how?
score: -1
downvote count: 1
tagged with: ios8-share-extension
has comment: http://stackoverflow.com/comment/138956774
has comment: http://stackoverflow.com/comment/138956838
has comment: http://stackoverflow.com/comment/138956386
answer count: 1

http://stackoverflow.com/q/78757491
type: UnansweredQuestion
answer count: 0
tagged with: objective-c
has title: Cocoapod integration Issue in Framework as target
score: 0
tagged with: frameworks
tagged with: cocoapods
type: Question
has body: I have created an Application in which we have framework as target. I am using SendbirdChatSDK and Sendbirdcalls Cocoapod as dependency for framework. While compiling it is showing error in swift generated header as Module not found for Sendbirdcalls and SendbirdChatSDK. Note: Our Project has mixed Objective C and Swift Please find screenshot and Project link for reference: Github link :(https://github.com/shikha110225/POCAPP) I have tried adding Cocoapod for the framework. Added the .h file in bridging header. Also tried deleting derived data. Expectation : Code should compile after this

http://stackoverflow.com/comment/138951901
comment on: http://stackoverflow.com/q/78796285
type: Comment
has text: I suggest to use SPM for framework creation, even if it's written in `Objective-C`
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138991949
has text: Thank you a lot! It does indeed work. And is compatible with the velocity that android passes to `GestureDetector.OnGestureListener.onFling`!
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78826037

http://stackoverflow.com/q/78816893
has body: I'm trying to add accessibility support for my iOS mobile app. for a table view when the user clicks on the cell, we are showing tick icon at the end of the cell as shown below. the voice should announce the selected state of the cell. Also, I tried with below code since we are reusing the same cell the same selected state is applied for all the rows. if(cell.selected){ cell.accessibilityHint = @"Hidden"; } else { cell.accessibilityHint = @"Visible"; } the value is getting change but it's getting applied for both the cells. I'm using iOS Objective C Any solution for this issue? Kindly help.
tagged with: voiceover
type: UnansweredQuestion
tagged with: accessibility
has title: Tableview cell selected state is not correctly announced by voice over accessibility - iOS Objective C
tagged with: ios
tagged with: objective-c
type: Question
score: 0
answer count: 0

http://stackoverflow.com/comment/138864064
score: 1
type: Comment
has text: Setting aside your question (whether it's possible to trick the compiler), the reason the compiler errors on a local allocation of an object is that the ObjC object lifecycle model going all the way back rests on reference counting, which can't be done reliably when stuff could be unexpectedly "deallocated" by stack unwinding. So it's not just unsupported (thought it is that too) it's a guarantee of disaster. :)
type: QuestionComment
comment on: http://stackoverflow.com/q/78757372

opengl-es
tag name: opengl-es
type: Tag
tags question: http://stackoverflow.com/q/78761078

http://stackoverflow.com/comment/138977812
type: Comment
has text: That is what I am doing - I am using a linear gradient I have tried reducing the size of the image to 1 pixel and even 20 or 30px previously however I notice a stepping on the gradient - so it's not a smooth gradient. So right no i'm using 850px which probably isn't helping with performance. I also wonder if drawinrect is the most efficient way as when I move the sliders in the color panel from my nscolorwell it's really lagging.
score: 0
comment on: http://stackoverflow.com/q/78824958
type: QuestionComment

http://stackoverflow.com/a/79067540
type: Answer
answers question: http://stackoverflow.com/q/78844651
upvote count: 1
downvote count: 0
score: 1
has body: By extending the Car class to conform to ObservableObject, we can update the car's color from both SwiftUI and Objective-C. The UI automatically reflects changes using Combine’s objectWillChange, keeping everything in sync. import SwiftUI import Combine extension Car: ObservableObject { public var objectWillChange: ObservableObjectPublisher { let willChange = ObservableObjectPublisher() let originalChangeColor = self.changeColor self.changeColor = { willChange.send() originalChangeColor() } return willChange } public static func randomCar() -> Car { let colors = ["Red", "Blue", "Green", "Yellow", "Purple", "Orange"] return Car(color: colors.randomElement() ?? "Red") } } @Observable class ObservableCar<CarT>: ObservableObject where CarT: CarProtocol { @Published public var car: CarT public init(_ car: CarT) { self.car = car } } struct SwiftObservableView<CarT>: View where CarT: CarProtocol & ObservableObject { @StateObject var car: ObservableCar<CarT> public init(car: CarT) { _car = StateObject(wrappedValue: ObservableCar(car)) } var body: some View { NavigationStack { Form { Section(header: Text("Modification Form")) { VStack { TextField("Color", text: Binding(get: { car.car.color }, set: { car.car.color = $0 })) } } Section(header: Text("Results")) { VStack { HStack() { Text("Color") Spacer() Text(car.car.color) } } } Section(header: Text("Actions")) { Button("Random Car") { self.car = ObservableCar(Car.randomCar() as! CarT) } Button("Assign from Objective-C") { self.car.car.changeColor() } } } .navigationTitle("Car Data (Swift)") } } } #Preview { SwiftObservableView(car: Car(color: "Green")) }

http://stackoverflow.com/comment/139038641
type: QuestionComment
score: 0
type: Comment
has text: Still you can build framework with SPM and use it directly
comment on: http://stackoverflow.com/q/78796285

http://stackoverflow.com/q/78849126
tagged with: square
score: 0
has title: Library not loaded: CorePaymentCard SquareInApp
type: Question
type: UnansweredQuestion
answer count: 0
has body: Library not loaded: @rpath/CorePaymentCard.framework/CorePaymentCard is the error that keeps popping up on me. I have used CocoaPods to install SquareInAppPaymentsSDK, and it builds, but as soon as it launches it crashes. I have done all that needs to be done according to Square's documentation, including the Run Script Phase: SETUP_SCRIPT=${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}"/SquareInAppPaymentsSDK.framework/setup" if [ -f "$SETUP_SCRIPT" ]; then "$SETUP_SCRIPT" fi Any ideas why I'm STILL getting this?
tagged with: ios
tagged with: objective-c

http://stackoverflow.com/q/78846475
tagged with: objective-c
tagged with: parse-platform
has body: I have an iOS app that I used CocoaPods to install Parse. My Podfile is: # Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'EYC' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! # Pods for EYC pod 'Parse' pod 'SquareInAppPaymentsSDK' end On my code I have imported both Parse and Bolts. I run some code that uses Parse, and even autocomplete suggestions works fine for me, so I know it can see the Parse code. However, when I try to build, I get four errors. Undefined symbol: _OBJC_CLASS_$_PFCloud Undefined symbol: _OBJC_CLASS_$_PFObject Undefined symbol: _OBJC_CLASS_$_PFUser Linker command failed with exit code 1 (use -v to see invocation) I've tried deleting the Podfile, doing a pod deintegrate and pod install again, but nothing seems to work. If I comment out the code that references anything with Parse, it builds fine, even with the @import Parse; and @import Bolts; still there.
has title: Parse Undefined Symbols PFCloud
score: 0
type: Question
type: UnansweredQuestion
answer count: 0
tagged with: ios

http://stackoverflow.com/q/78835604
upvote count: 0
tagged with: xcode
downvote count: 1
type: Question
tagged with: swift
answer count: 1
type: UnansweredQuestion
favorite count: 0
tagged with: ios
has body: https://github.com/Lessica/TrollFools I was reading through this repository and found a code snippet about getting all installed apps on an ios device: let allAppList: [LSApplicationProxy] = LSApplicationWorkspace.default().allApplications(); When I download and install tipa from the repository's distribution (TrollStore), I can get the list of all installed apps. But when I compile the install using xcode I can't get the list of apps. I don't understand why this is happening？
has answer: http://stackoverflow.com/a/78835712
tagged with: jailbreak
has title: TrollStore IOS swift Get Installed Apps about LSApplicationWorkspace.default().allApplications()
score: -1
tagged with: objective-c

audioqueue
tag name: audioqueue
tags question: http://stackoverflow.com/q/78811299
type: Tag

http://stackoverflow.com/comment/139169083
has text: For SPM with Objective-C file you need to put all header (.h) files in the same folder (eg: include). Look [here](https://stackoverflow.com/questions/70850794/how-to-create-an-spm-package-based-on-objc-code)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/78820826

http://stackoverflow.com/comment/138913755
type: AnswerComment
has text: The 'data' property is not initialized correctly and all old values ​​are 'nil'. It should be filled with the initial values ​​of the controls. Most controls can have a delegate and/or send notifications, for example `NSControlTextDidBeginEditingNotification` and `NSPopUpButtonWillPopUpNotification`. Check the documentation of the class and delegate methods with a notification argument. Also check the superclass.
comment on: http://stackoverflow.com/a/78772418
type: Comment
score: 0

module
tag name: module
type: Tag
tags question: http://stackoverflow.com/q/78820826
tags question: http://stackoverflow.com/q/78926432

http://stackoverflow.com/comment/138956386
score: 0
has text: - Currently, there is a future working of a post in Share Extension. Now I also want to share the chat in the share extension outside the app. - So now I want to run both post and chat futures in the share extension. - So how is that possible? - Both posts and chats should run from one share extension.
type: QuestionComment
comment on: http://stackoverflow.com/q/78813110
type: Comment

http://stackoverflow.com/q/78848946
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/78850956
has comment: http://stackoverflow.com/comment/139017496
has body: I have a Dictionary<ObjcType, SwiftType> that I have to serialize to and deserialize from JSON. SwiftType conforms to Codable. ObjcType is a class written in Objective-C (used by one of the libraries I heavily depend on, so cannot change it to be in Swift). All properties of ObjcType are either NSString or BOOL. I did some search and added these functions to ObjcType, to give it some semblance of serialization: -(NSString*)GetJSON{ NSError *writeError = nil; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:NSJSONWritingPrettyPrinted error:&writeError]; NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; return jsonString; } - (instancetype)initWithObject:(NSString *)jsonString { self = [super init]; if (self != nil) { NSData* jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; NSError *error = nil; NSDictionary *object = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error]; for (NSString *dictionaryKey in object) { self.field1 = [[object valueForKey:dictionaryKey] objectForKey:@"field1"]; self.field2 = [[object valueForKey:dictionaryKey] objectForKey:@"field2"]; self.field3 = [[object valueForKey:dictionaryKey] objectForKey:@"field3"]; } } return self; } So now my ObjcType can create its own text to put into that JSON. But I cannot figure out how to make a wrapper that will encode\decode this dictionary. Any help? P.S. even better is it could work with OrderedDictionary from OrderedCollections module instead of normal Dictionary.
type: Question
tagged with: swift
upvote count: 1
downvote count: 0
answer count: 1
has title: How can I encode/decode a Swift dictionary with Obj-C objects as keys to and from JSON?
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/139025526
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/78850956

http://stackoverflow.com/comment/138967309
has text: You need use `publicHeadersPath` and don't need use modulemap
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/78820826

http://stackoverflow.com/comment/139062099
type: Comment
has text: Do you call fetch or reload methods? Do you override any `NSManagedObject` methods? How do you keep the data and the outline view in sync? When do you call save? When/where/how do you see the faults?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78869590

http://stackoverflow.com/comment/138874668
type: QuestionComment
has text: If you just want to share via email, a `URL` and a `UIActivityViewController` is all you need. Is that what you are looking for?
type: Comment
comment on: http://stackoverflow.com/q/78767018
score: 0

http://stackoverflow.com/comment/139013645
has text: Must you use an instance of `Car`? Can you subclass it and use that instead?
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78844651

http://stackoverflow.com/q/78820826
has comment: http://stackoverflow.com/comment/138967313
has comment: http://stackoverflow.com/comment/138967383
type: Question
has comment: http://stackoverflow.com/comment/138967309
tagged with: module
tagged with: objective-c
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/70850794
has comment: http://stackoverflow.com/comment/139169083
score: 0
tagged with: swift-package-manager
has body: I have objc project https://github.com/facebookincubator/SocketRocket which I forked and adding SPM support. I create Package.swift: let package = Package( name: "SocketRocket", platforms: [ .iOS(.v12) ], products: [ .library( name: "SocketRocket", targets: ["SocketRocket"] ) ], targets: [ .target( name: "SocketRocket", path: "SocketRocket", publicHeadersPath: "." ), .testTarget( name: "SocketRocketTests", dependencies: ["SocketRocket"], path: "Tests" ) ] ) There is an umbrella header file inside of project SocketRocket.h: #import <SocketRocket/NSRunLoop+SRWebSocket.h> #import <SocketRocket/NSURLRequest+SRWebSocket.h> #import <SocketRocket/SRSecurityPolicy.h> #import <SocketRocket/SRWebSocket.h> I created a modulemap: module SocketRocket { header "SocketRocket.h" export * } But there is issue in building package: Building for debugging... fatal error: 'SRDelegateController.h' file not found #import "SRDelegateController.h" ^~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. I think imports is not applying, every time I run again and again there is different number of compiled files(0, 3, 4, 19): [0/19] Compiling SRIOConsumerPool.m I'm expecting to solve my problem. Project Structure
tagged with: swift
has title: Error while building SPM package with ObjC code
tagged with: sockets
answer count: 0

http://stackoverflow.com/a/78826064
has comment: http://stackoverflow.com/comment/138977226
has comment: http://stackoverflow.com/comment/138976329
answers question: http://stackoverflow.com/q/78824958
has comment: http://stackoverflow.com/comment/138976358
upvote count: 2
type: Answer
score: 2
downvote count: 0
has body: Tough to say, without seeing more of your code, but, here is a quick example... Start a new MacOS app project Add a new NSView class named "SimpleGradientView`: SimpleGradientView.h #import <Cocoa/Cocoa.h> NS_ASSUME_NONNULL_BEGIN @interface SimpleGradientView : NSView @end NS_ASSUME_NONNULL_END SimpleGradientView.m #import "SimpleGradientView.h" @implementation SimpleGradientView - (void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; NSGradient *bg = [[NSGradient alloc] initWithColors:@[NSColor.redColor, NSColor.yellowColor]]; [bg drawInRect:self.bounds angle:90.0]; } @end ViewController.h #import <Cocoa/Cocoa.h> @interface ViewController : NSViewController @end ViewController.m #import "ViewController.h" #import "SimpleGradientView.h" @interface ViewController () { SimpleGradientView *gradView; } @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; self.preferredContentSize = NSMakeSize(600.0, 480.0); gradView = [SimpleGradientView new]; // Create a button NSButton *button = [[NSButton alloc] initWithFrame:NSMakeRect(150, 125, 100, 50)]; [button setTitle:@"Save as PDF"]; [button setButtonType:NSButtonTypeMomentaryPushIn]; [button setBezelStyle:NSBezelStyleRounded]; [button setTarget:self]; [button setAction:@selector(saveAsPDF:)]; // Create a label NSTextField *label = [[NSTextField alloc] initWithFrame:NSMakeRect(40, 20, 200, 45)]; [label setStringValue:@"Hello, PDF!"]; [label setBezeled:NO]; [label setDrawsBackground:NO]; [label setEditable:NO]; [label setSelectable:NO]; NSFontManager *fontManager = [NSFontManager sharedFontManager]; NSFont *boldItalic = [fontManager fontWithFamily:@"Verdana" traits:NSBoldFontMask|NSItalicFontMask weight:0 size:48]; // create an image view with image NSImage *img = [NSImage imageWithSystemSymbolName:@"apple.logo" accessibilityDescription:@""]; NSImageView *iv = [NSImageView new]; iv.image = img; iv.imageScaling = NSImageScaleProportionallyUpOrDown; iv.contentTintColor = NSColor.cyanColor; [labe…

http://stackoverflow.com/q/78767018
tagged with: objective-c
score: 0
has comment: http://stackoverflow.com/comment/138874295
tagged with: avfoundation
has title: Retrieve an audio file such as an mp3 from the documents directory in Objective-C or Swift
tagged with: nsdocumentdirectory
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/138882175
answer count: 1
has comment: http://stackoverflow.com/comment/138945637
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/78767321
has comment: http://stackoverflow.com/comment/138874668
tagged with: ios
has body: I would like to store and retrieve audio files such as MP3s in the user's documents directory. When I do this with images I can simply fetch the file as a UIImage. However, I'm struggling with what format to use to retrieve the audio. For images I could do: -(UIImage*)getImageNamed: (NSString*) name { { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString* path = [documentsDirectory stringByAppendingPathComponent: [NSString stringWithString: name] ]; UIImage *img = [UIImage imageWithContentsOfFile:path]; return img; } return nil; } I'm trying a similar approach for audios but it does not compile as there is no such method as objectWithContentsOfFile. Also I'm not sure that an AVPlayerItem is the right way to return the audio file. (I don't want to just play it from its location in the documents directory, but rather get the actual .mp3 file to share via email etc.) How would I edit the following code to retrieve an audio file such as an mp3 instead of an image from the documents directory? -(id)getAudioFileNamed: (NSString*) name { { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString* path = [documentsDirectory stringByAppendingPathComponent: [NSString stringWithString: name] ]; AVPlayerItem* item = [AVPlayerItem objectWithContentsOfFile:path];//pseudo method return item; } return nil; } Thanks for any suggestions

http://stackoverflow.com/q/78770407
has answer: http://stackoverflow.com/a/78792187
answer count: 1
tagged with: ios
type: Question
tagged with: objective-c
tagged with: foundation
type: UnansweredQuestion
tagged with: nsdocumentdirectory
has body: I want to exclude a directory in documents storage class from backup. Setting exclusion attribute like so + (BOOL)kit_addSkipBackupAttributeForItemAtURL:(NSURL *)url { if (![[NSFileManager defaultManager] fileExistsAtPath:url.path]) { return NO; } NSError *error = nil; NSNumber *value = nil; BOOL success = [url getResourceValue:&value forKey:NSURLIsExcludedFromBackupKey error:&error]; if (value.boolValue == YES) { NSLog(@"ALREADY Excluded %@ from backup", [url absoluteString]); return YES; } success = [url setResourceValue:@(YES) forKey:NSURLIsExcludedFromBackupKey error:&error]; if (!success){ NSLog(@"Error excluding %@ from backup: %@", [url lastPathComponent], error); } success = [url getResourceValue:&value forKey:NSURLIsExcludedFromBackupKey error:&error]; NSAssert(success, @"The backup exclusion attribute is missing"); NSLog(@"Excluding %@ from backup", [url absoluteString]); NSAssert(value.boolValue, @"The backup exclusion attribute is false"); return success; } does trip: value.boolValue is NO and listing the directory later on using ls -la@ {directoryname} does not show that attribute. Somehow it does not stick for some items in the filesystem (within the same storage class!).
has title: Exclusion of a directory from backup : NSURLIsExcludedFromBackupKey does not always stick even though setResourceValue has reported success
score: 0

http://stackoverflow.com/a/78764265
score: 0
has body: Solution Apparently the GLKView is already a UIView. Not good at explaining things but this solved the problem. #import "FUCameraPlatformView.h" #import "OverlayView.h" #import "GLView.h" #import <GLKit/GLKit.h> @interface FUCameraPlatformView() @property (nonatomic, strong) EAGLContext *glContext; @property (nonatomic, strong) GLKView *glView; @property (nonatomic, strong) CIContext *ciContext; @property (nonatomic, strong) FUCamera *camera; @property (nonatomic, strong) MHBeautyManager *beautyManager; @property (nonatomic , strong) OverlayView *overlay; @property (nonatomic, assign) GLuint framebuffer; @property (nonatomic, assign) GLuint colorRenderbuffer; @property (nonatomic, strong) dispatch_queue_t captureQueue; @end @implementation FUCameraPlatformView - (instancetype)initWithFrame:(CGRect)frame viewIdentifier:(int64_t)viewId arguments:(id)args binaryMessenger:(NSObject<FlutterBinaryMessenger> *)messenger beautyManager:(MHBeautyManager *)manager cameraInstance:(FUCamera *)camera{ self = [super init]; if (self) { _containerView = [[UIView alloc] initWithFrame:frame]; // Initialize the OpenGL context _glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; if (!_glContext) { NSLog(@"Failed to create ES context"); return nil; } if (![EAGLContext setCurrentContext:_glContext]) { NSLog(@"Failed to set current OpenGL context."); return nil; } // Initialize the GLKView _glView = [[GLKView alloc] initWithFrame:frame context:_glContext]; _glView.context = _glContext; // _glView.drawableDepthFormat = GLKViewDrawableDepthFormat24; // _glView.drawableColorFormat = GLKViewDrawableColorFormatRGBA8888; // Initialize the CIContext _ciContext = [CIContext contextWithEAGLContext:_glContext]; // Add overlay view _overlay = [[OverlayView alloc] initWithFrame:_glView.bounds]; _overlay.backgroundColor = [UIColor clearColor]; [_glView addSubview:_overlay]; // Setup the camera and beauty manager _camera = camera; _camera.delegate = self; _beautyManager = manager; …
answers question: http://stackoverflow.com/q/78761078
type: Answer

http://stackoverflow.com/comment/138920942
type: AnswerComment
has text: Ok I think I have a solution which would work, would have preferred something a bit more automated that storing each fields value - but I can do it with an array with the field Identifier and the field value.
comment on: http://stackoverflow.com/a/78772418
type: Comment
score: 0

http://stackoverflow.com/comment/138992712
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78796285
type: QuestionComment
has text: Thank you for your suggestion but the client needs framework directly. Hence I am stuck. I am able to build other framework using Xcode 12.3 on different machine. but not with the described specification.

glkit
tags question: http://stackoverflow.com/q/78761078
type: Tag
tag name: glkit

http://stackoverflow.com/a/78798586
upvote count: 1
downvote count: 0
score: 1
has body: I would just declare ObjcClass conformance in an Swift extension: extension ObjcClass: ObjcClassProtocol { func doStuff() { } } Note : do not forget to add ObjcClass.h in Bridging Header file so it can be seen by Swift
answers question: http://stackoverflow.com/q/78793944
type: Answer

http://stackoverflow.com/a/78834398
has comment: http://stackoverflow.com/comment/139140102
has comment: http://stackoverflow.com/comment/138991095
has comment: http://stackoverflow.com/comment/139140103
answers question: http://stackoverflow.com/q/78824897
type: Answer
has comment: http://stackoverflow.com/comment/138991064
has body: Adding a X.509 certificate and private key to a Swift application involves reading the certificate and key from files, creating SecCertificate and SecKey objects. Creating a SecIdentity from these objects and you'll need to configure URLSession to use these credentials for the request. Paths to your certificate and key files : let certPath = "/path/to/device-cert.pem" let keyPath = "/path/to/device-key.pem" I have used this links for handling Certificates and Cryptography operations in Swift . I have used below code to register a device with Azure Device Provisioning Service (DPS) using x.509 certificates in Swift. import Foundation import Security func loadIdentity(certPath: String, keyPath: String) -> SecIdentity? { guard let certData = try? Data(contentsOf: URL(fileURLWithPath: certPath)) else { print("Unable to load certificate") return nil } guard let cert = SecCertificateCreateWithData(nil, certData as CFData) else { print("Unable to create certificate") return nil } guard let keyData = try? Data(contentsOf: URL(fileURLWithPath: keyPath)) else { print("Unable to load private key") return nil } let keyDict: [NSString: Any] = [ kSecAttrKeyType: kSecAttrKeyTypeRSA, kSecAttrKeyClass: kSecAttrKeyClassPrivate, kSecAttrKeySizeInBits: 2048, kSecReturnPersistentRef: true ] var error: Unmanaged<CFError>? guard let privateKey = SecKeyCreateWithData(keyData as CFData, keyDict as CFDictionary, &error) else { print("Unable to create private key: \(error?.takeRetainedValue() ?? "Unknown error" as CFError)") return nil } var identity: SecIdentity? let status = SecIdentityCreateWithCertificate(cert, privateKey, &identity) guard status == errSecSuccess else { print("Unable to create identity") return nil } return identity } class URLSessionPinningDelegate: NSObject, URLSessionDelegate { var identity: SecIdentity init(identity: SecIdentity) { self.identity = identity } func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @es…
score: 0

http://stackoverflow.com/q/78763503
tagged with: uikit
has answer: http://stackoverflow.com/a/78764845
answer count: 1
tagged with: objective-c
tagged with: ios
has title: AutoFill password into UITextField
score: 0
type: Question
tagged with: swift
type: UnansweredQuestion
has body: I want to implement such a function: a password UITextField, using the system Jiugongge numeric keypad(textField.keyboardType = .numberPad), and enable to automatically fill the password. like this: enter image description here There's my code: let passwordTextField: UITextField = { let textField = UITextField() textField.placeholder = "password" textField.textContentType = .password textField.isSecureTextEntry = true textField.keyboardType = .numberPad. return textField }() When I set textField.isSecureTextEntry = true, the button of autofilling password disappears, and if textField.isSecureTextEntry = false, the button of autofilling password appears. When I set textField.keyboardType to other type like .default, and textField.isSecureTextEntry = true, the button of autofilling password also appears. I wonder if that's Apple's feature? Is any way to make both textField.isSecureTextEntry = true, textField.keyboardType = .numberPad and the button of autofilling password appears?

http://stackoverflow.com/comment/138956406
comment on: http://stackoverflow.com/a/78813950
has text: Can you tell me how to manage both posts and chats with one share extension?
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/138864117
has text: @CPlus Maybe! Try it and see what happens. I'm resisting answering directly because I don't actually know and more to the point, I guess, it's possible to make a C compiler (or your own code) do nearly any unnatural acts if you really want it to. But then, if you break the language rules, are you still writing in ObjC? Not really, right?
type: QuestionComment
comment on: http://stackoverflow.com/q/78757372
score: 1
type: Comment

ckrecord
tag name: ckrecord
type: Tag
tags question: http://stackoverflow.com/q/78863706

http://stackoverflow.com/comment/139213647
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/78863706
type: Comment
has text: Fun fact: when I copy all the necessary code to a newly created project, errors disappear.

http://stackoverflow.com/q/78824958
has comment: http://stackoverflow.com/comment/138975155
type: Question
answer count: 1
tagged with: core-graphics
tagged with: objective-c
type: UnansweredQuestion
favorite count: 0
has answer: http://stackoverflow.com/a/78826064
score: -2
has comment: http://stackoverflow.com/comment/138977812
tagged with: nsgradient
has title: most efficient way to draw a gradient Objective-C (currently NSColorWell is lagging when moving color sliders)
tagged with: drawing
upvote count: 0
tagged with: core-image
has body: Hello I have an NSGradient which I had hoped to drawin to the rect using the following code: [g drawInRect:[self bounds] angle:90]; However the issue is to get the PDF data using the below produces a black color rather than the gradient. [myView dataWithPDFInsideRect:myView.bounds]; My solution currently is to create an NSImage from the gradient drawn on a rect - and draw the image - but obviously the performance of drawing this is bad - especially when changing colours. I am trying to use the gradient as a background which you can change the colors with objects drawn on top. Is there a better way to draw a gradient which works with dataWithPDFInsideRect, that's efficient so the NSColorWell sliders don't lag? I'm sure there musy be an efficient way but i'm obviously looking in the wrong direction!
downvote count: 2

http://stackoverflow.com/comment/138882175
type: Comment
has text: `NSData` is the object that can hold arbitrary data loaded from a file.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78767018

http://stackoverflow.com/comment/138977226
has text: @GeraldTheGerm - curious... I ran it first on Ventura, but I now see the problem when running on Sonoma. See the **Edit** to my answer.
comment on: http://stackoverflow.com/a/78826064
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/139055168
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78869590
type: Comment
has text: `NSTreeController` or data source? Post a [mre] please.

http://stackoverflow.com/comment/138917139
comment on: http://stackoverflow.com/q/78791941
has text: That is the expected output. The completion handler executes asynchronously, but the print of `555` is outside of the completion handler, so it executes first. Some time later the completion handler executes and you get `111`. You need to pass a completion handler to this method which you can invoke to provider the value back to the caller.
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/comment/139031623
type: QuestionComment
score: 0
type: Comment
has text: @Sweeper My situation was simplified here. Originally, I have a 1) parent framework that provides interfaces. This framework also have an Objective-C layer that consumes these interfaces for some business logic; 2) A client layer that implement the interfaces in (1) (as macOS and iOS behaves bit differently); 3) A UI layer that should somehow get work with the interfaces, agnostic to the platform (as we use SwiftUI), extend them with Observables; 4) The actual app (iOS/macOS) which instantiate the correct platform interface and send it to the UI.
comment on: http://stackoverflow.com/q/78844651

observable
tags question: http://stackoverflow.com/q/78844651
tag name: observable
type: Tag

http://stackoverflow.com/comment/138923939
comment on: http://stackoverflow.com/q/78793944
score: 0
type: QuestionComment
type: Comment
has text: @PtitXav my bad, forgot to add the \@objc to the question. The original code does have it. Thanks for pointing it out!

http://stackoverflow.com/comment/138974345
type: Comment
comment on: http://stackoverflow.com/q/78824897
type: QuestionComment
has text: the private key has no place in the http request. certificate authentication occurs at the transport layer (TLS). to make the communication, you need to add the certificate (and its private key) to the repository that your application uses. the rest is up to the operating system.
score: 0

http://stackoverflow.com/comment/139032385
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78844651
has text: Okay, why couldn't the same approach be used with protocols? Instead of `@Observable`, you can still create an `ObservableObject` that wraps something conforming to `CarProtocol`, and merge the publishers as you do here.

c99
tags question: http://stackoverflow.com/q/78846311
tag name: c99
type: Tag

http://stackoverflow.com/q/78793944
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/78798586
favorite count: 0
type: Question
has title: How can I mock an Objective-C class from Swift code for unit testing?
tagged with: objective-c
has comment: http://stackoverflow.com/comment/138923939
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138932364
tagged with: swift
downvote count: 0
has comment: http://stackoverflow.com/comment/138932337
has comment: http://stackoverflow.com/comment/138922527
score: 1
has body: I'm trying to unit test a Swift class that depends on an Objective-C class. Call these SwiftClass and ObjcClass. I created a protocol that contains the methods/properties of ObjcClass that SwiftClass needs. I created a stub (call it ObjcClassMock) that implements those methods and properties. So I tried to do this: // ObjcClass is in its own .m and .h files somewhere... // In Swift: @objc protocol ObjcClassProtocol { func doStuff() } class ObjcClassMock: ObjcClassProtocol { func doStuff() { /* sike, actually do nothing */ } } class SwiftClass { let objcClass: ObjcClassProtocol // default to ObjcClass's singleton for compatibility with older code init(objcClass: ObjcClassProtocol = ObjcClass.shared()) { ... } } // In tests: func testSwiftClass() { let swiftClass = SwiftClass(objcClass: ObjcClassMock()) } Now the issue here is that ObjcClass does not implicitly conform to this new protocol, even though it does contain all methods and properties that the protocol requires, which I guess makes sense. Force casting it to any ObjcClassProtocol crashes at runtime (Could not cast value of type ObjcClass to ObjcClassProtocol - I guess that also makes sense). From what I see, I have a couple of options: Make ObjcClass conform to ObjcClassProtocol explicitly. I'm not that familiar with Objective-C, so I may be missing something here, but this seems nontrivial. In particular it seems like it would require segregating the protocol methods into their own block. ObjcClass is also used in other places, and there is nothing that groups these particular methods together other than the fact that they are what SwiftClass happens to need, so I do not want to do that. (The project structure is a mess but it is what it is.) If this was Swift I could just add class ObjcClass: ObjcClassProtocol to ObjcClass's declaration and not change anything else. Can I do something similar in Objective-C? Giving up Swift's type safety somehow and using Objective-C dynamic dispatch. Haven't really figure…

http://stackoverflow.com/q/78846311
has title: ScreenCaptureKit example in Go/C
type: Question
upvote count: 1
tagged with: swift
downvote count: 0
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/139092174
score: 1
has body: I'm working on improving open source library to capture screenshots: https://github.com/kbinani/screenshot - it is somewhat popular and it uses legacy approach, and MacOS 15 (beta as of time of writing) already complains that "CGDisplayCreateImageForRect' is unavailable: obsoleted in macOS 15.0". So you can't use it on macOS 15.0 - will not compile. I spent a couple of days trying to use ScreenCaptureKit from Apple. Which is a new way of doing things. And it works, but not in Go with C bindings. How do I implement SCScreenshotManager_captureImage in C99? I have working code in swift (works absolutely fine): import Foundation import ScreenCaptureKit import CoreGraphics import AppKit // This program captures a screenshot using Apple's ScreenCaptureKit framework. // It detects multiple monitors and allows capturing from a specific display or the main display. // To run this program: // 1. Make sure you have Xcode and Swift installed on your Mac. // 2. Save this code in a file named 'demo.swift'. // 3. Open Terminal, navigate to the directory containing the file. // 4. Run: swift demo.swift // Function to capture screenshot func captureScreenshot(display: SCDisplay?, completion: @escaping (NSImage?) -> Void) { let filter: SCContentFilter if let display = display { filter = SCContentFilter(display: display, excludingApplications: [], exceptingWindows: []) } else { filter = SCContentFilter() } let configuration = SCStreamConfiguration() configuration.width = 1920 // You can adjust this configuration.height = 1080 // You can adjust this configuration.showsCursor = true configuration.scalesToFit = false SCScreenshotManager.captureImage(contentFilter: filter, configuration: configuration) { image, error in if let error = error { print("Error capturing screenshot: \(error.localizedDescription)") completion(nil) } else if let image = image { completion(NSImage(cgImage: image, size: NSSize(width: image.width, height: image.height))) } else { print("No image captured") completio…
tagged with: objective-c
tagged with: go
tagged with: c99
favorite count: 0
tagged with: screencapturekit

http://stackoverflow.com/comment/138975155
type: Comment
has text: Best way to draw a gradient is to attach image with gradient. If gradient linear you can use resizable image with 1 pixel width.
comment on: http://stackoverflow.com/q/78824958
score: 0
type: QuestionComment

http://stackoverflow.com/q/78822765
upvote count: 0
answer count: 1
tagged with: core-graphics
tagged with: objective-c
has answer: http://stackoverflow.com/a/78823984
has comment: http://stackoverflow.com/comment/138973530
favorite count: 0
has comment: http://stackoverflow.com/comment/138972582
has title: Creating a gradient with CILinearGradient
score: -1
type: Question
has body: Hello i've been doing some with with CIFilters and I have a basic understanding of many of the basic ones such as hue, brightness etc.. What i'm trying to understand is how to create a linear gradient using CIFilter, below is my attempt but when I put the outImage into an imageview nothing is displaying, what am I doing wrong? CIFilter *gradientfilter = [CIFilter filterWithName:@"CILinearGradient"]; [gradientfilter setValue:[CIVector vectorWithX:0 Y:0.75*img.size.height] forKey:@"inputPoint0"]; [gradientfilter setValue:[CIColor colorWithRed:0 green:1 blue:0 alpha:1] forKey:@"inputColor0"]; [gradientfilter setValue:[CIVector vectorWithX:0 Y:0.5 *img.size.height] forKey:@"inputPoint1"]; [gradientfilter setValue:[CIColor colorWithRed:0 green:1 blue:0 alpha:0] forKey:@"inputColor1"]; CIFilter *gradientfilter2 = [CIFilter filterWithName:@"CILinearGradient"]; [gradientfilter2 setValue:[CIVector vectorWithX:0 Y:0.25*img.size.height] forKey:@"inputPoint0"]; [gradientfilter2 setValue:[CIColor colorWithRed:0 green:1 blue:0 alpha:1] forKey:@"inputColor0"]; [gradientfilter2 setValue:[CIVector vectorWithX:0 Y:0.5 *img.size.height] forKey:@"inputPoint1"]; [gradientfilter2 setValue:[CIColor colorWithRed:0 green:1 blue:0 alpha:0] forKey:@"inputColor1"]; CIFilter *compositingFilter = [CIFilter filterWithName:@"CIAdditionCompositing"]; [compositingFilter setValue:gradientfilter.outputImage forKey:kCIInputImageKey]; [compositingFilter setValue:gradientfilter2.outputImage forKey:kCIInputBackgroundImageKey]; outImage = compositingFilter.outputImage;
tagged with: cifilter
downvote count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/138974221

http://stackoverflow.com/q/78811488
type: Question
type: UnansweredQuestion
score: 0
tagged with: ios
has title: Error com.facebook.sdk.core - code: 8 When Switching to FBSDKLoginTrackingLimited
tagged with: objective-c
answer count: 0
tagged with: facebook
has body: Facebook asked us to switch the tracking mode from enable to limited some time ago. I made this change, but I am getting the error "com.facebook.sdk.core - code: 8". I have been researching for a while, but I couldn't find any information to solve my problem. My objective-c code -(void) createLoginPopup { FBSDKLoginManager *login = [FBSDKLoginManager new]; FBSDKLoginConfiguration *configuration = [[FBSDKLoginConfiguration alloc] initWithPermissions:@[@"public_profile",@"user_friends"] tracking:FBSDKLoginTrackingLimited]; [login logInFromViewController:(UIViewController*)(((AppController *)[[UIApplication sharedApplication] delegate]).viewController) configuration:configuration completion:^(FBSDKLoginManagerLoginResult *result, NSError *error) { if (error || result.isCancelled) { NSLog(@"FacebookManagerIOS - Cancelled"); [self connectionToFacebookCompleted:NO]; } else { NSLog(@"FacebookManagerIOS - Logged in"); [self updateFacebookDefaults :[[FBSDKAccessToken currentAccessToken] tokenString] :[[FBSDKAccessToken currentAccessToken] expirationDate] :[[FBSDKAccessToken currentAccessToken] userID]]; [self connectionToFacebookCompleted:YES]; } }]; } If I change FBSDKLoginTrackingLimited to FBSDKLoginTrackingEnabled in this code, everything works correctly. error I tried the changes mentioned in the documentation, but I couldn't reach a solution. I looked at posts from other people experiencing the same problem, but I couldn't find a solution.

http://stackoverflow.com/comment/139036683
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78844651
type: Comment
has text: Don’t worry. `@Observable` is never meant as a *replacement* for `ObservableObject`.

azure-iot-hub
type: Tag
tags question: http://stackoverflow.com/q/78824897
tag name: azure-iot-hub

skproduct
tags question: http://stackoverflow.com/q/78867719
tag name: skproduct
type: Tag

http://stackoverflow.com/comment/138867584
type: Comment
comment on: http://stackoverflow.com/q/78757372
has text: All objects have pointer to the class object at the beginning of theirs buffer, to know whom to ask for function pointers.
type: QuestionComment
score: 1

cloudkit
type: Tag
tag name: cloudkit
tags question: http://stackoverflow.com/q/78863706
tags question: http://stackoverflow.com/q/79542554

http://stackoverflow.com/comment/138861450
comment on: http://stackoverflow.com/q/78757372
has text: Theoretically it's possible, but no one guaranty stable behaviour. You need set at least pointer to `[NSWindow class]` at the beginning of yours buffer. Also I suggest to turn off ARC. What you are trying to achieve with static `NSObject`?
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/138856817
has text: IMO it's much better to write a new dict proxy in swift and for swift using generics, and then if needs be, make an extension that conforms to `DictionaryProxy` for backward compatibility. When you fully migrate from ObjC, you ditch that old wrapper, and keep the new one.
score: 0
comment on: http://stackoverflow.com/q/78756425
type: QuestionComment
type: Comment

http://stackoverflow.com/a/78813656
has body: That code you're wondering about doesn't actually use the time returned by AudioQueueGetCurrentTime(), although it does sometimes overwrite and then log the result. I interpret this doco as meaning that AudioQueueGetCurrentTime should return the number of samples that the AudioQueue has output (or captured if you're using the input variant) or if that amount is negative, the number of samples in the future that the queue is scheduled to start in (and indeed AudioQueueStart() does have an optional start time, so that's reassuringly consistent). The negative timestamp shenanigans lead me to believe that this is not the number of your samples actually consumed by the AudioQueue, but that's ok, because you already know how many samples you've supplied it (probably dts-aqStartDts in your code).
score: 0
answers question: http://stackoverflow.com/q/78811299
type: Answer

http://stackoverflow.com/comment/139031629
has text: @Sweeper I've updated the question to list how I was able to achieve it using Combine.
type: Comment
comment on: http://stackoverflow.com/q/78844651
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138967313
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78820826
type: QuestionComment
has text: But I dont have modulemap in the project

http://stackoverflow.com/comment/138972582
type: Comment
has text: Can you please try to crop the image to some fixed size before assigning it to the view? `[outputImage imageByCroppingToRect: CGRectMake(0, 0, img.size.width, img.size.height)]`
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78822765

http://stackoverflow.com/comment/138974221
type: QuestionComment
has text: Thank you I will try that when back at my Mac thank you
comment on: http://stackoverflow.com/q/78822765
score: 0
type: Comment

http://stackoverflow.com/comment/138863975
has text: @Cy-4AH I am curious if this can be done and how. How does setting the pointer to `[NSWindow class]` to the beginning of the buffer work?
type: QuestionComment
comment on: http://stackoverflow.com/q/78757372
type: Comment
score: 0

http://stackoverflow.com/q/78799874
type: Question
has body: I have an NSView with NSImage instances as subviews that all show up correctly on the screen. I want to save them to a PDF file but the subviews are not included. The routine works well and also saves to PDF. The resulting PDF file contains all that I draw on the NSView, but the NSImage-subviews are only visible on screen but not in the PDF file. Any suggestions? NSString* savePath = [self getSavePath]; if (savePath != nil) { NSData *pdfData = [_myCtDistView dataWithPDFInsideRect:_myCtDistView.bounds]; if ([pdfData writeToFile:savePath atomically:YES]) { NSLog(@"Saved PDF successfully"); } else { NSLog(@"Saved PDF failed"); } } View drawing code: - (void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; [[NSColor whiteColor] set]; NSRectFill(self.bounds); [self drawBgImage]; }//end of drawRect - (void)drawBgImage { NSImageView *backgroundImageView = [[NSImageView alloc] initWithFrame:self.bounds]; backgroundImageView.image = _bgImage; backgroundImageView.imageScaling = NSImageScaleProportionallyUpOrDown; [self addSubview:backgroundImageView]; }// end of drawBgImage
type: UnansweredQuestion
answer count: 0
tagged with: http://stackoverflow.com/tag/pdf
has comment: http://stackoverflow.com/comment/138931188
tagged with: nsimage
has comment: http://stackoverflow.com/comment/138939157
tagged with: objective-c
tagged with: nsview
has title: Problems in saving NSView with subviews to PDF
score: 0
has comment: http://stackoverflow.com/comment/138932313

http://stackoverflow.com/q/78867719
score: 0
tagged with: ios
has title: iOS: How to show an introductory offer with promotional offer(if there is introductory offer not need to show promotional offer)
tagged with: objective-c
tagged with: storekit
answer count: 0
tagged with: skproduct
has body: I have an promotional offer for a 1 week trial for the app users who is subscribing for the very first time. Here I need to show an additional offer only for the users who are subscribing on certain days. So I am going with the introductory offer. For ex) If I am giving the offer for the app for 1 week or one month who are subscribing the app with a special offer for a certain day alone. Here I need to show this offer for few days and revert back the app to an original promotional offer after this special offer. Is there any way to make this using the SKProductsRequest using the StoreKit.
type: Question
type: UnansweredQuestion

http://stackoverflow.com/comment/138931188
type: QuestionComment
score: 1
type: Comment
has text: Was there a particular reason why you are adding the background image in `drawRect`?
comment on: http://stackoverflow.com/q/78799874

http://stackoverflow.com/comment/138874295
comment on: http://stackoverflow.com/q/78767018
type: QuestionComment
type: Comment
has text: Create a file url from your string and then use https://developer.apple.com/documentation/avfoundation/avasset/1389943-init and then use that to create an `AVPlayerItem` ?
score: 0

http://stackoverflow.com/comment/138932337
type: Comment
comment on: http://stackoverflow.com/q/78793944
score: 0
has text: Have you tried adding `< ObjcClassProtocol >` to `ObjcClass`? See [Conforming to Protocols](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithProtocols/WorkingwithProtocols.html#//apple_ref/doc/uid/TP40011210-CH11-SW3). You can try to do something similar as `class ObjcClass: ObjcClassProtocol` in Objective-C. It's called a Category.
type: QuestionComment

http://stackoverflow.com/comment/138932313
has text: `drawRect` should draw, nothing else. Don't add subviews from `drawRect`. Add the image view first and then call `dataWithPDFInsideRect`. Or draw the image without a `NSImageView` in `drawRect`.
comment on: http://stackoverflow.com/q/78799874
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/138908885
comment on: http://stackoverflow.com/a/78772418
score: 0
has text: Is there somekind of notification available which can obtain a field or other control's value when it is selected? I am struggling to find anything online.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/138874745
comment on: http://stackoverflow.com/a/78764845
score: 0
type: AnswerComment
type: Comment
has text: Even if I don‘t set any associated domain, autofilling password still appears when `textField.isSecureTextEntry = true` and `textField.keyboardType = .default`.

http://stackoverflow.com/a/78835712
answers question: http://stackoverflow.com/q/78835604
has body: If you were able to get a list of all apps installed on an iOS device, that would be a really huge security leak. Not going to happen.
has comment: http://stackoverflow.com/comment/138996243
score: 0
type: Answer

square
tag name: square
tags question: http://stackoverflow.com/q/78849126
type: Tag

http://stackoverflow.com/comment/139140103
score: 0
comment on: http://stackoverflow.com/a/78834398
type: AnswerComment
type: Comment
has text: Once this is done, you can successfully create an identity.

http://stackoverflow.com/a/78792187
has body: Resolved: Application Support storage class was created exactly for these no man's land cases when data does not need to be purged and yet it is not important enough to be backed up in its entirety (not a document created by this user and unavailable anywhere else).
type: Answer
answers question: http://stackoverflow.com/q/78770407
score: 0

http://stackoverflow.com/comment/138919120
comment on: http://stackoverflow.com/a/78772418
has text: Another solution is getting the initial values in `viewDidLoad` or `awakeFromNib`.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/138902880
type: AnswerComment
type: Comment
has text: Thank you Wileke, I will look through the code and unstand how it all works, I appeciate your time.
score: 0
comment on: http://stackoverflow.com/a/78772418

http://stackoverflow.com/comment/138922527
type: QuestionComment
comment on: http://stackoverflow.com/q/78793944
score: 0
type: Comment
has text: Your swift protocol/class are not compatible to objective-c . Missing the @objc and eventually the NSObject dependency.

http://stackoverflow.com/comment/139013581
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78844651
type: Comment
has text: By the way, how did you "achieve it with plain Combine"?

http://stackoverflow.com/a/78823984
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/138974362
upvote count: 1
downvote count: 0
has body: One way to visualize the output is to draw the CIImage into an NSView. A CIContext derived from the NSView's NSGraphicsContext is used with this technique. You may run the following source code in Xcode by copy/pasting into the 'main' after deleting pre-existing code and also deleting the pre-supplied AppDelegate files. Note that I changed the 'vectorWithX:' from zero to 400 on point1 of the first filter. #import <Cocoa/Cocoa.h> #import <CoreImage/CIImage.h> #import <CoreImage/CIFilter.h> #import <CoreImage/CIContext.h> @interface CustomView : NSView @end @implementation CustomView - (id)initWithFrame:(NSRect)frameRect { if ((self = [super initWithFrame:frameRect]) != nil) { // Add initialization code here } return self; } -(CIImage *) drawLinearGradient: (CGContextRef) context frame: (CGRect) viewBounds { CIFilter *gradientfilter = [CIFilter filterWithName:@"CILinearGradient"]; [gradientfilter setValue:[CIVector vectorWithX:0 Y:0.75*400] forKey:@"inputPoint0"]; [gradientfilter setValue:[CIColor colorWithRed:0 green:1 blue:0 alpha:1] forKey:@"inputColor0"]; [gradientfilter setValue:[CIVector vectorWithX:400 Y:0.5*400] forKey:@"inputPoint1"]; [gradientfilter setValue:[CIColor colorWithRed:0 green:1 blue:0 alpha:0] forKey:@"inputColor1"]; CIFilter *gradientfilter2 = [CIFilter filterWithName:@"CILinearGradient"]; [gradientfilter2 setValue:[CIVector vectorWithX:0 Y:0.25*400] forKey:@"inputPoint0"]; [gradientfilter2 setValue:[CIColor colorWithRed:0 green:1 blue:0 alpha:1] forKey:@"inputColor0"]; [gradientfilter2 setValue:[CIVector vectorWithX:0 Y:0.5 *400] forKey:@"inputPoint1"]; [gradientfilter2 setValue:[CIColor colorWithRed:0 green:1 blue:0 alpha:0] forKey:@"inputColor1"]; CIFilter *compositingFilter = [CIFilter filterWithName:@"CIAdditionCompositing"]; [compositingFilter setValue:gradientfilter.outputImage forKey:kCIInputImageKey]; [compositingFilter setValue:gradientfilter2.outputImage forKey:kCIInputBackgroundImageKey]; CIImage *outImage = compositingFilter.outputI…
answers question: http://stackoverflow.com/q/78822765

http://stackoverflow.com/comment/138956774
type: Comment
comment on: http://stackoverflow.com/q/78813110
score: 0
has text: Are you sharing *from* your app or *to* your app? Since you are talking about a share extension, I presume you are sharing *to* your app, in which case your Share Extension is responsible for presenting an appropriate UI that asks the user if they want to share to a Post or to a Chat.
type: QuestionComment

http://stackoverflow.com/comment/138939157
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78799874
has text: Thanks Shim, that was very helpful! I love learning.

http://stackoverflow.com/comment/139017496
type: QuestionComment
comment on: http://stackoverflow.com/q/78848946
score: 1
type: Comment
has text: JSON only supports strings for keys and doesn't support ordering, so using a `OrderedDictionary` wouldn't help anything. People could probably answer this question, but you can help them by giving them a short/simple snippet they can copy/paste and edit easily, showing the kind of dictionary you're looking to serialize

http://stackoverflow.com/a/78850956
type: AcceptedAnswer
type: Answer
upvote count: 1
downvote count: 0
score: 1
has body: You can write a wrapper like this: @propertyWrapper struct Wrapper: Codable { struct StringCodingKey: CodingKey { var intValue: Int? { nil } let stringValue: String init?(intValue: Int) { return nil } init(stringValue value: String) { stringValue = value } } var wrappedValue: [ObjcType: SwiftType] func encode(to encoder: any Encoder) throws { var container = encoder.container(keyedBy: StringCodingKey.self) for (key, value) in wrappedValue { // assuming there is property called 'jsonString' let keyString = key.jsonString try container.encode(value, forKey: StringCodingKey(stringValue: keyString)) } } init(wrappedValue: [ObjcType : SwiftType]) { self.wrappedValue = wrappedValue } init(from decoder: any Decoder) throws { var wrapped = [ObjcType: SwiftType]() let container = try decoder.container(keyedBy: StringCodingKey.self) for key in container.allKeys { // assuming such an initialiser exists let objcKey = ObjcType(json: key.stringValue) wrapped[objcKey] = try container.decode(SwiftType.self, forKey: key) } self.wrappedValue = wrapped } } Usage: // decoding JSONDecoder().decode(Wrapper.self, from: someJson).wrappedValue // encoding JSONEncoder().encode(Wrapper(wrapped: yourActualDictionary)) You can also use it as a property wrapper in other Codable types: struct SomeOtherCodableType: Codable { @Wrapper var dict: [ObjcType: SwiftType] }
accepted answer of: http://stackoverflow.com/q/78848946
answers question: http://stackoverflow.com/q/78848946

http://stackoverflow.com/comment/138903887
has text: I have marked your answer as top and upvoted - this was unbelievbly useful, anything I searched online seemed very complicated and daughnting but your code snippet helped me see everything needed and is very easy to understand. I am noticing one thing, when I modify a field for the first time the old value is coming up as NULL - so for things like dropdown menus when you do the final undo it takes you to a non existing blank option on the dropdown. register undo _NS:454 old:'(null)' new:'4' Any idea why it is coming up as null?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78772418
score: 0

http://stackoverflow.com/comment/139025526
type: QuestionComment
comment on: http://stackoverflow.com/q/78848946
type: Comment
has text: Order is not actually important for saving this, only for other operations. That is why I asked about a normal Dictionary.
score: 0

nsdocumentdirectory
tag name: nsdocumentdirectory
tags question: http://stackoverflow.com/q/78767018
type: Tag
tags question: http://stackoverflow.com/q/78770407

http://stackoverflow.com/comment/138858895
has text: Have you seen [Objective C: Memory Allocation on stack vs. heap](https://stackoverflow.com/questions/4326965/objective-c-memory-allocation-on-stack-vs-heap)?
type: QuestionComment
comment on: http://stackoverflow.com/q/78757372
score: 1
type: Comment

http://stackoverflow.com/comment/138945637
score: 0
has text: Paulw11, I am doing a fair amount with the audio that originally comes from a remote url. I would like to be able to save it locally, upload it to a server and share it using an activityViewController. I gather for playing it, you can just use the url--either to a lcoal or remote resource. For sharing it using activity view controller you can also use the url although this is not working very well for me... Are there any advantages to working with an AVPlayer item or AVAsset such as compression? The NSData itself of these files is around 4 megs so they add up.
type: Comment
comment on: http://stackoverflow.com/q/78767018
type: QuestionComment

share-extension
tags question: http://stackoverflow.com/q/78813110
tag name: share-extension
type: Tag

http://stackoverflow.com/comment/138967383
type: Comment
has text: UPD same issue with or without modulemap
score: 0
comment on: http://stackoverflow.com/q/78820826
type: QuestionComment

http://stackoverflow.com/comment/138864079
has text: @BenZotto Howver, if you disable ARC, and refrain from sending `release` to objects that were... questionably allocated, could that work? So the reference count in the objects are just ignored?
type: QuestionComment
comment on: http://stackoverflow.com/q/78757372
type: Comment
score: 0

http://stackoverflow.com/comment/138917176
type: Comment
comment on: http://stackoverflow.com/q/78791941
has text: If you were in Swift you could potentially use async/await to make your code linear, but it is still going to be an asynchronous operation.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/138932364
comment on: http://stackoverflow.com/q/78793944
score: 0
type: QuestionComment
has text: I don't have any experience with mocking but did you see [OCMock](https://ocmock.org)?
type: Comment

nsgradient
tag name: nsgradient
type: Tag
tags question: http://stackoverflow.com/q/78824958

http://stackoverflow.com/comment/139013528
type: Comment
score: 0
type: QuestionComment
has text: That's a bad idea. SwiftUI `View`s are *already* view models. Just write whatever "published properties" you want in your view directly, as `@State`s.
comment on: http://stackoverflow.com/q/78844651

http://stackoverflow.com/comment/138991064
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/78834398
has text: Hi @Sampath thank you for answer, I am getting one error i.e. `Cannot find 'SecIdentityCreateWithCertificate' in scope` I am using macOS `Sonoma 14.5` with Xcode `15.3`

mount
tags question: http://stackoverflow.com/q/78744919
tag name: mount
type: Tag

http://stackoverflow.com/comment/138996243
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/78835712
has text: But it's happened, and that's TrollStore
type: Comment

osx-mavericks
tag name: osx-mavericks
type: Tag
tags question: http://stackoverflow.com/q/78744919

osx-leopard
tag name: osx-leopard
type: Tag
tags question: http://stackoverflow.com/q/78744919

http://stackoverflow.com/comment/139140102
type: AnswerComment
type: Comment
has text: The problem arises because SecKeyRef and SecCertificateRef objects exist either in memory or in keychain storage. Only keychain-backed objects have the necessary metadata to form an identity. The public key hash, which is required to match private keys to their certificates, is stored within the metadata, which is only available when the key is stored in a keychain.The solution involves exporting the key from memory, then re-importing it into the keychain, which ensures that the necessary metadata, including the public key hash, is correctly populated.
comment on: http://stackoverflow.com/a/78834398
score: 0

http://stackoverflow.com/q/78975078
accepted answer: http://stackoverflow.com/a/78975505
favorite count: 0
has comment: http://stackoverflow.com/comment/139250858
tagged with: ios
downvote count: 1
type: AnsweredQuestion
tagged with: objective-c
has body: I am making my own custom swipeable cells where user can swipe a cell to show options. Currently all my subviews are added to the contentView of the cell. And I have added my options to the backgroundView of the cell. Is it okay for me to add my custom content to the backgroundView? Is it okay for me to manually change the position of the frame of the contentView when doing my swipe on the cell? And then I will reset it back to its original position after it's completed. Or should I use another view as a container?
has title: Is is legal to change the position of the frame of the contentView in a UITableViewCell or should I use another container view?
upvote count: 1
answer count: 1
tagged with: uitableview
score: 0
has comment: http://stackoverflow.com/comment/139247335
type: Question
tagged with: swift
has answer: http://stackoverflow.com/a/78975505

http://stackoverflow.com/comment/139158113
has text: You don't need `import MainApp-Swift.h`. You need just import modules that have protocol.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/78926432
type: QuestionComment

instance
tag name: instance
tags question: http://stackoverflow.com/q/79037340
type: Tag

http://stackoverflow.com/q/79034989
answer count: 1
has title: AppAuth-iOS-ObjC: failing at archive/unarchive of OIDAuthState
score: 0
has body: I'd like to use AppAuth's performActionWithFreshTokens method. This requires using the OIDAuthState returned by the authStateByPresentingAuthorizationRequest when generating access and refresh tokens. I want to save that OIDAuthState in the Keychain for security reasons, then use it at a later time when a token refresh is necessary. What I can't seem to do is properly archive and unarchive the saved value from the Keychain. I have two methods: (1) used to convert the OIDAuthState to an NSString to store to the Keychain and (2) used to convert the NSString from the Keychain to an OIDAuthState. Here is the first: NSData *checkEncoding; - (NSString *)authStateToString:(OIDAuthState *)authState { NSError *errRet; //NSData *authStateData = [NSKeyedArchiver archivedDataWithRootObject:authState]; NSData *authStateData = [NSKeyedArchiver archivedDataWithRootObject:authState requiringSecureCoding:NO error:&errRet]; checkEncoding = authStateData; NSString *authString = [[NSString alloc] initWithData:authStateData encoding:NSUnicodeStringEncoding]; NSLog(@"ToString length = %ld, authStateData length = %ld", (unsigned long)authString.length, (unsigned long)authStateData.length); return authString; } And here is the second: - (OIDAuthState *)stringToAuthState:(NSString *)authString { NSError *errRet; NSData *authStateData = [authString dataUsingEncoding:NSUnicodeStringEncoding allowLossyConversion:NO]; NSLog(@"ToAuthState length = %ld, authStateData length = %ld, checkEncoding = %d", (unsigned long)authString.length, (unsigned long)authStateData.length, [authStateData isEqualToData:checkEncoding]); OIDAuthState *authState = [NSKeyedUnarchiver unarchivedObjectOfClass:[OIDAuthState class] fromData:authStateData error:&errRet]; //OIDAuthState *authState = [NSKeyedUnarchiver unarchiveTopLevelObjectWithData:authStateData error:&errRet]; //OIDAuthState *authState = [NSKeyedUnarchiver unarchiveObjectWithData:authStateData]; /* NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] …
tagged with: appauth
type: Question
tagged with: ios
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/79044003
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/79044003

http://stackoverflow.com/comment/139153859
type: Comment
has text: Using the visual debugger and clicking on UITextView, something called UITextContainerView is the larger view that bleeds over and the UITextLayoutView is the smaller view respecting the border.
comment on: http://stackoverflow.com/a/78919977
score: 0
type: AnswerComment

http://stackoverflow.com/q/78937053
tagged with: core-data
has comment: http://stackoverflow.com/comment/139185644
score: 0
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/78941825
has answer: http://stackoverflow.com/a/78941825
downvote count: 1
type: Question
has body: I have a UI object (a subclass of NSObject called Label) that observes a property called region (subclass of NSManagedObject called Region) for three core data attributes: start (float) end (float) name (NSString) Label.m, contains: -(void) setRegion:(Region *)region { _region = region; [region addObserver:self forKeyPath:@"start" options:NSKeyValueObservingOptionNew context:nil]; [region addObserver:self forKeyPath:@"end" options:NSKeyValueObservingOptionNew context:nil]; [region addObserver:self forKeyPath:@"name" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionInitial context:nil]; // problematic } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { NSLog(@"%@", keyPath); } (I also remove observation as required, in another method) All this seems pretty standard. The problem is that when the instruction that is commented with //problematic is executed, observeValueForKeyPath: is called 3 times, one for each observed key (start, end, name), even though the problematic instruction only observes the name key (and should send the notification only once for this key). Using a specific pointer for the context of each observation does not change this. This issue doesn't not occur if the problematic instruction is placed at the start of the method, nor when NSKeyValueObservingOptionInitial is added as an option for the observation of start and end. Of note: Region is a subclass of an abstract class that defines the start, end and name attributes, and the issue does not occur if the observed object is from another concrete subclass, even though neither subclass do anything special with these attributes (they use default accessors, they don't implement custom setters or whatnot).
upvote count: 1
answer count: 1
favorite count: 0
has title: incomprehensible bug when adding an observer using NSKeyValueObservingOptionInitial
tagged with: key-value-observing
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/139183120
has comment: http://stackoverflow.com/comment/139181398

http://stackoverflow.com/q/78960444
type: Question
tagged with: objective-c
type: UnansweredQuestion
has body: Given this source code: #include <Cocoa/Cocoa.h> int main() { printf("%ld\n%ld\n", [@"A 2" localizedStandardCompare:@"a 10"], [@"A 2" localizedStandardCompare:@"a 10"]); } It produces two different results (presumably the first correct, the second incorrect): $ clang++ ./cmp.m -o cmp -ObjC -framework Foundation && ./cmp -1 1 This behaviour is consistent on two different machines (both MacOS 14), running two different versions of Xcode: 15 and 16. It doesn't make any sense, but is consistent - after the first invocation of localizedStandardCompare something breaks and then this methods always says that "A 2" is greater than "a 10" in natural ordering. Addendum: on MacOS 10.15 / Xcode 12 it produces an expected result "-1 -1". Addendum2: this small repo runs this snippet on GitHub Actions: https://github.com/mikekazakov/localizedStandardCompare. It confirms the issue in MacOS14: macos-12, xcode-14.2: -1 -1 macos-13, xcode-14.2: -1 -1 macos-12, xcode-13.1: -1 -1 macos-13, xcode-14.3.1: -1 -1 macos-14, xcode-16b6: -1 1 macos-14, xcode-15.4: -1 1 macos-14, xcode-14.3.1: -1 1
has comment: http://stackoverflow.com/comment/139220391
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/139220201
has title: Why could [NSString localizedStandardCompare:] produce different results?
upvote count: 1
answer count: 0
score: 1

http://stackoverflow.com/comment/139153915
score: 0
comment on: http://stackoverflow.com/a/78919977
has text: (thanks for pointing out the weird lines. They are created using a UILabel and I forgot to delete the default word Label in the storyboard inspector.)
type: AnswerComment
type: Comment

http://stackoverflow.com/q/78940966
upvote count: 2
score: 0
has body: Hello I have the below c function which I believe to be in the correct specification for CRC-16 CCITT False: uint16_t crc16(const char* pData, int length) { uint8_t i; uint16_t wCrc = 0xffff; while (length--) { wCrc ^= *(unsigned char *)pData++ << 8; for (i=0; i < 8; i++) wCrc = wCrc & 0x8000 ? (wCrc << 1) ^ 0x1021 : wCrc << 1; } return wCrc & 0xffff; } I am using Objective C for my application and have the following: - (IBAction)mycrc16function:(id)sender { NSString * stringexample = @"Example"; const char * stringAsChar = [stringexample cStringUsingEncoding:[NSString defaultCStringEncoding]]; //encode string into c string encoding unsigned long CrcTest = crc16(stringAsChar,sizeof(stringAsChar)); // put encoded string date and size of string into the crc16 function. NSLog(@"crctext %04lX\n",CrcTest); // print outcome to log } The output is always incorrect, the string I am testing with for example is giving a result of 6B20 However the result should be E272 I am using this site which I know to be correct to compare my results: http://www.sunshine2k.de/coding/javascript/crc/crc_js.html Any idea where I am going wrong?
has comment: http://stackoverflow.com/comment/139184358
has comment: http://stackoverflow.com/comment/139184182
has comment: http://stackoverflow.com/comment/139184485
linked to: http://stackoverflow.com/q/3846064
type: Question
has comment: http://stackoverflow.com/comment/139186640
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/139339462
tagged with: http://stackoverflow.com/tag/c
has comment: http://stackoverflow.com/comment/139185172
has comment: http://stackoverflow.com/comment/139184425
tagged with: crc16
tagged with: crc
favorite count: 0
has comment: http://stackoverflow.com/comment/139184201
has comment: http://stackoverflow.com/comment/139184549
has comment: http://stackoverflow.com/comment/139184512
has comment: http://stackoverflow.com/comment/139184527
tagged with: objective-c
has title: Trying to create a CRC-16 CCITT-FALSE checksum - but result is incorrect
has comment: http://stackoverflow.com/comment/139184197
has comment: http://stackoverflow.com/comment/139184489
answer count: 0
downvote count: 2

http://stackoverflow.com/comment/139376152
type: Comment
comment on: http://stackoverflow.com/q/79044693
has text: Please trim your code to make it easier to find your problem. Follow these guidelines to create a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).
score: 0
type: QuestionComment

http://stackoverflow.com/q/79001091
has comment: http://stackoverflow.com/comment/139295227
score: 0
has body: My app often fails to access the network (other apps on the device can access the network normally), and restarting the app is also ineffective. I need to open and close the flight mode to restore the app's network I used to suspect the background refresh was the cause, but removing the background refresh still occasionally causes this problem.
type: Question
type: UnansweredQuestion
answer count: 0
has title: My app often fails to access the network （iOS，Objective-c）
tagged with: ios
tagged with: objective-c

http://stackoverflow.com/q/79009379
tagged with: objective-c
answer count: 1
has answer: http://stackoverflow.com/a/79009857
score: 0
has body: I have a QT app with CMake. CMake generates .xcodeproj and CocoaPods generates .xcworkspace from the following Podfile: source 'https://github.com/CocoaPods/Specs.git' platform :ios, :deployment_target => '14.0' target 'MyApp' do pod 'YandexMobileAdsAdMobAdapters' pod 'YandexMobileAdsIronSourceAdapters' pod 'YandexMobileAdsMediation' pod 'YandexMobileAdsInstream' end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0' end end end pod install command generates the following headers: ./Pods/YandexMobileAdsIronSourceAdapters/YandexMobileAdsIronSourceAdapters.xcframework/ios-arm64_x86_64-simulator/YandexMobileAdsIronSourceAdapters.framework/Headers/YandexMobileAdsIronSourceAdapters-umbrella.h ./Pods/YandexMobileAdsIronSourceAdapters/YandexMobileAdsIronSourceAdapters.xcframework/ios-arm64_x86_64-simulator/YandexMobileAdsIronSourceAdapters.framework/Headers/YandexMobileAdsIronSourceAdapters-Swift.h ./Pods/YandexMobileAdsIronSourceAdapters/YandexMobileAdsIronSourceAdapters.xcframework/ios-arm64/YandexMobileAdsIronSourceAdapters.framework/Headers/YandexMobileAdsIronSourceAdapters-umbrella.h ./Pods/YandexMobileAdsIronSourceAdapters/YandexMobileAdsIronSourceAdapters.xcframework/ios-arm64/YandexMobileAdsIronSourceAdapters.framework/Headers/YandexMobileAdsIronSourceAdapters-Swift.h ./Pods/YandexMobileAds/static/YandexMobileAds.xcframework/ios-arm64_x86_64-simulator/YandexMobileAds.framework/Headers/YandexMobileAds-umbrella.h ./Pods/YandexMobileAds/static/YandexMobileAds.xcframework/ios-arm64_x86_64-simulator/YandexMobileAds.framework/Headers/YandexMobileAds-Swift.h ./Pods/YandexMobileAds/static/YandexMobileAds.xcframework/ios-arm64_x86_64-simulator/YandexMobileAds.framework/Headers/YandexMobileAds.h ./Pods/YandexMobileAds/static/YandexMobileAds.xcframework/ios-arm64/YandexMobileAds.framework/Headers/YandexMobileAds-umbrella.h ./Pods/YandexMobileAds/s…
has title: Importing Swift into Objective-C with CMake
tagged with: cocoapods
type: Question
tagged with: swift
linked to: http://stackoverflow.com/q/30355133
type: UnansweredQuestion
tagged with: yandex

http://stackoverflow.com/a/79050482
has body: IMO, I think NSAssert is appropriate because it is only in Development (by default). You do not want an unexpected crash in Production if the block of code changes in the near future somehow, do you? However, you can take a look at NSException raise here: [NSException raise: @"InvalidBlock" fromat: @"This should never happen"];
type: Answer
score: 2
answers question: http://stackoverflow.com/q/79050151
downvote count: 0
accepted answer of: http://stackoverflow.com/q/79050151
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/139184197
score: 3
type: Comment
has text: I don't know Objective C, but this looks wrong: `const char * stringAsChar` used as argument for a function that expects a `unsigned long`. Also `sizeof(stringAsChar)` is rather strange as it does not depend on the length of that string.
comment on: http://stackoverflow.com/q/78940966
type: QuestionComment

http://stackoverflow.com/comment/139279115
has text: This question is similar to: [In Objective-C MRR, if foo is a retain property, then self.foo = \[\[Foo alloc\] init\] will need to be released immediately?](https://stackoverflow.com/questions/12354230/in-objective-c-mrr-if-foo-is-a-retain-property-then-self-foo-foo-alloc-in). If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78983850

http://stackoverflow.com/q/78967569
type: AnsweredQuestion
tagged with: objective-c
answer count: 1
score: 0
accepted answer: http://stackoverflow.com/a/78971747
has answer: http://stackoverflow.com/a/78971747
tagged with: grand-central-dispatch
type: Question
has title: Memory pressure detection is not working on MacOS
has body: I use grand central dispatch framework to handle memory pressure change via DISPATCH_SOURCE_TYPE_MEMORYPRESSURE. This is my program in Objective C: #import <Foundation/Foundation.h> #import <dispatch/dispatch.h> int main(int argc, const char * argv[]) { @autoreleasepool { NSLog(@"Starting memory pressure monitoring..."); // Create a dispatch source for memory pressure events dispatch_source_t memoryPressureSource = dispatch_source_create( DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, 0, DISPATCH_MEMORYPRESSURE_WARN | DISPATCH_MEMORYPRESSURE_CRITICAL | DISPATCH_MEMORYPRESSURE_NORMAL, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0) ); if (memoryPressureSource == NULL) { NSLog(@"Failed to create dispatch source"); return 1; } // Set the event handler block to be executed on memory pressure events dispatch_source_set_event_handler(memoryPressureSource, ^{ NSLog(@"Memory pressure event handled"); }); dispatch_source_set_registration_handler(memoryPressureSource, ^{ NSLog(@"Memory pressure event registered"); }); dispatch_activate(memoryPressureSource); // Keep the main thread alive to let the dispatch source process events dispatch_main(); } return 0; } I compile it via the command: clang -framework Foundation -framework CoreFoundation -o memory_pressure_tracker ./untitled.mm and launch it: ./memory_pressure_tracker At the same time in another terminal I emulate high memory pressure: sudo memory_pressure -l critical. Despite the fact that memory pressure changes in activity monitor, my program does not write any logs about it. The only logs it writes are below: 2024-09-10 10:41:27.048 memory_pressure_tracker[130:11424978] Starting memory pressure monitoring... 2024-09-10 10:41:27.048 memory_pressure_tracker[130:11424985] Memory pressure event registered Where is the problem? I tested it on MacOS Sonoma 14.6.1 on M1 Max.
tagged with: macos

http://stackoverflow.com/q/79010527
tagged with: kotlin
has title: KMP Library to interact with AdMob API
answer count: 2
type: Question
tagged with: swift
accepted answer: http://stackoverflow.com/a/79010692
has body: I can independently build projects for iOS (using Swift) or Android (using Kotlin or Java) with Google AdMob. Unfortunately, my company switched to Kotlin Multiplatform (KMP), which isn't directly supported by Google yet. Here's a typical KMP project structure for me in case you're wondering: - composeApp - src + androidMain # Android implementation + commonMain # Shared implementation + iosMain # iOS implementation - iosApp # Swift / iOS-specific frameworks - iosApp # target iOS app In my KMP project, I have built a commonMain class with functions that call androidMain and iosMain implementations. androidMain is working well displaying ads, but I'm struggling to get AdMob working on the iOS side. Are there any instructions or walkthroughs for how to create an iosMain / iosApp implementation of AdMob in a Kotlin Multiplatform (KMP) project?
has answer: http://stackoverflow.com/a/79195331
possible better answer: http://stackoverflow.com/a/79195331
favorite count: 0
upvote count: 0
tagged with: kotlin-multiplatform
type: AnsweredQuestion
tagged with: admob
tagged with: objective-c
has answer: http://stackoverflow.com/a/79010692
score: -2
downvote count: 2

http://stackoverflow.com/q/79027410
tagged with: swift
downvote count: 0
tagged with: linker-errors
score: 1
has body: I have upgraded to Xcode 16.0 recently. I encountered the following error when building my project in iOS physical devices. I am not sure how to resolve this issue and would appreciate any help. Here is the error message Assertion failed: ((ct == Atom::ContentType::objcConst) || (ct == Atom::ContentType::objcData) || (ct == Atom::ContentType::constData) || (ct == Atom::ContentType::constText)), function ObjCClassReadOnlyDataRef, file Atom.cpp, line 3022. Linker command failed with exit code 1 (use -v to see invocation) Note : Same codebase is building successfully in XCode 15. I tried to debug and find more information about this error. But I couldn't find much information about it.
tagged with: ios18
type: Question
has answer: http://stackoverflow.com/a/79027692
accepted answer: http://stackoverflow.com/a/79027692
upvote count: 1
answer count: 1
has title: Unable Run/Build/Archive iOS app in Xcode 16
tagged with: objective-c
tagged with: xcode16
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/a/78971747
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/139256454
accepted answer of: http://stackoverflow.com/q/78967569
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/78967569
has body: It looks like MacOS is smart enough to not report small spikes in memory pressure and to not notify the apps which can not free some memory because they already use low amount of it. I've added the following lines to the beginning of main function to make the app consume some memory: size_t size = 1024 * 1024 * 1024 / sizeof(int); int* largeArray = (int*)std::malloc(size * sizeof(int)); for (size_t i = 0; i &lt; size; ++i) { largeArray[i] = i; } In addition, when I emulated critical memory pressure via the command sudo memory_pressure -l critical which kept allocating memory until pressure becomes critical, I did not get handler called because the pressure came back to normal state immediately. I managed to get handler called when I emulated pressure for 10 seconds while my test app consumed 1Gb of RAM: sudo memory_pressure -S -l critical -s 10

http://stackoverflow.com/comment/139345877
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79023265
has text: No. Your framework is part of the app and running in the app sandbox. It is not running in its own sandbox.

http://stackoverflow.com/comment/139184512
has text: I've already deleted the comment because it was a duplicate of @Gerhardh's comment, but: no. Objective-C is said to be superset to C so `sizeof()` should be as wrong here as it is in puce C. Just use `strlen()` if you have a nul terminated string. Btw. my `main()` is basically `uint16_t wCrc = crc16(argv[1], strlen(argv[1]);`
type: Comment
comment on: http://stackoverflow.com/q/78940966
type: QuestionComment
score: 1

http://stackoverflow.com/q/78975833
tagged with: swift
score: 1
answer count: 1
tagged with: xcode16
linked to: http://stackoverflow.com/q/10003962
tagged with: ios18
downvote count: 1
type: Question
tagged with: objective-c
type: UnansweredQuestion
favorite count: 0
has body: I'm trying to build and run my app with the new Xcode 16.0 to a device with iOS 18.0, but it is crashing immediately after launch with this stack trace: 0 libobjc.A.dylib`_objc_warn_deprecated 1 realizeClassWithoutSwift 2 map_images_nolock 3 map_images 4 invocation function for block in dyld4::RuntimeState::setObjCNotifiers(void (*)(char const", mach_header const*), void (*)(mach_header con...apped_info const*), void (*) (unsigned int, _dyld _objc_notify_mapped_info const*, void (unsigned int) block_pointer))::$_0::operator)( const 5 dyld4::RuntimeLocks::withLoadersReadLock 6 dyld4::RuntimeState::setObjCNotifiers 7 dyld4:: APls::_dyld_objc_register_callbacks 8_objc_init 9_os_object_init 10 libdispatch_init 11 libSystem_initializer 12 invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const 13 invocation function for block in dyld3::MachOAnalyzer::forEachinitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const 14 invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const 15 dyld3::MachOFile::forEachLoadCommand 16 dyld3::MachOFile::forEachSection 17 dyld3::MachOAnalyzer::forEachInitializer 18 dyld4::Loader::findAndRunAllinitializers 19 dyld4::JustInTimeLoader::runInitializers 20 dyld4::APIs::runAllinitializersForMain 21 dyld4:: prepare 22 dyld4::start(dyld4::KernelArgs*, void*, void*)::$_0::operatori() const 23 start If I build and run from Xcode 16.0 to devices with iOS 15 or iOS 17, the app builds and runs successfully. This is the only thing in the console, but my sense is that it's not related since it also appears when the app runs successfully on the other devices: warning: (arm64) /Users/username/Library/Developer/Xcode/DerivedData/AppName-gevkjrdhpvsixnciokrsaracikam/Build/Products/Debug-iphoneos/AppName.app/AppName empty dSYM file detected, dSYM was created with a…
has answer: http://stackoverflow.com/a/79290261
has title: Crash on launch with "_objc_warn_deprecated" with Xcode 16 and iOS 18
upvote count: 2
linked to: http://stackoverflow.com/q/78129981

http://stackoverflow.com/comment/139183120
type: QuestionComment
comment on: http://stackoverflow.com/q/78937053
has text: `+keyPathsForValuesAffecting...` is not implemented. I can try to code a minimal example, but I'm afraid the issue will not manifest itself as it only occurs when the observed object is of a particular subclass, and not when it is of another subclass with the same attributes.
type: Comment
score: 0

http://stackoverflow.com/q/78914923
has comment: http://stackoverflow.com/comment/139137423
has body: I have a UItextView within a UIViewController created in storyboard. The UITextView has an outlet property myTextView and constraints that keep it at a fixed size. One wrinkle: The vertical constraints are initially inactive and set to active if the length of the text exceeds a certain amount. I can set the text without issue, however, when the text is long it bleeds outside the UITextView at the top and bottom. It doesn't always do this... If the text is just a little bit long, it scrolls okay within the UITextView. However if it is significantly longer than what fits in the textViewwindow a good portion of it (not all) displays outside. It scrolls but bleeds above and below the top and bottom depending on whether you scroll up or down. I can see the outlines of the textView from a border. Here is my code: in .h file @property (weak, nonatomic) IBOutlet UITextView *myTextView; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *myViewHeight; In view didLoad: [self styleAndAddBorderTo: self.myTextView]; if (descript.length&gt;=32) { self.myTextView.text = descript; self.myTextView.translatesAutoresizingMaskIntoConstraints = FALSE; self.myViewHeight.constant = 240; self.myViewHeight.active = YES; } else { //display in a UILabel } -(UITextView*) styleAndAddBorderTo: (UITextView*) myTextView { [myTextView.layer setBackgroundColor: [[UIColor whiteColor] CGColor]]; [myTextView.layer setBorderWidth: 2.0]; [myTextView.layer setCornerRadius:8.0f]; [myTextView.layer setMasksToBounds:YES]; [myTextView setClipsToBounds: YES]; myTextView.translatesAutoresizingMaskIntoConstraints = NO; [myTextView.layer setBorderColor:[[[UIColor grayColor] colorWithAlphaComponent:0.5] CGColor]]; return myTextView; } How can I prevent the text from bleeding outside the textView? Edit Screenshots With myViewHeight set to 100 and 320 respectively Edit with colors: Comment out setting text //textView.text = descript; with textView.hidden = YES;
tagged with: clipstobounds
has title: Prevent text in UITextView from bleeding outside of textView
tagged with: autolayout
has answer: http://stackoverflow.com/a/78919977
has comment: http://stackoverflow.com/comment/139137956
answer count: 1
has comment: http://stackoverflow.com/comment/139144398
type: Question
has comment: http://stackoverflow.com/comment/139138046
has comment: http://stackoverflow.com/comment/139137447
tagged with: objective-c
type: UnansweredQuestion
score: 0
tagged with: uitextview

http://stackoverflow.com/a/79023661
has comment: http://stackoverflow.com/comment/139336695
score: 0
has comment: http://stackoverflow.com/comment/139336098
type: Answer
answers question: http://stackoverflow.com/q/79023642
downvote count: 1
upvote count: 1
has body: The issue likely stems from m_hook not being a strong reference in your C++ class. In Objective-C/C++ interop, plain pointers don't imply ownership. To create a strong reference, modify your AdHolder class to use a pointer to a pointer (AdHook** m_hook;). In the constructor, allocate it with m_hook = new AdHook*; *m_hook = [[AdHook alloc] initFromCpp:cpp_ad];. Add a destructor to clean up: if (m_hook) { [*m_hook release]; delete m_hook; }. When accessing, use (*holder()-&gt;m_hook)-&gt;m_loader. This ensures the AdHook object isn't deallocated unexpectedly. Also, verify that the AdHolder instance itself remains valid when you're accessing m_hook, as its premature destruction could lead to crashes.
has comment: http://stackoverflow.com/comment/139336591

http://stackoverflow.com/q/78965718
score: 0
tagged with: ubuntu
answer count: 0
tagged with: objective-c
tagged with: clang++
type: Question
has title: Version 2 Objective-C ABI may not be mixed with earlier versions
type: UnansweredQuestion
has body: I am unable to compile and run a Obj-C program on Ubuntu Enviroment: Ubuntu Version: 22.04, 24.04 clang -v output: Ubuntu clang version 14.0.0-1ubuntu1.1 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11 Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11 Candidate multilib: .;@m64 Selected multilib: .;@m64 Build Command: clang++ -o checker checker.mm \ -I/opt/homebrew/opt/openssl@3/include \ -L/opt/homebrew/opt/openssl@3/lib \ -I/usr/local/include \ -isystem /usr/include/GNUstep \ -isystem /usr/local/include/GNUstep \ -L/usr/local/lib \ -fobjc-runtime=gnustep-2.0 \ -lssl -lcrypto -lgnustep-base -lobjc Log with LD_DEBUG=libs shows that the lib at /usr/local/lib/libobjc.so.4.6 might be the reason, so I tried to compile that as well, first with cd ~ wget https://github.com/gnustep/libobjc2/archive/v2.2.1.tar.gz tar xvzf v2.2.1.tar.gz cd libobjc2-2.2.1 mkdir build cd build export CC=`which clang` export CXX=`which clang++` cmake .. make sudo make install ldconfig Which, didn't work, then with script from https://github.com/plaurent/gnustep-build/tree/master which didn't resolve the issue either, right now I'm at a blind for what could be going on with my program. Any and every help will be appriciated, thank you

http://stackoverflow.com/q/79033269
favorite count: 0
tagged with: ios
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/139354865
tagged with: objective-c
downvote count: 0
tagged with: parse-platform
has body: I am getting this error at initialization of Parse. Most likely it is because I updated to XCode Version 16.0 (16A242d). MacOS is 14.5 (23F79). I have installed Parse as a pod. Also tried to remove it and install latest version as a Package Dependency but same error. [Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) { configuration.applicationId = @"myAppId"; configuration.clientKey = nil; configuration.server = @"myParseServerUrlStringHostedonHeroku"; }]]; Here is what I get when I run the app: (No errors while compiling.) *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: Invalid class name. Class names cannot start with an underscore.' *** First throw call stack: ( 0 CoreFoundation 0x00000001804ae0f8 __exceptionPreprocess + 172 1 libobjc.A.dylib 0x0000000180087db4 objc_exception_throw + 56 2 CoreFoundation 0x00000001804ae008 -[NSException initWithCoder:] + 0 3 myApp.debug.dylib 0x0000000106d2f1f8 +[PFObject(Private) _assertValidInstanceClassName:] + 180 4 myApp.debug.dylib 0x0000000106d37598 -[PFObject init] + 436 5 myApp.debug.dylib 0x0000000106d37898 -[PFObject initWithObjectState:] + 92 6 myApp.debug.dylib 0x0000000106d379cc +[PFObject objectWithClassName:objectId:completeData:] + 248 7 myApp.debug.dylib 0x0000000106d37ae0 +[PFObject objectWithClassName:] + 80 8 myApp.debug.dylib 0x0000000106d37fcc +[PFObject object] + 252 9 myApp.debug.dylib 0x0000000106cf6bdc __56-[PFCurrentInstallationController getCurrentObjectAsync]_block_invoke.9 + 452 10 myApp.debug.dylib 0x0000000106a64f18 __62-[BFTask continueWithExecutor:successBlock:cancellationToken:]_block_invoke + 124 11 myApp.debug.dylib 0x0000000106a64848 __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke + 88 12 myApp.debug.dylib 0x0000000106a615c0 __29+[BFExecutor defaultExecutor]_block_invoke_2 + 152 13 myApp.debug.dylib 0x0000000106a61da0 -[BFExecutor execute:] + 88 1…
has title: Parse iOS XCode: Class names cannot start with an underscore
type: Question
upvote count: 1
tagged with: xcode
answer count: 1
accepted answer: http://stackoverflow.com/a/79034348
has comment: http://stackoverflow.com/comment/139353593
has answer: http://stackoverflow.com/a/79034348
score: 1

http://stackoverflow.com/q/79023265
tagged with: keychain
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/139345877
type: UnansweredQuestion
has title: iOS Keychain data for SDKs
tagged with: ios
tagged with: objective-c
answer count: 0
has body: We have a SDK in which we use keychain to store some data. The customers who integrate our SDK in their app are able to delete our data by using SecItemDelete on kSecClass. Is their any way we can protect the SDK's data from getting delete by the host app or use something only accessible to SDK only ? Thanks Not able to find any solution
tagged with: sdk
score: 0

http://stackoverflow.com/comment/139370890
has text: I'd love to try it
type: Comment
comment on: http://stackoverflow.com/q/79029952
score: 0
type: QuestionComment

http://stackoverflow.com/q/79029952
has comment: http://stackoverflow.com/comment/139392180
score: 0
tagged with: iphone
has body: I am facing an issue with QLThumbnailGenerationRequest, it is not creating thumbnail from the image captured from the iPhone camera. I am doing the following: I get the captured image and convert it into NSData like this: UIImage *source = info[UIImagePickerControllerOriginalImage]; NSData *imageData = UIImageJPEGRepresentation(source, 1.0); Then I save the imageData to a temporary directory like this: NSString *directoryPath = NSTemporaryDirectory(); NSString *filePath = [directoryPath stringByAppendingPathComponent:@"CapturedImageFromCamera.jpg"]; NSError *error = nil; BOOL success = [imageData writeToFile:filePath options:NSDataWritingAtomic error:&error]; I am getting success as true which means that the image is saved at the given path. I am creating QLThumbnailGenerationRequest like this: CGSize thumbnailSize = CGSizeMake(720, 720); QLThumbnailGenerator *generator = [[QLThumbnailGenerator alloc] init]; QLThumbnailGenerationRequest *request = [[QLThumbnailGenerationRequest alloc] initWithFileAtURL: [NSURL fileURLWithPath:filePath] size:thumbnailSize scale:[UIScreen mainScreen].scale representationTypes:QLThumbnailGenerationRequestRepresentationTypeThumbnail]; [generator generateBestRepresentationForRequest:request completionHandler:^(QLThumbnailRepresentation * _Nullable thumbnail, NSError * _Nullable error) { if (error) { NSLog(@"ERROR = %@", error.localizedDescription); } else { NSLog(@"SUCCESS"); } }]; I am getting the following error everytime: Thumbnail generation failed with error: The operation couldn’t be completed. (QLThumbnailErrorDomain error 0.) Error code: 0 Error domain: QLThumbnailErrorDomain Error user info: { NSUnderlyingError = "Error Domain=QLThumbnailErrorDomain Code=102 \"(null)\""; Let me know if you need any further details reagarding this issue. Any help regarding this would be appreciated. Thanks
has comment: http://stackoverflow.com/comment/139403714
has comment: http://stackoverflow.com/comment/139369643
has comment: http://stackoverflow.com/comment/139363009
answer count: 0
has comment: http://stackoverflow.com/comment/139376749
has comment: http://stackoverflow.com/comment/139370890
has comment: http://stackoverflow.com/comment/139440311
tagged with: ios
type: Question
tagged with: objective-c
type: UnansweredQuestion
has title: QLThumbnailGenerationRequest not generating thumbnail from the image captured from camera

http://stackoverflow.com/q/79002502
has comment: http://stackoverflow.com/comment/139350827
score: 0
has title: ScreenCaptureKit: SCShareableContent getShareableContentExcludingDesktopWindows never calls completion handler
answer count: 0
tagged with: macos
downvote count: 1
type: Question
upvote count: 1
tagged with: objective-c
type: UnansweredQuestion
tagged with: cocoa
has body: I am trying to capture a window image using ScreenCaptureKit. It works fine in swift, but I need to use objective-c, and it never calls the completion handler when getting a SCSharableContent. Is there something obvious I've been missing for the last two days? @import Foundation; @import CoreServices; @import to use ; BOOL CanCapture(void) { for(;;) { if (CGPreflightScreenCaptureAccess()) { return true; } if (!CGRequestScreenCaptureAccess()) { return false; } } return false; } int main(int argc, const char * argv[]) { @autoreleasepool { if (CanCapture()) { NSLog(@"Here\n"); [SCShareableContent getShareableContentExcludingDesktopWindows: true onScreenWindowsOnly: true completionHandler: ^(SCShareableContent *shareableContent, NSError *error) { NSLog(@"But not Here\n"); }]; } } }
favorite count: 0
tagged with: screencapturekit

http://stackoverflow.com/comment/139336098
comment on: http://stackoverflow.com/a/79023661
has text: Could you explain, please, why does the reference become strong with `AdHook**`? What actually changes with this? We create additional C++ pointer, right? So it is C++ pointer to Objective-C pointer, right?
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/79050151
score: 0
tagged with: iphone
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/139386182
tagged with: macos
favorite count: 0
has answer: http://stackoverflow.com/a/79050482
has title: Unconditional NSAssert in Objective-C?
tagged with: ios
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/79050482
downvote count: 1
answer count: 1
tagged with: objective-c
has body: Sometimes I like to put NSAssert(NO, @"this should never happen") in a block of code that should never be reached. Is there a better alternative for such unconditional asserts in Objective-C? I would like something like NSTerminate(@"this should never happen") - a convenient function which prints a message and terminates the program unconditionally.
tagged with: cocoa

http://stackoverflow.com/q/79056995
type: UnansweredQuestion
answer count: 0
tagged with: objective-c
type: Question
has body: I updated my flutter version to latest and when run flutter build ios command getting this error below :-&gt; Unable to get Xcode project information: 2024-10-04 17:21:46.356 xcodebuild[31047:2236830] Writing error result bundle to /var/folders/mm/83rw22ln29qgl9n2gcnzd9600000gn/T/ResultBundle_2024-04-10_17-21-0046.xcresult xcodebuild: error: Could not resolve package dependencies: ocmock is required using two different revision-based requirements (fe1661a3efed11831a6452f4b1a0c5e6ddc08c3d and ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a), which is not supported flutter version detail :-&gt; Flutter 3.24.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision 2663184aa7 (3 weeks ago) • 2024-09-11 16:27:48 -0500 Engine • revision 36335019a8 Tools • Dart 3.5.3 • DevTools 2.37.3 I tried to remove ocmock from podfile using post_install that code is also below:-&gt; post_install do |installer| installer.pods_project.targets.each do |target| if target.name == 'OCMock' target.remove_from_project end end installer.pods_project.targets.each do |target| if target.name == 'ocmock' target.remove_from_project end end So please provide the solution to resolve this.
score: 0
has title: ocmock is required using two different revision-based requirements
tagged with: ocmock

http://stackoverflow.com/comment/139386182
comment on: http://stackoverflow.com/q/79050151
score: 1
has text: `NSAssert(NO,...)` is the traditional way to write this.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/139453227
has text: THANK YOU so much! This was it. My project was configured to use openSSL for receipt validation. I ended up moving to Revenuecat but never removed the dependency.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/79077043

http://stackoverflow.com/q/78939676
score: 0
tagged with: accelerate-framework
tagged with: objective-c
type: Question
upvote count: 1
tagged with: swift
favorite count: 0
has title: Does Apple BNNS copy weight data internally? Can I safely free my weight buffer afterward?
has body: I'm working with Apple's BNNS framework to implement neural networks. I'm using the BNNSFilterCreateLayerFullyConnected function to create fully connected layers. I have a few questions regarding weight data handling: Does BNNS Filter factory methods like BNNSFilterCreateLayerFullyConnected internally copy the weight data I provide into its own buffer? Or does it simply reference my original weight buffer? If it does copy the data, can I safely free my original weight buffer after the layer is created? I want to ensure proper memory management and avoid potential issues. I haven't been able to find definitive information in Apple's documentation. Any insights or clarifications on this would be greatly appreciated.
downvote count: 1
type: UnansweredQuestion
tagged with: macos
answer count: 0
tagged with: ios

uislider
tag name: uislider
type: Tag
tags question: http://stackoverflow.com/q/78952984
tags question: http://stackoverflow.com/q/79504242

http://stackoverflow.com/q/78945375
tagged with: capacitor
type: Question
upvote count: 1
tagged with: swift
type: UnansweredQuestion
favorite count: 0
has comment: http://stackoverflow.com/comment/139199384
score: 0
tagged with: ios
has title: Is it possible to augment input components for `WKWebView`?
has body: We are working on an iOS app. It is built on Capacitor, but I have generalized my question, so it may be irrelevant. The app uses a WKWebView to show an HTML form. In that form, there is an input element with type="month" and min/max attributes. In case you are not familiar with HTML, type="month", despite it's name, is actually a year-month picker. For example: On iOS, 13.4+ it shows a native UIDatePicker with datePickerMode = .yearAndMonth and datePickerStyle = .wheels. However, it does not support the min and max attributes. Is there a way to either augment the UIDatePicker that WKWebView shows for this HTML element or completely replace it? The goal being, of course, to support the min and max attributes by parsing their values and setting minimumDate and maximumDate, respectively?
tagged with: objective-c
downvote count: 1
answer count: 0

http://stackoverflow.com/q/78957932
tagged with: push-notification
type: UnansweredQuestion
answer count: 0
tagged with: iphone
tagged with: onesignal
tagged with: ios
has title: OneSignal Push notification works in iPhone 14 but not iPhone SE and iPhone 11
tagged with: objective-c
score: 0
has body: I implemented push notification using OneSignal. I am using Objective-C. Here is the part of Pod file. target 'PlugYou' do ... pod 'OneSignal', '&gt;= 2.11.2', '&lt; 3.0' end target 'OneSignalNotificationServiceExtension' do pod 'OneSignal', '&gt;= 2.11.2', '&lt; 3.0' end It works well in iPhone 14 but not iPhone SE and iPhone 11, which iOS version is 17.6.1 Please help me. I need to make push notification works in all the iOS devices. Thanks.
type: Question

uipasteboard
tags question: http://stackoverflow.com/q/78932369
type: Tag
tag name: uipasteboard

appauth
type: Tag
tag name: appauth
tags question: http://stackoverflow.com/q/79034989

http://stackoverflow.com/comment/139256454
comment on: http://stackoverflow.com/a/78971747
type: AnswerComment
type: Comment
score: 0
has text: Thanks, Mikhail. Some investigations today led me to your post, and indeed, it seems that unless you're actually using some amount of memory, you don't get notified.

http://stackoverflow.com/q/79025566
has title: How to Open the Default Phone App Scene from CarPlay Scene on iOS (Including Devices Without Multiple Scene Support)?
has body: I’m developing an iOS app with CarPlay support, and I’m trying to open the default phone app scene from the CarPlay scene. This needs to work on all iOS devices, including those that do not support multiple scenes (e.g., older iOS versions or devices that do not have multiple windows). Scenario: • The default configuration scene is the phone app, and the CarPlay scene is a separate one. • When interacting with the CarPlay interface, I want to programmatically switch or launch the phone app scene. I’ve found resources on managing multiple scenes on devices that support it, but not much about how to handle this scenario for devices that only support a single scene. Could someone guide me on the correct approach to achieve this behavior in Objective-C? I’d appreciate code examples that work on all iOS devices, including handling cases where multiple scenes aren’t available. Here’s a rough version of what I’m trying, but I’m unsure how to make this compatible across all devices: - (void)switchToPhoneAppScene { if (@available(iOS 13.0, *)) { NSSet&lt;UIScene *&gt; *connectedScenes = [UIApplication sharedApplication].connectedScenes; for (UIScene *scene in connectedScenes) { if ([scene.session.role isEqualToString:UIWindowSceneSessionRoleApplication]) { // Trying to activate the phone app scene [UIApplication.sharedApplication requestSceneSessionActivation:scene.session userActivity:nil options:nil errorHandler:nil]; return; } } } else { // For iOS versions below 13 that do not support multiple scenes // What should be done here to ensure compatibility? } } What would be the best way to handle scene activation or app switching across all iOS devices, regardless of whether they support multiple scenes? Thanks in advance!
answer count: 0
tagged with: ios
tagged with: objective-c
has comment: http://stackoverflow.com/comment/139340783
score: 0
type: Question
type: UnansweredQuestion

http://stackoverflow.com/comment/139137447
type: Comment
comment on: http://stackoverflow.com/q/78914923
has text: Unless you mean the actual border line *appearing* to "bleed"? https://i.sstatic.net/oTl2ZUHA.png
score: 0
type: QuestionComment

http://stackoverflow.com/comment/139336591
type: Comment
score: 0
has text: Sure, the AdHook** approach creates a strong reference by using C++ to manage an Objective-C pointer. It allocates C++-controlled memory to store the Objective-C pointer, preventing ARC from releasing the object. The Objective-C runtime sees this as a persistent reference. When you release in the C++ destructor, you free both the Objective-C object and C++-managed memory. This bridges C++ and Objective-C memory management, controlling the Objective-C object's lifetime.
comment on: http://stackoverflow.com/a/79023661
type: AnswerComment

http://stackoverflow.com/comment/139363009
score: 0
type: QuestionComment
has text: Did you try on real device ?
type: Comment
comment on: http://stackoverflow.com/q/79029952

http://stackoverflow.com/q/79034494
has title: Xcode 16 error - Use of undeclared identifier '_CTYPE_A'
accepted answer: http://stackoverflow.com/a/79077043
downvote count: 0
tagged with: xcode
score: 1
has comment: http://stackoverflow.com/comment/139355761
type: AnsweredQuestion
has body: I just upgraded to Xcode 16.0 and Sequoia 15.0. I have a large, mostly Objective-C project that's giving me the following error. Does anybody know how I can track down this error? I'd love to create a sample project to reproduce it, but I have no idea which part of my project is taking the compiler down this path. Other projects build fine. /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/wchar.h:67:10: note: while building module '\_wchar' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/wchar.h:67: #include \<\_wchar.h\> ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/\_wchar.h:76:10: note: while building module '\__wctype' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/\_wchar.h:76: #include \<sys/\_types/\_mbstate_t.h\> ^ \<module-includes\>:1:9: note: in file included from \<module-includes\>:1: #import "\___wctype.h" ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/\___wctype.h:83:24: error: use of undeclared identifier '\_CTYPE_A' return (\__istype(\_wc, \_CTYPE_A|\_CTYPE_D)); ^ There are 100+ lines of similar errors referencing _CTYPE_A, _CTYPE_C, _CTYPE_D, _CTYPE_G, etc. I've tested this on another Mac that's still running Sonoma. The project compiles on that computer with Xcode 15.4, but gives the same errors with Xcode 16. UPDATE: This project is for a macOS application (not sure if that matters).
answer count: 2
has answer: http://stackoverflow.com/a/79034518
has answer: http://stackoverflow.com/a/79077043
possible better answer: http://stackoverflow.com/a/79034518
type: Question
upvote count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/139383694
favorite count: 0

http://stackoverflow.com/a/78975505
score: 2
accepted answer of: http://stackoverflow.com/q/78975078
upvote count: 2
type: AcceptedAnswer
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/78975078
has body: Is it okay for me to add my custom content to the backgroundView? No. The backgroundView should be limited to a simple view whose basic properties, such as its backgroundColor, you configure. It would be even better, nowadays, to use the cell's background configuration instead. Is it okay for me to manually change the position of the frame of the contentView when doing my swipe on the cell? No. Your content should be inside a view inside a scroll view (or other "slideable" view) inside the content view. Don't touch the content view itself.

http://stackoverflow.com/comment/139274604
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78983850
score: 0
has text: This question is similar to: [A developer when going through a code base encounters two different syntaxes for creating a NSString with the given integer. (implemented in MRC)](https://stackoverflow.com/questions/69929144/a-developer-when-going-through-a-code-base-encounters-two-different-syntaxes-for). If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.

http://stackoverflow.com/comment/139340559
score: 0
type: QuestionComment
has text: @Cy-4AH yes, it was turned off, see the picture: https://developernote.com/2024/09/examples-of-c-objective-c-interop/#arcoff
comment on: http://stackoverflow.com/q/79023642
type: Comment

http://stackoverflow.com/q/79023642
has comment: http://stackoverflow.com/comment/139340808
score: 1
answer count: 1
has title: How to prevent a root object from being deleted in C++/Objective-C
linked to: http://stackoverflow.com/q/18883726
has comment: http://stackoverflow.com/comment/139340559
has body: I have the following code in my C++/Objective-C app: #import <YandexMobileAds/YandexMobileAds-Swift.h> @class AdHook; namespace MyApp { class AdHolder { public: AdHolder(IosInterstitialAd* cpp_ad); AdHook* m_hook; }; } using namespace MyApp; @interface AdHook : NSObject <YMAInterstitialAdLoaderDelegate, YMAInterstitialAdDelegate> { @public IosInterstitialAd* m_cppAd; @public YMAInterstitialAdLoader* m_loader; @public YMAInterstitialAd* m_interstitialAd; } @end @implementation AdHook - (id)initFromCpp:(IosInterstitialAd *)cpp_ad { if (self = [super init]) { m_cppAd = cpp_ad; m_interstitialAd = nil; m_loader = [[YMAInterstitialAdLoader alloc]init]; m_loader.delegate = self; } return self; } AdHolder::AdHolder(IosInterstitialAd* cpp_ad) { [YMAMobileAds enableLogging]; m_hook = [[AdHook alloc]initFromCpp:cpp_ad]; } void SomeOtherClass::load() { NSLog(@"IosInterstitialAd::load()"); YMAAdRequestConfiguration* configuration = [[YMAAdRequestConfiguration alloc]initWithAdUnitID:@"demo-interstitial-yandex"]; [m_holder->m_hook->m_loader loadAdWithRequestConfiguration:configuration]; } I create an instance of AdHolder class in C++ code and AdHolder's constructor creates an instance of Objective-C class AdHook that in its turn crates its internal Objective-C objects. But I do not understand well enough what is the lifetime of m_hook? And I suspect that it is deleted at some point, because when I try to access m_hook->m_interstitialAd from YMAInterstitialAdLoaderDelegate callback I get a wrong value and the app crashes. Is m_hook a strong reference? If it is not how to make it strong? EDIT1 Tried to randomly add retain call to various objects in my app and made the app work by adding retain call to AdHook::m_interstitialAd: - (void)interstitialAdLoader:(YMAInterstitialAdLoader * _Nonnull)adLoader didLoad:(YMAInterstitialAd * _Nonnull)interstitialAd { NSLog(@"IosInterstitialAd::YMAInterstitialAdLoader::didLoad, %@", interstitialAd); m_interstitialAd = [interstitialAd retain]; m_in…
tagged with: objective-c
type: Question
tagged with: objective-c++
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/139340891
has comment: http://stackoverflow.com/comment/139341199
favorite count: 0
has comment: http://stackoverflow.com/comment/139336319
has comment: http://stackoverflow.com/comment/139341435
has comment: http://stackoverflow.com/comment/139340440
has answer: http://stackoverflow.com/a/79023661
type: UnansweredQuestion

http://stackoverflow.com/comment/139343682
has text: Thank you so much @MoonKid . It solved the error.
comment on: http://stackoverflow.com/a/79027692
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/78926432
has title: Import Swift protocol from SubModule into Objective-C Class
has comment: http://stackoverflow.com/comment/139158113
tagged with: swift
answer count: 0
has body: need some light here! Been working on a app where some submodules (.xcproject) are written in swift, and some inner modules of the main target are written in ObjC. Until then all good. We want to implement a feature from one of the swift submodule into an ObjC class. Our way for the rest of the project is to import every dependencies to a Parent class through an extension conforming to the protocol. Example. // In Swift @obc public protocol MyProtocol { } class ParentClass: MyProtocol { } // this way all the children gets access to the parent conformance class ChildClass: ParentClass { } In my bridging header, (which is already found, and works correctly by the way), I added: #import &lt;MySubModule/MySubModule.h&gt; In my ObjC class, I import MainApp-Swift.h Now when importing the same protocol, I get this error: Cannot find protocol declaration for MyProtocolFromSubModule Although the submodule is added and the protocol is found in the MainApp-Swift.h @interface SomeClassIExtend (SWIFT_EXTENSION(MainApp)) &lt;MyProtocolFromSubModule&gt; @end Ideas ? EDIT SOLUTION FOUND It might have been obvious but still want to share it. Since swift is ObjectiveC c friendly, and my protocol holds object that be identified by ObjectiveC, turning the protocol into a an ObjectiveC one resolved my issue. Still have to make it public in my submodule and export it, but once its done, can reach by #importing my module. Yeah !
tagged with: ios
type: Question
tagged with: module
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/139158328
score: 0

http://stackoverflow.com/q/78976697
type: UnansweredQuestion
has title: AppCheckCore 'GoogleUtilities/GULKeychainStorage.h' file not found in my objective-c project
tagged with: cocoapods
answer count: 0
has body: I gets the error: 'GoogleUtilities/GULKeychainStorage.h' file not found in file - Pods/AppCheckCore/GACAppCheckStorage.h The error occurred when i installed a new pod in an old objective-c project. I have tried deleting derived data, clean build, deleting workspace, pod deintegrate and install etc... Below is my podfile # Uncomment this line to define a global platform for your project # platform :ios, '10.0' # Uncomment this line if you are using Swift # use_frameworks! target ‘PurposeColor’ do pod 'FirebaseMessaging' pod 'GooglePlaces' pod 'GoogleMaps' pod 'FirebaseAuth' pod 'GoogleSignIn' source 'https://github.com/CocoaPods/Specs.git' pod 'AFNetworking', '~&gt; 2.7.0' pod 'SDWebImage', '~&gt;3.8.3' pod 'Fabric' pod 'Crashlytics' pod 'MobileVLCKit', '~&gt;3.3.0' pod 'EMEmojiableBtn' pod 'FirebaseCore' pod 'FirebaseFirestore' pod 'algorithmia', '~&gt;0.1.1' pod 'FBSDKCoreKit' pod 'FBSDKLoginKit' pod 'FBSDKShareKit' pod 'SVProgressHUD' pod 'Alamofire' pod 'Kingfisher', '~&gt;5.7.1' pod 'SwiftGifOrigin' pod 'MarqueeLabel' pod 'NXPlacePicker' pod 'SVPullToRefresh' pod 'MKDropdownMenu' end target ‘Share’ do source 'https://github.com/CocoaPods/Specs.git' pod 'AFNetworking', '~&gt; 2.7.0' pod 'SDWebImage', '~&gt;3.8.3' source 'https://github.com/CocoaPods/Specs.git' #pod 'GooglePlacePicker' pod 'GooglePlaces' pod 'GoogleMaps' end target 'PurposeColorTests' do end target 'PurposeColorUITests' do end
type: Question
tagged with: objective-c
tagged with: firebase
score: 0

ios18
tags question: http://stackoverflow.com/q/78975833
tag name: ios18
tags question: http://stackoverflow.com/q/79006898
type: Tag
tags question: http://stackoverflow.com/q/79027410
tags question: http://stackoverflow.com/q/79086536
tags question: http://stackoverflow.com/q/79351022

http://stackoverflow.com/q/79017759
tagged with: firebase
tagged with: objective-c
type: Question
upvote count: 1
has title: How did I solve the Could not build Objective-C module 'Firebase' error at flutter?
downvote count: 0
has body: How did I solve the Could not build Objective-C module 'Firebase' error at flutter ? I opened edit schemes in xcode and set the build configuration in debug mode and the problem was solved. Make sure that debug mode is selected in the window that opens by selecting the edit scheme option under the runner in Xcode.
tagged with: xcode
answer count: 0
tagged with: flutter
favorite count: 0
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/139325748

http://stackoverflow.com/q/79046682
type: Question
tagged with: react-native
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/139384441
has comment: http://stackoverflow.com/comment/139833029
has comment: http://stackoverflow.com/comment/139833036
has comment: http://stackoverflow.com/comment/139416284
has body: I'm trying to share my UIView between some class for decode frame. For this, i've add sharedInstance method for get the instance from other class. This method same not work and return an new instance, not the current. My UIView class : using namespace facebook::react; @interface RTNViewStreamView () <RCTRTNViewStreamViewViewProtocol> @end @implementation RTNViewStreamView { UIView * _view; } + (ComponentDescriptorProvider)componentDescriptorProvider { return concreteComponentDescriptorProvider<RTNViewStreamViewComponentDescriptor>(); } - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { static const auto defaultProps = std::make_shared<const RTNViewStreamViewProps>(); _props = defaultProps; _view = [[UIView alloc] init]; NSLog(@"initWithFrame: %p", _view); self.contentView = _view; } return self; } + (id)sharedInstance { static RTNViewStreamView *sharedClassA = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedClassA = [[self alloc] init]; }); return sharedClassA; } - (UIView *)getContentView { return self.contentView; } - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps { const auto &oldViewProps = *std::static_pointer_cast<RTNViewStreamViewProps const>(_props); const auto &newViewProps = *std::static_pointer_cast<RTNViewStreamViewProps const>(props); if (oldViewProps.color != newViewProps.color) { NSString * colorToConvert = [[NSString alloc] initWithUTF8String: newViewProps.color.c_str()]; [_view setBackgroundColor:[self hexStringToColor:colorToConvert]]; } [super updateProps:props oldProps:oldProps]; } Class<RCTComponentViewProtocol> RTNViewStreamViewCls(void) { return RTNViewStreamView.class; } Then, from other class, i try this : - (instancetype)init { self = [super init]; if (self) { RTNViewStreamView *classA = [RTNViewStreamView sharedInstance]; NSLog(@"init rtnstream: %p", classA.contentView); classA.contentView.backgroundColor = [UIColor redColor]; // Not wor…
has title: Share UIView instance between class
answer count: 0
tagged with: ios
score: 0
tagged with: objective-c

http://stackoverflow.com/comment/139274725
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/78990121
has text: For ARC it's ok and Apple recommends to use ivar directly in initializers. For example you have overridden `setFoo:` and it's behaviour is depending on some property of children class, but at the line `self.froo = foo` in the parent class initializer it's not set yet.

http://stackoverflow.com/q/79007074
upvote count: 1
has body: in my application that I developed with Objective-C, I have a web view structure in which I select a photo from the photo gallery and upload it while testing it on my device with Xcode 16 and iOS 18 installed, but when I try to select and upload a photo from the photo gallery, I receive the following error in the log [ERROR] Could not create a bookmark: NSError: Cocoa 4097 "connection to service named com.apple.FileProvider". Has anyone encountered this error before? Thank you in advance. I changed the product name based on an article stating that this error would be resolved by changing the product name. it didn't work again
favorite count: 0
type: Question
has title: connection to service named com.apple.FileProvider"
downvote count: 0
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/79163874
tagged with: ios
answer count: 1
tagged with: objective-c

http://stackoverflow.com/comment/139137956
comment on: http://stackoverflow.com/q/78914923
score: 0
has text: Added pics with height set to 240, 100 and 320 rspectively. The text in the textview always seems to be about four lines too long. Could it be a timing issue, the border of the textview is set before the text is set and the text is responding to some other layout constraints affected by the amount of text? There is a textview constraint at the bottom that goes to the next element down--an image that is not being used in this scenario. As of now, I am not touching that constraint. i do set the height of the image to zero elsewhere
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/139340808
type: Comment
comment on: http://stackoverflow.com/q/79023642
has text: If you turned off `ARC` then you need implement smart pointer functionality in your holders: retain new objects on assign and release old objects. And release objects in destructor. But I don't know reasons to not use `ARC`.
score: 1
type: QuestionComment

http://stackoverflow.com/comment/139833029
type: Comment
has text: Looking at the results you printed, it seems that `RTNViewStreamView` was initialized twice. I'm not sure which instance you intend to use for editing. I don't understand why you don't let the `ViewController` hold the instance of `RTNViewStreamView` and instead use a singleton to hold it. In that case, the singleton will always end up holding only the most recently initialized instance.
score: 0
comment on: http://stackoverflow.com/q/79046682
type: QuestionComment

http://stackoverflow.com/a/78941825
upvote count: 0
type: AcceptedAnswer
type: Answer
score: -1
downvote count: 1
accepted answer of: http://stackoverflow.com/q/78937053
answers question: http://stackoverflow.com/q/78937053
has body: Ok I found the root cause. The problem what that the observed object was a fault. The observation instruction using NSKeyValueObservingOptionInitial causes the fault to fire, which results in changes of the other (observed) attributes (fetched from the store), triggering change notifications. Move along, nothing to see here.

http://stackoverflow.com/comment/139217585
type: Comment
comment on: http://stackoverflow.com/q/78958789
has text: What does the error say? You need to have a bridging header "MyFramework-Bridge.h" and import "MyFramework.h" in it (don't forget to declare bridging header in target settings). No modulemap/umbrella needed, just bridging header
score: 1
type: QuestionComment

http://stackoverflow.com/a/79195331
downvote count: 1
answers question: http://stackoverflow.com/q/79010527
score: 0
type: Answer
upvote count: 1
has body: Lexilabs has a Kotlin Multiplatform library that enables AdMob @Composables called basic-ads. The only downside is that it requires Android's Context to initialize and build @Composables, but there's already a tutorial out there for how to do that.

http://stackoverflow.com/q/79006898
upvote count: 1
downvote count: 0
has body: First, apology if my English is not quite good. We have developed an iOS app in objective-C and added integrations for shortcuts app - more specific the "automation" part of the app. Basically, user opens shortcuts app, select automation and when scanning NFC tag, user can select an action and our app shows 3 different actions. User select action, opens the app and action is executed. That all done in Obj-C and was working very well with no complaints till users start to update to iOS18. Now, when user starts to add automation, only thing they can do is select "open app". Our app actions are not showing any more. Is there something new in iOS 18 we have to update our app. I know Obje-C is considered "old", but the cost of upgrading an existing app and time is not available at the moment. Here's a code snippet of out shortcutIntent: <?xml version="1.0" encoding="UTF-8"?> com.apple.security.application-groups group.lw.grp1 group.lw.grp2 Info-plist <?xml version="1.0" encoding="UTF-8"?> NSExtension NSExtensionAttributes IntentsRestrictedWhileLocked IntentsRestrictedWhileProtectedDataUnavailable IntentsSupported LockIntent TrunkIntent UnlockIntent NSExtensionPointIdentifier com.apple.intents-service NSExtensionPrincipalClass IntentHandler IntentHandler @implementation IntentHandler -(id)init{ self = [super init]; self.started = false; self.handler = [[AppIntentHandler alloc] init]; self.handler.userInfo = [[NSMutableDictionary alloc] init]; return self; } - (id)handlerForIntent:(INIntent *)intent { // This is the default implementation. If you want different objects to handle different intents, // you can override this and return the handler you want for that particular intent. if(!self.started){ self.started = YES; if([intent isKindOfClass:[LockIntent class]]){ NSLog(@"*intent lock selected*"); self.handler.userInfo = [self assignUserInfo:@"lock"]; }else if([intent isKindOfClass:[UnlockIntent class]]){ NSLog(@"*intent unlock selected*"); self.handler.userInfo = [self a…
tagged with: shortcut
answer count: 0
favorite count: 0
type: Question
type: UnansweredQuestion
score: 1
has title: App shortcut actions not showing on iOS 18 shortcuts app
tagged with: ios
tagged with: ios18
tagged with: objective-c

http://stackoverflow.com/comment/139156361
score: 0
comment on: http://stackoverflow.com/a/78919977
type: AnswerComment
type: Comment
has text: I have another view controller for posting comments with similar code and constraints that works fine. Something seems to have gone awry in the constraints so I will try to rebuild from scratch. If it still shows problem I will share as minimum reproducible example. Thank you for all your attention to this.

http://stackoverflow.com/q/79007340
tagged with: c++
type: Question
tagged with: swift
type: UnansweredQuestion
has body: I have the following function to process audio data in Obj-C (and then deeper in C++): - (void) audioProcess: (int) numChannels numSamples: (int) numSamples stride: (int) stride data: (float * const *) data; This signature is classic for processing audio buffer data stored in contiguous memory. It could be interleaved or not, depending on the buffer. Then in Swift, I want to process an audio buffer like so: let buffer = ... // get AVAudioPCMBuffer from somewhere if let floatChannelData = buffer.floatChannelData { audioProcess(Int32(buffer.format.channelCount), numSamples: Int32(buffer.frameLength), stride: Int32(buffer.stride), data: floatChannelData) } I get the following compilation error: Cannot convert value of type 'UnsafePointer&lt;UnsafeMutablePointer&lt;Float&gt;&gt;' to expected argument type 'UnsafePointer&lt;UnsafeMutablePointer&lt;Float&gt;?&gt;' Notice the difference in optionality of the UnsafeMutablePointer&lt;Float&gt;. How can I pass the floatChannelData from Swift to Obj-C (C++)? Edit: typos
has title: Pass AVAudioPCMBuffer.floatChannelData from Swift to Obj-C (C++)
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/79084321
score: 0

http://stackoverflow.com/a/78919977
has comment: http://stackoverflow.com/comment/139153915
has comment: http://stackoverflow.com/comment/139154342
has comment: http://stackoverflow.com/comment/139153859
has comment: http://stackoverflow.com/comment/139152422
has comment: http://stackoverflow.com/comment/139152617
has comment: http://stackoverflow.com/comment/139152168
score: 1
has comment: http://stackoverflow.com/comment/139152678
type: Answer
has body: Couple notes... First, this line of your code: [self styleAndAddBorderTo: self.myTextView]; discards any return value. Since you are passing self.myTextView, let's change your style method to: - (void) styleAndAddBorderTo: (UITextView*) someTextView { [someTextView.layer setBackgroundColor: [[UIColor whiteColor] CGColor]]; // etc } Next, when you set constraints on UI elements in Storyboard, .translatesAutoresizingMaskIntoConstraints is automatically set to false - so you don't need to set that anywhere in your code. Third, you don't need to set .masksToBounds to true on the text view's layer. Fourth -- the only two ways I can think of to get your "bleed" problem would be: somewhere in your code you are setting [self.myTextView setClipsToBounds: NO]; (because the code you've shown explicitly sets it to YES), or you have somehow overlaid another text view on top of the "styled" one So, here is your code, implementing the above notes: @implementation YourViewController - (void) styleAndAddBorderTo: (UITextView*) someTextView { [someTextView.layer setBackgroundColor: [[UIColor whiteColor] CGColor]]; [someTextView.layer setBorderWidth: 2.0]; [someTextView.layer setCornerRadius:8.0f]; [someTextView.layer setBorderColor:[[[UIColor grayColor] colorWithAlphaComponent:0.5] CGColor]]; // not needed - UI elements (@IBOutlets) with constraints set in Storyboard // automatically set .translatesAutoresizingMaskIntoConstraints = FALSE //self.myTextView.translatesAutoresizingMaskIntoConstraints = FALSE; // not needed //[someTextView.layer setMasksToBounds:YES]; // we'll keep this here, in case you've set it to NO in Storyboard // or somewhere else in your code [someTextView setClipsToBounds: YES]; } - (void)viewDidLoad { [super viewDidLoad]; // let's set the view background to yellow, so we can // easily see the white background of the text view self.view.backgroundColor = UIColor.systemYellowColor; // let's make a really long string NSString *descript = @"This is the description s…
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/78914923
has comment: http://stackoverflow.com/comment/139156361

shortcut
type: Tag
tags question: http://stackoverflow.com/q/79006898
tag name: shortcut

http://stackoverflow.com/comment/139220391
type: Comment
score: 1
type: QuestionComment
has text: Right, good to know I'm not going insane :) Just established that the issue must be in the MacOS itself - the binary compiled on 10.15 produces the same issue when executed on macOS 14, while working correctly on 10.15.
comment on: http://stackoverflow.com/q/78960444

http://stackoverflow.com/comment/139298803
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/79002469
has text: Why add the Swift and SwiftUI tags when your code example is purely Obj-C? If you're actually using Swift and SwiftUI as well and you know that's causing the issue, you should also include the relevant parts in the question. Either way, you need to [edit] your question to include all relevant code in the form of a [mcve] in order to make the question on-topic.
score: 0

http://stackoverflow.com/a/79013633
type: Answer
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/79013614
score: 1
has comment: http://stackoverflow.com/comment/139318551
has body: initWithMemoryCapacity:diskCapacity:diskPath: was deprecated iOS 13. You should use the replacement initialiser configuration.URLCache = [[NSURLCache alloc] initWithMemoryCapacity:20*1024*1024 diskCapacity:100*1024*1024 directoryUrl: nil];

http://stackoverflow.com/comment/139340440
score: 1
has text: May be just turn on `ARC`?
type: QuestionComment
comment on: http://stackoverflow.com/q/79023642
type: Comment

http://stackoverflow.com/comment/139184182
comment on: http://stackoverflow.com/q/78940966
type: QuestionComment
score: 0
type: Comment
has text: Please [edit] your question and add a C `main` function that feeds your test data into your function `crc16` and prints the result. It would be best to embed the data in the main function. Otherwise, if it needs an input file, provide the input file as well. `unsigned long ptr` and `(uint16_t )ptr++ << 8` look wrong. It looks like you wanted to use a pointer.

http://stackoverflow.com/comment/139185172
type: Comment
comment on: http://stackoverflow.com/q/78940966
type: QuestionComment
score: 1
has text: You have made the whole question useless by removing the erroneous code and replacing it by the workging code. What help could any visitor gain from your question now? If you find the solution to your problem, do not vandalize your post but instead post it as an answer to your own question.

http://stackoverflow.com/q/79002609
answer count: 0
score: 0
has body: Is there a way to know when Crashlytics has finished sending report? There is a method sendUnsentReports, which can be used together with checkAndUpdateUnsentReportsWithCompletion method, but it just "Enqueues any unsent reports on the device to upload to Crashlytics", but how do I know when upload is finished?
type: Question
tagged with: swift
type: UnansweredQuestion
has title: Crashlytics notification that crash report sending is finished
tagged with: ios
tagged with: objective-c
tagged with: crashlytics

http://stackoverflow.com/q/78932369
score: 0
answer count: 0
tagged with: uikit
has title: How do you use UIKit to watch for clipboard changes in a Mac Catalyst console app in Objective-C?
tagged with: uipasteboard
tagged with: macos
has body: I'm trying to write a console app that uses UIKit that watches for clipboard changes. Here is the code so far: #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface TestClass : NSObject - (void) pasteboardChanged:(NSNotification *) notification; @end @implementation TestClass - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [super dealloc]; } - (id) init { self = [super init]; if (!self) return nil; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pasteboardChanged:) name:UIPasteboardChangedNotification object:nil]; return self; } - (void) pasteboardChanged:(NSNotification *) notification { printf("2\n"); } @end int main(){ printf("1\n"); TestClass* test = [[TestClass alloc] init]; printf("2\n"); [[NSRunLoop currentRunLoop] run]; printf("3\n"); /* dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul); dispatch_async(queue, ^{ TestClass* test = [[TestClass alloc] init]; // Perform async operation // Call your method/function here // Example: }); [NSThread sleepForTimeInterval:6000.0f]; */ } I compiled it with /usr/bin/clang test.m -F /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks -framework UIKit -target arm64-apple-ios13.4-macabi -framework Foundation. It runs, but it seems that the selector does not fire (eg, copying things do not fire the selector). Is there something I'm doing incorrectly?
type: Question
tagged with: mac-catalyst
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/a/79010692
upvote count: 1
has body: which isn't directly supported by Google yet Well, that depends what you mean by "Google" and "support". Are there any instructions or walkthroughs for how to create an iosMain / iosApp implementation of AdMob in a Kotlin Multiplatform (KMP) project? Probably nothing specific to AdMob. If what you're calling in common code is relatively limited, I'd create an interface in common with those calls, then implement Android in androidMain, and implement the iOS side in Swift. Interface, not expect/actual. Generally speaking, you won't use expect/actual much for classes/objects. If ever. Create an implementation of the Kotlin interface in Swift, and pass it in on app start. I gave a talk about bridging native apis a couple years ago: https://www.droidcon.com/2022/06/28/sdk-design-and-publishing-for-kotlin-multiplatform-mobile/
downvote count: 1
accepted answer of: http://stackoverflow.com/q/79010527
answers question: http://stackoverflow.com/q/79010527
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/comment/139340891
type: Comment
score: 0
comment on: http://stackoverflow.com/q/79023642
type: QuestionComment
has text: @Cy-4AH I do not use ARC, because there is `QT Purchasing` code in my project that does not use it and does `[objc_object release]` in destructors.

http://stackoverflow.com/comment/139184485
type: Comment
comment on: http://stackoverflow.com/q/78940966
score: 0
has text: As suggested by @Gerhardh `sizeof(stringAsChar)` would be the size of a pointer (probably 8 or 4 bytes), not the length of the string, assuming Objective C is anything like C.
type: QuestionComment

http://stackoverflow.com/a/79037670
accepted answer of: http://stackoverflow.com/q/79037340
answers question: http://stackoverflow.com/q/79037340
type: AcceptedAnswer
type: Answer
has body: You'll need to expose the UIView (in this case, the backgroundUIView) to your CustomHostingController. This can be done by passing a callback to the CustomButton, which lets the hosting controller know when a new UIView is created. try this: public struct BackgroundUIView: UIViewRepresentable { var onUIViewCreated: ((UIView) -> Void)? func makeUIView(context: Context) -> UIView { let view = UIView() view.backgroundColor = .blue onUIViewCreated?(view) return view } func updateUIView(_ uiView: UIView, context: Context) {} } public struct CustomButton: View { public var viewModel: ButtonViewModel public var index: Int public var onUIViewCreated: ((Int, UIView) -> Void)? public var body: some View { Button(action: viewModel.tapEvent) { ZStack { BackgroundUIView(onUIViewCreated: { view in onUIViewCreated?(index, view) }) Text(viewModel.title) } } } } public struct ContainerView: View { @ObservedObject var viewModel: ContainerViewModel var onUIViewCreated: ((Int, UIView) -> Void)? public var body: some View { LazyVStack { ForEach(viewModel.buttonViewModels.indices, id: \.self) { index in CustomButton(viewModel: viewModel.buttonViewModels[index], index: index, onUIViewCreated: onUIViewCreated) } } } } public class CustomHostingController: UIHostingController<ContainerView> { public var containerViewModel: ContainerViewModel private var buttonUIViews: [Int: UIView] = [:] public init(containerViewModel: ContainerViewModel) { self.containerViewModel = containerViewModel super.init(rootView: ContainerView(viewModel: containerViewModel, onUIViewCreated: { [weak self] index, uiView in self?.buttonUIViews[index] = uiView })) } @objc required dynamic init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } public func getButtonAtIndex(index: Int) -> UIView? { return buttonUIViews[index] } } and use like below: let hostingController = CustomHostingController(containerViewModel: yourViewModel) if let buttonView = hostingController.getButtonAtIndex(index…
score: 0

http://stackoverflow.com/comment/139184489
type: Comment
comment on: http://stackoverflow.com/q/78940966
score: 0
type: QuestionComment
has text: Hey Ingo - so do you think it's something related to the Obj-C code? would you mind posting your function for feeding the data and printing the result so I can compare what I have done to it?

http://stackoverflow.com/comment/139158328
type: QuestionComment
comment on: http://stackoverflow.com/q/78926432
has text: The protocol is still invisible to the objc class tho
type: Comment
score: 0

http://stackoverflow.com/comment/139263745
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78983850
has text: It is a strong reference. It does deallocate if I set the `textView` to nil, but only if I `release` it first.
score: 0

http://stackoverflow.com/comment/139152678
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78919977
has text: @user6631314 - if you're not familiar with it yet, use `Debug View Hierarchy` so you can inspect the UI at run-time.

http://stackoverflow.com/comment/139137423
score: 0
has text: We need some more information. Using your code, I set the text to **2400 characters** and don't get any "bleed." As a side note, the way your code is written, there is no reason to return a `UITextField` from your `styleAndAddBorderTo` method.
comment on: http://stackoverflow.com/q/78914923
type: QuestionComment
type: Comment

http://stackoverflow.com/q/79042128
has body: If screen is ideal for 5mins I set AutoLogout it works perfectly but when the UIAlert dialogue shows it logged out but the alert remains showed in the login screen. so below are the code to dismiss my alert dialogue before logout - (void)dismissAnyAlertControllerIfPresent { UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow; UIViewController *topVC = keyWindow.rootViewController.presentedViewController; while (topVC.presentedViewController != nil) { topVC = topVC.presentedViewController; } if ([topVC isKindOfClass:[UIAlertController class]]) { [topVC dismissViewControllerAnimated:NO completion:nil]; } } - (void)didLogout { [self dismissAnyAlertControllerIfPresent]; NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; [prefs removeObjectForKey:@"userName"]; [prefs synchronize]; // Redirect to login page [self redirectToLoginPage]; } - (void)redirectToLoginPage { if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main_iPhone" bundle:nil]; BmobileViewController * login = [storyboard instantiateViewControllerWithIdentifier:@"login"] ; login.hideBackbtn = YES; login.hideAutoLogoutMsg = YES; login.modalPresentationStyle = UIModalPresentationFullScreen; [self presentViewController:login animated:YES completion:nil]; } else { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main_iPad" bundle:nil]; BmobileViewController * login = [storyboard instantiateViewControllerWithIdentifier:@"login"] ; login.hideBackbtn = YES; login.hideAutoLogoutMsg = YES; login.modalPresentationStyle = UIModalPresentationFullScreen; [self presentViewController:login animated:YES completion:nil]; } } the code above which one diss miss the alert dialogue runs, then the screen becomes unresponsive if ([topVC isKindOfClass:[UIAlertController class]]) { [topVC dismissViewControllerAnimated:NO completion:nil]; } `if there is no alert dialogue on ideal state and logged out logi…
type: Question
answer count: 1
type: UnansweredQuestion
score: 0
tagged with: uikit
tagged with: ios
has title: After UIAlert dismiss my screen becomes unresponsive IOS
tagged with: objective-c
has comment: http://stackoverflow.com/comment/139411295
has answer: http://stackoverflow.com/a/79067514

http://stackoverflow.com/comment/139411295
score: 0
type: QuestionComment
has text: What calls `didLogout`?
comment on: http://stackoverflow.com/q/79042128
type: Comment

http://stackoverflow.com/comment/139354865
type: QuestionComment
has text: You need a specific commit for the swift package. It’s in the issues.
type: Comment
comment on: http://stackoverflow.com/q/79033269
score: 1

http://stackoverflow.com/comment/139250858
type: QuestionComment
comment on: http://stackoverflow.com/q/78975078
has text: Background view is for background, not for the content, content view frame is managed by the table view. In 99% of cases all you need to to with the cell can be done over the content view. Try to think it simple
type: Comment
score: 1

xcode16
tag name: xcode16
tags question: http://stackoverflow.com/q/78975833
type: Tag
tags question: http://stackoverflow.com/q/79027410
tags question: http://stackoverflow.com/q/79394234

http://stackoverflow.com/comment/139361527
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79037340
has text: You can’t SwiftUI Views are not meant to be accessed from the outside or from parents. Views don’t belong in properties.
type: Comment

clang++
tags question: http://stackoverflow.com/q/78965718
type: Tag
tag name: clang++

http://stackoverflow.com/comment/139184549
type: QuestionComment
comment on: http://stackoverflow.com/q/78940966
type: Comment
score: 1
has text: This is correct sizeof was returning 8, I hadn't realised that was how sizeof worked, I have changed it to the string length and it's all working now, thanks for your help!

http://stackoverflow.com/comment/139199384
has text: I can imagine some Javascript ping/pong where you call iOS on field activation, show the picker natively and sends picker results to the WebView, but I'm not sure this is the best way to do it. What about web-side validation with the field just turning red in case of wrong input, or just implement custom picker, easiest option - 2 separate option pickers for month and year and refilter of available month options on year pick
comment on: http://stackoverflow.com/q/78945375
score: 0
type: QuestionComment
type: Comment

mobile-development
tags question: http://stackoverflow.com/q/78930752
tag name: mobile-development
type: Tag

http://stackoverflow.com/comment/139383675
comment on: http://stackoverflow.com/a/79034518
has text: It didn't work for me too
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/139186640
type: Comment
comment on: http://stackoverflow.com/q/78940966
score: 0
has text: What is the string encoding and what does `defaultCStringEncoding` use? "You might sometimes need to use this encoding when interpreting user documents with unknown encodings, in the absence of other hints, but in general this encoding should be used rarely, if at all."
type: QuestionComment

http://stackoverflow.com/q/78983850
has comment: http://stackoverflow.com/comment/139274604
linked to: http://stackoverflow.com/q/12354230
linked to: http://stackoverflow.com/q/69929144
has body: I am learning to create a Cocoa application on Mac OS and have run into an issue with memory I don't quite understand. From what I've read with non-ARC is that you should be releasing anything you've allocated manually. However, I am running into issues with some classes not deallocating after being allocated and initialized. For example, NSTextView, if I manually try to release it, it will not deallocate. I am testing this by using my own implementation and overriding the dealloc function. As far as why, I plan to have my application be able to open and close Windows for debug and test suite runs; so I want to be able to destroy and remake the NSTextView with the Window if needed. However, I don't want to be leaking things when Windows are remade. @implementation MyCustomTextView - (void)dealloc { NSLog(@"MyCustomTextView deallocated"); [super dealloc]; } @end With my code being something like this: @autoreleasepool { self.textView = [[MyCustomTextView alloc] init]; } Then after callinge [self.textView release]; to release it my dealloc function does not get called. However, if I call [self.textView release]; twice, then it will trigger the deallocation. Why is that? It doesn't seem to do it with many classes, just a few, but most classes seem to call dealloc after one release call. Shouldn't it be 1:1 release for each allocation to get a deallocation? I know refcounts can increase due to internal behavior, but that they should be freed when the original allocation is released. It doesn't seem like the solution should be to trace the internals of a class to determine how to release it. It seems like either I'm doing something wrong or I am missing something, any help is appreciated!
tagged with: objective-c
tagged with: macos
answer count: 0
has comment: http://stackoverflow.com/comment/139279115
score: 0
has title: Deallocation for NSTextView in Objective-C
has comment: http://stackoverflow.com/comment/139263352
tagged with: cocoa
tagged with: automatic-ref-counting
type: Question
has comment: http://stackoverflow.com/comment/139263745
tagged with: refcounting
has comment: http://stackoverflow.com/comment/139266058
type: UnansweredQuestion

http://stackoverflow.com/a/79034518
answers question: http://stackoverflow.com/q/79034494
has comment: http://stackoverflow.com/comment/139383675
score: 0
type: Answer
has body: I solved this problem by following these steps: Open xcode (your project's ios folder or ios/Runner.xcworkspace) Select Runner Tap on Build Settings Find "Apple clang - Language - Modules" or you can just search "allow" You will see Allow non-modular Includes In Framework Modules - NO Change this to "YES" Then try to run your app again.
has comment: http://stackoverflow.com/comment/139360132

http://stackoverflow.com/comment/139339462
score: 0
type: QuestionComment
type: Comment
has text: @Gerhardh - I don't see the fix to use strlen() instead of sizeof().
comment on: http://stackoverflow.com/q/78940966

http://stackoverflow.com/comment/139833036
score: 0
comment on: http://stackoverflow.com/q/79046682
type: QuestionComment
type: Comment
has text: To avoid initializing `RTNViewStreamView` twice, it is recommended that you create a separate singleton class to hold the instance of `RTNViewStreamView`.

http://stackoverflow.com/a/79027692
has comment: http://stackoverflow.com/comment/139343682
has body: You can add an -ld64 flag to other linker flags (More info https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking)
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/79027410
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/79027410
score: 2

http://stackoverflow.com/comment/139184358
has text: Yes you are correct it was meant to have pointers I was playing around with it and I must have forgot to put it back to its original state. I have simplified the CRC16-CCITT FALSE function with one I have found online instead (now replaced in my question), which seems a bit better put together than my attempt! It's the Obj-C function which feeds the data and outputs the result (NSLog). Still getting a wrong result with the new crc16 function B415 instead of E272 now.
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/78940966
type: Comment

ubuntu
tag name: ubuntu
tags question: http://stackoverflow.com/q/78965718
type: Tag

digital-signature
type: Tag
tag name: digital-signature
tags question: http://stackoverflow.com/q/79013987

http://stackoverflow.com/q/78988312
has comment: http://stackoverflow.com/comment/139305182
has title: Trying to use GTMAppAuth in objectiveC project using cocoapods throws errors
type: Question
has body: I'm trying to use GTMAppAuth in my ObjectiveC project. In my podfile I use pod 'GTMAppAuth' platform: ios, '12.0' and use_frameworks! The Podfile seems to be installed and I can see the GTMAppAuth in my Pods, too. But when I try #import &lt;GTMAppAuth/GTMAppAuth.h&gt; I'm getting an error saying #import &lt;GTMAppAuth/GTMAppAuth.h&gt; file not found. Same goes for #import &lt;GTMAppAuth/GTMAppAuthFetcherAuthorization.h&gt;. What am I doing wrong?
tagged with: objective-c
type: UnansweredQuestion
score: 0
tagged with: cocoapods
has comment: http://stackoverflow.com/comment/139290680
answer count: 0

http://stackoverflow.com/comment/139360132
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79034518
score: 0
has text: Unfortunately, this didn't work for me. I also tried cleaning the build folder and deleting the DerivedData prior to rebuilding. Same error.

http://stackoverflow.com/comment/139144398
score: 0
comment on: http://stackoverflow.com/q/78914923
type: QuestionComment
has text: It's a storyboard project and I'm think something has gotten messed up in the storyboard. If I create a new simple down storyboard from scrach I imagine it will work proerly. But leaving aside autolayout and constraints can you confirm the normal ways to prevent bleeding are [myTextView.layer setMasksToBounds:YES]; [myTextView setClipsToBounds: YES]; and myTextView.translatesAutoresizingMaskIntoConstraints = NO; ?
type: Comment

http://stackoverflow.com/comment/139350827
score: 1
type: Comment
comment on: http://stackoverflow.com/q/79002502
type: QuestionComment
has text: It's because "Program ended with exit code: 0". You don't have NSRunLoop

http://stackoverflow.com/comment/139184527
type: QuestionComment
comment on: http://stackoverflow.com/q/78940966
score: 0
has text: Suggested by [this answer](https://stackoverflow.com/a/3846072/5264491): "If your string is a C-String then you can use `strlen(str)`." Which would become `strlen(stringAsChar)` for your code.
type: Comment

http://stackoverflow.com/comment/139376749
has text: From here you download the sample project. https://drive.google.com/file/d/1HRJ9Cdnj4vymbZojpU9OI-80L2mGuQ1s/view?usp=sharing You need to try it on your device. Once you run it you will see a button. When you tap on it, it will show you an action sheet with two options (Camera/Library) you need to select Camera and the rest is given in the question. I'll be waiting to hear from you soon.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/79029952

http://stackoverflow.com/comment/139341435
score: 0
has text: @Cy-4AH yes, it is `-fno-objc-arc` compiler flag (https://stackoverflow.com/a/18883995/2394762)
type: QuestionComment
comment on: http://stackoverflow.com/q/79023642
type: Comment

http://stackoverflow.com/comment/139383694
has text: The same issue can be found here: https://forums.developer.apple.com/forums/thread/764530
type: Comment
comment on: http://stackoverflow.com/q/79034494
score: 0
type: QuestionComment

http://stackoverflow.com/a/79084321
score: 0
answers question: http://stackoverflow.com/q/79007340
type: Answer
has body: The issue here is that Objective-C allows nullable pointers, and Swift has strict typing around optional and non-optional pointers. Since floatChannelData is of type UnsafePointer&lt;UnsafeMutablePointer&gt;, you can map it to the correct type using this conversion: if let floatChannelData = buffer.floatChannelData { // Convert the pointer to the expected form let data = UnsafePointer&lt;UnsafeMutablePointer&lt;Float&gt;?&gt;(floatChannelData) audioProcess(Int32(buffer.format.channelCount), numSamples: Int32(buffer.frameLength), stride: Int32(buffer.stride), data: data) } different UnsafePointer for Swift and Objective-C/C++

http://stackoverflow.com/comment/139154342
comment on: http://stackoverflow.com/a/78919977
has text: @user6631314 - `UITextContainerView` and `UITextLayoutView` are *parts* of `UITextView`. I fear the only way we're going to be able to help is for you to put together a [mre] and share the project.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/139305182
score: 0
type: QuestionComment
has text: Thanks, that sort of works. Seems like there are lots of deprecations in newser versions of GoogleSignIn. I get weird errors (handleUrl not working, for example). Do you have an idea where I find the latest examples for GIDSignIn?
comment on: http://stackoverflow.com/q/78988312
type: Comment

http://stackoverflow.com/comment/139152168
has text: Thank you! Setting colors as you suggest it appears there are two instances of the text. One in thee round green textView looks ok. Behind it however is another instance. However the text is set only once with textView.text = descript; and when I comment out the single setting of the text no text appears at all. When I hide the textview with textView.hidden = YES; both sets of text disappear. Therefore the second instance of text seems to be in the same textview.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/78919977

http://stackoverflow.com/comment/139152617
score: 1
comment on: http://stackoverflow.com/a/78919977
has text: @user6631314 - I have to wonder if you are creating and somehow "layering" multiple instances of your views? You've got some weird stuff going on with the gray lines *below* the text view: https://i.sstatic.net/BH4RXn9z.png
type: AnswerComment
type: Comment

http://stackoverflow.com/q/78990121
tagged with: objective-c
has body: a bit related to In Objective-C MRR, if foo is a retain property, then self.foo = [[Foo alloc] init] will need to be released immediately? suppose you have @property (nonatomic, readwrite, retain) NSObject *foo; In this case - (instancetype)initWithSomeObject:(NSObject)foo { self = [super init]; if (self != nil) { _foo = foo; } } would foo correctly get autoincremented as retain property attribute suggests it should? I initially wrote this as self.foo = foo; but for some reason folks on the team use the compact syntax that seemed more fitting in MRC times to avoid superfluous release for a n object newly created in the init context.
has title: Objective C ARC: _foo in constructor autoincrements or not?
linked to: http://stackoverflow.com/q/12354230
score: 0
has comment: http://stackoverflow.com/comment/139274686
type: Question
tagged with: reference-counting
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/139274725
answer count: 0

http://stackoverflow.com/comment/139184201
score: 0
has text: BTW: There is a code generator for CRC calculation with selectable algorithms and CRC models. see https://pycrc.org/
comment on: http://stackoverflow.com/q/78940966
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/139384441
type: Comment
has text: May be someone is setting `contentView` too?
score: 0
comment on: http://stackoverflow.com/q/79046682
type: QuestionComment

http://stackoverflow.com/q/79013987
tagged with: ios
tagged with: digital-signature
tagged with: objective-c
score: 0
has body: Sign verifier.m This file has the utility to verify the data #import "SignatureVerifier.h" #include \<Foundation/Foundation.h\> #import \<CommonCrypto/CommonCrypto.h\> @implementation SignatureVerifier - (BOOL)verifySignature:(NSString \*)jsonString signature:(NSData \*)signatureData publicKey:(SecKeyRef)publicKey hashFunction:(NSString \*)hashFunction { // Validate input parameters if (!jsonString || !signatureData || !publicKey) { NSLog(@"Error: Invalid input parameters"); return NO; } // Convert the JSON string to data (normalize if necessary) NSData \*jsonData = \[jsonString dataUsingEncoding:NSUTF8StringEncoding\]; NSLog(@"Json Data utf8: %@", jsonData); if (!jsonData) { NSLog(@"Error converting JSON string to data"); return NO; } // Hash the JSON data using SHA256 NSData \*hashedData = nil; if (\[hashFunction isEqualToString:@"SHA256"\]) { hashedData = \[self sha256HashForData:jsonData\]; NSLog(@"Hashed Data: %@", hashedData); } else { NSLog(@"Unsupported hash function: %@", hashFunction); return NO; } if (!hashedData) { NSLog(@"Error: Hashing failed"); return NO; } // Verify the signature CFErrorRef error = NULL; BOOL result = SecKeyVerifySignature( publicKey, kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA256, (\__bridge CFDataRef) hashedData, (\__bridge CFDataRef) signatureData, &error ); if (!result || error) { if (error) { CFStringRef errorDescription = CFErrorCopyDescription(error); NSLog(@"Error verifying signature: %@", errorDescription); CFRelease(errorDescription); } return NO; } NSLog(@"Signature successfully verified."); return YES; } - (NSData \*)sha256HashForData:(NSData \*)data { if (!data) { NSLog(@"Error: No data provided for hashing"); return nil; } uint8_t hash\[CC_SHA256_DIGEST_LENGTH\]; CC_SHA256(data.bytes, (CC_LONG)data.length, hash); return \[NSData dataWithBytes:hash length:CC_SHA256_DIGEST_LENGTH\]; } @end main.m This is the main file using the utility. Please consider the other utility function correct as they've been checked. #import…
tagged with: openssl
has comment: http://stackoverflow.com/comment/139333360
type: Question
has title: Unable to verify message from signature
tagged with: security
type: UnansweredQuestion
answer count: 0

http://stackoverflow.com/comment/139340783
score: 0
type: QuestionComment
has text: I would drop support for < iOS 13. You can probably reasonably drop support for < iOS 15
comment on: http://stackoverflow.com/q/79025566
type: Comment

http://stackoverflow.com/comment/139369643
has text: Yes I tried on a real device and I am getting this error everytime. I have a sample app created if you want to try it.
comment on: http://stackoverflow.com/q/79029952
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/q/78952984
tagged with: uislider
has body: When I run my iOS app on Apple Silicon Mac (ARM) in "Designed for iPad" mode, I'm not able to use a UISlider contained in a reorderable tableview cell. Dragging the slider triggers a reorder of the cell rather than sliding the slider. This behaves correctly on iOS devices: when I drag the slider, no reorder is triggered. I tried a Swift version which yields the same result. Here's how the UITableView is setup: [self.tableView setEditing:YES animated:YES]; [self.tableView setAllowsSelectionDuringEditing:YES]; Here's the cellForRowAtIndexPath implementation: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell*cell=[tableView dequeueReusableCellWithIdentifier:@"AddRow"]; if (cell == nil) cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"AddRow"] autorelease]; UISlider *slider = [[UISlider new] autorelease]; [cell.contentView addSubview:slider]; return cell; }
type: Question
upvote count: 1
answer count: 1
tagged with: uitableview
type: UnansweredQuestion
score: 1
downvote count: 0
favorite count: 0
tagged with: ios
has title: UISlider triggers reorder on Silicon Mac's UITableView
has answer: http://stackoverflow.com/a/78953513
tagged with: objective-c

http://stackoverflow.com/q/79037340
tagged with: instance
score: 0
accepted answer: http://stackoverflow.com/a/79037670
tagged with: swift
tagged with: xcode
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/79037670
tagged with: swiftui
has comment: http://stackoverflow.com/comment/139361527
type: Question
has body: I have a custom SwiftUI containerView which contains a set of SwiftUI buttons. The SwiftUI button contains a UIKit UIView which I need to be used by the main UIViewConroller. The code looks something like as below: public struct ContainerView: View { public var body: some View { LazyVStack { ForEach(viewModel.buttonViewModels, id:\.self) { buttonViewModel in CustomButton(buttonViewModel) } } } } public class CustomButton: View { public var backgroundUIView = BackgroundUIView() public var body: some View { Button(action: viewModel.tapEvent), label: { ZStack { backgroundUIView Text(viewModel.title) } } } public BackgroundUIView: UIViewRepresentable { func makeUIView(context: Context) -> UIView { let view = UIView() view.backgroundColor = .blue return view } public CustomHostingController: UIHostingController<ContainerView> { public var containerViewModel: ContainerViewModel public init?(containerViewModel: ContainerViewModel) { self.containerVieModel = containerViewModel super.init(rootView: ContainerView()) } } In CustomHostingController how can I access CustomButton at particular index I want something like this. extension CustomHostingController { func getButtonAtIndex(index: Int) -> CustomButton { rootView.body.subviews[index] } } I need to find the CustomButton instance at particular index in CustomHostingController. Tried to find a way to find Swiftui button at particular index in ContainerView. like extension CustomHostingController { func getButtonAtIndex(index: Int) -> CustomButton { rootView.body.*subviews[index]* } } In unlike UIKit in SwiftUI there is no way to do this subViews[at index]. How can I access CustomButton instance at particular index? I need access to CustomButton because CustomHostingController is a childViewController to a UIKit UIViewController, and I want to present a third party provided Popover controller (UIKit implementation) which requires the UIView as the source view for presenting it. The third party popover controller initializer …
answer count: 1
has title: How to access SwiftUI Button instance at particular index in LazyVStack which the rootView of a UIHostingController?
tagged with: objective-c

http://stackoverflow.com/comment/139247335
has text: *In general* you should not mess with the cell's `contentView`.
score: 2
comment on: http://stackoverflow.com/q/78975078
type: QuestionComment
type: Comment

clipstobounds
type: Tag
tag name: clipstobounds
tags question: http://stackoverflow.com/q/78914923

http://stackoverflow.com/comment/139152422
score: 0
type: AnswerComment
has text: When I scroll the text up and dowm it moves above and below the green so it appears there is only one instance of the text. It just is not respecting the boundaries or border layer of the text view.
type: Comment
comment on: http://stackoverflow.com/a/78919977

http://stackoverflow.com/q/78958789
tagged with: xcframework
has body: My team creates an xcframework, let's call it MyFramework. The framework uses just one class as an API, also called MyFramework. Until now, this framework has only contained ObjC code. However, we want to add a Swift file to support some SwiftUI stuff. In this Swift file, I want to add an extension to the MyFramework class. In my Swift file, I have something simple, like import SwiftUI import UIKit public extension MyFramework { func doStuff() { /// } } However, this doesn't build because the swift file can't find MyFramework. I experimented with adding a bridging header, which allows the framework to build. However, this doesn't seem to generate a .swiftinterface file, which means a test app can't find the doStuff() function. In further investigation, it seems that bridging headers aren't permitted in frameworks? I attempted to manually construct a .swiftinterface file, with no success. I then enabled Build Libraries for Distribution, which seems to be recommended for this situation. However, this requires that the bridging header be removed, which means that the swift file can't find MyFramework again. Online reading suggests that a modulemap is supposed to fix this, but I already have a modulemap, which looks like framework module MyFramework { umbrella header "MyFramework.h" export * } But this doesn't seem to affect the build at all. My understanding of modulemaps may be flawed, but I thought they were intended to expose ObjC code to Swift APPS, not necessarily when building the framework in the first place. Does anyone have any advice on how I can do this? I could resort to creating a separate framework for the swift portion, but I'd really rather not do that if at all possible.
tagged with: ios
has comment: http://stackoverflow.com/comment/139217585
tagged with: objective-c
has title: Swift extension to an ObjC class inside the same framework
answer count: 0
score: 0
tagged with: frameworks
type: Question
tagged with: swift
type: UnansweredQuestion

http://stackoverflow.com/comment/139440311
type: QuestionComment
comment on: http://stackoverflow.com/q/79029952
has text: I tried on iOS 18 works without problem
type: Comment
score: 0

http://stackoverflow.com/comment/139333360
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79013987
has text: Please include at least the openssl commands you used for verifying.
type: Comment

http://stackoverflow.com/comment/139353593
has text: https://github.com/parse-community/Parse-SDK-iOS-OSX/issues/1792
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/79033269

http://stackoverflow.com/comment/139263352
score: 0
type: QuestionComment
has text: Is `self.textView` a strong property and retaining the text view? What happens when you do `self.textView = nil;`?
type: Comment
comment on: http://stackoverflow.com/q/78983850

reference-counting
type: Tag
tag name: reference-counting
tags question: http://stackoverflow.com/q/78990121

http://stackoverflow.com/a/79067514
downvote count: 0
score: 1
type: Answer
answers question: http://stackoverflow.com/q/79042128
upvote count: 1
has body: UIAlertController is dismissed automatically when user taps any action button from it. So just do what you want in the action handler, like proceeding logout with the method -didLogout, but don't try to manually dismiss the alert.

http://stackoverflow.com/comment/139184425
has text: I've compiled xour `crc16()` in pure c and have compared some results like 1234567890 with the online calculator you've linked to and I get the same results
type: Comment
comment on: http://stackoverflow.com/q/78940966
score: 0
type: QuestionComment

refcounting
tags question: http://stackoverflow.com/q/78983850
tag name: refcounting
type: Tag

http://stackoverflow.com/comment/139336319
has text: Found some examples: https://developernote.com/2024/09/examples-of-c-objective-c-interop/. Can they help?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79023642
type: Comment

http://stackoverflow.com/comment/139211642
score: 0
comment on: http://stackoverflow.com/a/78953513
has text: Yes, possibly. But on iOS, one can only reorder the cells by dragging the burger icon, and thus the slider is usable even when the table is editing. In my view, that is the correct behavior. Whichever way is correct, it doesn't behave the same between iOS and Mac, which is a shame.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/78953513
has body: [self.tableView setEditing:YES animated:YES]; Well, there's your problem. Being able to edit, meaning that the user can rearrange or delete cells, is incompatible with the notion of being able to do things in the cell. Just the opposite: the slider should be disabled when the cell/table is in edit mode.
type: Answer
has comment: http://stackoverflow.com/comment/139211642
upvote count: 1
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/78952984

http://stackoverflow.com/comment/139274686
type: QuestionComment
has text: you just need `@property (nonatomic) NSObject *foo;`
score: 1
type: Comment
comment on: http://stackoverflow.com/q/78990121

http://stackoverflow.com/comment/139181398
type: Comment
has text: Is `+keyPathsForValuesAffecting…` implemented? Have you tried reproducing the issue in a [mre]?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/78937053

http://stackoverflow.com/q/79002469
tagged with: swiftui
answer count: 0
has comment: http://stackoverflow.com/comment/139298803
tagged with: ios
has body: we have created a function that is expanding copy module to support html format. Everything inside that function works fine but on 17.4+ iOS versions copying the html element strike-through or tag is not working (other HTML elements are working fine). Looking the logs seems like are getting stripped. Also list that have indents won't work on paste indent is missing. Does anyone know fix for this or when this will be fixed or will it be fixed in next update? void copyToClipboard(NSString *htmlContent) { UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; [pasteboard setValue:htmlContent forPasteboardType:@"public.html"]; }
score: 0
tagged with: objective-c
has title: iOS 17.4 + version bug when copying and pasting HTML (rich) text
type: Question
tagged with: swift
type: UnansweredQuestion

http://stackoverflow.com/comment/139185644
type: QuestionComment
type: Comment
has text: Ok, the issue appears when the observed object was not "realized" (a fault) before it was observed. If any attribute is accessed before observation, the issue does not occur.
comment on: http://stackoverflow.com/q/78937053
score: 0

http://stackoverflow.com/comment/139290680
comment on: http://stackoverflow.com/q/78988312
type: QuestionComment
has text: use more modern syntax for importing modules `@import GTMAppAuth;`
type: Comment
score: 0

http://stackoverflow.com/q/79044693
tagged with: ios
tagged with: javascript
tagged with: objective-c
tagged with: carplay
has body: I'm developing a React Native app with CarPlay support using the react-native-carplay library. The CarPlay interface works correctly when the phone app is open, but it fails to load the JavaScript when the phone app is closed. Currently, the CarPlay does not load the JS when the app is open either, although that is something easier to fix. I already tried adhering to this README, although to little avail. // AppDelegate.mm (redacted and consolidated) @implementation AppDelegate - (BOOL)initAppFromScene:(UISceneConnectionOptions *)connectionOptions { if (self.rootView == nil) { self.rootViewFactory = [self createRCTRootViewFactory]; NSDictionary *initProps = [self prepareInitialProps]; self.rootView = [self.rootViewFactory viewWithModuleName:self.moduleName initialProperties:initProps launchOptions:[self connectionOptionsToLaunchOptions:connectionOptions]]; return YES; } return NO; } // Other necessary methods... @end // CarSceneDelegate.mm (redacted and consolidated) @implementation CarSceneDelegate - (void)templateApplicationScene:(CPTemplateApplicationScene *)templateApplicationScene didConnectInterfaceController:(CPInterfaceController *)interfaceController { AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; [appDelegate initAppFromScene:nil]; UIView *carPlayRootView = [appDelegate.rootViewFactory viewWithModuleName:@"CarPlayApp" initialProperties:nil launchOptions:nil]; UIViewController *rootViewController = appDelegate.createRootViewController; [appDelegate setRootView:appDelegate.rootView toRootViewController:rootViewController]; CPWindow *carWindow = templateApplicationScene.carWindow; carWindow.rootViewController = rootViewController; [carPlayRootView setFrame:carWindow.bounds]; [carWindow addSubview:carPlayRootView]; [RNCarPlay connectWithInterfaceController:interfaceController window:carWindow]; } // Other necessary methods... @end // SceneDelegate.mm (redacted and consolidated) @implementation SceneDelegate - (void)sce…
has comment: http://stackoverflow.com/comment/139376152
has answer: http://stackoverflow.com/a/79045660
score: 0
tagged with: react-native
type: Question
answer count: 1
has title: React Native CarPlay app not loading JavaScript when phone app is closed
type: UnansweredQuestion

http://stackoverflow.com/comment/139266058
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/78983850
has text: Are you using Objective-C as some sort of archaeological / historical exploration? This seems an odd way to "learn to create a Cocoa application".
score: 2

http://stackoverflow.com/comment/139392180
score: 0
has text: I tried it. It's just like you wrote, but I don't get the error, I took a photo then selected the photo and got “success” in the log (Without any changes in code, just change deployment target to 16.6) Maybe the problem is in the read accesses from the specified directory ? System Info: iOS 17.6.1 Developer mode on
type: QuestionComment
comment on: http://stackoverflow.com/q/79029952
type: Comment

http://stackoverflow.com/a/79045660
answers question: http://stackoverflow.com/q/79044693
score: 0
type: Answer
has body: The issue is not from not from iOS code. The issue you are facing is because the JAVASCRIPT. if don't know then let me tell you that javascript does not run in the background because of JavaScript thread is tied to the UI thread. The second thing, iOS will pause your app in background. Try the library that provides support to run react-native (javascript) in the background. Try BackgroundTimer or Background-Task Hope this will help you.

http://stackoverflow.com/comment/139355761
type: Comment
has text: If it's any comfort, you're not alone: https://developer.apple.com/forums/thread/681946
comment on: http://stackoverflow.com/q/79034494
type: QuestionComment
score: 1

http://stackoverflow.com/a/79163874
type: Answer
score: 0
answers question: http://stackoverflow.com/q/79007074
has body: As for my understanding (I'm not a dev), when faced with that kind of errors (FP, Cocoa), it usually could point to a few things: App blocked from accessing fp/cocoa (perms) Network/connectivity/not enough required system resources FP/Cocoa is failing and restarting but the app cannot resume the connection with service. I know that's not a lot, but hopefully, it will point you in the right direction.

http://stackoverflow.com/a/79290261
answers question: http://stackoverflow.com/q/78975833
has body: I finally solved this. My app had three Objective-C breakpoints. I don't remember what they're for and probably don't need them since I rewrote the app in Swift. I did find this old SO post that I had upvoted, so that's probably what prompted me to add the objc_autoreaseNoPool breakpoint. Anyway, when I removed that breakpoint, the problem immediately disappeared. Now I can finally debug on iOS 18 and macOS 15.
type: Answer
score: 0

http://stackoverflow.com/a/79044003
answers question: http://stackoverflow.com/q/79034989
has body: I ended up implementing a different Keychain approach, using the Apple-provided KeychainItemWrapper to simplify Keychain operations. - (void)storeAuthState:(OIDAuthState *)authState { NSError *errRet; NSData *authStateData = [NSKeyedArchiver archivedDataWithRootObject:authState requiringSecureCoding:NO error:&amp;errRet]; KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:@&quot;&lt;your ID here&gt;&quot; accessGroup:nil]; [keychainItem setObject:authStateData forKey:(id)kSecAttrAccount]; } - (OIDAuthState *)retrieveAuthState { NSError *errRet; KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:@&quot;&lt;your ID here&gt;&quot; accessGroup:nil]; NSData *data = [keychainItem objectForKey:(id)kSecAttrAccount]; OIDAuthState *authState = [NSKeyedUnarchiver unarchivedObjectOfClass:[OIDAuthState class] fromData:data error:&amp;errRet]; return authState; }
score: 0
accepted answer of: http://stackoverflow.com/q/79034989
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/139318551
comment on: http://stackoverflow.com/a/79013633
type: AnswerComment
type: Comment
has text: Thanks for your suggestion, but it still doesn't work .
score: 0

crc16
tag name: crc16
type: Tag
tags question: http://stackoverflow.com/q/78940966

http://stackoverflow.com/comment/139325748
has text: On stackoverflow, you are welcome to answer your own questions, see https://stackoverflow.com/help/self-answer. However, the answer should be posted as a reply to your question. That way, you can accept your own answer after 48 hours and it will be marked with a green tick.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/79017759
type: Comment

http://stackoverflow.com/comment/139403714
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79029952
type: Comment
has text: Can you try using the latest iOS 18?

ocmock
tags question: http://stackoverflow.com/q/79056995
type: Tag
tag name: ocmock

http://stackoverflow.com/comment/139336695
score: 0
type: AnswerComment
has text: `AdHolder` itself is a C++ controlled memory that stores the Objective-C pointer, right?
type: Comment
comment on: http://stackoverflow.com/a/79023661

http://stackoverflow.com/comment/139295227
type: QuestionComment
has text: Please provide enough code so others can better understand or reproduce the problem.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/79001091

http://stackoverflow.com/comment/139220201
type: QuestionComment
has text: This definitely looks like a bug. -1 (ascending) is correct given how Finder orders these filenames. I've reproduced this many ways, including in Swift, and the second and subsequent calls are all incorrect. I would open a Feedback about it. Especially since only the first call is correct, I don't see a way to work around this (you can't "prime" the system by just making a comparison and throw it away).
type: Comment
comment on: http://stackoverflow.com/q/78960444
score: 2

key-value-observing
tag name: key-value-observing
tags question: http://stackoverflow.com/q/78937053
type: Tag

http://stackoverflow.com/a/79077043
score: 1
answers question: http://stackoverflow.com/q/79034494
has body: The issue with me was that my project included openSSL static libs and among the include headers was a file "ctype.h", that has the same name as the one of the files in macOS SDK /usr/include folder. So, yeah, it has to do with "search and discovery" phase of the compiler. I packed openSSL as a framework and added it to the project, solved this mix-up.
has comment: http://stackoverflow.com/comment/139453227
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/79034494
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/79034348
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/79033269
answers question: http://stackoverflow.com/q/79033269
has body: We ran into the same issue. Simple fix is to register your PFObject classes at app start. On macOS Swift, it can be done here. func applicationDidFinishLaunching(_ aNotification: Notification) { // Insert code here to initialize your application PFInstallation.registerSubclass() PFUser.registerSubclass() PFSession.registerSubclass() PersonClass.registerSubclass() } we found it to be more convenient to do it here: override func viewDidLoad() { super.viewDidLoad() let configuration = ParseClientConfiguration { $0.applicationId = Constants.PARSE_APPLICATION_ID $0.clientKey = Constants.PARSE_CLIENT_KEY $0.server = Constants.PARSE_SERVER } Parse.initialize(with: configuration) PFInstallation.registerSubclass() PFUser.registerSubclass() PFSession.registerSubclass() PersonClass.registerSubclass() } assuming your classes, like our PersonClass above, conforms to the PFObject, PFSubclassing protocols

openssl
type: Tag
tags question: http://stackoverflow.com/q/79013987
tag name: openssl

http://stackoverflow.com/q/79013614
has title: The app will crash on IOS 18 when send a network request
tagged with: ios
type: Question
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/79013633
has body: The code like this: NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; configuration.URLCache = [[NSURLCache alloc] initWithMemoryCapacity:20 * 1024 * 1024 diskCapacity:100 * 1024 * 1024 diskPath:@"myCache"]; if (!configuration) { NSLog(@"Failed to create session configuration."); return; } NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration]; if (!session) { NSLog(@"Failed to create session."); return; } NSURL *url = [NSURL URLWithString:@"https://example.com"]; if (!url) { NSLog(@"Invalid URL."); return; } NSURLRequest *request = [NSURLRequest requestWithURL:url]; if (!request) { NSLog(@"Failed to create request."); return; } NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { if (error) { NSLog(@"Error: %@", error.localizedDescription); } else { NSLog(@"Data received: %@", data); } }]; if (!dataTask) { NSLog(@"Failed to create data task."); return; } dataTask.priority = NSURLSessionTaskPriorityDefault; [dataTask resume]; the error message: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSFileManager createDirectoryAtURL:withIntermediateDirectories:attributes:error:]: URL is nil' *** First throw call stack: (0x1848bd08c 0x181bbf2e4 0x183585f48 0x185d2f2bc 0x185d2ec7c 0x10709271c 0x1070a3f04 0x185d2ea88 0x185d2db20 0x185d2d5f4 0x185d2d07c 0x185d274b0 0x185dd82c4 0x185dd8214 0x185dd730c 0x107090a30 0x10709271c 0x10709a5e8 0x10709b394 0x10709cb20 0x1070a85f0 0x1070a7c00 0x20bc27c7c 0x20bc24488) libc++abi: terminating due to uncaught exception of type NSException the network request could be worked well under ios 18
score: 0

keychain
tags question: http://stackoverflow.com/q/79023265
tag name: keychain
type: Tag
tags question: http://stackoverflow.com/q/79217908
tags question: http://stackoverflow.com/q/79374739

http://stackoverflow.com/comment/139416284
comment on: http://stackoverflow.com/q/79046682
type: QuestionComment
score: 0
has text: What do you mean with the comment "Not work" when you set background color?
type: Comment

http://stackoverflow.com/q/78930752
tagged with: ios
score: 0
has title: How to control AVAudioPlayer volume when AVAudioSession category is PlayAndRecord
tagged with: objective-c
type: Question
type: UnansweredQuestion
tagged with: mobile-development
answer count: 0
has body: I'm building an iOS app that only allows you to listen to audio through the builtInReceiver when the proximity sensor is activated, like so: @interface CDVAudioPlayer : AVAudioPlayer { NSString* mediaId; } ---- self.avSession = [AVAudioSession sharedInstance]; audioFile.player = [[CDVAudioPlayer alloc] initWithContentsOfURL:resourceURL error:&amp;playerError]; ---- [self.avSession setCategory:AVAudioSessionCategoryPlayAndRecord mode:AVAudioSessionModeDefault options:0 error:&amp;err]; [self.avSession setActive:true error:&amp;err]; [self.avSession overrideOutputAudioPort:AVAudioSessionPortOverrideNone error:&amp;err]; This works fine, except that when the proximity sensor is activated an the audio plays through the builtInReceiver the hardware volume buttons switch to in-call, thus having no effect on the AVAudioPlayer. Is there a way where I can let the in-call volume control the AVAudioPlayer?

http://stackoverflow.com/comment/139341199
comment on: http://stackoverflow.com/q/79023642
type: Comment
has text: You can disable `ARC` for particular files and use `#if __has_feature(objc_arc)` to check is it on
score: 1
type: QuestionComment

http://stackoverflow.com/comment/139138046
comment on: http://stackoverflow.com/q/78914923
type: QuestionComment
has text: That must be happening due to code you are not showing us. Strip down your code (or comment-out sections) until you have a [mre].
score: 0
type: Comment

http://stackoverflow.com/a/79009857
answers question: http://stackoverflow.com/q/79009379
score: 0
type: Answer
has body: I changed Podfile with this: source 'https://github.com/CocoaPods/Specs.git' platform :ios, :deployment_target =&gt; '14.0' target 'MyApp' do pod 'YandexMobileAdsMediation', '7.5.1' end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0' end end end and was able to compile my .mm file with #import &lt;YandexMobileAds/YandexMobileAds-Swift.h&gt; But I still do not understand well enough what this Podfile does.

yandex
tag name: yandex
tags question: http://stackoverflow.com/q/79009379
type: Tag

crc
type: Tag
tag name: crc
tags question: http://stackoverflow.com/q/78940966

admob
tags question: http://stackoverflow.com/q/79010527
tag name: admob
type: Tag

http://stackoverflow.com/comment/139711036
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/79228527
has text: @MartinR This certainly isn't the first time Apple has deprecated something and the supposed replacement isn't really a valid replacement. Oh well.

http://stackoverflow.com/q/79103337
tagged with: google-mlkit
has body: I'm developing an app using Kotlin Multiplatform and Googles MLKit for barcode scanning. I'm unable to create a VisionImage in the captureOutput method of a AVCaptureVideoDataOutputSampleBufferDelegate. When trying, I am encountering periodic freezes every 15 frames for 10 seconds. In my CameraViewController (iosMain) class CameraViewController( private val onQRCodeDetected: (String) -> Unit ) : UIViewController(null, null), AVCaptureVideoDataOutputSampleBufferDelegateProtocol { I overwrite captureOutput override fun captureOutput( output: AVCaptureOutput, didOutputSampleBuffer: CMSampleBufferRef?, fromConnection: AVCaptureConnection ) { frameCounter+=1 logging("CViewC").i { "FRAME #$frameCounter" } so far everything works perfect. captureOutput gets called each frame in time and logs the framecount. When I add the following line things break. val visionImage = MLKVisionImage(didOutputSampleBuffer) Now the first 15 calles of captureOutput are ok. During this duration the preview on the phone works fluent. Then the preview freezes and captureOutput is not called. This lasts for 10 seconds. After the 10 seconds I receive again 15 frames normally. This cicle goes on and the app never crashes. When I add now the line CFRelease(didOutputSampleBuffer) I get a continuous flow of 288 frames until a crash. The crash report indicates that I tried to release an already released buffer(Detected over-release of a CFTypeRef %p (%lu / %s)). I tried to copy the Buffer: val copiedBufferVar = nativeHeap.alloc<CMSampleBufferRefVar>() CMSampleBufferCreateCopy( allocator = kCFAllocatorDefault, sbuf = didOutputSampleBuffer, sampleBufferOut = copiedBufferVar.ptr ) val visionImage = MLKVisionImage(didOutputSampleBuffer.value) CFRelease(copiedBufferVar.value) Since I assumed the Buffers were not released from memory because of the strong reference of the VisionImage to the Buffer. (I don't know if that makes sense - I desperately tried to make sense of something). This resulted in the same …
downvote count: 0
tagged with: ios
upvote count: 2
tagged with: objective-c
answer count: 1
has answer: http://stackoverflow.com/a/79207327
tagged with: kotlin
favorite count: 0
tagged with: avfoundation
score: 2
type: Question
has title: iOS Camera Freezes and Crashes with MLKit Barcode Scanning in Kotlin Multiplatform
type: UnansweredQuestion

rctbridge
tag name: rctbridge
tags question: http://stackoverflow.com/q/79228371
type: Tag

http://stackoverflow.com/q/79240177
favorite count: 0
tagged with: uiviewanimation
tagged with: ios
downvote count: 1
answer count: 1
tagged with: objective-c
upvote count: 1
has comment: http://stackoverflow.com/comment/139730946
tagged with: uiview
has answer: http://stackoverflow.com/a/79241740
score: 0
has title: How to animate an UIView by setting its frame that has auto layout constraints?
type: Question
type: UnansweredQuestion
has body: I have a UIView subclass called MyView as such @implementation MyView { UIView&lt;SomeImageProtocol&gt; *_imageView; } - (instancetype) init { if (self = super) { _imageView = ... [self addSubview:_imageView]; } } ... - (void)layoutSubviews { [super layoutSubviews]; _imageView.frame = self.bounds; } .. In my MyViewController, I want to trigger some image animation, i.e shrinking in size: -(void)viewDidLoad { _dwellTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(animateView) userInfo:nil repeats:NO]; } - (void)animateView { [myView animateOnImage]; } In MyView class, animation doesn't seem to work when I set _imageView's frames, but when I set its opacity like .alpha or .layer.cornerRadius, it works just fine. The resources I came across online suggested that _imageView has Auto Layout constraints and its frame is still controlled by I have specified in layoutSubviews. The animation seems to always end in Auto Layout. -(void)animateOnImage { [UIView animateWithDuration:2 animations:^{ [self shrinkImageView]; }]; } - (void)shrinkImageView { // Doesn't work _imageView.frame = CGRectMake(100, 100, 400, 500); // Works _imageView.alpha = 0.5; }

http://stackoverflow.com/q/79072182
has comment: http://stackoverflow.com/comment/139424927
tagged with: ios
score: 0
tagged with: subscription
has body: As the title states, I'm looking for the correct format of the Apple auto-renewable subscription "expires_date". The "expires_date" field comes from App Store receipt json data. for example: [{ "quantity": "1", "product_id": "test2", "transaction_id": "1000000472106082", "original_transaction_id": "1000000472106082", "purchase_date": "2018-11-13 16:46:31 Etc/GMT", "purchase_date_ms": "1542127591000", "purchase_date_pst": "2018-11-13 08:46:31 America/Los_Angeles", "original_purchase_date": "2018-11-13 16:46:31 Etc/GMT", "original_purchase_date_ms": "1542127591000", "original_purchase_date_pst": "2018-11-13 08:46:31 America/Los_Angeles", "is_trial_period": "false", "expires_date" : "2023-05-24 18:01:31 Etc/GMT" }] I'm using: @"yyyy-MM-dd HH:mm:ss VV" I see generally see dates like: 2023-05-24 18:01:31 Etc/GMT This appears to work most of the time. However, there are cases where it appears to be failing, generally, but not always I see more failures from iOS devices in the UK. I don't know what the date string looks like in those cases, unfortunately, as this code is being performed on the device. There is no information on the apple developer site as to the correct format. There is a deprecated document that states its RFC3339 date format. However, this is not correct. It is also not ISO8601 format. BTW, here's basically the code I'm using. NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease]; formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss VV"; formatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]; NSDate* expireDate = [formatter dateFromString:expireDate]; I then compare it to now with a date created like: NSDate* nowDate = [NSDate date]; if(([nowDate compare:expireDate] == NSOrderedDescending) || ([nowDate compare:bufferDate] == NSOrderedSame)) { //the subscription has expired retVal = true; } Like I said a vast majority of the time the format I provided works, but occasionally it does not. So I suspect an issue with the fo…
type: Question
type: UnansweredQuestion
tagged with: in-app-purchase
tagged with: objective-c
answer count: 0
has title: Correct format of Apple auto-renewable subscription expires_date

http://stackoverflow.com/comment/139679596
type: Comment
comment on: http://stackoverflow.com/a/79190404
score: 0
has text: @user9398585 -- *"'v' and 'y' type curves"* -- I considered that. I added code to log any of those, but have not found a PDF that contain them. Some quick searching indicates it's unusual. There is a lot about PDF path/shape data that I am not familiar with. For example, if I create a PDF from either Sketch or InkScape... if I have a shape with both Fill and Border, my "extract path" code gets two paths, with the Border path inverted on the y-axis...
type: AnswerComment

http://stackoverflow.com/q/79149592
downvote count: 1
tagged with: xcode
answer count: 1
upvote count: 3
has title: How to use EditorConfig with Xcode?
type: Question
tagged with: swift
has answer: http://stackoverflow.com/a/79149593
accepted answer: http://stackoverflow.com/a/79149593
score: 2
has body: With the release of Xcode 16 apple added support for EditorConfig: Added support for EditorConfig. The editor now respects indentation settings given in .editorconfig files. Xcode supports the following settings: indent_style, tab_width, indent_size, end_of_line, insert_final_newline, max_line_length, and trim_trailing_whitespace. See https://editorconfig.org for more information. Settings from .editorconfig files normally take precedence over settings given in the “Text Editing” section of View &gt; Inspectors &gt; File for a file or group. This can be disabled by unchecking the “Prefer Settings from EditorConfig” checkbox on the Indentation tab of Xcode &gt; Settings &gt; Text Editing. (20796230) In my project I create a new .editorconfig file under root directory: # EditorConfig is awesome: https://EditorConfig.org # top-most EditorConfig file root = true [*] end_of_line = lf charset = utf-8 trim_trailing_whitespace = false insert_final_newline = false [*.swift] indent_style = space indent_size = 4 [*.{h, m, mm}] indent_style = space indent_size = 4 [*.metal] indent_style = space indent_size = 4 However, when I try to re-indent, it's not working
favorite count: 0
tagged with: editorconfig
tagged with: metal
type: AnsweredQuestion
tagged with: objective-c

http://stackoverflow.com/comment/139569345
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79100724
has text: @Willeke seems like the workaround is calling `[[self mutableArrayValueForKey:@"myMutableArray"] addObject: newObject];` every time I add a new element, I suppose this complies with KVO...
score: 0

http://stackoverflow.com/a/79228527
accepted answer of: http://stackoverflow.com/q/79218608
has body: Here's code, using deprecated functions (but there's no modern alternative, apparently): #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" NSData* icnsOfFileAtPath (NSString *path) { // based on https://github.com/sveinbjornt/IconFamily CFURLRef urlRef = CFURLCreateWithFileSystemPath (kCFAllocatorDefault, (CFStringRef)path, kCFURLPOSIXPathStyle, false); if (!urlRef) { return nil; } FSRef fsRef; bool ok = CFURLGetFSRef (urlRef, &fsRef); CFRelease (urlRef); if (!ok) { return nil; } IconRef iconRef; SInt16 label; OSStatus res = GetIconRefFromFileInfo (&fsRef, 0, NULL, kFSCatInfoNone, NULL, kIconServicesNormalUsageFlag, &iconRef, &label); if (res) { return nil; } IconFamilyHandle ifh; res = IconRefToIconFamily (iconRef, kSelectorAllAvailableData, &ifh); ReleaseIconRef (iconRef); NSData *icns = [NSData dataWithBytes:*ifh length:GetHandleSize((Handle)ifh)]; DisposeHandle ((Handle)ifh); return icns; } #pragma clang diagnostic pop
has comment: http://stackoverflow.com/comment/139711036
has comment: http://stackoverflow.com/comment/139710992
has comment: http://stackoverflow.com/comment/139718242
has comment: http://stackoverflow.com/comment/139721860
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/79218608
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/139710274
score: 1
has comment: http://stackoverflow.com/comment/139713309

http://stackoverflow.com/comment/139424927
score: 0
has text: You don't say where you are obtaining this date from, but are you looking for https://developer.apple.com/documentation/foundation/nsiso8601dateformatter?language=objc ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/79072182

http://stackoverflow.com/q/79177378
tagged with: ios
tagged with: kotlin-multiplatform
has body: I am developing a feature for my app where user can upload a PDF from shared storage in device (Drive, onDrive, Dropbox,..) I am using Kotlin Multiplatform 2.0.20 This is the code i am using to upload the PDF for iOS, it works fine for files selected from iCloud, Downloaded locally in the device and Dropbox but NOT for Google Drive and OneDrive val documentPickerController = UIDocumentPickerViewController( forOpeningContentTypes = listOf(UTTypePDF) ) documentPickerController.allowsMultipleSelection = false val documentDelegate = remember { object : NSObject(), UIDocumentPickerDelegateProtocol { override fun documentPicker( controller: UIDocumentPickerViewController, didPickDocumentAtURL: NSURL ) { val accessing = didPickDocumentAtURL.startAccessingSecurityScopedResource() val data = try { NSData.dataWithContentsOfURL(didPickDocumentAtURL) } catch (e: Error) { e.printStackTrace() null } if (accessing == true) { didPickDocumentAtURL.stopAccessingSecurityScopedResource() } controller.dismissViewControllerAnimated(true, null) } } } When debugging i find that the problem in this line : NSData.dataWithContentsOfURL(didPickDocumentAtURL) it returns null no exception is thrown and even putting it in try/catch block did't help to understand the error behind the null value. I don't have an expert knowledge of ObjectiveC or Swift so i am reaching out for your help :) I found this is exactly a similar issue: https://www.hackingwithswift.com/forums/swiftui/error-domain-nsposixerrordomain-code-2-no-such-file-or-directory-when-using-fileimporter-then-read-the-content/20397 except they use SwiftUI, but i am not so i wonder how can i fix it in my case. I appreciate if someone faced similar issue and can share his/her thoughts :) Thank you!
score: 0
has comment: http://stackoverflow.com/comment/139637345
has answer: http://stackoverflow.com/a/79203030
answer count: 2
tagged with: objective-c
has comment: http://stackoverflow.com/comment/139617809
type: Question
tagged with: swift
has comment: http://stackoverflow.com/comment/139618068
has answer: http://stackoverflow.com/a/79179769
accepted answer: http://stackoverflow.com/a/79203030
type: AnsweredQuestion
has title: Upload PDF from shared local storage in iOS (Drive, OneDrive, Dropbox..) to server with Ktor Fails
tagged with: file-upload
has comment: http://stackoverflow.com/comment/139618078
possible better answer: http://stackoverflow.com/a/79179769

http://stackoverflow.com/comment/139583994
type: QuestionComment
has text: You might be better off converting your Airplane "icons" to `CGPath` and then scaling / rotating the path for use as `CAShapeLayer`. As an example, I used that PDF to create a path -- various sizing: https://i.sstatic.net/AJUXwbL8.png -- and then `40x40` with rotation and positioning: https://i.sstatic.net/cwRNflYg.png ...
score: 0
type: Comment
comment on: http://stackoverflow.com/q/79135341

http://stackoverflow.com/q/79195432
type: Question
type: UnansweredQuestion
tagged with: ios
score: 0
tagged with: sdk
tagged with: virtual-machine
tagged with: objective-c
has body: Even though everything is perfect and set up correctly, the accessToken is not returning. I'm running my project in xCode on WmWare I'm testing it on a real device, I'm connected to the PC via cable. I am switching my application to Spotify, and after approval for the authorize process, it returns to the application, but the accessToken returns nil every time. I am sure that my code verifier code challenge client id, client secret and redirect uri data are correct. return Warning : Failed to initiate session: invalid_grant Error domain: com.spotify.sdk.login Error code: 1 User Info: { NSLocalizedDescription = "invalid_grant"; } Please Help Me
tagged with: spotify
answer count: 0
has title: I cannot access the access token in SessionManager on Spotift IOS SDK

http://stackoverflow.com/comment/139641753
score: 0
has text: @KJ - file won't download from that link. I posted an example project at: https://github.com/DonMag/PDFPathExtract ... you can clone the repo or download the PDF file only.
type: AnswerComment
comment on: http://stackoverflow.com/a/79190404
type: Comment

http://stackoverflow.com/q/79189823
type: AnsweredQuestion
has body: By default Cocoa binding of NSTextFiled's value to a property only does model update when text field loses input focus. Is there a way to force an update on, for example, form button click and not using 'Continuously Update Value'? What have I tried. I've created Xcode macOS Objective-C project with XIB interface. I've laid out my MainMenu's form in the following way: I've added to the project the following class: @interface Person : NSObject @property (weak) NSString* firstName; @property (weak) NSString* middleName; @property (weak) NSString* lastName; @end and modified my AppDelegeate: @interface AppDelegate : NSObject &lt;NSApplicationDelegate&gt; @property (strong) Person* person; @end Finally, I've bound my form NSTextFileds to AppDelegate's person's properties as follows: and connected the save button action to the following method: - (IBAction)onSave:(id)sender { NSLog(@&quot;%@ %@ %@&quot;, self.person.firstName, self.person.middleName, self.person.lastName); } Now, when I run the application and Enter 'John' into the first text field, click second one; Enter 'Lee' into the second text field, click third one; Enter 'Hooker' into the third text field and click save button , I got in the log John Lee (null). This, obviously, means, that by default bound values are updated only when text field loses input focus. So, is there a way to force Cocoa to update all form's bound values on button click? The 'Continuously Update Value' option does the thick, but I'm going to avoid updating model on each keyboard hit.
has title: Force Cocoa to update bound value on button click
tagged with: macos
accepted answer: http://stackoverflow.com/a/79190668
type: Question
answer count: 1
tagged with: objective-c
tagged with: cocoa
tagged with: xcode
has answer: http://stackoverflow.com/a/79190668
score: 0
tagged with: cocoa-bindings

http://stackoverflow.com/q/79213356
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/139686982
has body: I'm following this code here where I have an NSTableView that displays the folder name as a group header and then the contents of the folder below, for this example these are all images. So like, here I have a folder named flags and a folder named states, what I want to do is to change the font size of this header, I have successfully changed the text color but for some reason I can't change the font size neither through storyboard nor programmatically. Here's my tableView:viewForTableColumn:row: method -(NSView*)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; { DesktopEntity *entity = _tableContents[row]; if ([entity isKindOfClass:[DesktopFolderEntity class]]) { NSTextField *groupCell = [tableView makeViewWithIdentifier:@"GroupCell" owner:self]; [groupCell setStringValue: entity.name]; [groupCell setFont:[NSFont fontWithName:@"Arial" size:40]]; [groupCell setTextColor:[NSColor magentaColor]]; return groupCell; } else if ([entity isKindOfClass:[DesktopImageEntity class]]) { NSTableCellView *cellView = [tableView makeViewWithIdentifier:@"ImageCell" owner:self]; [cellView.textField setStringValue: entity.name]; [cellView.textField setFont:[NSFont fontWithName:@"Impact" size:20]]; [cellView.imageView setImage: [(DesktopImageEntity *)entity image]]; return cellView; } return nil; } what am I doing wrong here, and how can I change the font size programmatically? Edit I tried changing the font size in the second if statement for the "ImageCell" and it works, but I still can't get it to work for the "GroupCell" in the first if statement. Looking a bit further, there's this method tableView:isGroupRow: that I'm using: -(BOOL)tableView:(NSTableView *)tableView isGroupRow:(NSInteger)row { DesktopEntity *entity = _tableContents[row]; if ([entity isKindOfClass:[DesktopFolderEntity class]]) { return YES; } return NO; } I found out that if I comment out this function those changes work and the font size gets updated, but afte…
tagged with: appkit
has answer: http://stackoverflow.com/a/79218549
has comment: http://stackoverflow.com/comment/139684524
has comment: http://stackoverflow.com/comment/139682820
tagged with: nstableview
score: 0
has comment: http://stackoverflow.com/comment/139688264
tagged with: objective-c
tagged with: cocoa
type: Question
answer count: 1
accepted answer: http://stackoverflow.com/a/79218549
has comment: http://stackoverflow.com/comment/139687372
has title: Can't change the font size of an NSTableView

http://stackoverflow.com/a/79093403
has body: I still don't known why, but I stored the GeneratedPluginRegistrant.m and GeneratedPluginRegistrant.h files and just copy them under ios/Runner, then it can be build...
answers question: http://stackoverflow.com/q/79093041
type: Answer
score: 0

http://stackoverflow.com/comment/139567673
has text: IIRC much of the `CGS` APIs are locked down through an 'ownership' model. Apps only 'own' their own windows and are only allowed to move those. The Dock process is a 'universal owner' and can manipulate all the windows. But IIRC, the Universal ownership is locked through a special entitlement, and when you give your own app that entitlement macOS will just not run it. The only way that I know of to manipulate windows is to use the Accessibiliy API. Which is slow and restrictive but it works.
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79135637

http://stackoverflow.com/comment/139601432
comment on: http://stackoverflow.com/q/79135341
type: Comment
score: 0
has text: Thanks @DonMag. A CGPath is much more useful to me than the image so if I could load the PDF to a CGPath that would be great.
type: QuestionComment

http://stackoverflow.com/comment/139606978
has text: It would help if you explained exactly what you need to do. Do you want to animate a `CAShapeLayer`? Do you want to draw the shape to the map bitmap? Do you just need to scale, rotate and color the image and place it on the map? It is ***possible*** to extract paths from a PDF file, but it can be finicky. For example, the AW109.pdf you linked to has some bad data in it, as seen here: https://i.sstatic.net/BOKtF0bz.png
score: 0
type: Comment
comment on: http://stackoverflow.com/q/79135341
type: QuestionComment

youtube-api
tag name: youtube-api
type: Tag
tags question: http://stackoverflow.com/q/79160899

http://stackoverflow.com/q/79090801
tagged with: ios
type: Question
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
tagged with: react-native
upvote count: 1
favorite count: 0
tagged with: swift
downvote count: 0
has body: New to Swift and new to working on native iOS code with React Native. I'm trying to use the common UITextField approach to blocking screenshots on certain screens. I have a function initTextField here: private var secureTextField: UITextField? private func initTextField() { let boundLength = max(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height) secureTextField = UITextField(frame: CGRect(x: 0, y: 0, width: boundLength, height: boundLength)) secureTextField!.isSecureTextEntry = true secureTextField!.isUserInteractionEnabled = false secureTextField!.backgroundColor = .red if let rootView = UIApplication.shared.keyWindow?.rootViewController?.view { for subview in rootView.subviews { subview.addSubview(secureTextField!) subview.layer.superlayer?.addSublayer(secureTextField!.layer) secureTextField!.layer.sublayers?.last?.addSublayer(subview.layer) } } } This works. The screenshots turn out red and on the app switcher the app is also red. I ended up having to use this definition for rootView, not sure if it's because I'm using React Native but anyway, it works. On certain screens I want to disable this and allow screenshots but haven't figured out how to do this. How can I undo/remove the UITextField on all of the sublayers/subviews? Thanks!
has title: Can't remove UITextField from sublayers
score: 1
has answer: http://stackoverflow.com/a/79091918

http://stackoverflow.com/comment/139637345
score: 0
comment on: http://stackoverflow.com/q/79177378
has text: Interesting message : https://forums.developer.apple.com/forums/thread/748135 "After trying a little bit around, I think it is because OneDrive does not have its file locally, hence the error "no such file or directory". If in OneDrive I mark the file as "keep offline available", then it works." Could that be also you case? In other the words, they have the file listed, they have a refernce on it, but it's on demand through their own service to download it really.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/79143366
tagged with: ios
type: Question
has body: Implemented iOS PencilKit for React-native with a native bridge. The canvasView's content area can be panned and zoomed. However, I'm encountering a strange behavior... When drawing in the content area while completely zoomed out (the canvas area is completely visible), the canvas drawing behaves perfectly fine. However, when zoomed-in (so only a portion of the canvas is visible) and the user starts to draw, strokes at the lower and upper edges of the content area will flicker for a couple of seconds. Why does it do that? Further, if I set the minimumZoomScale so that in effect it is like setting resizeMode = 'cover' for the content area (i.e. the content area covers the entire frame), it doesn't have that strange behavior. Doing this however, means user cannot view the entire content area on the screen at the same time. - (UIView *)view { CGFloat deviceWidth = [UIScreen mainScreen].bounds.size.width; CGFloat deviceHeight = [UIScreen mainScreen].bounds.size.height; CGRect viewRect = CGRectMake(0, 0, deviceWidth, deviceHeight); _canvasView = [[CanvasView alloc] initWithFrame:viewRect]; _canvasView.zoomScale = 1.0; _canvasView.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.0]; _canvasView.drawingPolicy = PKCanvasViewDrawingPolicyAnyInput; _canvasView.overrideUserInterfaceStyle = UIUserInterfaceStyleLight; _canvasView.multipleTouchEnabled = true; _canvasView.delegate = self; return _canvasView; } RCT_EXPORT_METHOD(setupCanvas : (nonnull NSNumber *)viewTag imagePath : (NSString *)imagePath width : (CGFloat)width height : (CGFloat)height traceImagePath : (NSString *)traceImagePath traceImageSize : (nonnull NSNumber *)traceImageSize) { dispatch_async(dispatch_get_main_queue(), ^{ NSLog(@"Set Toolpicker"); [self setupToolPicker]; NSLog(@"Set Canvas size"); [self setCanvasDimensions:width height:height]; if (imagePath != (id)[NSNull null] && imagePath.length != 0) { NSLog(@"Draw on image"); [self drawOnImage:imagePath]; } }); } - (void)setCanvasDimen…
tagged with: objective-c
type: UnansweredQuestion
tagged with: react-native
score: 0
tagged with: pencilkit
has title: React-Native PencilKit: Strokes at the edges of canvasView flicker for a couple seconds when user draws after zooming in on canvas
tagged with: flicker
answer count: 0

http://stackoverflow.com/a/79238319
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/139776174
has comment: http://stackoverflow.com/comment/139752974
has comment: http://stackoverflow.com/comment/139773122
answers question: http://stackoverflow.com/q/79228371
has comment: http://stackoverflow.com/comment/139791154
has comment: http://stackoverflow.com/comment/139755365
has body: To answer your question first: At least one things that is missing is event emitting capabilities, but I doubt that alone will fix your problems. The react-native-code-push library depends on code-push, which basically contains the JS code. But in order to support the new arch, the whole project needs to be a Turbo Module. So it needs the JSI interface and codegen information. I also use Codepush and decided to take another approach, since the existing Codepush library contains a lot of legacy code (Windows for example). After doing some research I figured it was likely less work to start from scratch and only implement the things needed for my project. On a high level you only need to have this functionality: Build time Create new bundles for Android and iOS (simply the existing react-native CLI commands) Upload to cloud storage Run time A way to check the currently active bundle and compare it to the cloud bundles ( = version check) Download new bundles when available and write to the file system Point RN to most recent bundle cleanup of old bundles Edit Some key parts of the interface, adding logic is going to lead to to a lot of code here ... // TS Spec file import { TurboModule, TurboModuleRegistry } from "react-native"; export interface Spec extends TurboModule { getAppVersion(): Promise<string>; initiateUpdate(): Promise<{ success: boolean }>; checkForUpdate(): Promise<{ updateAvailable: boolean }>; restartApp(): void; } export default TurboModuleRegistry.getEnforcing<Spec>('OTA'); Then I basically have 3 main files containing most of the logic: Codepush.mm Contains the C++ interface for the spec file + 4 core functions: @interface OTA: NSObject <NativeOTASpec> - (void)downloadPackage:(NSString *)updatePackageUrl destinationPath:(NSString *)destinationPath resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject; - (void)unzipFileAtPath:(NSString *)zipPath toDestination:(NSString *)destinationPath completionHandler:(void (^)(NSError *error…

http://stackoverflow.com/comment/139492977
comment on: http://stackoverflow.com/a/79100724
has text: @IRP_HANDLER yes, if you only mutate the array using the methods of the `NSArrayController`.
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/comment/139752974
score: 0
has text: Thanks for your response. Can you share some code?
comment on: http://stackoverflow.com/a/79238319
type: AnswerComment
type: Comment

http://stackoverflow.com/a/79087577
score: 0
type: Answer
has body: Use KQueue or FSEvents to Monitor /proc Directory import Foundation // Setup KQueue to monitor the `/proc` directory for new process creation let procPath = "/proc" let kqueue = kqueue() var event = kevent(ident: UInt(procPath.hashValue), filter: EVFILT_VNODE, flags: EV_ADD | EV_ENABLE, fflags: NOTE_WRITE, data: 0, udata: nil) let fd = open(procPath, O_RDONLY) kevent(kqueue, &event, 1, nil, 0, nil) DispatchQueue.global().async { var eventList = [kevent()] while true { let eventCount = kevent(kqueue, nil, 0, &eventList, 1, nil) if eventCount > 0 { print("New process or daemon launched!") } } } also for Audit System modify /etc/security/audit_control to log exec events. Add the following line to the flags in audit_control: flags:lo,aa,ex restart the audit daemon: sudo audit -s Tail the audit logs in your Swift program to track new processes and daemons. import Foundation let task = Process() task.launchPath = "/usr/bin/tail" task.arguments = ["-f", "/var/audit/current"] let pipe = Pipe() task.standardOutput = pipe task.launch() let fileHandle = pipe.fileHandleForReading fileHandle.readabilityHandler = { handle in let data = handle.availableData if let output = String(data: data, encoding: .utf8) { print("New process or daemon detected: \(output)") } } You can continue using DispatchSource, but to also capture child processes, you’ll need to monitor process forks and track their parent-child relationships using pid information. let pid: pid_t = 1 // Replace with process ID to track (e.g., `launchd`) let queue = DispatchQueue.global() let source = DispatchSource.makeProcessSource(identifier: pid, eventMask: [.fork, .exec], queue: queue) source.setEventHandler { print("Process forked or executed") } source.setCancelHandler { print("Source cancelled") } source.resume()
answers question: http://stackoverflow.com/q/79087126
has comment: http://stackoverflow.com/comment/139453310

http://stackoverflow.com/a/79147528
score: 0
answers question: http://stackoverflow.com/q/79092218
has body: MaxPacketSize and the size of the cache before you agree, can from the above, do not use the status = AudioConverterGetProperty (_encodeConvertRef, kAudioConverterPropertyMaximumOutputPacketSize, &amp;size, &amp;maxPacketSize); The computed maxPacketSize
type: Answer

http://stackoverflow.com/comment/139694922
has text: @ThomasTempelmann: Here https://stackoverflow.com/a/12315845/1187415 is a link to a GitHub project https://github.com/sveinbjornt/IconFamily which claims to be able to read and write .icns data. I haven't tried it. It is written in Objective-C and uses many deprecated APIs, but perhaps you can get *some* ideas from there.
comment on: http://stackoverflow.com/q/79218608
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/a/79091918
answers question: http://stackoverflow.com/q/79090801
has comment: http://stackoverflow.com/comment/139463380
has comment: http://stackoverflow.com/comment/139461324
score: 0
type: Answer
has body: To delete the layer associated with the UITextField, you need to remove the UITextField from its superview, which will automatically detach its layer from the view hierarchy. If you still need to manipulate the layer separately for some reason, you can directly remove the layer from its superlayer. Here's how you can do it: Removing the UITextField and Its Layer You can extend the removeTextField() method to ensure that the layer is also removed from the view hierarchy: /// Removes the secure text field and its layer, enabling screenshots. private func removeTextField() { guard let textField = secureTextField else { return } // Remove the text field from its superview textField.removeFromSuperview() // Additionally, remove the text field's layer from its superlayer if needed textField.layer.removeFromSuperlayer() // Clean up the reference secureTextField = nil } Explanation textField.removeFromSuperview(): This will detach the UITextField from its parent view, which also effectively removes the corresponding layer from the view hierarchy. textField.layer.removeFromSuperlayer(): This line ensures that the layer itself is detached from its superlayer if it's still attached. This step is typically not necessary if you have already removed the UITextField from the view hierarchy, but it can be added as a precaution. secureTextField = nil: Clears the reference to the UITextField to prevent memory leaks. Removing Layers from Other Views If you've previously added the UITextField's layer to other views or layers manually, you would need to iterate over those views or layers to remove the text field's layer from each. Here’s how you can do that: /// Removes the secure text field's layer from all superlayers where it might have been added. private func removeTextFieldLayerFromAllSuperlayers() { guard let textField = secureTextField else { return } // Iterate over all superlayers to remove the layer if let superlayers = textField.layer.sublayers { for sublayer in superlayers …

http://stackoverflow.com/a/79190404
has comment: http://stackoverflow.com/comment/139668178
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/139641753
answers question: http://stackoverflow.com/q/79135341
has comment: http://stackoverflow.com/comment/139679596
score: 0
has comment: http://stackoverflow.com/comment/139664259
type: Answer
has comment: http://stackoverflow.com/comment/139642254
accepted answer of: http://stackoverflow.com/q/79135341
has body: A few notes... First, as I mentioned in my comments, shapes / paths in PDF files can be finicky. Using the original PDF you linked to - http://www.iridiumblue.com/pages/AW109.pdf : And, using a PDF of an AC130 (can't remember where I got it): You can edit the paths in the PDF file to fix problems... but, as you can see, fixing that AC130 might be a fair amount of work. If it were me, I would generate my own CGMutablePath -- most PDF / vector editors can export the paths in various formats - such as SVG which can be converted fairly easily to CGPathMoveToPoint(...) / CGPathAddLineToPoint(...) / CGPathAddCurveToPoint(...) / etc. If you're set on using PDF files and extracting the paths, here is some Example code... Extractor.h #import <Foundation/Foundation.h> #import <PDFKit/PDFKit.h> NS_ASSUME_NONNULL_BEGIN @interface Extractor : NSObject + (NSArray<id> *)extractVectorPathsFromPDF:(NSURL *)pdfURL; @end NS_ASSUME_NONNULL_END Extractor.m #import "Extractor.h" @implementation Extractor void ExtractPathsFromContent(CGPDFScannerRef scanner, void *info); void moveToCallback(CGPDFScannerRef scanner, void *info); void lineToCallback(CGPDFScannerRef scanner, void *info); void curveToCallback(CGPDFScannerRef scanner, void *info); void closePathCallback(CGPDFScannerRef scanner, void *info); CGMutablePathRef currentPath = NULL; + (NSArray<id> *)extractVectorPathsFromPDF:(NSURL *)pdfURL { PDFDocument *pdfDocument = [[PDFDocument alloc] initWithURL:pdfURL]; if (!pdfDocument) { NSLog(@"Unable to load PDF document."); return nil; } NSMutableArray<id> *vectorPaths = [NSMutableArray array]; // Iterate through all pages in the PDF document for (NSInteger pageIndex = 0; pageIndex < pdfDocument.pageCount; pageIndex++) { PDFPage *pdfPage = [pdfDocument pageAtIndex:pageIndex]; if (!pdfPage) continue; CGPDFPageRef cgPage = pdfPage.pageRef; if (!cgPage) continue; // Set up the scanner to process PDF content streams CGPDFContentStreamRef contentStream = CGPDFContentStreamCreateWithPage(cgPag…
has comment: http://stackoverflow.com/comment/139675709
has comment: http://stackoverflow.com/comment/139654268
has comment: http://stackoverflow.com/comment/139679640
has comment: http://stackoverflow.com/comment/139645422
has comment: http://stackoverflow.com/comment/139645156
has comment: http://stackoverflow.com/comment/139642407
has comment: http://stackoverflow.com/comment/139642253
has comment: http://stackoverflow.com/comment/139675578
has comment: http://stackoverflow.com/comment/139642329
has comment: http://stackoverflow.com/comment/139641942
has comment: http://stackoverflow.com/comment/139664098

http://stackoverflow.com/q/79217908
tagged with: objective-c
tagged with: cocoa
has title: Programmatically check there a "disk image password" in KeyChain
tagged with: keychain
score: 0
type: Question
has body: On my macOS app I would like to know whether the user has defined a password in the KeyChain for a given encrypted Disk Image. I do not want to know the password itself. I just need to know whether the password is in the KeyChain or not. I can clearly see the password is on the KeyChain.app, as name: "MyDisk.dmg" kind: "disk image password" Account: D0899FA8-C…… Access Group: com.apple.DisklmagesKeychainGroup So, from my macOS app I unsuccessfully tried to get that item using SecItemCopyMatching with any kind of kSecClass: kSecClassInternetPassword, kSecClassGenericPassword, kSecClassCertificate, kSecClassKey, kSecClassIdentity. NSDictionary *query = @{ (__bridge NSString*)kSecClass : (__bridge NSString*)kSecClassGenericPassword, (__bridge NSString*)kSecReturnAttributes: (id)kCFBooleanTrue, (__bridge NSString*)kSecMatchLimit : (NSString*)kSecMatchLimitAll }; NSArray *items = nil; OSStatus status = SecItemCopyMatching((CFDictionaryRef)query, (CFTypeRef*)&items); I get any kind of item but no one reports MyDisk.dmg or any other data that can drive me to the MyDisk.dmg volume. Even if it should return just the NSURL credentials, I also unsuccessfully tried NSDictionary *credentials = [[NSURLCredentialStorage sharedCredentialStorage] allCredentials]; And I event tried, unsuccessfully security dump-keychain -d login.keychain How can I know that there is a keychain item for a given Disk Image Password, a Local Disk Password and a Remote Disk Password? I run macOS 15.1 and XCode 16.1.
type: UnansweredQuestion
tagged with: macos
answer count: 0

http://stackoverflow.com/comment/139480559
has text: @PaulBeusterien Podfile.lock details updated in the question. Kindly check and update
score: 0
comment on: http://stackoverflow.com/q/79100926
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/139478656
score: 1
has text: Instead of the workaround, fire KVO notifications with `willChangeValueForKey:` and `didChangeValueForKey:`.
comment on: http://stackoverflow.com/a/79100724
type: AnswerComment
type: Comment

http://stackoverflow.com/a/79149593
answers question: http://stackoverflow.com/q/79149592
upvote count: 1
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/79149592
has body: Turns out it's a known issue: Changes to .editorconfig are not reflected immediately in open files. (120389049) Workaround: Quit and restart Xcode.
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/139688264
has text: Group rows are drawn in group row style. Workaround: Subclass `NSTableRowView`, override `isGroupRowStyle` and return `NO`.
comment on: http://stackoverflow.com/q/79213356
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/139675578
type: AnswerComment
comment on: http://stackoverflow.com/a/79190404
type: Comment
score: 0
has text: Thanks @DonMag. The issue I think was that I had Deploy to 10.10 set when I added PDFKit. I removed it changed to macOS 12 then re-added and it worked. I do get some of the artefacts that you have previously shown. I'm not sure why but I may have to do some work on the icons and see if I need to simplify them. The C130.pdf has the engines as separate objects which may not help. I'll look at the NSImageView as well. Thank you very much for the time you spent on this. Your PDF Extractor is brilliant, Thanks.

http://stackoverflow.com/q/79135637
has body: I'm trying to move windows around from other spaces to the current window and have wasted many hours not understanding why nothing is being moved.. I've tried various applications (hardcoding some screens now to test). I ensure window level is 0 and various other things, but the key thing is that the private API is not migrating the window. Common libs on the market today are using these calls on this Mac release, but I'm worried there is an additional step in the flow I'm missing. Demo repo: https://github.com/Schachte/mac-os-graphics I've tried thread sleeps between windows, etc. The main snippet is this: static func addInitialRunningApplicationsWindows() { let cgsMainConnectionId = CGSMainConnectionID() let otherSpaces = [UInt64(213)] print("Other spaces found: \(otherSpaces)") guard otherSpaces.count > 0 else { print("No other spaces found") return } let windowsOnCurrentSpace = getWindowsInSpace([currentSpaceId]) print("Windows on current space: \(windowsOnCurrentSpace)") let windowsOnOtherSpaces = getWindowsInSpace(otherSpaces) print("Windows on other spaces: \(windowsOnOtherSpaces)") let windowsOnlyOnOtherSpaces = Array(Set(windowsOnOtherSpaces).subtracting(windowsOnCurrentSpace)) print("Windows to move: \(windowsOnlyOnOtherSpaces)") guard windowsOnlyOnOtherSpaces.count > 0 else { print("No windows to move") return } // Split windows into chunks to avoid overwhelming the API let chunkSize = 5 let windowChunks = stride(from: 0, to: windowsOnlyOnOtherSpaces.count, by: chunkSize).map { Array(windowsOnlyOnOtherSpaces[$0..<min($0 + chunkSize, windowsOnlyOnOtherSpaces.count)]) } for chunk in windowChunks { print("Processing chunk of \(chunk.count) windows") // First add windows to the current space CGSAddWindowsToSpaces(cgsMainConnectionId, chunk as NSArray, [currentSpaceId] as NSArray) // Give the system a moment to process Thread.sleep(forTimeInterval: 0.1) // Then remove from other spaces for spaceId in otherSpaces { CGSRemoveWindowsFromSpaces(cgsMainConnectionId…
has comment: http://stackoverflow.com/comment/139567673
has comment: http://stackoverflow.com/comment/139567690
type: Question
tagged with: swift
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/139567685
has title: Unable to move windows on Sonoma using private APIs in Swift
tagged with: macos
favorite count: 0
answer count: 0
upvote count: 2
score: 2
tagged with: core-graphics
tagged with: objective-c
downvote count: 0

http://stackoverflow.com/q/79191029
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/139643008
has comment: http://stackoverflow.com/comment/139642693
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/79191409
has body: I have defined a method appendString method in a NSMuatableAttributedString category like this: @implementation NSMutableAttributedString (HTML) // appends a plain string extending the attributes at this position - (void)appendString:(NSString *)string { NSParameterAssert(string); NSUInteger length = [self length]; ... And this method is worked well in iOS17 and before . But when it cames iOS18 . this appendString will not be called. So I doubt maybe there is a system-defined appendString already. So I write a demo in empty project to print all the NSMuatableAttributedString method in iOS18 like these: @interface ViewController () @end @implementation ViewController void printNSStringCategories() { unsigned int count; Class nsStringClass = [NSMutableAttributedString class]; // 获取所有的方法 Method *methods = class_copyMethodList(nsStringClass, &count); for (unsigned int i = 0; i < count; i++) { SEL selector = method_getName(methods[i]); NSString *methodName = NSStringFromSelector(selector); NSLog(@"NSMutableAttributedString method: %@", methodName); } free(methods); } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. printNSStringCategories(); } And test it in my iPhone (iOS18.2) , the log will printed NSMutableAttributedString method: appendString:withAttributes: NSMutableAttributedString method: cr_appendStorage:fromRange: NSMutableAttributedString method: cr_appendString: NSMutableAttributedString method: appendString:withAttributes: NSMutableAttributedString method: appendString: So it seems a appendString: is aleady defined in system SDK . But the weird thing is when I run this code in the Xcode simulator (iOS18.1) this appendString: will not print . 1 Is it a bug of SDK ? because the appendString: only exist in device-build , and not exist in simulator-build? two more furthur question: 2.1 if the SDK contains appendString: already , why the appendString: defined in my category not cause the duplicate symbol error when comp…
tagged with: objective-c
has title: NSMuatableAttributedString's appendString method only exist in iPhone-device build in iOS18, and not exist in Simulator-build
accepted answer: http://stackoverflow.com/a/79191409
tagged with: xcode
score: 0

http://stackoverflow.com/comment/139582909
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79135341
has text: Thank for you replaying @DonMag An example icon is at http://www.iridiumblue.com/pages/AW109.pdf It is a single page 128x128 in black on a clear background. I would like to change the colour of the black part to reflect military/civil/etc and apply an alpha if possible. I'm currently converting the icons to an NSImage which then losses quality whens called to say 40x40. Thanks.

http://stackoverflow.com/q/79092218
tagged with: crash
tagged with: audiounit
has comment: http://stackoverflow.com/comment/139462274
answer count: 2
type: Question
tagged with: aac
has answer: http://stackoverflow.com/a/79147528
tagged with: ios
score: 0
has answer: http://stackoverflow.com/a/79095619
has title: In iOS 18, using AudioUnit for audio recording, converting PCM format to AAC crashes the application
tagged with: objective-c
type: UnansweredQuestion
has body: AudioBufferList* convertPCMToAAC (XDXRecorder *recoder) { UInt32 maxPacketSize = 0; UInt32 size = sizeof(maxPacketSize); OSStatus status; status = AudioConverterGetProperty(_encodeConvertRef, kAudioConverterPropertyMaximumOutputPacketSize, &size, &maxPacketSize); // log4cplus_info("AudioConverter","kAudioConverterPropertyMaximumOutputPacketSize status:%d \n",(int)status); AudioBufferList *bufferList = (AudioBufferList *)malloc(sizeof(AudioBufferList)); bufferList->mNumberBuffers = 1; bufferList->mBuffers[0].mNumberChannels = _targetDes.mChannelsPerFrame; bufferList->mBuffers[0].mData = malloc(maxPacketSize); bufferList->mBuffers[0].mDataByteSize = kTVURecoderPCMMaxBuffSize; AudioStreamPacketDescription outputPacketDescriptions; UInt32 inNumPackets = 1; pthread_mutex_lock(&pcmBufferMutex); status = AudioConverterFillComplexBuffer(_encodeConvertRef, encodeConverterComplexInputDataProc, pcm_buffer, &inNumPackets, bufferList, &outputPacketDescriptions); pthread_mutex_unlock(&pcmBufferMutex); if(status != noErr){ // log4cplus_debug("Audio Recoder","set AudioConverterFillComplexBuffer status:%d inNumPackets:%d \n",(int)status, inNumPackets); free(bufferList->mBuffers[0].mData); free(bufferList); return NULL; } if (recoder.needsVoiceDemo) { OSStatus status = AudioFileWritePackets(recoder.mRecordFile, FALSE, bufferList->mBuffers[0].mDataByteSize, &outputPacketDescriptions, recoder.mRecordPacket, &inNumPackets, bufferList->mBuffers[0].mData); // log4cplus_info("write file","write file status = %d",(int)status); if (status == noErr) { recoder.mRecordPacket += inNumPackets; } } return bufferList; } The above code for converting PCM to AAC works normally in iOS versions below 18, but in iOS 18, crashes occur during the conversion process. The console does not provide much useful information, and the application crashes at malloc(maxPacketSize) or AudioConverterFillComplexBuffer(), displaying the message AURemoteIO::IOThread (14): EXC_BAD_ACCESS (code=1, address=0x0). Please hel…

http://stackoverflow.com/comment/139720123
has text: Yes. Property is `self.tableContents`, but `_tableContents` is it's instance variable. It's just compiler declaring ivars automatically for you.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/79228264
score: 0

http://stackoverflow.com/q/79135341
has comment: http://stackoverflow.com/comment/139582909
has comment: http://stackoverflow.com/comment/139568055
type: Question
has title: Draw PDF with a different colour in a CALayer. (Objective-C)
has comment: http://stackoverflow.com/comment/139590289
has body: I've loaded a black and transparent .PDF icon to a CGPDFPageRef and need to draw it out to a CALayer with a specified colour. I can scale and rotate it correctly but don't know how to change the colour it's rendered in. This is part of a macOS desktop application that maps aircraft in flight. I have been using an NSImage to draw .PNG aircraft icons but as my source icons are 128x128 they often appear slightly blurry when an NSImage is scaled down to 40x40. I have been converting the icons to 128x128 Vector PDF files and the code below draws them correctly scaled and orientated on a CALayer but I don’t seem to be able to change the colour they are drawn in. When I used NSImages to load .png’s I have some code to read the .png to an NSImage then create a new NSImage with the changed colour and I suspect I’ll need to do the same with a PDF but have no idea how to do that. My code to render the .PDF icon to the map is: // Render a PDF vector icon - (void)drawAircraftInContext:(CGContextRef)context acft:(Aircraft *)acft { CGContextSaveGState (context); CGRect pdfRect = CGPDFPageGetBoxRect (acft.pdf, kCGPDFCropBox); CGContextTranslateCTM (context, acft.x, acft.y); CGContextRotateCTM (context, degreesToRadians (acft.heading)); CGContextTranslateCTM (context, (_iconSize / 2), (_iconSize / 2)); CGContextScaleCTM (context, .0 - (_iconSize / pdfRect.size.width), .0 - (_iconSize / pdfRect.size.height)); // None of this block actually works - the colour remains black with a clear background. CGContextSetAlpha (context, _radarView.militaryAlpha); CGContextSetFillColorWithColor (context, _militaryColour); CGContextSetStrokeColorWithColor (context, _militaryColour); CGContextSetBlendMode (context, kCGBlendModeMultiply); // How do we change the colour of the image? CGContextDrawPDFPage (context, acft.pdf); CGRect rect = CGRectMake (0.0 - (_iconSize / 2.0), 0.0 - (_iconSize / 2.0), _iconSize, _iconSize); // Draw a highlight if (acft == _radarView.selected &amp;&amp; !_radarView.showO…
tagged with: cgcontextdrawpdfpage
has answer: http://stackoverflow.com/a/79190404
has comment: http://stackoverflow.com/comment/139639109
tagged with: calayer
has comment: http://stackoverflow.com/comment/139583763
has comment: http://stackoverflow.com/comment/139601432
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/139583994
answer count: 1
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/79190404
score: 0
has comment: http://stackoverflow.com/comment/139606978

http://stackoverflow.com/q/79151429
has comment: http://stackoverflow.com/comment/139573309
has comment: http://stackoverflow.com/comment/139580491
score: 0
has body: In my app I’m running into a problem leaking custom objects passed into a chain of methods that store HTML files into a custom object. Where each method finds a local copy of a file, the file is read in and referenced by an NSString in the custom object. When no local copy of the file exists, the method makes an asynchronous network request with the completion routine saving the contents locally and again storing a reference to the data read in the custom object. Things work fine as long as I have local copies of each file: the HTML is read from the local file, the reference is stored in the custom object, and the next method in the chain is called. There are about 2 dozen methods in the chain, and once done the HTML files are processed, I set the reference to the custom object to nil, and repeat the whole process with a different set of 24 HTML files. As long as everything is local, an examination of the memory map shows that no objects have leaked. Problems begin, however, when any one of the HTML files is not available locally and that file is fetched from the web. In those cases, the custom object used to store references to the data is never released via ARC. My code (here, a mix of real and pseudo code) looks like this: @interface CustomObject : NSObject @property (strong) NSString *htmlPage1; @property (strong) NSString *htmlPage2; @property (strong) NSString *htmlPage3; @property (strong) NSMutableArray *array; @property (strong) DifferentCustomObject *c1; @end The custom object is then created within a loop, like so: - (void) loop: (int) n { CustomObject *co; int i; for (i = 0; i &lt; n; ++i) { co = [[CustomObject alloc] init]; co.c1 = [[DifferentCustomObject alloc] init]; [self startFileFetchChain: co]; } } And the custom object is set to nil once the request chain has ended. - (void) endFileFetchChain: (CustomObject *) co { if (co.array) [co.array removeAllObjects]; if (co.c1) co.c1 = nil; co = nil; } This is the beginning of the chain of methods that wil…
tagged with: asynchronous
has title: ARC and the release of custom objects passed into async network methods
type: Question
tagged with: memory-leaks
has comment: http://stackoverflow.com/comment/139573305
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/139580484
tagged with: macos
answer count: 0
has comment: http://stackoverflow.com/comment/139575032
tagged with: objective-c
tagged with: automatic-ref-counting

http://stackoverflow.com/comment/139569313
type: Comment
has text: @Willeke this works only if I call `[arrayController setContent: myMutableArray]` every time I make any change to the array.
comment on: http://stackoverflow.com/a/79100724
score: 0
type: AnswerComment

http://stackoverflow.com/comment/139695185
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79220401
has text: I should have said that our app targets 10.11 but, you're right, my question would have been clearer if I have written `else if (@available(macOS 10.11, *))`. It's especially about 10.11 to 10.13 and the necessity to switch to openGL when the GPU doesn't support Metal, not about which version of Metal. The Apple doc is unclear about that, so I can just presume that if there is no MTLDevice, it means that Metal is unavailable (?) - which would also mean that there is no other possible failure (?). I'm just looking for a confirmation of that assumption.
score: 0

http://stackoverflow.com/a/79228502
upvote count: 1
has comment: http://stackoverflow.com/comment/139716499
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/79228264
has comment: http://stackoverflow.com/comment/139716572
score: 1
has comment: http://stackoverflow.com/comment/139716527
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/79228264
has body: The block does retain self the way you're doing it. If you know for a fact that the block is not being stored for later use by the runtime, that's fine; but if you cannot be sure that the block is not being stored for later use, you risk a retain cycle: the block retains self but perhaps, behind the scenes, someone is retaining the block, thus preventing self from ever going out of existence. And in that case, you should use the "weak-strong dance", as illustrated in the code at the end of your question, which breaks the retain cycle by referring to self with a weak reference. But which is the case? Is this block retained behind the scenes or not? Alas, the runtime's behavior behind the scenes is opaque. One way to find out experimentally whether there is a retain cycle is to implement dealloc on self to log to the console, and try running the app with the code your way. If the printing in dealloc never happens, then self is never being deallocated because you've created a retain cycle and you know that the weak-strong dance is needed. Personally, I'd be inclined just to do the weak-strong dance and let it go at that. It is over-used in a knee-jerk way by a lot of programmers, so you are right to doubt its necessity here; but it does no harm and can do good, so it might be best to err on the side of caution.

http://stackoverflow.com/q/79155986
tagged with: cmmotionmanager
score: 0
type: UnansweredQuestion
answer count: 0
tagged with: iphone
tagged with: ios
tagged with: core-motion
has title: CoreMotion: attitude (roll/pitch/yaw) returning very inaccurate values
type: Question
tagged with: objective-c
has body: I want to add a "bubble horizon" to a camera application to help the user keep their iPhone level. For this, I'm using the CoreMotion Attitude functionality of CMMotionManager. However, the output I'm getting is very inaccurate. I'm comparing my readings with Apple's own Measure app which is dead accurate, so the sensors are working fine. My own readings seem to be several degrees off. I'm using quaternion transformation to calculate Roll (don't need Pitch/Yaw for this use case) to avoid gimbal lock, but am I perhaps missing some calibration step or something? - (void)initializeMotionManager { if (self.motionManager.deviceMotionAvailable) { self.motionManager.deviceMotionUpdateInterval = 0.1; // Update interval in seconds NSOperationQueue *queue = [NSOperationQueue mainQueue]; [self.motionManager startDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameXArbitraryZVertical toQueue:queue withHandler:^(CMDeviceMotion *motion, NSError *error) { // error handling removed for readability [self processDeviceMotion:motion]; }]; } } - (void)processDeviceMotion:(CMDeviceMotion *)motion { // use quaternions to avoid Gimbal Lock CMQuaternion quat = motion.attitude.quaternion; // calculate roll in degrees double roll = atan2( 2 * ( quat.w * quat.x + quat.y * quat.z ), 1 - 2 * ( quat.x * quat.x + quat.y * quat.y ) ); roll = radiansToDegrees( roll ); NSLog( @"Roll: %f", roll ); // readings tend to be +/- 3 degrees }

http://stackoverflow.com/a/79091266
type: AcceptedAnswer
type: Answer
score: 6
accepted answer of: http://stackoverflow.com/q/79091148
answers question: http://stackoverflow.com/q/79091148
upvote count: 6
has body: The actual Swift signature generated for this ObjC function is: func handleOpen(_ url: URL?, options: [AnyHashable : Any]?) If a method name has a suffix that matches the name of the first parameter, this suffix is removed from the name of the Swift method, as it would otherwise violate Swift's API Design Guidelines. In the Xcode editor of an ObjC file, you can also display the "Generated Interface" for Swift. Just click the "Related Items" Button and Select "Generated Interface". Apple describes this in the Technote TN3108. If you can change the code of the libraries, you may also change the Swift method signatures with NS_REFINED_FOR_SWIFT.
has comment: http://stackoverflow.com/comment/139460457
downvote count: 0
has comment: http://stackoverflow.com/comment/139460536

http://stackoverflow.com/comment/139590289
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79135341
has text: Can you use image views as subviews? If so, that's an option. If that won't work with what you're trying to do, if you post a [mre] I'm pretty sure I can modify your code to allow "coloring" the image.
type: Comment

http://stackoverflow.com/a/79218549
type: Answer
answers question: http://stackoverflow.com/q/79213356
accepted answer of: http://stackoverflow.com/q/79213356
score: 0
has body: As Willeke explained, the solution here is to subclass NSTableRowView and override the isGroupRowStyle method @interface CustomTableRowView : NSTableRowView @end @implementation CustomTableRowView -(BOOL)isGroupRowStyle { return NO; } //custom background for a table row view - (void)drawBackgroundInRect:(NSRect)dirtyRect { NSColor *groupBackgroundColor = [NSColor windowBackgroundColor]; [groupBackgroundColor setFill]; NSRectFill(dirtyRect); } @end I also had to override rowViewForRow for the NSTableViewDelegate: - (NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row { DesktopEntity *entity = _tableContents[row]; if ([entity isKindOfClass:[DesktopFolderEntity class]]) { return [[CustomTableRowView alloc] init]; } // use default row for non-group rows return nil; }
type: AcceptedAnswer

http://stackoverflow.com/comment/139719022
has text: @Cy-4AH I don't think so, they are declared as `@property NSMutableArray* tableContents;` and `@property (weak) IBOutlet NSTableView *tableView;` am I missing something?
comment on: http://stackoverflow.com/q/79228264
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/79087126
tagged with: objective-c
downvote count: 0
has body: I tried with NSWorkspace but i able to identify when application is lauched not process not any daemon. NSWorkspace.shared.notificationCenter.addObserver(forName: NSWorkspace.didLaunchApplicationNotification, object: nil, queue: nil) let source = DispatchSource.makeProcessSource(identifier: pid, eventMask: [.fork], queue: queue) source.setEventHandler(handler: completion) source.resume() dispatchsource always tell if new process is launched but no information about child process
tagged with: process-monitor
type: Question
upvote count: 1
tagged with: swift
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/79087577
tagged with: process-monitoring
score: 1
tagged with: macos
has title: Is there any way to get notify whenever new process , daemon and application is launched ? MACOS
favorite count: 0

http://stackoverflow.com/comment/139645422
comment on: http://stackoverflow.com/a/79190404
score: 0
has text: @user9398585 - This is what I get with your `C130.PDF`: https://i.sstatic.net/itF7XF6j.png ... Now, it's very possible (likely) that my PDF path extractor is only suitable for simple paths and could be vastly improved. I still think using image views as subviews will be the most reliable and straightforward approach. If subviews won't work, I can also give you sample code to generate scaled + rotated + solid-color images which could be used as `CALayer contents`.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/79220145
tagged with: macos
tagged with: metal
tagged with: objective-c
has title: Availability of Metal in pre-Mojave systems
score: 0
has body: Is it correct to consider: that Metal is available on any Mac running Mojave or greater? that Metal is unavailable on earlier systems if MTLCopyAllDevices() returns an empty array? In other words, is this test correct in any case? if (@available(macOS 10.14, *)) { MetalCompatible = true; } else { MetalCompatible = MTLCopyAllDevices().count &gt; 0; } Incidentally, is there a better approach to test the availability of Metal on old macOS systems?
type: Question
has answer: http://stackoverflow.com/a/79220401
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/comment/139717898
comment on: http://stackoverflow.com/q/79228264
has text: `_tableContents` and `_tableView` are instance variables though.
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/139643008
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79191029
has text: @Willeke ,thanks ! works like charm! seems ScreenReaderCore`-[NSMutableAttributedString(SCRCMutableAttributedStringExtras) appendString:] has defined in the system ! My 2.2 question is solved !!
type: Comment

http://stackoverflow.com/comment/139686982
has text: @Willeke here's the whole thing https://github.com/lucasderraugh/AppleProg-Cocoa-Tutorials/tree/master/Lesson%2053
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/79213356
type: Comment

http://stackoverflow.com/comment/139645156
score: 0
type: AnswerComment
has text: PocketSVG looks like it would do the job if I can't get the PDFs to work. https://github.com/pocketsvg/PocketSVG
comment on: http://stackoverflow.com/a/79190404
type: Comment

http://stackoverflow.com/comment/139589502
type: Comment
score: 0
comment on: http://stackoverflow.com/q/79158106
has text: May be problem with name? Doesn't see how `.encryptedStringTransformer` declared? May be use `@objc` and declare explicit name
type: QuestionComment

http://stackoverflow.com/q/79100926
favorite count: 0
tagged with: firebase
has body: I am working on a cross-platform application, and we recently released updates for our apps. We received a large number of crashes in our Crashlytics logs. All the crashes seem to occur in the APM submodule classes with "__isPlatformVersionAtLeast SIGABRT (ABORT)." While checking the Crashlytics event summary details, I found that the crashes happen during the execution of the didFinishLaunchingWithOptions function in the AppDelegate. didFinishLaunchingWithOptions: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Firebase [FIRPerformance sharedInstance].instrumentationEnabled = 0; [FIRApp configure]; NSDictionary *props = @{ @"TESTING": @"iOS", @"Date": [NSDate date] }; //Clevertap [[CleverTap sharedInstance] setInAppNotificationDelegate:self]; [[CleverTap sharedInstance] setPushNotificationDelegate:self]; NSString *appPath = [[NSBundle mainBundle] bundlePath]; NSLog(@"appPath ------ %@",appPath); // Config an additional instance NSLog(@"multiple instance registration"); CleverTapInstanceConfig *ctConfig = [[CleverTapInstanceConfig alloc] initWithAccountId:@"TEST*******" accountToken:@"TEST*****"]; NSLog(@"multiple instance registration %@",ctConfig); CleverTap *additionalCleverTapInstance = [CleverTap instanceWithConfig:ctConfig]; [AEPMobileCore setLogLevel:AEPLogLevelDebug]; [AEPMobileCore configureWithAppId:@"99********"]; return YES; } Podfile: pod 'Firebase/Analytics' pod 'Firebase/Auth' pod 'Firebase/Crashlytics', '10.28.1' pod 'FirebasePerformance', '10.28.0' pod 'FirebaseRemoteConfig' pod 'CleverTap-iOS-SDK', '6.2.1' Stack Trace: Crashed: APMIdentityWorkerQueue 0 libsystem_kernel.dylib 0xc274 __pthread_kill + 8 1 libsystem_pthread.dylib 0x7ef8 pthread_kill + 268 2 libsystem_c.dylib 0x77ad8 abort + 128 3 libsystem_malloc.dylib 0x9c38 malloc_vreport + 896 4 libsystem_malloc.dylib 0x98a8 malloc_report + 64 5 libsystem_malloc.dylib 0x8e80 find_zone_and_free + 528 6 App 0xfe574 (Missing UUID 0faca6be…
tagged with: ios
tagged with: objective-c
tagged with: crashlytics
has comment: http://stackoverflow.com/comment/139480366
tagged with: clevertap
answer count: 0
has comment: http://stackoverflow.com/comment/139480559
has title: Application crash with _isPlatformVersionAtLeast SIGABRT (ABORT) - APMIdentityWorkerQueue
type: Question
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/139485130
type: UnansweredQuestion
score: 1

http://stackoverflow.com/comment/139691986
score: 1
type: QuestionComment
has text: Okay, so what's the *input* for generating the data? Do you want to get it for a particular file? Or do you just want to know how icns data should be structured?
comment on: http://stackoverflow.com/q/79218608
type: Comment

http://stackoverflow.com/comment/139642329
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79190404
has text: Thanks @DonMag. I'll try that code at the weekend. I assumed that PDF would be better supported for drawing, scaling and colouring vector icons. I'm creating my own icons in Affinity Designer 2 (350 to date) so could easily export as SVG if I knew how to extract a CGPath from an SVG. My own C-130 is at http://www.iridiumblue.com/pages/C130.pdf (256x256).
score: 0

http://stackoverflow.com/q/79093041
tagged with: objective-c
type: UnansweredQuestion
has title: Runner-Bridging-Header.h:1:9: error: 'GeneratedPluginRegistrant.h' file not found
favorite count: 0
upvote count: 0
tagged with: flutter
score: -1
has answer: http://stackoverflow.com/a/79093403
downvote count: 1
answer count: 1
has body: I've run flutter clean & flutter pub get many times and when I run flutter build ios it will complain about /Users/john.z/Desktop/frontendRepos/flutter_alp_invoicing/ios/Runner/Runner-Bridg ing-Header.h:1:9: error: 'GeneratedPluginRegistrant.h' file not found #import "GeneratedPluginRegistrant.h" and I search from the file system, it really not exists. I think it's created by flutter automatically. but why it's missing I also run the following command many times cd ios pod install besides, my Podfile looks like this # Uncomment this line to define a global platform for your project platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do use_frameworks! use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) target 'RunnerTests' do inherit! :search_paths end end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end end the Generated.xcconfig file always be created after I run flutter build ios.... it's not as the docs said after I run flutter p…
tagged with: ios
type: Question

qt6
type: Tag
tags question: http://stackoverflow.com/q/79109731
tag name: qt6

http://stackoverflow.com/q/79228371
has answer: http://stackoverflow.com/a/79238319
type: Question
has body: I'm running RN 0.76.3 with New Architecture enabled, and react-native-code-push 9.0.0 When downloading a CodePush update, I don't get progress events before the download has finished. I've found that the reason is that the method - (void)didUpdateFrame:(RCTFrameUpdate *)update of the CodePush module is never invoked, because - (void)registerModuleForFrameUpdates:(id&lt;RCTBridgeModule&gt;)module withModuleData:(RCTModuleData *)moduleData; is never called with the CodePush module. I can see that RCTTurboModuleManager.mm contains this code which should register CodePush for updates, but because bridge is nil, it doesn't happen. if (_bridge) { RCTModuleData *data = [[RCTModuleData alloc] initWithModuleInstance:(id&lt;RCTBridgeModule&gt;)module bridge:_bridge moduleRegistry:_bridge.moduleRegistry viewRegistry_DEPRECATED:nil bundleManager:nil callableJSModules:nil]; [_bridge registerModuleForFrameUpdates:(id&lt;RCTBridgeModule&gt;)module withModuleData:data]; } I guess there's some method or protocol that needs to be implemented in CodePush.m to make it register for frame updates with the New Architecture?
tagged with: react-native-code-push
type: UnansweredQuestion
score: 1
tagged with: rctbridge
answer count: 1
tagged with: objective-c
has title: React Native New Architecture - CodePush does not register for frame updates
tagged with: react-native
upvote count: 1
downvote count: 0
favorite count: 0
tagged with: new-architecture

http://stackoverflow.com/comment/139617809
has text: can you please share error here? what you are getting while convert url to data.
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/79177378

http://stackoverflow.com/q/79086536
score: 0
tagged with: ios
tagged with: ios18
has comment: http://stackoverflow.com/comment/139455182
tagged with: objective-c
answer count: 0
tagged with: uinavigationcontroller
downvote count: 1
has comment: http://stackoverflow.com/comment/139451354
type: Question
has body: Problem with "More" Tab in UITabBarController on iOS 18 I'm working on an iOS application using Objective-C and UITabBarController. I have more than five tabs, so the additional ones are placed under the "More" tab. However, when I click on the "More" tab in iOS 18.0, the first item does not show up properly. This issue does not occur in iOS 17 or earlier versions. Development Environment Xcode Version: 15 Deployment Target: iOS 17 Steps to Reproduce Create a new iOS project in Xcode and set the deployment target to iOS 17. Delete the default main storyboard and add a new UITabBarController as the initial view controller. Populate the UITabBarController with more than five tabs so that the additional ones appear under the "More" menu. Run the app on an iOS 18.0 simulator or device. Navigate to the "More" menu in the tab bar. Expected Behavior All items in the "More" menu should appear as expected. Actual Behavior The first item in the "More" menu does not appear initially but is visible when editing the menu. What I've Tried Verified that each view controller is correctly initialized and has a title and image. Logged the contents of the moreNavigationController to confirm that it contains the correct view controllers. Tested by reducing the number of view controllers to fewer than five, which resolves the issue but is not a viable solution for the app. Ensured all navigation controllers are configured consistently (e.g., translucency, bar style). Additional Notes The issue only occurs when the UITabBarController is set up using the storyboard. When initialized and configured programmatically, the problem does not occur. The behavior is specific to iOS 18.0; everything works as expected in iOS 17. Workaround To temporarily avoid this issue, initialize and set up the UITabBarController programmatically instead of using the storyboard. What could be causing the first item under the "More" tab to not show up correctly on iOS 18 when using a storyboard configuration? Any…
upvote count: 1
type: UnansweredQuestion
has title: First item in UITabBarController's 'More' tab not showing up properly when using storyboard and run on device with ios 18.0
tagged with: uitabbarcontroller
has comment: http://stackoverflow.com/comment/139451299
favorite count: 0

http://stackoverflow.com/q/79091148
favorite count: 0
tagged with: ios
tagged with: objective-c
accepted answer: http://stackoverflow.com/a/79091266
type: Question
downvote count: 0
upvote count: 1
has body: I have the following method signature in Obj-C: - (void)handleOpenUrl:(NSURL * _Nullable)url options:(NSDictionary * _Nullable)options And to my mind, the Swift version should be: func handleOpenUrl(_ url: URL?, options: [AnyHashable: Any]?) Im trying to mock a library by using an extension to make conform to a protocol containing the above signature. But my Swift version doesnt work. Can anyone help me as to why? Most common error is: Unavailable instance method 'handleOpenUrl(_:options:)' was used to satisfy a requirement of protocol 'xxxLibProtocol'
has title: Convert this obj-c method signature to swift
tagged with: swift
has answer: http://stackoverflow.com/a/79091266
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/139460380
score: 1
answer count: 1

http://stackoverflow.com/comment/139583763
type: Comment
has text: This is what the App produces. http://www.iridiumblue.com/pages/Radar.png
comment on: http://stackoverflow.com/q/79135341
type: QuestionComment
score: 0

http://stackoverflow.com/comment/139510416
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/79118618
has text: Apparently the transition to full screen fails if you run a modal save panel at the same time. Why do you want to do this?

http://stackoverflow.com/q/79109731
upvote count: 1
has title: Qt6 using Objective-C script in CPP (H) file
tagged with: qt
has comment: http://stackoverflow.com/comment/139537313
has body: Normally, I use only *.h files in my c++ project as scripts are short and I don't need to really generate many files. So, currently I have a c++ script used only in a header file. Also in there, I have some objective-c script, which currently works. However, another one does not. I, of course, understand using objective-c in cpp file is not as easy However, it can be managed. Unfortunately, I have no experience with this just yet. How to run the fallowing code inside cpp (header) file without having the script in separate *.mm file? #ifndef PERMISSION_H #define PERMISSION_H #include <QMainWindow> #include <QMessageBox> #include <QtCore/QObject> #include <QtCore/QMetaObject> #include <QUrl> #include <QDesktopServices> #if defined(Q_OS_ANDROID) #include <QtCore/qjniobject.h> #include <QtCore/qcoreapplication.h> #include <QtCore/private/qandroidextras_p.h> #elif defined(Q_OS_IOS) #include <objc/objc.h> #include <objc/message.h> #include <objc/runtime.h> //#include <UIKit/UIKit.h> // this brings this error: http://www.j88.tech/appdev/macos-qt-carbon-h-warning/ //#include <QtCore/private/qcore_map_p.h> // if I undcomment this, error from line above changes to: "expected unqualified-id/applications/Xcode.app/Contents/Developer/..." #endif class Permission : public QObject { Q_OBJECT public: Permission(QObject *parent = nullptr) : QObject(parent) {} // Photo Library Q_INVOKABLE bool requestMedia() { #if defined(Q_OS_ANDROID) // ANDROID: cpp script to request permission for camera galery pictures... this works fine, no need to show the code here #elif defined(Q_OS_IOS) // iOS: objective-c script to request permission for camera galery pictures... this works fine __block BOOL isAuthorized; id phPhotoLibrary = (id) objc_getClass("PHPhotoLibrary"); SEL mediaPermission = sel_registerName("requestAuthorization:"); typedef void (^CompletionHandler)(int); CompletionHandler completionHandler = ^(int status) { switch (status) { case 3: // PHAuthorizationStatusAuthorized qDebug() << …
linked to: http://stackoverflow.com/q/32827389
tagged with: c++
type: Question
tagged with: qt6
type: UnansweredQuestion
score: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/139494354
answer count: 0
tagged with: ios
tagged with: objective-c

http://stackoverflow.com/q/79144762
tagged with: objective-c
has comment: http://stackoverflow.com/comment/139566928
score: 0
has title: Caret is hiding behind UITextField border
tagged with: uikit
type: Question
tagged with: swift
tagged with: uitextfield
type: UnansweredQuestion
answer count: 0
has body: I'm adding offset to caret to it was not just behind symbol, but 2 points away. public final class MyTextField: UITextField { override public func caretRect(for position: UITextPosition) -&gt; CGRect { super.caretRect(for: position).offsetBy(dx: 2, dy: 0) } } But when entered text is as long as TextField, cursor (caret) become not visible. How to keep entered text + caret inside TextField bounds?
tagged with: ios

http://stackoverflow.com/comment/139651384
type: AnswerComment
type: Comment
score: 0
has text: `makeFirstResponder:` might return `NO`.
comment on: http://stackoverflow.com/a/79190668

cmmotionmanager
type: Tag
tags question: http://stackoverflow.com/q/79155986
tag name: cmmotionmanager

http://stackoverflow.com/q/79118618
tagged with: macos
score: 0
has comment: http://stackoverflow.com/comment/139510416
tagged with: user-interface
tagged with: objective-c
tagged with: cocoa
has body: The documentation around Cocoa is lacking when it comes to Native fullscreen support. I'm trying to find out if Cocoa supports toggling a window into fullscreen while simultaneously opening a modal dialog. This seems to trigger the application to leave fullscreen instantly as if it's some kind of safety mechanism (or bug). Does anybody if this is the case? Below follows the sample application that creates this behavior, but I've seen similar behavior in real world applications, which led me to write this sample application to ask if anybody has any clues. The sample application has a button (two buttons really, but 1 is only interesting), that toggles the fullscreen and simultaneously opens a modal save-as dialog. This creates this described behavior. #import "AppDelegate.h" @interface AppDelegate () @property (strong) NSWindow *window; @property (strong) NSButton *fullscreenButton; @property (strong) NSButton *saveOnlyButton; @end @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Create the window NSRect frame = NSMakeRect(0, 0, 600, 400); self.window = [[NSWindow alloc] initWithContentRect:frame styleMask:(NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskResizable) backing:NSBackingStoreBuffered defer:NO]; [self.window setTitle:@"Fullscreen & Save Panel"]; [self.window makeKeyAndOrderFront:nil]; // Create the fullscreen and save button self.fullscreenButton = [[NSButton alloc] initWithFrame:NSMakeRect(200, 180, 200, 50)]; [self.fullscreenButton setTitle:@"Go Fullscreen & Save"]; [self.fullscreenButton setTarget:self]; [self.fullscreenButton setAction:@selector(fullscreenButtonClicked:)]; [[self.window contentView] addSubview:self.fullscreenButton]; // Create the save only button self.saveOnlyButton = [[NSButton alloc] initWithFrame:NSMakeRect(200, 100, 200, 50)]; [self.saveOnlyButton setTitle:@"Open Save Panel"]; [self.saveOnlyButton setTarget:self]; [self.saveOnlyButton setAction:@selector…
tagged with: objective-c++
answer count: 0
has title: Cocoa: Native fullscreen transition and modal dialog on MacOS not working
type: Question
type: UnansweredQuestion

http://stackoverflow.com/q/79227303
has body: I have an Objective-C app that sometimes takes over focus without the user actively switching to it. I want to track when this happens, so I can have a dump and analyze why this happens. For this reason, I wanted to see if when I get applicationDidBecomeActive I can distinguish when it happened because of the user (clicked on app in dock, cmd+tabbed to it, etc.) vs. when it happened because my app is broken (e.g. crashed and restarted). Obviously, I don't want to track ALL user input across the whole system. I'm developing for MacOS. Is there a way to do that?
score: 0
type: Question
tagged with: appdelegate
tagged with: nsapplication
type: UnansweredQuestion
has title: Source of applicationDidBecomeActive: user vs. bug?
answer count: 0
tagged with: objective-c
tagged with: application-lifecycle

http://stackoverflow.com/comment/139463380
score: 0
has text: Both approaches end up showing the red `secureTextField` when ran so I don't think it's working. Perhaps something to do with how it's being initialised in the first place.
type: AnswerComment
comment on: http://stackoverflow.com/a/79091918
type: Comment

http://stackoverflow.com/comment/139494354
score: 3
has text: Using only headers is a bad habit. Stick to convention.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/79109731

http://stackoverflow.com/a/79191409
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/79191029
answers question: http://stackoverflow.com/q/79191029
type: Answer
has body: Thanks @Willeke for your tips ,now I know the whole thing behind this problem. As the image lookup -rn NSMutableAttributedString says There will be a appendString defined in ScreenReaderCore framework ScreenReaderCore`-[NSMutableAttributedString(SCRCMutableAttributedStringExtras) appendString:] For Question 1: there will be duplicate methods for sure ! And because this ScreenReaderCore is seemd to used for Voice-Over . The simulator is not using this framework . So this duplication exist only in real device. For question 2.1 The method duplication in different category can not be found by the compilor , and this function will be invoked is undefined , It's very dangerous , So it's better to add prefix to the method name in catetory. For question 2.2: Just as @Willeke comment. run and pause the app and execute debugger command image lookup -rn NSMutableAttributedString or image lookup -rn appendString:. –
upvote count: 1
downvote count: 0

application-lifecycle
tag name: application-lifecycle
type: Tag
tags question: http://stackoverflow.com/q/79227303

http://stackoverflow.com/q/79069233
tagged with: wkwebview
score: 0
type: Question
type: UnansweredQuestion
answer count: 0
tagged with: css
tagged with: javascript
has title: Issue with scrolling through WKWebView when direction=rtl
tagged with: objective-c
has body: I have an eBook with dir=rtl and I'm using the following css to split the content of the html into columns: #book { width:350px; height:750px; margin-left:25px; margin-right:25px; -webkit-column-count:auto; -webkit-column-width:350px; -webkit-column-gap:50px; text-align:justify; word-wrap: break-word; } I use the following line to get the Webview's Content Width to calculate the number of columns produced: [myWKWebView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('html')[0].scrollWidth;"] I use the following to scroll through the WebView horizontally: [myWKWebView evaluateJavaScript:[NSString stringWithFormat:@"window.scrollTo(%d,0);",xPosition]]; All the above code works perfectly well, until I introduce the direction to the css: direction:rtl; Upon adding the direction to the css, scrollWidth stops giving the correct measurement and scrollTo function ceases to work. I use the direction in the css, to order the columns from right to left. Is there an alternative that doesn't affect the scrolling feature and the scrollWidth? Kindly note, this is the code used to initialize the WebView: WKWebViewConfiguration *theConfiguration = [[WKWebViewConfiguration alloc] init]; theConfiguration.selectionGranularity = WKSelectionGranularityCharacter; [theConfiguration.preferences setValue:@"TRUE" forKey:@"allowFileAccessFromFileURLs"]; theConfiguration.preferences.javaScriptEnabled = true; myWKWebView = [[WKWebView alloc] initWithFrame:self.view.frame configuration:theConfiguration]; myWKWebView.UIDelegate = self; myWKWebView.userInteractionEnabled = true; myWKWebView.contentMode = UIViewContentModeScaleAspectFit; myWKWebView.autoresizesSubviews = true; myWKWebView.scrollView.scrollEnabled = true; myWKWebView.multipleTouchEnabled = true; [self.view addSubview: myWKWebView];

http://stackoverflow.com/comment/139692177
comment on: http://stackoverflow.com/a/79207327
type: AnswerComment
type: Comment
has text: a further complication, but a separate issue was that even with the GC you can't block the queue the AVCaptureVideoDataOutputSampleBufferDelegate is running on for long. Solved it by using (coroutines) channel that drops the current frame if the last one has not finished processing yet.
score: 0

http://stackoverflow.com/comment/139453310
comment on: http://stackoverflow.com/a/79087577
has text: I don't want to use an infinite loop to get new process information. Process tail does not give the child process information. The same goes for DispatchSource. DispatchSource notifies me whenever a new process is forked or exec, but information about the child process is not provided anywhere.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/79143690
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/139559471
has title: Overlapping Video Frames in RPBroadcastSampleHandler with ReplayKit
tagged with: video
has body: On iOS, when using ReplayKit to record the screen, overlapping video frames appear in the callback of RPBroadcastSampleHandler. I am recording video on iOS using ReplayKit and found that after copying data in the processSampleBuffer:withType: callback using memcpy, the data changes. This occurs particularly frequently when the screen content changes rapidly, making it look like the frames are overlapping. image I found that the values starting from byte 672 in the video data on my device often change. Here is the test demo: - (void)processSampleBuffer:(CMSampleBufferRef)sampleBuffer withType:(RPSampleBufferType)sampleBufferType { switch (sampleBufferType) { case RPSampleBufferTypeVideo: { CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); CVPixelBufferLockBaseAddress(pixelBuffer, kCVPixelBufferLock_ReadOnly); int ret = 0; uint8_t *oYData = CVPixelBufferGetBaseAddressOfPlane(pixelBuffer, 0); size_t oYSize = CVPixelBufferGetHeightOfPlane(pixelBuffer, 0) * CVPixelBufferGetBytesPerRowOfPlane(pixelBuffer, 0); uint8_t *oUVData = CVPixelBufferGetBaseAddressOfPlane(pixelBuffer, 1); size_t oUVSize = CVPixelBufferGetHeightOfPlane(pixelBuffer, 1) * CVPixelBufferGetBytesPerRowOfPlane(pixelBuffer, 1); if (oYSize <= 672) { return; } uint8_t tempValue = oYData[672]; uint8_t *tYData = malloc(oYSize); memcpy(tYData, oYData, oYSize); if (tYData[672] != oYData[672]) { NSLog(@"$$$$$$$$$$$$$$$$------ t:%d o:%d temp:%d", tYData[672], oYData[672], tempValue); } free(tYData); CVPixelBufferUnlockBaseAddress(pixelBuffer, kCVPixelBufferLock_ReadOnly); break; } default: { break; } } } Output: $$$$$$$$$$$$$$$$------ t:110 o:124 temp:110 $$$$$$$$$$$$$$$$------ t:111 o:133 temp:111 $$$$$$$$$$$$$$$$------ t:124 o:138 temp:124 $$$$$$$$$$$$$$$$------ t:133 o:144 temp:133 $$$$$$$$$$$$$$$$------ t:138 o:151 temp:138 $$$$$$$$$$$$$$$$------ t:144 o:156 temp:144 $$$$$$$$$$$$$$$$------ t:151 o:135 temp:151 $$$$$$$$$$$$$$$$------ t:156 o:78 temp:156 $$$$$$$$$$$$$$$$------ t:135 o:76…
tagged with: rpbroadcastsamplehandler
tagged with: replaykit
answer count: 0
tagged with: ios
score: 0
has comment: http://stackoverflow.com/comment/139556212
has comment: http://stackoverflow.com/comment/139560982
tagged with: objective-c
has comment: http://stackoverflow.com/comment/139556792
type: Question

http://stackoverflow.com/a/79190668
has comment: http://stackoverflow.com/comment/139652069
has comment: http://stackoverflow.com/comment/139651384
has comment: http://stackoverflow.com/comment/139680932
answers question: http://stackoverflow.com/q/79189823
has comment: http://stackoverflow.com/comment/139646143
has comment: http://stackoverflow.com/comment/139668590
accepted answer of: http://stackoverflow.com/q/79189823
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/139643920
score: 0
type: Answer
has body: The easiest way is to make sure the text fields relinquish first responder state which implies ending edit. Example: - (IBAction)onSave:(id)sender { [[sender window] makeFirstResponder:[sender window]]; // &lt;-- this! NSLog(@&quot;%@ %@ %@&quot;, self.person.firstName, self.person.middleName, self.person.lastName); }

http://stackoverflow.com/comment/139451354
type: QuestionComment
score: 1
type: Comment
comment on: http://stackoverflow.com/q/79086536
has text: Personally I wouldn't waste time waiting for an "answer" on Stack Overflow; you won't get one. It's clearly a bug, you've proved it, you've got an easy workaround, report it to Apple and move on. Thanks again for documenting this so clearly.

http://stackoverflow.com/q/79158106
tagged with: objective-c
has comment: http://stackoverflow.com/comment/139582905
has comment: http://stackoverflow.com/comment/139589502
type: Question
score: 0
answer count: 0
tagged with: encryption
tagged with: swift
has title: CoreData re-encrypt string property
type: UnansweredQuestion
has body: I'm using Core Data in my iOS application and I have one property that is encrypted using ValueTransformer: class EncryptedStringTransformer: ValueTransformer { private var encryptionKey: String init(encryptionKey: String) { self.encryptionKey = encryptionKey super.init() } override class func allowsReverseTransformation() -&gt; Bool { return true } override class func transformedValueClass() -&gt; AnyClass { return NSData.self } override func transformedValue(_ value: Any?) -&gt; Any? { guard let string = value as? String, let data = string.data(using: .utf8), let encryptedData = EncryptionUtils.aes256EncryptData(data, withKey: encryptionKey) else { return nil } return encryptedData } override func reverseTransformedValue(_ value: Any?) -&gt; Any? { guard let encryptedData = value as? Data, let decryptedData = EncryptionUtils.aes256DecryptData(encryptedData, withKey: encryptionKey) else { return nil } return String(data: decryptedData, encoding: .utf8) } func updateEncryptionKey(newKey: String) { self.encryptionKey = newKey } } The encrypted property is String: @NSManaged public var message: String? and it set in the CoreData model as Transformable the encryption is based on the user password that can be changed, if the user updates the password I want to re-encrypt the property, I try to do it using this function: func reEncryptDataWithNewPassword(oldPassword: String, newPassword: String) -&gt; ReEncryptDBStatus { let fetchRequest: NSFetchRequest&lt;Message&gt; = Message.fetchRequest() guard let messages = try? context.fetch(fetchRequest) else { return .failed } guard !messages.isEmpty else { return .success } for message in messages { if let _ = message.message { message.message = message.message } } ValueTransformer.setValueTransformer(EncryptedStringTransformer(encryptionKey: newPassword), forName: .encryptedStringTransformer) do { try context.save() } catch { return .failed } return .success } The problem is that trying context.save() does not force the DB to …
tagged with: ios
tagged with: core-data

encryption
tags question: http://stackoverflow.com/q/79158106
tag name: encryption
type: Tag

user-interface
type: Tag
tag name: user-interface
tags question: http://stackoverflow.com/q/79118618

http://stackoverflow.com/comment/139485130
has text: Thanks. Nothing looks problematic to me. Sorry.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/79100926

http://stackoverflow.com/comment/139702036
comment on: http://stackoverflow.com/q/79218608
score: 1
type: Comment
type: QuestionComment
has text: @ThomasTempelmann: If you have a working solution then you are welcome to post that as a (self) answer.

http://stackoverflow.com/comment/139791154
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79238319
has text: NA = New Architecture
score: 0

http://stackoverflow.com/comment/139461324
comment on: http://stackoverflow.com/a/79091918
has text: looks like an answer generated by ChatGPT, OpenAI, Google AI or some other AI.
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/comment/139642253
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79190404
score: 0
has text: @KJ - there are still some issues. I loaded your PDFs into my example app: https://i.sstatic.net/MtONnpBW.png ... notice that your `AW109red` still has the path glitch. Also, paths in PDFs can contain transforms (such as rotation) as seen in your `airDoc3`. As I said in my answer, if it were me I'd create my own CGPaths. If we're sticking with PDFs, I'd say using `NSImage` / `NSImageView` is much more reliable... although, that would not allow different stroke+fill colors.

http://stackoverflow.com/comment/139567685
type: Comment
comment on: http://stackoverflow.com/q/79135637
score: 0
type: QuestionComment
has text: Actually, IIRC there were also some older, lesser known APIs that could be used to bring a window to the front and stuff programmatically, but they were quite restrictive as well. I don't remember the names but I remember they were really old and deprecated for years but still worked.

http://stackoverflow.com/comment/139721860
has text: @ThomasTempelmann: What I noticed: The 'icns' item in the pasteboard contains an icon of type 'FD D9 2F A8' when copying a file in the Finder. According to https://en.wikipedia.org/wiki/Apple_Icon_Image_format that is for the dark mode. The icns from GetIconRefFromFileInfo does not contain that icon.
comment on: http://stackoverflow.com/a/79228527
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/comment/139726336
type: Comment
comment on: http://stackoverflow.com/q/79233081
score: 0
type: QuestionComment
has text: I don't think you would ever need to store you public key as a new one can be generated pretty easily now days. You can however as the documentation states store it in the keychain, you just have to write your own logic for it. I will say also I moved over to CryptoKit awhile ago and it has a steep learning curve, but it's quite a bit nicer. have a look at this sample code on storing keys https://developer.apple.com/documentation/cryptokit/storing_cryptokit_keys_in_the_keychain

youtube
type: Tag
tags question: http://stackoverflow.com/q/79160899
tag name: youtube

http://stackoverflow.com/a/79207327
has body: I had the same issue. What worked for me was calling kotlin.native.runtime.GC.collect() as soon as the MLKVisionImage was no longer needed. var visionImage: MLKVisionImage? = MLKVisionImage(didOutputSampleBuffer) // ... recognizer.processImage(visionImage as MLKCompatibleImageProtocol) { mlkText, nsError -&gt; visionImage = null kotlin.native.runtime.GC.collect() // ... }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/79103337
has comment: http://stackoverflow.com/comment/139692177

http://stackoverflow.com/a/79100724
has comment: http://stackoverflow.com/comment/139478656
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/139569313
accepted answer of: http://stackoverflow.com/q/79100189
has comment: http://stackoverflow.com/comment/139569111
has comment: http://stackoverflow.com/comment/139490819
has comment: http://stackoverflow.com/comment/139481075
score: 1
has comment: http://stackoverflow.com/comment/139492977
answers question: http://stackoverflow.com/q/79100189
has comment: http://stackoverflow.com/comment/139569345
has body: You can achieve this by connecting the Content binding with myMutableArray and the Content Values binding with myMutableArray.name1. You may however run into another problem: adding objects to NSMutableArray does not fire key-value notifications, so if you add values after the UI did load those will not display. To work around this after modifications you can assign the mutable array to another instance variable and bind the UI to that array in an observable fashion: // modify array self.observedArray=myMutableArray;
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/139568662

http://stackoverflow.com/comment/139460457
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79091266
has text: you are a life saver, thanks

http://stackoverflow.com/a/79179769
has comment: http://stackoverflow.com/comment/139663990
answers question: http://stackoverflow.com/q/79177378
has body: NOTE: i am not expert in kotlin on swift side we are doing it this way. if fileURL.startAccessingSecurityScopedResource() { if let data = try? Data(contentsOf: fileURL) { //USE DATA HERE } fileURL.stopAccessingSecurityScopedResource() }
score: 0
type: Answer

http://stackoverflow.com/comment/139679640
score: 0
has text: @user9398585 - the most reliable path extraction works when the PDF contains **only** closed, filled (but not bordered) paths. Since Cocoa appears to do a great job of rendering the PDF as an `NSImage`, clearly it's doing a lot of other work with the PDF data. If you can stick to filled paths, you should be OK. Otherwise, I'd use `NSImage` (unless you need different fill and stroke colors).
comment on: http://stackoverflow.com/a/79190404
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/139582905
type: Comment
score: 0
comment on: http://stackoverflow.com/q/79158106
type: QuestionComment
has text: Info: I assume, your user's password is stored in the KeyChain. The encrypted string thus has no more security than the access to the key chain. You might also directly store your string into the key chain instead of CoreData. You also might consider to add an additional layer of security on top of the KeyChain by requiring [Local Authentication](https://developer.apple.com/documentation/localauthentication): when the app needs access to the secure item it will then authenticate the user via TouchID, FaceID or Passcode. The resulting LAContext which grants access can be reused or invalidated.

http://stackoverflow.com/comment/139716527
score: 0
comment on: http://stackoverflow.com/a/79228502
type: AnswerComment
type: Comment
has text: like I'm unsure on whether to declare a macro like `#define WEAKSELF __weak typeof(self) weakSelf = self;` or just declare it as a global

http://stackoverflow.com/comment/139684524
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79213356
has text: I tried your code and it works for me. Post a [mre] please.
type: Comment

http://stackoverflow.com/comment/139776174
comment on: http://stackoverflow.com/a/79238319
score: 0
type: AnswerComment
has text: Not sure what NA stands for ... I'll update my question with some key parts of my logic
type: Comment

http://stackoverflow.com/comment/139573309
comment on: http://stackoverflow.com/q/79151429
type: QuestionComment
score: 2
type: Comment
has text: And to your last question: pay attention to circular references like A->B->C->A. These will not ever release unless you break them up.

http://stackoverflow.com/comment/139618078
has text: even though the file is there, this happen only for files selected from onDrive and google drive
comment on: http://stackoverflow.com/q/79177378
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/139567690
has text: Actually, only certain interactions with window are locked down through the 'ownership' model IIRC. I think moving windows is among the forbidden things but I'm not entirellyyy sure anymore.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79135637
type: Comment

http://stackoverflow.com/q/79233081
score: 0
type: UnansweredQuestion
tagged with: objective-c++
tagged with: key-pair
has title: Export public key by private key with `SecKeyCopyPublicKey` on macOS failed?
answer count: 0
has comment: http://stackoverflow.com/comment/139726336
tagged with: macos
has comment: http://stackoverflow.com/comment/139726350
has body: I've been creating a key pair on macOS by SecKeyCreateRandomKey. According to Apple Document (https://developer.apple.com/documentation/security/generating-new-cryptographic-keys?language=objc), I store private key in keychain and export public key by SecKeyCopyPublicKey everytime. You could add a kSecPublicKeyAttrs attribute to the attributes dictionary, specifying a distinct tag and keychain storage for the public key. However, it’s typically easier to store only the private key and then generate the public key from it when needed. That way you don’t need to keep track of another tag or clutter your keychain. However, I found on few macOS, the exported public key is always null, so I have to create key pair again every time. Maybe I can store both private key and public key to solve this problem, but does it have some better solution? Code to create key pair: @autoreleasepool { const auto* application_tag = [@(identity.c_str()) dataUsingEncoding:NSUTF8StringEncoding]; NSMutableDictionary* attributes = [@{ (id)kSecAttrKeyType : (__bridge id)kSecAttrKeyTypeECSECPrimeRandom, (id)kSecAttrKeySizeInBits : @256, (id)kSecAttrAccessible : (__bridge id)kSecAttrAccessibleAfterFirstUnlock, (id)kSecPrivateKeyAttrs : @{ (id)kSecAttrIsPermanent : @YES, (id)kSecAttrApplicationTag : application_tag, (id)kSecAttrAccessGroup : @(GetAccessGroup().c_str()), }, } mutableCopy]; CFErrorRef err = nullptr; SecKeyRef key = SecKeyCreateRandomKey((__bridge CFDictionaryRef)attributes, &amp;err); if (err || !key) { if (error) { // handling error... } return false; } return true; } and simply use SecKeyCopyPublicKey to export public key SecKeyRef pub_key = SecKeyCopyPublicKey(pvt_key_); // it is null ?
type: Question
tagged with: objective-c

http://stackoverflow.com/comment/139730946
type: Comment
has text: You animate the constraints, not the frame
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/79240177

pencilkit
type: Tag
tags question: http://stackoverflow.com/q/79143366
tag name: pencilkit

http://stackoverflow.com/q/79160899
type: AnsweredQuestion
tagged with: objective-c
tagged with: youtube
score: 0
has answer: http://stackoverflow.com/a/79166086
accepted answer: http://stackoverflow.com/a/79166086
type: Question
answer count: 1
tagged with: youtube-api
has body: I've been given a warning by YouTube that the embedded video in my app has a title that is meant to be clickable and take the user to YouTube. However I cannot understand how that is meant to happen because all we're doing is using a WKWebview to load a url Is there something I'm missing? Is there something that needs to be added to the url? WKWebView *webView = [[WKWebView alloc] initWithFrame: self.videoContainerView.bounds]; webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString: [NSString stringWithFormat:@"https://www.youtube.com/embed/%@", rowViewModel.videoId]]]; webView.clipsToBounds = YES; webView.contentMode = UIViewContentModeScaleAspectFill; [webView loadRequest:request]; I've tried looking around to see if there are parameters that can be passed but I'm not sure I found anything useful.
has title: YouTube video in Objective C app needs to redirect to YouTube

http://stackoverflow.com/comment/139740494
score: 0
has text: unfortunately no, I see you using `myView.translatesAutoresizingMaskIntoConstraints = NO;` and NSLayoutConstraints in `viewDidLoad `I am not using any of these. Not sure if it has anything to do with it.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79241740

http://stackoverflow.com/comment/139537313
type: Comment
has text: This question is similar to: [Force Header Files to Compile as C++ in Xcode](https://stackoverflow.com/questions/32827389/force-header-files-to-compile-as-c-in-xcode). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.
type: QuestionComment
comment on: http://stackoverflow.com/q/79109731
score: 0

new-architecture
tag name: new-architecture
type: Tag
tags question: http://stackoverflow.com/q/79228371

http://stackoverflow.com/comment/139726350
type: Comment
has text: Also have a look at the secure enclave very nice stuff https://developer.apple.com/documentation/cryptokit/secureenclave
comment on: http://stackoverflow.com/q/79233081
type: QuestionComment
score: 0

http://stackoverflow.com/q/79100189
type: Question
tagged with: nsarray
accepted answer: http://stackoverflow.com/a/79100724
has title: How do I bind an NSMutableArray to an NSPopUpButton
type: AnsweredQuestion
tagged with: objective-c
has body: I have an NSPopUpButton defined in my view controller : @property (weak) IBOutlet NSPopUpButton* popUpButton; this view controller also has an NSMutableArray which includes some objects of type NSDictionary, for instance: NSDictionary *obj = @{@"name1": @"something", @"name2": @"something else"}; [myMutableArray addObject: obj]; I'd like my NSPopUpButton to reflect the contents of the name1 field of all elements contained in this array, but I have no idea how to achieve that with the bindings inspector in Xcode. If I select the NSPopUpButton in the storyboard the following is shown in the bindings inspector: am I supposed to use "Contents" or "Content Values" to achieve of what I want?(assuming it's even possible). I've seen some people use an ArrayController but I'd like to know if it's possible to go about this without it.
tagged with: cocoa
tagged with: xcode
answer count: 1
score: 0
has answer: http://stackoverflow.com/a/79100724

http://stackoverflow.com/comment/139734506
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/79241740
has text: Thank you! but the animation now is shrinking starting from MyView's origin x and y (0,0), then moving toward its final position, instead of shrinking from the center :(

http://stackoverflow.com/comment/139573305
score: 2
type: Comment
has text: Run the app within Xcode, trigger the leak, then click the *Debug Memory Graph* control found within the debugger controls. The output will take a moment to produce, when ready study it: select the leaking objects on the left, and study the produced graph. Usually that provides a smoking gun.
type: QuestionComment
comment on: http://stackoverflow.com/q/79151429

http://stackoverflow.com/a/79095619
has body: In an effort to enforce tighter memory safety, iOS 18 introduced new memory allocation features: The system memory allocator (malloc(3)) has switched to a new implementation for most allocation sizes. Users might experience exposure of latent memory access bugs due to changes in heap layout, differences in performance for allocation-heavy workloads, and changes in fragmentation. (127493322) This likely includes changes in how memory allocation for zero-sized buffers is handled to guard against information disclosure and other memory safety issues. According to the malloc documentation: Crashes in memory allocators are almost always related to heap corruption, such as overflowing an allocated chunk... You are not checking the return status of the AudioConverterGetProperty function. Check that maxPacketSize is initialized and not zero as a result of this call. Also check that the size is actually sufficient. iOS &amp; iPadOS 18 Release Notes malloc(3) — Linux manual page
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/79092218
downvote count: 0

http://stackoverflow.com/comment/139568055
comment on: http://stackoverflow.com/q/79135341
has text: How complex is your "Airplane Icon"? There may be a much simpler way to handle this...
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/139713246
comment on: http://stackoverflow.com/q/79228264
score: 1
type: Comment
has text: Doesn't use instance variables anyway. Use properties instead. Instance variable should be used only in initialisers.
type: QuestionComment

http://stackoverflow.com/a/79241740
has comment: http://stackoverflow.com/comment/139734670
score: 2
has comment: http://stackoverflow.com/comment/139734506
downvote count: 0
answers question: http://stackoverflow.com/q/79240177
has comment: http://stackoverflow.com/comment/139740494
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/139742798
has body: The problem is NOT the auto-layout constraints... The issue is that setting the frame of a subview in [UIView animateWithDuration:...] triggers a call to layoutSubviews ... where you again set the frame of the subview. To avoid that, we can add a CGRect property to track self.bounds and, in layoutSubviews, only update _imageView.frame if self.bounds has changed. Example code... MyView.h #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface MyView : UIView -(void)animateOnImage; @end NS_ASSUME_NONNULL_END MyView.m #import "MyView.h" @implementation MyView { UIView *_imageView; CGRect myBounds; } - (instancetype)init { self = [super init]; if (self) { _imageView = [UIView new]; _imageView.backgroundColor = UIColor.blueColor; [self addSubview:_imageView]; myBounds = CGRectZero; } return self; } - (void)layoutSubviews { [super layoutSubviews]; // debug - log that layoutSubviews was called NSLog(@"layoutSubviews"); // only execute the following if self.bounds has changed if (!CGRectEqualToRect(myBounds, self.bounds)) { // debug - log that self.bounds has changed NSLog(@"self.bounds changed, so set _imageView frame"); myBounds = self.bounds; _imageView.frame = self.bounds; } } -(void)animateOnImage { [UIView animateWithDuration:2 animations:^{ [self shrinkImageView]; }]; } - (void)shrinkImageView { _imageView.frame = CGRectMake(50, 100, 150, 200); _imageView.alpha = 0.5; } @end AnimSubViewController.h #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface AnimSubViewController : UIViewController @end NS_ASSUME_NONNULL_END AnimSubViewController.m #import <UIKit/UIKit.h> #import "AnimSubViewController.h" #import "MyView.h" @interface AnimSubViewController () { MyView *myView; } @end @implementation AnimSubViewController - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = UIColor.systemBackgroundColor; myView = [MyView new]; myView.backgroundColor = UIColor.systemYellowColor; myView.translatesAutoresizingMaskIntoConstraints = NO; [self.view addSub…

http://stackoverflow.com/comment/139642254
score: 0
has text: @KJ - and, to be clear, I'm trying to offer the OP some help. This is not my task, and I don't know what constraints the OP has, nor do I know his full intents.
comment on: http://stackoverflow.com/a/79190404
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/139718242
type: AnswerComment
type: Comment
score: 0
has text: @MartinR Since my app doesn't require sandboxing I could probably use the private API. I'll have a look with Hopper inside.
comment on: http://stackoverflow.com/a/79228527

process-monitor
type: Tag
tags question: http://stackoverflow.com/q/79087126
tag name: process-monitor

http://stackoverflow.com/comment/139734670
has text: @夢のの夢 -- I added a screen-cap of the animation to my answer. Is that not what you're getting?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79241740

http://stackoverflow.com/comment/139716499
score: 0
has text: just one more question, in this same file I have other blocks for implementing my NSTableView, am I supposed to get a weak reference to self before each one of these blocks, or is it ok to declared the weak reference as a global once and use it across all the blocks?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79228502

key-pair
tags question: http://stackoverflow.com/q/79233081
type: Tag
tag name: key-pair

http://stackoverflow.com/comment/139569111
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79100724
score: 0
has text: @IRP_HANDLER the easiest way is to bind in IB. In code: `[arrayController bind:NSContentArrayBinding toObject:self withKeyPath:@"myMutableArray" options:nil]` (`self` is the view controller).

http://stackoverflow.com/comment/139451299
has text: Nice demo; actually you only need six vc's (on a small simulator) to see the problem. Four items appear in the tab bar, one item appears in the More list; one item is missing. You could do quite a bit to simplify and clean up the example before sending it to Apple.
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/79086536
type: Comment

http://stackoverflow.com/q/79189300
tagged with: swift
tagged with: ios
type: Question
tagged with: objective-c
type: UnansweredQuestion
has body: I'm trying to build a mixed Swift/Objective-C library using Bazel, but Swift code cannot access types defined in the Objective-C header. I've spent nearly two weeks researching and trying various solutions found in Bazel documentation and other sources, but none have worked. The project is BSText, with some Objective-C code. The key files are: BSText.h (umbrella header with Objective-C type definitions) Swift files in BSText/ directory that need to access Objective-C types Full source code: BSText GitHub Repository Setup The BSText library has an umbrella header containing Objective-C declarations BSText/Bstext.h My Bazel build file: # Objective-C header target objc_library( name = "BSTextObjC", hdrs = ["BSText/BSText.h"], sdk_frameworks = [ "Foundation", "UIKit", "CoreText", ], includes = ["BSText"], visibility = ["//visibility:public"], ) # Swift library target swift_library( name = "BSTextLib", module_name = "BSText", srcs = glob([ "BSText/**/*.swift", ]), swiftc_inputs = ["BSText/BSText.h"], deps = [":BSTextObjC"], copts = [ "-enable-bare-slash-regex", "-suppress-warnings", ], visibility = ["//visibility:public"], ) apple_bundle_version( name = "BSText_Version", build_version = "1", short_version_string = "1.1.13", ) apple_xcframework( name = "BSText", bundle_id = "com.geekbruce.bstext", bundle_name = "BSText", infoplists = ["Framework/BSText/Info.plist"], minimum_os_versions = { "ios": "13.0", }, ios = { "simulator": ["x86_64", "arm64"], "device": ["arm64"], }, umbrella_header = "BSText/BSText.h", deps = [ ":BSTextLib", ], version = ":BSText_Version" ) Error When building, I get multiple errors about TextAction not being found: error: cannot find type 'TextAction' in scope @objc open var textTapAction: TextAction? ^ What I've Tried Added swiftc_inputs with the header file Added header to deps Different combinations of includes paths Creating module maps Various combinations of objc_bridging_header, generates_header, and module_name Consulting Bazel documentatio…
tagged with: bazel
has title: Unable to access Objective-C types in Swift when building with Bazel
score: 0
answer count: 0

aac
tags question: http://stackoverflow.com/q/79092218
type: Tag
tag name: aac

cgcontextdrawpdfpage
type: Tag
tags question: http://stackoverflow.com/q/79135341
tag name: cgcontextdrawpdfpage

http://stackoverflow.com/a/79166086
type: AcceptedAnswer
type: Answer
has body: Turns out that YouTube blocks the navigation interaction when the user taps the title. Therefore the WebKit navigation delegate receives no calls. But this is ONLY the case with the title. Tapping at other places will still take you to YouTube app. In other words: YouTube is purposefully blocking the taps on the title and saying we are the one's violating their terms and conditions. Therefore you need to write a hack using the WKUIDelegate - (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures { if (navigationAction.request.URL) { [[UIApplication sharedApplication] openURL:navigationAction.request.URL options:@{} completionHandler:nil]; } return nil; } and also inject JavaScript: - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { NSString *js = @"document.querySelector('.ytp-title-link').onclick = function() { " " window.webkit.messageHandlers.openInSafari.postMessage(this.href); " " return false; " "};"; [webView evaluateJavaScript:js completionHandler:nil]; } and add a script handler: [webView.configuration.userContentController addScriptMessageHandler:self name:@"openInSafari"]; - (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message { if ([message.name isEqualToString:@"openInSafari"]) { NSString *urlString = (NSString *)message.body; NSURL *url = [NSURL URLWithString:urlString]; if (url) { [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; } } }
score: 0
accepted answer of: http://stackoverflow.com/q/79160899
answers question: http://stackoverflow.com/q/79160899

http://stackoverflow.com/comment/139480366
score: 0
comment on: http://stackoverflow.com/q/79100926
type: Comment
has text: What are the versions in Podfile.lock?
type: QuestionComment

http://stackoverflow.com/comment/139460536
score: 1
comment on: http://stackoverflow.com/a/79091266
has text: HTH Also note that there is a little trick how you can view the generated Swift interface for ObjC types at any time. See [TN3108](https://developer.apple.com/documentation/technotes/tn3108-viewing-the-interface-of-your-swift-code). I will add this to my answer, as this is probably helpful information.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/139641942
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/79190404
has text: @KJ - yes, that AC130 is (likely) bigger and more detailed than needed. When I grabbed that, the OP had not indicated where he was getting the PDF file(s) from, nor whether he could edit them. I imagine it's also possible he would *want* to display a larger, detailed view of the icon. However, it is a good example of the difference between path extraction and loading the PDF as an `NSImage`.
type: Comment

http://stackoverflow.com/comment/139642407
score: 0
type: AnswerComment
has text: I've added http://www.iridiumblue.com/pages/C130.svg The SVG file looks readable and probably much easier extract a CGPath from than the PDF.
type: Comment
comment on: http://stackoverflow.com/a/79190404

http://stackoverflow.com/comment/139680932
score: 0
comment on: http://stackoverflow.com/a/79190668
has text: @GerdK Yeah, in this form works like a charm! Thank you very much!
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/139580484
type: Comment
comment on: http://stackoverflow.com/q/79151429
score: 0
has text: Thanks for the response and the memory graph was very helpful. As it turns out, the code above works fine and doesn't "technically" leak. However... the 'n' passed into the loop that drives the process is quite large; around 12,000. So that means that I was loading approximately 288,000 web pages of various sizes, along with a tone of custom objects being created and disposed of within this single loop. While nothing was leaking, the autorelease pool was HUGE!!! This eventually filled available memory until the application crashed.
type: QuestionComment

http://stackoverflow.com/comment/139713309
comment on: http://stackoverflow.com/a/79228527
score: 1
type: AnswerComment
type: Comment
has text: macOS has an `iconutil` command line tool which can create icns files. Interestingly, this is linked agains the *private* IconServices framework (as can be seen from `otool -L /usr/bin/iconutil`).

http://stackoverflow.com/comment/139716572
score: 0
has text: I ended up doing it like [this](https://pastebin.com/dSLRWKv0)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79228502

http://stackoverflow.com/q/79218608
has answer: http://stackoverflow.com/a/79228527
tagged with: nsimage
has comment: http://stackoverflow.com/comment/139691990
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/139702036
tagged with: swift
has comment: http://stackoverflow.com/comment/139691986
type: Question
answer count: 1
tagged with: appkit
linked to: http://stackoverflow.com/q/12315162
has title: How to get the 'com.apple.icns' data of a file for filling the pasteboard?
has body: When one copies a file in Finder, the pasteboard contains a 'icns' type with the various icon descriptions of the copied item(s). I need to accomplish the same effect in my code, i.e. generate the data I can put into the pasteboard for the com.apple.icns type. How do I collect the data for this type? All I can find in AppKit are functions for getting an NSImage for a file, but nothing that gives me the icns resource.
accepted answer: http://stackoverflow.com/a/79228527
has comment: http://stackoverflow.com/comment/139701139
score: 0
tagged with: nspasteboard
has comment: http://stackoverflow.com/comment/139694922
tagged with: objective-c

http://stackoverflow.com/comment/139642693
comment on: http://stackoverflow.com/q/79191029
has text: Tip: run and pause the app and execute debugger command `image lookup -rn NSMutableAttributedString` or `image lookup -rn appendString:`.
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/comment/139668590
comment on: http://stackoverflow.com/a/79190668
type: AnswerComment
type: Comment
has text: @eggor Is the revised solution in the answer not working for you?
score: 0

virtual-machine
type: Tag
tags question: http://stackoverflow.com/q/79195432
tag name: virtual-machine

http://stackoverflow.com/comment/139755365
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79238319
has text: Can you be a bit more specific in what you need, adding everything here is going to be a lot of work. It involves JS code, native iOS code, native Android code and my backend code.

http://stackoverflow.com/comment/139652069
type: AnswerComment
type: Comment
has text: Well if you are nitpicking using `sender` and assuming it is a `NSView` subclass isn't exactly 1000% fault proof either. But it will do when the action methods is called from a button. `id` could be replaced with a static type (`NSView *` or `NSButton *`) which would also make `sender.window` work again. But this all doesn't matter since the runtime system makes that connection and doesn't care. For all practical purposes though this solution will do the job.
score: 0
comment on: http://stackoverflow.com/a/79190668

http://stackoverflow.com/comment/139682820
has text: Have you tried an attributed string?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79213356
type: Comment

http://stackoverflow.com/comment/139710992
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79228527
has text: @HangarRash: I spent some time on this problem and I found no way to get the icns data out of the NSImage that iconForFile returns.
score: 1

http://stackoverflow.com/comment/139580491
type: Comment
comment on: http://stackoverflow.com/q/79151429
has text: I was able to fix the problem by inserting @autoreleasepool at a strategic point within the main loop. In my actual code, that one loop is really three loops, so I found a spot that was a good balance of performance and managing the memory.
type: QuestionComment
score: 1

http://stackoverflow.com/comment/139691990
type: QuestionComment
comment on: http://stackoverflow.com/q/79218608
has text: The input is the icon information that the Finder has and that it would put into the Clipboard if you Copy the file. I am writing a program that mimics the Finder's behavior, for any file.
score: 0
type: Comment

http://stackoverflow.com/q/79144065
type: Question
tagged with: multimedia
tagged with: objective-c
type: UnansweredQuestion
has body: There are different microphones that can be connected via a 3.5-inch jack or via USB or via Bluetooth, the behavior is the same. There is a code that gets access to the microphone (connected to the 3.5-inch audio jack) and starts an audio capture session. At the same time, the microphone use icon starts to be displayed. The capture of the audio device (microphone) continues for a few seconds, then the session stops, the microphone use icon disappears, then there is a pause of a few seconds, and then a second attempt is made to access the same microphone and start an audio capture session. At the same time, the microphone use icon is displayed again. After a few seconds, access to the microphone stops and the audio capture session stops, after which the microphone access icon disappears. Next, we will try to perform the same actions, but after the first stop of access to the microphone, we will try to pull the microphone plug out of the connector and insert it back before trying to start the second session. In this case, the second attempt to access begins, the running part of the program does not return errors, but the microphone access icon is not displayed, and this is the problem. After the program is completed and restarted, this icon is displayed again. This problem is only the tip of the iceberg, since it manifests itself in the fact that it is not possible to record sound from the audio microphone after reconnecting the microphone until the program is restarted. Is this normal behavior of the AVFoundation framework? Is it possible to somehow make it so that after reconnecting the microphone, access to it occurs correctly and the usage indicator is displayed? What additional actions should the programmer perform in this case? Is there a description of this behavior somewhere in the documentation? Below is the code to demonstrate the described behavior. I am also attaching an example of the microphone usage indicator icon. Computer description: MacBook Pro 13-i…
score: 0
answer count: 0
tagged with: avfoundation
has title: Recording audio from a microphone using the AVFoundation framework does not work after reconnecting the microphone

replaykit
type: Tag
tags question: http://stackoverflow.com/q/79143690
tag name: replaykit

http://stackoverflow.com/comment/139559471
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79143690
has text: **(1)** So `processSampleBuffer` can't happen on a Timer (_eg:_ 30 times per second)? **(2)** What happens if you don't involve `BufferLock` (_eg:_ is now getting a better picture)? **(3)** What happens if you make `*oYData` and `*oUVData` into global variables so it's not making a new `uint8_t` every time? Or is it required to be that way? **(4)** Your `return` should ideally first print a message to notify that a size was incorrect and clear the `*oYData` & `*oUVData` buffers instead of just silently returning to the rest of program code.
type: Comment

http://stackoverflow.com/comment/139556212
comment on: http://stackoverflow.com/q/79143690
score: 0
has text: I don't have iOS but is there a way to set a recording frame rate?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/139566928
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/79144762
has text: Just use `inset(by:)` instead of `offset By(dx:dy:)`

core-motion
type: Tag
tag name: core-motion
tags question: http://stackoverflow.com/q/79155986

http://stackoverflow.com/comment/139663990
type: AnswerComment
type: Comment
score: 0
has text: thank you for your response, still with kotlin/native it doesn't work
comment on: http://stackoverflow.com/a/79179769

http://stackoverflow.com/a/79220401
has body: Metal has been available since OS X El Capitan (10.11) @available(macOS 10.11, *) public func MTLCopyAllDevices() -&gt; [any MTLDevice] Detecting GPU Features and Metal Software Versions
answers question: http://stackoverflow.com/q/79220145
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/139695185

uiviewanimation
tag name: uiviewanimation
type: Tag
tags question: http://stackoverflow.com/q/79240177

http://stackoverflow.com/q/79228264
type: Question
upvote count: 1
answer count: 1
linked to: http://stackoverflow.com/q/7023894
tagged with: objective-c
tagged with: cocoa
favorite count: 0
has answer: http://stackoverflow.com/a/79228502
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/139717898
has title: Cocoa - Block implicitly retains 'self' - Different solutions
accepted answer: http://stackoverflow.com/a/79228502
has body: So I have this snippet here which involves a block: NSArray&lt;Class&gt; *acceptableClasses = @DesktopEntity class; __block NSInteger insertIdx = row; [info enumerateDraggingItemsWithOptions:0 forView:_tableView classes:acceptableClasses searchOptions:nil usingBlock:^(NSDraggingItem *draggingItem, NSInteger idx, BOOL *stop) { DesktopEntity *entity = draggingItem.item; [_tableContents insertObject:entity atIndex: insertIdx]; [_tableView insertRowsAtIndexes:[NSIndexSet indexSetWithIndex:insertIdx] withAnimation:NSTableViewAnimationEffectGap]; draggingItem.draggingFrame = [_tableView frameOfCellAtColumn:0 row: insertIdx]; ++insertIdx; }]; it compiles fine but I'm getting a warning: Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior I'm having some trouble understanding what it means. I managed to make the warning disappear by just typing the self keyword before the variables: [self.tableContents insertObject:entity atIndex: insertIdx]; [self.tableView insertRowsAtIndexes:[NSIndexSet indexSetWithIndex:insertIdx] withAnimation:NSTableViewAnimationEffectGap]; draggingItem.draggingFrame = [self.tableView frameOfCellAtColumn:0 row: insertIdx]; ++insertIdx; But I've also seen people using constructs such as __weak typeof(self) weakSelf = self; and then using this 'weakSelf' instead, what's the difference here and is my first approach wrong?
downvote count: 0
has comment: http://stackoverflow.com/comment/139719022
has comment: http://stackoverflow.com/comment/139720123
has comment: http://stackoverflow.com/comment/139714830
score: 1
tagged with: appkit
has comment: http://stackoverflow.com/comment/139713246

http://stackoverflow.com/comment/139664259
has text: I do have PDFKit.framework in my Frameworks
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/79190404
type: Comment

http://stackoverflow.com/comment/139687372
score: 0
type: QuestionComment
has text: @Willeke for some reason it only works for the second if statement, but not for the first when trying to change the font size for the groupcell
comment on: http://stackoverflow.com/q/79213356
type: Comment

http://stackoverflow.com/comment/139668178
score: 0
comment on: http://stackoverflow.com/a/79190404
has text: @user9398585 - you added the framework, but did you `#import <PDFKit/PDFKit.h>`?
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/139556792
type: QuestionComment
type: Comment
score: 1
has text: There are no functions or configurations for setting the frame rate.
comment on: http://stackoverflow.com/q/79143690

clevertap
type: Tag
tag name: clevertap
tags question: http://stackoverflow.com/q/79100926

http://stackoverflow.com/comment/139664098
comment on: http://stackoverflow.com/a/79190404
type: AnswerComment
type: Comment
score: 0
has text: Is PDFDocument available in macOS 12 Monterey? The documentation seems to suggest it does but I get: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_PDFDocument", referenced from: objc-class-ref in PDFExtractor.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) But PDFDocument.h also has this: PDFKIT_CLASS_AVAILABLE(10_4, 11_0)

nsapplication
type: Tag
tag name: nsapplication
tags question: http://stackoverflow.com/q/79227303

http://stackoverflow.com/comment/139643920
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79190668
has text: @gerd-k Got "Property 'window' not found on object of type '__strong id'" :(

rpbroadcastsamplehandler
tag name: rpbroadcastsamplehandler
tags question: http://stackoverflow.com/q/79143690
type: Tag

http://stackoverflow.com/comment/139460380
type: Comment
comment on: http://stackoverflow.com/q/79091148
type: QuestionComment
has text: A good check is to create a sample project with Swift and Objectif and write the needed method in one language, and check how it's translated in the other one.
score: 1

http://stackoverflow.com/comment/139560982
type: Comment
has text: Thanks @VC.One **(1)** `processSampleBuffer:withType:` is a method of `RPBroadcastSampleHandler`, called by ReplayKit after capturing audio or video. **(2)** To access `CVPixelBuffer` data on the CPU, you must lock it first. **(3)** ReplayKit passes in a new frame each time `processSampleBuffer` is called, so a new data object must be created each time. **(4)** This is just test code to verify that `CVPixelBuffer` changes before and after copying. I initially wanted to rotate the frame, but incorrect images appeared. Testing showed that errors occurred even with just copying.
comment on: http://stackoverflow.com/q/79143690
score: 0
type: QuestionComment

spotify
type: Tag
tags question: http://stackoverflow.com/q/79195432
tag name: spotify

http://stackoverflow.com/comment/139714830
score: 0
type: Comment
comment on: http://stackoverflow.com/q/79228264
has text: @Cy-4AH I am using properties though
type: QuestionComment

http://stackoverflow.com/comment/139568662
comment on: http://stackoverflow.com/a/79100724
score: 0
type: AnswerComment
type: Comment
has text: @Willeke hey, I totally forgot about this... but can't you be a little bit more specific? Like, I created an array controller and set a bind to to the NSArray with **bind:toObject:withKeyPath:options:** but I'm not sure yet how do observe the changes to the array, the documentation is a bit confusing .

http://stackoverflow.com/comment/139710274
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79228527
has text: The deprecation of `GetIconRefFromFileInfo` states that you should use [`NSWorkspace iconForFile:`](https://developer.apple.com/documentation/appkit/nsworkspace/1528158-iconforfile?language=objc) instead. I have no idea if that's a workable solution for your case.

http://stackoverflow.com/comment/139618068
has text: This is the error: Error Domain=NSCocoaErrorDomain Code=260 "The file “cv-template.pdf” couldn’t be opened because there is no such file."
comment on: http://stackoverflow.com/q/79177378
type: QuestionComment
score: 0
type: Comment

react-native-code-push
tag name: react-native-code-push
type: Tag
tags question: http://stackoverflow.com/q/79228371

file-upload
tags question: http://stackoverflow.com/q/79177378
type: Tag
tag name: file-upload

http://stackoverflow.com/comment/139742798
comment on: http://stackoverflow.com/a/79241740
score: 0
has text: @夢のの夢 - no, that has nothing to do with it. If you are not using constraints, I don't now why you were talking about them in your post (and post title). Did you run my example code as-is? If not, try it. If you made changes to *your* code based on my answer, and it's still not working, then post your full, modified code so we can see what's happening.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/139639109
comment on: http://stackoverflow.com/q/79135341
type: QuestionComment
type: Comment
has text: Thanks @DonMag. If I can get the CGPath I can then hopefully scale the aircraft andchoose to just draw the outline or fill with colours to indicate military, police or civilian and various squark codes such as emergency or QRA. I usually draw CGPath's onto a CALayer with something like CGContextDrawPath (context, kCGPathStroke) or kCGPathFill. I'm not animating the aircraft just drawing them every 15 seconds. I think I can fix the errors in my .PDF by making them a single layer with a single path in. That helicopter was at least two layers as I thought I might animate the blades in the future.
score: 0

http://stackoverflow.com/comment/139575032
comment on: http://stackoverflow.com/q/79151429
has text: Don't need check `co.c1` for `nil` to assign `nil` to it. And you don't need to reset it is you nullify `co`
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/139646143
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/79190668
has text: Answer adapted to that.

http://stackoverflow.com/comment/139701139
has text: @MartinR Thank you for finding that for me. Yes, it contains a function, based on the deprecated `GetIconRefFromFileInfo`, that does what I need. If you'd please turn this into an answer, so that I can mark it as resolved.
comment on: http://stackoverflow.com/q/79218608
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/139455182
type: Comment
score: 0
has text: Please I would request anyone seeing this to report also, as the apps using this code are in production and clients are reporting that menu is not there
type: QuestionComment
comment on: http://stackoverflow.com/q/79086536

css
type: Tag
tags question: http://stackoverflow.com/q/79069233
tag name: css

http://stackoverflow.com/comment/139462274
comment on: http://stackoverflow.com/q/79092218
type: Comment
score: 0
has text: can you include `encodeConverterComplexInputDataProc` and the crash dump?
type: QuestionComment

bazel
type: Tag
tags question: http://stackoverflow.com/q/79189300
tag name: bazel

http://stackoverflow.com/comment/139490819
score: 0
has text: @Willeke can I avoid this by using an NSArrayController instead?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79100724

cocoa-bindings
type: Tag
tags question: http://stackoverflow.com/q/79189823
tag name: cocoa-bindings

http://stackoverflow.com/comment/139675709
type: Comment
score: 0
type: AnswerComment
has text: I think I have some 'v' and 'y' type curves in my PDF which might cause an issue as I think they have different characteristics to a 'c' curve.
comment on: http://stackoverflow.com/a/79190404

http://stackoverflow.com/comment/139481075
has text: Because mutable array and KVO can lead to odd and hard to debug issues, I tend to make the observed one an `NSArray`. Reduces surprises.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79100724
score: 0

editorconfig
tags question: http://stackoverflow.com/q/79149592
type: Tag
tag name: editorconfig

http://stackoverflow.com/comment/139773122
score: 0
comment on: http://stackoverflow.com/a/79238319
has text: Another question: You say "The react-native-code-push library depends on code-push, which basically contains the JS code. But in order to support the new arch, the whole project needs to be a Turbo Module. So it needs the JSI interface and codegen information." My impression was that NA had a compatibility layer that would handle stuff like this? Also, I find it hard to see any documentation about the methods used for RN Code Push and other modules, the only results I get by googling is the source code itself?
type: AnswerComment
type: Comment

http://stackoverflow.com/a/79203030
answers question: http://stackoverflow.com/q/79177378
has body: I managed to find the reason behind this issue and a solution. The problem: in iOS cloud storage (Google Drive, OneDrive, Dropbox,..) provide placeholders not the real URI to the file and unless the file is downloaded locally you cannot get the Data of the file. Even it seems to you that you can access files from Google Drive, or any other cloud storage from the shared storage in iOS u can not get the data only if they are downloaded in the device. The solution: There are 2 solution for this problem: Use each Cloud service/API separately to manage access remote files. that way you need to implement each API separately. Display a preview of the file using documentInteractionController and it will take care of loading the file, and then you got access to data. I personally found the second solution more efficient, because in my case i just need the data of the selected file and displaying the file to the user is not problem for me so i am not limited to implement the logic only in the background. here is my solution: lateinit var documentInteractionDelegate: DocumentInteractionControllerDelegate val documentInteractionController = UIDocumentInteractionController() val documentPickerController = UIDocumentPickerViewController( forOpeningContentTypes = listOf(UTTypePDF) ) documentPickerController.allowsMultipleSelection = false val documentPickerDelegate = remember { object : NSObject(), UIDocumentPickerDelegateProtocol { override fun documentPicker( controller: UIDocumentPickerViewController, didPickDocumentAtURL: NSURL ) { val accessing = didPickDocumentAtURL.startAccessingSecurityScopedResource() if (accessing) { documentInteractionController.URL = didPickDocumentAtURL documentInteractionDelegate = DocumentInteractionControllerDelegate( fileUrl = documentInteractionController.URL, handelDocInfoCallback = handelDocInfo ) documentInteractionController.delegate = documentInteractionDelegate presentDocumentInteractionController(documentInteractionController) didPickDocum…
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/79177378

http://stackoverflow.com/comment/139654268
comment on: http://stackoverflow.com/a/79190404
has text: @user9398585 - you mention PocketSVG ... that library (as well as other SVG libs) typically processes an SVG file and creates a view with multiple shape layers.
type: AnswerComment
type: Comment
score: 0

nspasteboard
tags question: http://stackoverflow.com/q/79218608
tag name: nspasteboard
type: Tag

flicker
tag name: flicker
tags question: http://stackoverflow.com/q/79143366
type: Tag

process-monitoring
tags question: http://stackoverflow.com/q/79087126
tag name: process-monitoring
type: Tag

multimedia
tag name: multimedia
type: Tag
tags question: http://stackoverflow.com/q/79144065

http://stackoverflow.com/comment/139932607
type: QuestionComment
has text: https://developer.apple.com/documentation/security/trust-result-dictionary-keys you just need check value of `kSecTrustCertificateTransparency` flag
type: Comment
comment on: http://stackoverflow.com/q/79344272
score: 0

http://stackoverflow.com/q/79317378
tagged with: iobluetooth
tagged with: bluetooth
type: Question
upvote count: 1
downvote count: 0
type: UnansweredQuestion
answer count: 0
score: 1
favorite count: 0
has title: Problem with deleting SDP service (macOS, IOBluetooth)
tagged with: objective-c
tagged with: macos
has body: macOS, IOBluetooth framework. My goal is to create a temporary SDP service. According to the documentation, by default a temporary service is created (aka Persistent = NO), which is deleted after the application is closed. The documentation also mentions the IOBluetoothRemoveServiceWithRecordHandle function for forced removal of the service. This function is deprecated and is currently unavailable. I guesse that it has been replaced by the IOBluetoothSDPServiceRecord.removeServiceRecord method. The essence of the problem is that the server is not deleted either using removeServiceRecord or even after app closing. That is, if you create several services and try to delete them, they will remain alive. Only turning Bluetooth off and on in the OS helps. I tested all versions of macOS starting with Monteray. The same behavior. Example of requesting services from PacketLogger. Can someone confirm this behavior? And is there a solution? for (int i = 0; i < 10; i++) { service = [IOBluetoothSDPServiceRecord publishedServiceRecordWithDictionary:dictionary]; if (!service) { NSLog(@"Failed to create service"); } else { [service getRFCOMMChannelID:&channelID]; [service getServiceRecordHandle:&serverHandle]; NSLog(@"A new service has been created handle=%u, channelID=%hhu", serverHandle, channelID); if (service.removeServiceRecord != kIOReturnSuccess) { NSLog(@"Failed to delete service"); } //service.release; service = nil; } } A minimal test example is available at the link.

http://stackoverflow.com/q/79331889
has body: I am developing an app using Ionic Angular, and I am using a camera preview plugin to display the camera feed. I made modifications in the native code (Objective-C) to use the AVCaptureDeviceTypeBuiltInTripleCamera for newer iPhones. The camera works as expected, but the preview is always rotated like landscape mode. I want to ensure the camera always displays in portrait orientation, regardless of the device's physical orientation. Here’s what I’ve done so far: - (void)startCamera:(CDVInvokedUrlCommand*)command { CDVPluginResult *pluginResult; if (self.sessionManager != nil) { pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Camera already started!"]; [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; return; } if (command.arguments.count > 3) { CGFloat x = (CGFloat)[command.arguments[0] floatValue] + self.webView.frame.origin.x; CGFloat y = (CGFloat)[command.arguments[1] floatValue] + self.webView.frame.origin.y; CGFloat width = (CGFloat)[command.arguments[2] floatValue]; CGFloat height = (CGFloat)[command.arguments[3] floatValue]; NSString *defaultCamera = command.arguments[4]; BOOL tapToTakePicture = (BOOL)[command.arguments[5] boolValue]; BOOL dragEnabled = (BOOL)[command.arguments[6] boolValue]; BOOL toBack = (BOOL)[command.arguments[7] boolValue]; CGFloat alpha = (CGFloat)[command.arguments[8] floatValue]; BOOL tapToFocus = (BOOL) [command.arguments[9] boolValue]; BOOL disableExifHeaderStripping = (BOOL) [command.arguments[10] boolValue]; // ignore Android only self.storeToFile = (BOOL) [command.arguments[11] boolValue]; // Create the session manager self.sessionManager = [[CameraSessionManager alloc] init]; // render controller setup self.cameraRenderController = [[CameraRenderController alloc] init]; self.cameraRenderController.dragEnabled = dragEnabled; self.cameraRenderController.tapToTakePicture = tapToTakePicture; self.cameraRenderController.tapToFocus = tapToFocus; self.cameraRen…
favorite count: 0
has title: Ionic Angular Camera Preview Plugin: How to Keep AVCaptureDeviceTypeBuiltInTripleCamera in Portrait Orientation?
tagged with: objective-c
type: Question
upvote count: 1
downvote count: 0
tagged with: angular
type: UnansweredQuestion
answer count: 0
score: 1
tagged with: ionic-framework
tagged with: swift
has comment: http://stackoverflow.com/comment/139897779

http://stackoverflow.com/q/79379840
accepted answer: http://stackoverflow.com/a/79388016
type: Question
tagged with: mac-catalyst
tagged with: objective-c
has answer: http://stackoverflow.com/a/79388016
favorite count: 0
upvote count: 0
tagged with: uitextview
type: AnsweredQuestion
score: -1
tagged with: uikit
downvote count: 1
has title: Update Visible Range UITextView Method
has body: The app's textView utilizes text kit 2. However the compiler reports it has to fall back to text kit 1 because text kit 1's layout manager was accessed, which was traced back to the code provided. When NSLayoutManger is not used, no warnings are reported. How can I refactor this method to resolve this issue? Here's the code: - (NSRange)visibleRange { // Get the layout manager associated with the text view NSLayoutManager *layoutManager = self.scriptView.layoutManager; // Get the visible rectangle of the text view CGRect visibleRect = self.scriptView.bounds; // Convert the visible rectangle into a glyph range NSRange glyphRange = [layoutManager glyphRangeForBoundingRect:visibleRect inTextContainer:self.scriptView.textContainer]; // Convert the glyph range into a character range and return it return [layoutManager characterRangeForGlyphRange:glyphRange actualGlyphRange:NULL]; } This code returns the viewable range of the textview when using Mac Catalyst.
answer count: 1

http://stackoverflow.com/comment/139932628
type: QuestionComment
score: 0
type: Comment
has text: A little example from Apple: https://developer.apple.com/forums/thread/688302
comment on: http://stackoverflow.com/q/79344272

http://stackoverflow.com/comment/139744846
has text: As the table view shows the selected content of a source list (another view), the arrows keys should navigate the source list, even if the focus is on the table view (trust me, it makes sense UI-wise). I can subclass if there is no simpler alternative.
comment on: http://stackoverflow.com/q/79246671
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/79412250
has comment: http://stackoverflow.com/comment/140048614
has comment: http://stackoverflow.com/comment/140048604
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/79412316
has body: I definitely remember being able to jump to definitions of system classes (e. g. NSWindow) in past versions of Xcode. Not in 16.2. Is that a setting that needs to be enabled, or something is broken in my setup, or is it an intentional change in functionality? EDIT: seems like something is broken in my Xcode setup. It jumps as expected to definitions of my classes, but not to the definitions of framework classes. Almost as if there is an index that enables the jumping logic, and it needs to be rebuilt for the MacOS SDK itself...
accepted answer: http://stackoverflow.com/a/79412316
has title: No more "jump to definition" for system classes in Xcode?
tagged with: objective-c
has comment: http://stackoverflow.com/comment/140048743
upvote count: 0
has comment: http://stackoverflow.com/comment/140048627
has comment: http://stackoverflow.com/comment/140048533
tagged with: cocoa
type: Question
tagged with: xcode
answer count: 1
has comment: http://stackoverflow.com/comment/140048664
has comment: http://stackoverflow.com/comment/140048567
favorite count: 0
score: -1

http://stackoverflow.com/q/79310010
answer count: 0
score: 1
tagged with: node.js
has body: I want to implement an addon using Rust to expose an addListener API. When I modify the system's time zone, I can receive a callback. using core_foundation_sys and neon The code is as follows: extern "C" fn notification_callback( _center: notification_center::CFNotificationCenterRef, _observer: *mut c_void, _name: notification_center::CFNotificationName, _object: *const c_void, _user_info: CFDictionaryRef, ) { println!("timezone_change"); } fn init_notification { unsafe { let center = notification_center::CFNotificationCenterGetLocalCenter(); let observer = &Observer as *const _ as *mut c_void; let name = CFStringCreateWithCString( kCFAllocatorDefault, b"kCFTimeZoneSystemTimeZoneDidChangeNotification\0".as_ptr() as *const i8, kCFStringEncodingUTF8, ); let object = ptr::null(); let suspension_behavior: isize = CFNotificationSuspensionBehaviorDeliverImmediately as isize; notification_center::CFNotificationCenterAddObserver( center, observer, notification_callback, name, object, suspension_behavior, ); // Run the main loop to keep the application alive and responsive to notifications CFRunLoopRun(); } } fn add_date_listener(mut cx: FunctionContext) -> JsResult<JsUndefined> { let cb_name_js = &cx.argument::<JsString>(0)?; let cb_name = cb_name_js.value(&mut cx); if cb_name == "timezone_change" { init_notification(); TimeZoneChangeEvent::new(cx) } else { Ok(cx.undefined()) } } fn create_date_module(cx: &mut ModuleContext) -> NeonResult<()> { let date = cx.empty_object(); let get_timezone_fn = JsFunction::new(cx, get_timezone)?; let add_date_listener_fn = JsFunction::new(cx, add_date_listener)?; date.set(cx, "getTimeZone", get_timezone_fn)?; date.set(cx, "addListener", add_date_listener_fn)?; cx.export_value("date", date)?; Ok(()) } #[neon::main] fn main(mut cx: ModuleContext) -> NeonResult<()> { create_date_module(&mut cx)?; Ok(()) } nodejs usage: const addon = require('dist/x.node'); addon.date.addListener('timezone_change', () => { console.log(timezone_change); }) prin…
upvote count: 1
tagged with: rust
tagged with: core-foundation
tagged with: macos
has title: Can the Rust compiled node extension listen for notification events on the Mac system?
favorite count: 0
type: Question
tagged with: objective-c
type: UnansweredQuestion
downvote count: 0

http://stackoverflow.com/comment/139745590
comment on: http://stackoverflow.com/q/79246671
has text: Usually the key events are sent to the focused UI element. There is no simple way to change that.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/79412316
answers question: http://stackoverflow.com/q/79412250
has body: It is indeed a setting, in the Navigation preferences: When I command-click on NSWindow in this code... ... I get this: I believe that's what you're looking for. I can't explain why that doesn't happen on your machine. I would suggest quitting Xcode and deleting the derived data and caches.
score: 1
downvote count: 0
type: AcceptedAnswer
upvote count: 1
has comment: http://stackoverflow.com/comment/140048637
type: Answer
has comment: http://stackoverflow.com/comment/140048632
accepted answer of: http://stackoverflow.com/q/79412250

scorm
tag name: scorm
tags question: http://stackoverflow.com/q/79393501
type: Tag

http://stackoverflow.com/q/79344272
type: Question
has comment: http://stackoverflow.com/comment/140023145
tagged with: objective-c
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/139940044
has comment: http://stackoverflow.com/comment/139929968
has title: How do I implement SSL Pinning using acmacalister/jetfire? (Objective-C)
score: 0
has comment: http://stackoverflow.com/comment/140021596
has comment: http://stackoverflow.com/comment/139932628
has comment: http://stackoverflow.com/comment/139932607
has comment: http://stackoverflow.com/comment/139925397
answer count: 0
has body: My goal is to implement a wss connection using SSL pinning on an React Native iOS module. For this problem, I chose to use Jetfire. I have the following class: @interface RCTWebSocketSslPinning : RCTEventEmitter <RCTBridgeModule, JFRWebSocketDelegate> @property (nonatomic, strong) JFRWebSocket *socket; @property bool hasListeners; -(void)sendEventToJavaScript:(NSString *)eventName withParams:(id)params; @end And the following fetch method: RCT_EXPORT_METHOD(fetch:(NSString *)url withOptions:(NSDictionary *)options callback:(RCTResponseSenderBlock)callback) { RCTLogInfo(@"Pretending to fetch %@ with options: %@", url, options.description); self.socket = [[JFRWebSocket alloc] initWithURL:[NSURL URLWithString: url] protocols:nil]; self.socket.delegate = self; NSString *path = [[NSBundle mainBundle] pathForResource:@"rootCA_public" ofType:@"cer"]; NSData *data = [NSData dataWithContentsOfFile:path]; if (data) { NSLog(@"Certificate loaded successfully!"); } else { NSLog(@"Failed to load certificate. Check the file path."); callback(@[ @"Failed to load certificate.", [NSNull null]]); } self.socket.security = [[JFRSecurity alloc] initWithCerts:@[[[JFRSSLCert alloc] initWithData:data]] publicKeys:YES]; [self.socket connect]; callback(@[[NSNull null], @"WebSocket fetch complete."]); } I implemented this method following the Jetfire guide here however when I run the program I get a run-time error within JFRSecurity.m: - (SecKeyRef)extractPublicKeyFromCert:(SecCertificateRef)cert policy:(SecPolicyRef)policy { SecTrustRef trust; SecTrustCreateWithCertificates(cert,policy,&trust); // ERROR: Thread x: EXC_BAD_ACCESS (code=1, address=0x8) SecTrustResultType result = kSecTrustResultInvalid; SecTrustEvaluate(trust,&result); SecKeyRef key = SecTrustCopyPublicKey(trust); CFRelease(trust); return key; } I analyzed the project and I get this message: I'm not familiar with Objective-C, and I'm not sure if this is a problem with the library that I'm using or if it's the way I'm attempting…
tagged with: sslpinning
has comment: http://stackoverflow.com/comment/139989324

http://stackoverflow.com/comment/140017549
type: AnswerComment
comment on: http://stackoverflow.com/a/79394310
type: Comment
has text: I trired the same soultion suggested above but that alos not work. Device_swift.framework version is ios10 MyFileFramework.frameworkversion is ios10 `tapas.mukherjee@BTM-Y39T7931V9 iOS % xcrun vtool -arch arm64 -show MyFileFramework.xcframework/ios-arm64_armv7/MyFileFramework.framework/MyFileFramework MyFileFramework.xcframework/ios-arm64_armv7/MyFileFramework.framework/MyFileFramework (architecture arm64): Load command 8 cmd LC_VERSION_MIN_IPHONEOS cmdsize 16 version 10.0 sdk 15.0 Load command 9 cmd LC_SOURCE_VERSION cmdsize 16 version 0.0`
score: 0

http://stackoverflow.com/q/79290269
has title: NSTableView dragImageForRowsWithIndexes: produces a blank image
tagged with: nstableview
has body: When an NSTableView's draggingDestinationFeedbackStyle is set to NSTableViewDraggingDestinationFeedbackStyleGap, the method dragImageForRowsWithIndexes:tableColumns:event:offset: returns an NSImage that appears to have the correct size, but it has no visible content (regardless of the offset argument). So I cannot set an image for dragged rows at the beginning of a drag in tableView:draggingSession:willBeginAtPoint:forRowIndexes:. There is nothing I can show under the cursor. The image appears correct with another draggingDestinationFeedbackStyle. Any solution that would allow using the whole dragged row as the image component of a dragged item using NSTableViewDraggingDestinationFeedbackStyleGap?
type: Question
tagged with: objective-c
type: UnansweredQuestion
score: 0
answer count: 0

http://stackoverflow.com/a/79360158
score: 0
type: Answer
answers question: http://stackoverflow.com/q/79351022
accepted answer of: http://stackoverflow.com/q/79351022
has body: Okay. After 2 weeks of searching I have found a solution to this issue. Seems in RNCallKeep library when you end the call if you used normal RNCallKeep.endCall() function, there may be some AudioSession can be hanging there and cause audio issues for the next calls. So my fix was calling RNCallKeep.endAllCalls() instead. So then this will clear all the audio sessions and restore the default configurations. This was fixed my audio issues.
type: AcceptedAnswer

http://stackoverflow.com/comment/140077822
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/79402308
has text: `WKOpenPanelParameters` knows the file types but it's private API. You can get them with `[parameters valueForKey:@"allowedFileExtensions"]`.
score: 0

http://stackoverflow.com/q/79269479
has body: So I have a view-based NSTableView whose contents are stored in an NSMutableArray. Basically I created a table view in the storyboard and inserted a control of type "Image and Text Table CellView", this table just holds a string and an image, for this example it's just a quiz and a grade: Now I would like to somehow implement a function to allow me to edit these two strings, the NSTableViewDataSource has this method called tableView:setObjectValue:forTableColumn:row: but it states that it should not be used for view-based tables and that I should instead use: target/action to set each item in the view cell. But what does that mean exactly? Am I supposed to subclass NSTableView?
tagged with: appkit
tagged with: objective-c
tagged with: cocoa
answer count: 0
type: Question
has title: Appkit & Cocoa - How to support editing for a view-based NSTableView?
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/28281045
score: 0

http://stackoverflow.com/comment/139979981
type: Comment
score: 4
comment on: http://stackoverflow.com/q/79376363
type: QuestionComment
has text: The simplest is to change `@property (nonatomic, retain) NSData * video;` to `@property (nonatomic, retain, nullable) NSData * video;` in the .h file. Then the property will be optional in Swift.

http://stackoverflow.com/a/79422535
has body: If you are compiling against an older SDK which does not know about newer APIs, then @available won't work, because the compiler still needs to know the method it's calling. Normally, you would do this once you switch to a newer SDK (i.e. newer Xcode). You can forcibly declare the method though, if you need to enable building with SDKs (i.e. using an older Xcode). You can check if you are compiling against an SDK older than the API in question, and if so, declare it the same way Apple does. This can go in your .m file so only the code that needs it can "see" it, or more publicly if you need the @available check across several files. #if TARGET_OS_OSX && (!defined(__MAC_15_0) || __MAC_OS_X_VERSION_MAX_ALLOWED < __MAC_15_0) @interface NSCursor (ForwardDeclaration15_0_Methods) @property (class, readonly, strong) NSCursor *columnResizeCursor NS_SWIFT_NAME(columnResize) API_AVAILABLE(macos(15.0)); @end #endif After that, the compiler knows about the method, and the code you had above should work, even with an older Xcode. The name of the category does not matter (though best to avoid duplicating another one).
score: 1
accepted answer of: http://stackoverflow.com/q/79312237
answers question: http://stackoverflow.com/q/79312237
type: AcceptedAnswer
type: Answer
upvote count: 1
downvote count: 0

concurrency
tags question: http://stackoverflow.com/q/79403737
tag name: concurrency
type: Tag

http://stackoverflow.com/q/79327312
type: Question
has comment: http://stackoverflow.com/comment/139940430
has body: So in swift there are "lazy vars" so I wanted to try the same thing in objective-c. Say I have a class with the following property: @interface MainWindowController : NSWindowController<NSWindowDelegate> @property(nonatomic, strong) NSTabViewController *tabViewController; @end After reading multiple questions here I noticed that people are always encouraged to access properties via : self.tabViewController rather than: _tabViewController but if I want to use lazy instantiation for this property I am pretty much compelled to use the backing ivar am I right? Like for the getter: (NSTabViewController *)tabViewController { if( !_tabViewController ) { _tabViewController = [[NSTabViewController alloc] init]; // ... } return _tabViewController; } if I use self.tabViewController here in the if statement it would recursively call the getter forever. Is this considered a correct usage of _ivar instead of self.ivar?
score: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/4142177
tagged with: appkit
has title: Objective-C Appropriate usage of ivar instead of property for lazy instantiation
answer count: 0
has comment: http://stackoverflow.com/comment/139887317
has comment: http://stackoverflow.com/comment/139888513
tagged with: objective-c
tagged with: cocoa

http://stackoverflow.com/a/79286829
score: 1
type: AcceptedAnswer
type: Answer
upvote count: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/79286630
answers question: http://stackoverflow.com/q/79286630
has body: A few observations: The simple way to add a URL (without the “display text”) is to just write the NSURL as an object and be done with it. [pasteboard writeObjects:@[url]]; If you use NSPasteboardTypeURL, it would be setPropertyList, not setString. I know there are sources that suggest that you can set setString with the display text, but in my experience, apps that pick up the simple string representation do not generally also simultaneously pick up the URL. And for apps that only pick up the string, the URL is generally more important than the “Click here” text, so I would be inclined to make the simple string representation the URL rather than the display text. I think the best way to support the “Click here” display text is with the RTF and HTML representations. The RTF representation has greater utility than the HTML, but it simply depends upon where you plan on pasting this. Different apps offer differing level of support for different representations. Anyway, perhaps: NSURL *url = [NSURL URLWithString:@"https://example.com"]; NSString *displayText = @"Click here"; NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; [pasteboard clearContents]; NSPasteboardItem *item = [[NSPasteboardItem alloc] init]; // Add the URL as the string representation [item setString:url.absoluteString forType:NSPasteboardTypeString]; // Add RTF representation NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:displayText]; NSRange range = NSMakeRange(0, displayText.length); [attributedString addAttribute:NSLinkAttributeName value:url range:range]; NSData *rtf = [attributedString RTFFromRange:range documentAttributes:@{}]; [item setData:rtf forType:NSPasteboardTypeRTF]; // Add HTML representation NSString *htmlString = [NSString stringWithFormat:@"%@", url.absoluteString, displayText]; [item setString:htmlString forType:NSPasteboardTypeHTML]; // Add the URL [item setPropertyList:url.absoluteString forType:NSPasteboardTypeURL]; // Wr…

http://stackoverflow.com/comment/139876069
score: 0
comment on: http://stackoverflow.com/q/79321316
type: QuestionComment
has text: Okay, you can probably write your own static property like that. Just use `pressesBegan`/`pressesEnded` etc to update it.
type: Comment

http://stackoverflow.com/q/79316508
tagged with: objective-c
answer count: 1
has body: While coding in Objective-C, I stumbled upon something very weird. When I add an allocated target to a UISwitch from a different class, it doesn't get called. But if the function is deallocated it gets called normally. Can someone explain this to me and is there anyway to call an allocated function from a different class in a UISwitch? Doesn't work: @implementation CustomClass : NSObject -(void) test { NSLog(@"TEST"); } @end UISwitch *uiSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(100, 100, 50, 50)]; [uiSwitch addTarget:[CustomClass alloc] action:@selector(test) forControlEvents:UIControlEventValueChanged]; [self addSubview:uiSwitch]; Works: @implementation CustomClass : NSObject +(void) test { NSLog(@"TEST"); } @end UISwitch *uiSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(100, 100, 50, 50)]; [uiSwitch addTarget:[CustomClass class] action:@selector(test) forControlEvents:UIControlEventValueChanged]; [self addSubview:uiSwitch];
accepted answer: http://stackoverflow.com/a/79316528
downvote count: 1
type: Question
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/79316528
tagged with: ios
type: AnsweredQuestion
upvote count: 2
has title: UISwitch addTarget fails to call an allocated function from a different class

http://stackoverflow.com/a/79307016
has body: am I doing this right or is there another way to get this side bar? Yes. The other way is to build a custom split view from NSViews. Do I really have to manually add a toolbar item with a target/action to make this work on appkit? Yes. The target is the NSSplitViewController and the action is toggleSidebar(_:).
accepted answer of: http://stackoverflow.com/q/79305765
answers question: http://stackoverflow.com/q/79305765
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/139871071
comment on: http://stackoverflow.com/a/79316528
has text: That only follows half of my answer. You also need to store the instance in an instance variable.
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/139940430
score: 1
type: Comment
type: QuestionComment
has text: You can't just only call properties. Something, somewhere needs to actually access the instance variable (even if it's an auto-synthesized property), after all, that's where the actual storage is. It is perfectly normal for your property getters and setters to directly interact with the ivars. Most other code should go through those getters and setters, though.
comment on: http://stackoverflow.com/q/79327312

http://stackoverflow.com/q/79279193
tagged with: srgb
type: UnansweredQuestion
tagged with: python
tagged with: colors
favorite count: 0
downvote count: 1
has comment: http://stackoverflow.com/comment/139838357
has comment: http://stackoverflow.com/comment/139837719
has comment: http://stackoverflow.com/comment/139800233
tagged with: objective-c
answer count: 0
score: 0
has body: I am trying to write some code in Python to display a color taken from a Swift program. However, that color is in the extendedSRGB format. extendedSRGB is similar to standard sRGB except RGB values can be outside of the typical 0 to 1 range. Upon further research, it seems that this is an Apple-made color format, so it is not supported in languages other than Swift or Objective-C. Note: it is called extendedSRGBColorSpace in Objective-C. I attempted to clip the RGB channels using srgb = np.clip(extended_srgb, 0, 1). I also tried taking the absolute value of the channels using srgb = np.abs(extended_srgb). However, neither of these techniques gave the correct color, particularly for shades of green. According to the extendedSRGB Apple Developer docs: This color space has the same colorimetry as sRGB, but component values below 0.0 and above 1.0 may be encoded in this color space. Negative values are encoded as the signed reflection of the original encoding function. y(x) = sign(x)*f(abs(x)) I tried following this to create a formula for converting extendedSRGB values back into standard sRGB format, but was unable to. When I used this formula, it seemed to convert negative numbers back into negative numbers. I also do not know what f(x) is in this case. My question is, what exactly is the formula for converting colors in the extendedSRGB format into standard sRGB format? Alternatively, is there any way in Python to convert from extendedSRGB colors to sRGB?
has comment: http://stackoverflow.com/comment/139800273
has title: How to convert from extendedSRGB color to standard sRGB outside of Swift or Objective-C
has comment: http://stackoverflow.com/comment/139800216
has comment: http://stackoverflow.com/comment/139800200
type: Question
upvote count: 1
tagged with: swift

http://stackoverflow.com/a/79326854
type: Answer
upvote count: 1
downvote count: 0
has body: This should help you with the Swift's AppTransaction API in Objective-C for receipt validation. A few suggestions to improve it: 1- The Swift code should use proper Swift naming conventions: private func validateAppStoreReceipt() async -&gt; Int { // Lowercase first letter for function names. } 2- Consider using an enum for return codes instead of magic numbers: @objc public enum ReceiptValidationResult: Int { case valid = 1 case invalid = 99 } 3- Add error handling for specific AppTransaction verification errors: case .unverified(_, let error): switch error { case .invalidSignature: return .invalidSignature case .deviceNotSupported: return .deviceNotSupported default: return .invalid } 4- In Objective-C, consider using dispatch groups if you need to wait for the async validation: dispatch_group_t group = dispatch_group_create(); dispatch_group_enter(group); [self.receiptValidation getValidityOfAppStoreReceiptWithCompletionHandler:^(NSInteger result, NSError *error) { // Handle result dispatch_group_leave(group); }]; If this helps, Please dont forget to approve it!
score: 1
answers question: http://stackoverflow.com/q/79318039

http://stackoverflow.com/comment/139888513
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/79327312
type: Comment
has text: See [Encapsulating Data](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/EncapsulatingData/EncapsulatingData.html)

http://stackoverflow.com/comment/140035141
score: 0
comment on: http://stackoverflow.com/q/79403737
type: Comment
has text: I wasn't able to get any error from the code you originally showed, so I could not comment directly on your assertions.
type: QuestionComment

http://stackoverflow.com/q/79393501
type: UnansweredQuestion
tagged with: scorm
answer count: 0
has comment: http://stackoverflow.com/comment/140040309
tagged with: ios
has title: SCORM lesson status is "In Progress" even after complete the reading of lesson
score: 0
tagged with: objective-c
has body: We have SCORM lesson feature in our iOS mobile app. We open the SCORM lesson in WKWebView with the following code: WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init]; if([[NSUserDefaults standardUserDefaults] objectForKey:[TMEUserDefaultKeys cdnSetCookie]]) { WKUserContentController *userContentController = [[WKUserContentController alloc] init]; [userContentController addScriptMessageHandler:self name:@"callNativeAction"]; [userContentController addScriptMessageHandler:self name:@"callNativeActionWithArgs"]; WKUserScript *cookieScript = [[WKUserScript alloc] initWithSource:[NSString stringWithFormat:@"document.cookie = '%@';", [[NSUserDefaults standardUserDefaults] objectForKey:[TMEUserDefaultKeys cdnSetCookie]]] injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES]; [userContentController addUserScript:cookieScript]; [configuration setUserContentController:userContentController]; } WKPreferences *preferences = [[WKPreferences alloc] init]; preferences.javaScriptEnabled = YES; preferences.javaScriptCanOpenWindowsAutomatically = YES; configuration.preferences = preferences; configuration.websiteDataStore = [WKWebsiteDataStore defaultDataStore]; configuration.allowsInlineMediaPlayback = YES; configuration.allowsAirPlayForMediaPlayback = YES; configuration.allowsPictureInPictureMediaPlayback = YES; configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone; //WKAudiovisualMediaTypeNone; NSArray<NSHTTPCookie *> *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]; for(NSHTTPCookie *cookie in cookies) { [configuration.websiteDataStore.httpCookieStore setCookie:cookie completionHandler:nil]; } self.webView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:configuration]; self.webView.UIDelegate = self; self.webView.navigationDelegate = self; self.webView.allowsLinkPreview = YES; self.webView.translatesAutoresizingMaskIntoConstraints = false; self.webView.scrollView.bo…
type: Question

http://stackoverflow.com/comment/140045236
comment on: http://stackoverflow.com/q/79403737
score: 0
type: QuestionComment
has text: Sorry what is a GAIT? The code is inside `viewDidLoad` of an empty template project (i didn't know it matters, but i was clearly wrong, sorry)
type: Comment

http://stackoverflow.com/comment/139898650
has text: BTW - ASCII is a subset of UTF-8. If the file is ASCII, decoding as UTF-8 will succeed.
comment on: http://stackoverflow.com/q/79333775
score: 4
type: QuestionComment
type: Comment

http://stackoverflow.com/q/79312237
accepted answer: http://stackoverflow.com/a/79422535
has body: I'm trying to use a different property names for a future macOS version due to deprecation. Specifically, NSCursor.columnResizeCursor is available on 15.0+, but I'm using the 14.0 SDK. I read that @available guards are the correct way to handle this. However, the code below does not compile when ran with clang -mmacos-version-min=10.14 -weak_framework AppKit main.m. The error is error: property 'columnResizeCursor' not found on object of type 'NSCursor' Is there anything I am doing wrong? I was under the impression that weak linking the AppKit framework wouldn't have it complain about missing properties. // main.m #include &lt;AppKit/AppKit.h&gt; int main() { if (@available(macOS 15.0, *)) { // This line does not compile! [NSCursor.columnResizeCursor set]; } else { [NSCursor.resizeLeftRightCursor set]; } }
type: Question
has answer: http://stackoverflow.com/a/79422535
has title: @available guard/weak linking not compiling
answer count: 1
tagged with: objective-c
score: 0
has comment: http://stackoverflow.com/comment/139863452
type: AnsweredQuestion

http://stackoverflow.com/comment/139838357
type: QuestionComment
comment on: http://stackoverflow.com/q/79279193
score: 0
type: Comment
has text: @Evan93 PS: _"When I used this formula, it seemed to convert negative numbers back into negative numbers"_ A possible solution might be to **mask** or **bit-shift** the resulting channel number into range of 8-bits. Bit-Masking would remove the sign. What/How to do the conversion will depend on the **bit-depth** of your extendedSRGB color... If not sure, then tell us some numbers for primary and secondary hues.

http://stackoverflow.com/comment/139983320
comment on: http://stackoverflow.com/q/79376363
type: Comment
has text: Nullable = optional.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/140033361
comment on: http://stackoverflow.com/q/79403737
has text: `@preconcurrency` reduces an error to a warning. It does not make the facts magically go away.
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/139813846
comment on: http://stackoverflow.com/q/79286630
has text: Try removing all of the `NSPasteboardItem` code and simply do `[pasteboard writeObject:@[ url ]];`. `NSURL` conforms to `NSPasteboardWriting`.
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/79376958
type: Question
has body: We’re using a UIColor subclass with three public properties (hovered, pressed, disabled) and one private property (idle) to model stateful colors. The idle state is considered the default color for any reference to an instance of this subclass. This implementation has worked very well for our needs. However, as we added dark mode support, we noticed an issue: while all colors update automatically in response to trait changes (e.g., dark mode), the default idle color does not. Interestingly, when we experimented with exposing idle as a public property, it updated correctly in dark mode. This makes us suspect that there’s an issue with how the idle property is resolved internally in our subclass. Below is the relevant implementation: @interface CUIColorVariant : UIColor @property (nonatomic, readonly) UIColor *hovered; @property (nonatomic, readonly) UIColor *pressed; @property (nonatomic, readonly) UIColor *disabled; - (instancetype)initWithIdle:(UIColor *)idle hovered:(UIColor *)hovered pressed:(UIColor *)pressed disabled:(UIColor *)disabled; @end @interface CUIColorVariant () @property (nonatomic, strong) UIColor *idle; @end @implementation CUIColorVariant - (instancetype)initWithIdle:(UIColor *)idle hovered:(UIColor *)hovered pressed:(UIColor *)pressed disabled:(UIColor *)disabled { self = [super init]; if (self) { _idle = idle; _hovered = hovered; _pressed = pressed; _disabled = disabled; } return self; } #pragma mark - Required UIColor methods - (CGColorRef)CGColor { return self.idle.CGColor; } - (CIColor *)CIColor { return self.idle.CIColor; } - (void)set { [self.idle set]; } - (void)setFill { [self.idle setFill]; } - (void)setStroke { [self.idle setStroke]; } - (UIColor *)colorWithAlphaComponent:(CGFloat)alpha { return [self.idle colorWithAlphaComponent:alpha]; } - (UIColor *)resolvedColorWithTraitCollection:(UITraitCollection *)traitCollection { return [self.idle resolvedColorWithTraitCollection:traitCollection]; } - (BOOL)getWhite:(nullable CGFloat *)white a…
type: UnansweredQuestion
tagged with: darkmode
has comment: http://stackoverflow.com/comment/139985049
tagged with: uikit
tagged with: uicolor
has title: UIColor Subclass with Stateful Colors: Idle Color Doesn’t Update in Dark Mode
tagged with: objective-c
has comment: http://stackoverflow.com/comment/139984748
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/140116790

http://stackoverflow.com/q/79305765
has body: I want to use Appkit/Cocoa to create a split view with a side bar, I have this sample code in SwiftUI that does that: import SwiftUI struct ContentView: View { var body: some View { NavigationSplitView { // Sidebar List { NavigationLink("Item 1", value: "Item 1 Details") NavigationLink("Item 2", value: "Item 2 Details") NavigationLink("Item 3", value: "Item 3 Details") } .navigationTitle("Items") } content: { // Main content (detail view for selected item) Text("Select an item to see details.") .padding() } detail: { // Detail view (for the selected item) Text("Select an item from the sidebar to view details.") .padding() } } } struct MyApp: App { var body: some Scene { WindowGroup { ContentView() } } } Now, for AppKit I tried using an NSSplitViewController: @interface SplitViewController : NSSplitViewController<NSSplitViewDelegate> @property (strong) IBOutlet NSSplitView *splitView; @property (weak) IBOutlet NSSplitViewItem *sideBarView; @property (weak) IBOutlet NSSplitViewItem *rightView; -(IBAction)hideSideBarNow:(id)sender; @end Notice that I also had to manually add a ToolbarItem with the 'sidebar.left' icon that calls a method to collapse the view when clicked: -(void)hideSideBarNow:(id)sender { static BOOL isCollapsing = YES; [[[[self splitViewItems] firstObject] animator] setCollapsed:isCollapsing]; isCollapsing = !isCollapsing; } This works fine and all but I noticed the button looks a bit different if you compare it to the SwiftUI version or any other macOS applications. So I wonder am I doing this right or is there another way to get this side bar? Do I really have to manually add a toolbar item with a target/action to make this work on appkit? I know that I could use NSHostingController to use a SwiftUI controller but I want to do it with Appkit/Cocoa only.
upvote count: 0
accepted answer: http://stackoverflow.com/a/79307016
has title: What is the equivalent of SwiftUI NavigationSplitView and NavigationLink in Cocoa/Appkit?
score: -1
has comment: http://stackoverflow.com/comment/139848147
has comment: http://stackoverflow.com/comment/139848674
downvote count: 1
type: Question
answer count: 1
tagged with: appkit
has answer: http://stackoverflow.com/a/79307016
tagged with: objective-c
tagged with: cocoa
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/comment/139985838
type: QuestionComment
comment on: http://stackoverflow.com/q/79322635
score: 0
type: Comment
has text: Got it, thanks @Willeke

http://stackoverflow.com/q/79336530
score: 2
type: Question
downvote count: 0
has title: Reference counting an uninitialized object
upvote count: 2
type: AnsweredQuestion
tagged with: objective-c
tagged with: automatic-ref-counting
answer count: 1
has body: I have some Objective C code compiled with ARC: void func(void) { NSString *string; // Do some stuff. Maybe return early. string = @"initialized"; // Other stuff. } How does ARC handle an uninitialized object pointer? I assume that, like a C pointer, string initially contains stack garbage. If so, then how does ARC know what to do with it if, say, I were to return before initializing the variable? Do I need to initialize it to, say, nil, to avoid memory leaks? Does it matter if the reference was to a dispatch object or block instead of an NSObject?
has answer: http://stackoverflow.com/a/79336677
accepted answer: http://stackoverflow.com/a/79336677
favorite count: 0

http://stackoverflow.com/a/79336677
score: 3
type: AcceptedAnswer
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/79336530
answers question: http://stackoverflow.com/q/79336530
upvote count: 3
has body: I assume that, like a C pointer, string initially contains stack garbage. This is actually not the case. From the Clang ARC docs: It is undefined behavior if the storage of a __strong or __weak object is not properly initialized before the first managed operation is performed on the object, or if the storage of such an object is freed or reused before the object has been properly deinitialized. i.e., garbage object pointers are invalid under ARC rules Storage for a __strong or __weak object may be properly initialized by filling it with the representation of a null pointer, e.g. by acquiring the memory with calloc or using bzero to zero it out. A __strong or __weak object may be properly deinitialized by assigning a null pointer into it. A __strong object may also be properly initialized by copying into it (e.g. with memcpy) the representation of a different __strong object whose storage has been properly initialized; doing this properly deinitializes the source object and causes its storage to no longer be properly initialized. i.e., strong references are valid when they either point to nil or a valid object pointer. (weak references are a little more complicated) The crux: These requirements are followed automatically for objects whose initialization and deinitialization are under the control of ARC: objects of static, automatic, and temporary storage duration instance variables of Objective-C objects elements of arrays where the array object’s initialization and deinitialization are under the control of ARC fields of Objective-C struct types where the struct object’s initialization and deinitialization are under the control of ARC non-static data members of Objective-C++ non-union class types Objective-C++ objects and arrays of dynamic storage duration created with the new or new[] operators and destroyed with the corresponding delete or delete[] operator They are not followed automatically for these objects: objects of dynamic storage duration created in other m…

http://stackoverflow.com/comment/139818756
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79286805
has text: But this creates a new problem. ``dragImageForRowsWithIndexes:`` returns a blank image when I call this method within ``tableView:draggingSession:willBeginAtPoint:forRowIndexes:``. This returns the correct image of the row when the row size style is "custom".

http://stackoverflow.com/comment/139940044
type: Comment
comment on: http://stackoverflow.com/q/79344272
has text: Thanks for the replies, but this does not solve our problem. The root certificate of authority we are using is self-signed. We have decided to request the users to download and install this certificate instead of including the certificate in the app, and pinning it.
score: 0
type: QuestionComment

http://stackoverflow.com/q/79259549
tagged with: nstableview
tagged with: nssortdescriptor
has body: I'm trying to implement a custom sort for a column in an NSTableView. The data for this column contains double values inside a custom object, where some of the values are positive, some are negative, and some are "not applicable" (i.e. this row doesn't matter and should be sorted to the bottom). I've created a comparison method in my table view that looks like this... - (NSComparisonResult) myCompare:(id) obj1 : (id) obj2 { if (obj1 < obj2) return NSOrderedAscending; else if (obj1 > obj2) return NSOrderedDescending; else return NSOrderedSame; // they must be the same }; ...where the comparisons of obj1 and obj2 actually dig into the data of the objects being compared. In my storyboard, the Sort key for the column is: myObject And the selector for the column is: myCompare: Running the code and clicking on the column I wish to sort on results in: Thread 1: "-[__NSCFNumber myCompare:]: unrecognized selector sent to instance 0x600003824740" Obviously, things aren't set up quite right. I made some changes to my viewWillAppear method to set the sort descriptors, but the same error appears. How do I get my table view to recognize and call the custom sort routine?
tagged with: objective-c
type: Question
has answer: http://stackoverflow.com/a/79260158
answer count: 1
score: 0
has title: Custom sorting column of NSTableView
type: UnansweredQuestion
tagged with: interface-builder

http://stackoverflow.com/q/79355825
score: 0
has body: Recently, in Swift 5.9 I think Apple released support for interoperability between Swift and Objective-C++/C++. I'm currently working on a project that has a lot of Swift, Objective-C and Objective-C++/C++ and not being able to interoperate between Swift and C++ has always been a sticking point requiring an array messy wrappers. In the spirit of this, I updated my project's Swift version to Swift 6 to support this. The last setting I needed to change was C++ and Objective-C Interoperability from C/Objective-C to C++/Objective-C++. Doing this though created numerous errors of the variety of /Users/---/Bridging-Header.h:7:9 failed to emit precompiled header '/Users/---/Library/Developer/Xcode/DerivedData/Project-akhczzqbkaltwdgzmryrlhcpnduq/Build/Intermediates.noindex/PrecompiledHeaders/Bridging-Header-swift_3CPL2KPLMYXOU-clang_35SMM50I2WP8K.pch' for bridging header '---/Bridging-Header.h' Note: sensitive file paths have been omitted and replaced with --- I've tried playing with various related build settings to get rid of these errors but all to no avail. How do I properly update my project to avoid these errors and fully support Objective-C++/C++ interoperability?
tagged with: objective-c
tagged with: c++
downvote count: 1
type: Question
upvote count: 1
tagged with: swift
tagged with: xcode
has title: Update Xcode Project to Support Objective-C++/C++ Interop
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/139942856
favorite count: 0
has comment: http://stackoverflow.com/comment/139941344
answer count: 0
tagged with: language-interoperability

http://stackoverflow.com/q/79333775
has comment: http://stackoverflow.com/comment/139900437
tagged with: string
favorite count: 0
has comment: http://stackoverflow.com/comment/139898858
has title: Swift ASCII string fails, but works in Objective-C
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/139900206
has comment: http://stackoverflow.com/comment/139902231
has comment: http://stackoverflow.com/comment/139898650
tagged with: swift
has comment: http://stackoverflow.com/comment/139898632
downvote count: 1
tagged with: ios
tagged with: ascii
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/139900221
has body: I'm converting some code from Objective-C to Swift and I have a very simple function that reads text from a file into a string. @implementation DecodeFile - (NSString * _Nullable)readFile:(nonnull NSURL *)selectedFile { NSString *utf8 = [[NSString alloc] initWithContentsOfURL:selectedFile encoding:NSUTF8StringEncoding error:nil]; if (utf8) { return utf8; } NSString *ascii = [[NSString alloc] initWithContentsOfURL:selectedFile encoding:NSASCIIStringEncoding error:nil]; if (ascii) { return ascii; } return nil; } @end If utf8 fails, it attempts ascii. This works perfectly fine, but my Swift implementation fails with an ASCII file that succeeds using Obj-C! print(try? String(contentsOf: selectedFile, encoding: .utf8)) &lt;-- nil print(try? String(contentsOf: selectedFile, encoding: .ascii)) &lt;-- nil print(String(data: data, encoding: .utf8)) &lt;-- nil print(String(data: data, encoding: .ascii)) &lt;-- nil // Obj-C implementation print(DecodeFile().read(selectedFile)) &lt;-- WORKS Why would this fail, and how can I get the same behaviour from Swift as Obj-C?
has comment: http://stackoverflow.com/comment/139900228
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/comment/139878283
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79321383
score: 1
has text: @simd it’s called [`alphaShift`](https://developer.apple.com/documentation/uikit/uikeymodifierflags/alphashift) in UIKit.

http://stackoverflow.com/comment/140021596
comment on: http://stackoverflow.com/q/79344272
type: QuestionComment
type: Comment
has text: We cannot use Let's Encrypt. We provide clients with physical servers, and these servers are installed and designed to operate on a local network without internet access. These servers, all in local networks, do not have domain names.
score: 0

http://stackoverflow.com/q/79376363
tagged with: conditional-binding
tagged with: option-type
favorite count: 0
has comment: http://stackoverflow.com/comment/139984640
tagged with: swift
has comment: http://stackoverflow.com/comment/139995350
has answer: http://stackoverflow.com/a/79378181
downvote count: 1
has comment: http://stackoverflow.com/comment/139983320
answer count: 1
has comment: http://stackoverflow.com/comment/139979981
has title: Best way to represent Objective-C properties as optionals in Swift
score: 0
tagged with: null
tagged with: objective-c
has comment: http://stackoverflow.com/comment/139985586
type: Question
has comment: http://stackoverflow.com/comment/139986219
has body: I am working on a hybrid Objective-C/Swift project containing many legacy Objective-C NSObjects with properties. In Objective-C, the values of the properties can be nil. However, when accessed from Swift, they are ingested as non-optional. I don't want to change the legacy Objective-C code as it is used throughout the project in many places. What Swift code can I write to access the properties given that they may be nil? Here is a stripped down version of the code with two things I have tried: Objective-C: @interface myObject : NSObject @property (nonatomic, retain) NSData * video; Swift //object with property is sent in Notification if let latest = notification.userInfo?["incoming"] as? myObject { // Approach 1...compare to nil gives compiler warning let thevideo = latest.video if theVideo != nil { //thows compiler warning Comparing non-optional value of type 'Data' to 'nil' always returns true //do something with video } else { //handle nil case } // Approach 2..treat it like optional gives compiler error if let aVideo = latest.video { //compiler error: initializer for conditional binding must have Optional type, not 'Data' //Do something with the video if it exists } else { //handle nil case } How can I check if the property is nil given that it is not an optional in Swift?
upvote count: 1
type: UnansweredQuestion

http://stackoverflow.com/comment/140048604
type: Comment
has text: Command-clicking on `NSWindow` jumps to the NSWindow class definition in the AppKit header. Option-clicking on `NSWindow` brings up a Quick Help pop-up about NSWindow; at the bottom of that pop-up is Open In Developer Documentation, and clicking that brings up the NSWindow entry in the documentation window. None of this seems very different from earlier versions. Is there something else you remember from earlier versions that's missing here? Perhaps you are wishing for the Symbol Navigator, which is indeed gone.
score: 0
comment on: http://stackoverflow.com/q/79412250
type: QuestionComment

http://stackoverflow.com/a/79321383
has comment: http://stackoverflow.com/comment/139878500
has comment: http://stackoverflow.com/comment/139879518
has comment: http://stackoverflow.com/comment/139878454
accepted answer of: http://stackoverflow.com/q/79321316
answers question: http://stackoverflow.com/q/79321316
has comment: http://stackoverflow.com/comment/139878283
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/139876916
type: Answer
has body: You can write such a static property yourself, and update it as the key presses change, by overriding pressesBegan/pressesEnded in your app delegate/scene delegate (or anywhere else along the responder chain). extension UIEvent { fileprivate(set) static var modifierKeys: UIKeyModifierFlags = [] } // ... override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) { UIEvent.modifierKeys.formUnion(event?.modifierFlags ?? []) } override func pressesEnded(_ presses: Set<UIPress>, with event: UIPressesEvent?) { UIEvent.modifierKeys.formIntersection(event?.modifierFlags ?? []) } override func pressesCancelled(_ presses: Set<UIPress>, with event: UIPressesEvent?) { UIEvent.modifierKeys.formIntersection(event?.modifierFlags ?? []) } The above cannot get you the current state of the caps lock key until your app receives a key press. The only way I found is through private IOKit APIs (inspired by this answer). This will likely get your app rejected from the App Store, but I will include it anyway as a proof of concept. // ---- Implementation ---- #include <IOKit/IOKitLib.h> #define kIOHIDSystemClass "IOHIDSystem" #define kIOHIDParamConnectType 1 #define kIOHIDCapsLockState 0x00000001 // In macOS the above constants and IOHIDGetModifierLockState // are declared in IOKit/hid/IOHIDLib.h but that header is not in iOS. // Even so, IOHIDGetModifierLockState apparently *does* exist in iOS // so we can just declare its prototype and linking succeeds nonetheless extern kern_return_t IOHIDGetModifierLockState( io_connect_t handle, int selector, bool *state ); @implementation ObjCClass + (BOOL)getCapsLock { bool state = false; @autoreleasepool { io_service_t ioService = IOServiceGetMatchingService(kIOMainPortDefault, IOServiceMatching(kIOHIDSystemClass)); io_connect_t ioConnect = 0; IOServiceOpen(ioService, mach_task_self_, kIOHIDParamConnectType, &ioConnect); IOHIDGetModifierLockState(ioConnect, kIOHIDCapsLockState, &state); IOServiceClose(ioConnect); } return state…

http://stackoverflow.com/comment/139766600
score: 0
has text: Notification presentation is not something your app does, so it is not part of the system under test and you should not make any attempt to test it. You can mock the notification center to see whether your app configures and adds the notification as expected, but that would be a unit test, not a UI test.
type: QuestionComment
comment on: http://stackoverflow.com/q/79259799
type: Comment

http://stackoverflow.com/comment/139917269
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/79334360
score: 0
has text: Apply a transform?

option-type
tags question: http://stackoverflow.com/q/79376363
type: Tag
tag name: option-type

http://stackoverflow.com/comment/139800200
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/79279193
type: Comment
has text: The extended sRGB colorspace is used to describe colors with a larger gamut (Display P3) while still being compatible with sRGB. I *think* that truncating the components to 0.0 ... 1.0 should be the right approach.

http://stackoverflow.com/comment/139800273
type: Comment
comment on: http://stackoverflow.com/q/79279193
score: 0
type: QuestionComment
has text: The formula you found is the *transfer function* of the extended sRGB color space, and f(x) is the transfer function of the non-extended sRGB color space. This formula is not how you convert from sRGB to extended sRGB.

http://stackoverflow.com/q/79351022
has body: I have a mobile app that uses for taking voice calls between two parties via VoIP protocol. That was worked until iOS 16 and now it is giving one way audio issues. That means when I try to take a call to another user, sometimes that user cannot hear my voice. This is sporadic and it activates the audio when I toggle the speaker button. So I am using PortSIP (licensed) SDK for SIP connections and RNCallKeep library to handle CallKit operations. I have tried activating audio using AVAudioSession's [audioSession setActive:YES error:nil] but no any improvements either. Also tried to set Configurations manually to BOOL success = [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord mode:AVAudioSessionModeVoiceChat options:AVAudioSessionCategoryOptionAllowBluetooth error:&error]; But still I have the issues. Then I tried to set configs to the RNCallKeep like below. NSDictionary *audioSession = @{ @"categoryOptions": @(AVAudioSessionCategoryOptionAllowBluetooth), @"mode": AVAudioSessionModeVoiceChat }; [RNCallKeep setup:@{ @"appName": @"My App", @"maximumCallGroups": @1, @"maximumCallsPerCallGroup": @1, @"includesCallsInRecents": @NO, @"supportsVideo": @NO, @"imageName": @"app-icon.png", @"audioSession": audioSession }]; Still no any improvements. When I tried to run RNCallKeep.setAudioRoute(systemId, audioRouteName); with below parameters to forcefully set the audio route to phone. But still having issues with it. RNCallKeep.setAudioRoute(<some id>,"phone"); So can anyone help me to get through this. Thank you.
has title: One way Audio issues in iOS 18.2 on call apps
tagged with: react-native-call-keep
type: Question
downvote count: 0
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/79360158
score: 1
favorite count: 0
tagged with: portsip
tagged with: ios18
type: AnsweredQuestion
tagged with: objective-c
tagged with: react-native
accepted answer: http://stackoverflow.com/a/79360158

http://stackoverflow.com/comment/139900206
type: QuestionComment
comment on: http://stackoverflow.com/q/79333775
score: 0
type: Comment
has text: It seems that’s exactly what’s happened. Objective-C .ascii falls back to `.windowsCP1252`. So when UTF fails, the ASCII also fails but falls back to WinCP.

http://stackoverflow.com/q/79321725
tagged with: skia
tagged with: ios
type: Question
tagged with: objective-c
type: UnansweredQuestion
tagged with: c++
tagged with: objective-c++
downvote count: 0
favorite count: 0
has title: Skia memory issues when used from static library on iOS
has comment: http://stackoverflow.com/comment/139882316
answer count: 0
has body: I've compiled Skia for iOS: bin/gn gen out/ios-apple --args='target_os="ios" target_cpu="arm64" ios_use_simulator=false skia_enable_tools=false is_official_build=false is_debug=true is_trivial_abi=false skia_use_metal=true skia_use_expat=false skia_use_system_expat=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_system_freetype2=false skia_use_system_harfbuzz=false skia_use_system_icu=false skia_enable_gpu=true skia_enable_skottie=false skia_compile_modules=true extra_cflags=["-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks"] extra_ldflags=["-framework", "CoreFoundation", "-framework", "Metal"]' This is how I'm using it in a View Controller: #import <MetalKit/MetalKit.h> #import <Metal/Metal.h> #import <UIKit/UIKit.h> #define SK_GANESH #define SK_METAL #import <include/gpu/ganesh/GrDirectContext.h> #import <include/core/SkSurface.h> @interface SkiaViewController : UIViewController <MTKViewDelegate> @property (nonatomic, strong) MTKView *mtkView; @property (nonatomic, strong) id<MTLDevice> metalDevice; @property (nonatomic, strong) id<MTLCommandQueue> metalQueue; @property (nonatomic, assign) sk_sp<GrDirectContext> grDirectContext; @property (nonatomic, assign) sk_sp<SkSurface> surface; @end #import <MetalKit/MetalKit.h> #import <Metal/Metal.h> #define SK_GANESH #define SK_METAL #import "include/gpu/ganesh/GrTypes.h" #import "include/gpu/ganesh/SkSurfaceGanesh.h" #import "include/gpu/ganesh/mtl/GrMtlTypes.h" #import <include/gpu/ganesh/GrBackendSurface.h> #import <include/gpu/ganesh/SkSurfaceGanesh.h> #import <include/gpu/ganesh/mtl/GrMtlBackendContext.h> #import <include/gpu/ganesh/mtl/GrMtlBackendSurface.h> #import <include/gpu/ganesh/mtl/GrMtlDirectContext.h> #import <include/gpu/ganesh/mtl/SkSurfaceMetal.h> #import <include/gpu/ganesh/GrDirectContext.h> #import <include/core/SkSurface.h> #import <include/core/SkCanvas.h> #import <inc…
upvote count: 1
score: 1

http://stackoverflow.com/comment/139904746
score: 0
has text: @Willeke as in the controller itself doesn't change at all. From what I've seen so far it seems that it's not possible to customize NSProgressIndicator.
type: QuestionComment
comment on: http://stackoverflow.com/q/79334360
type: Comment

http://stackoverflow.com/q/79322635
tagged with: midi
has body: I'm trying to debug incoming MMC "locate" messages that are being sent from Pro Tools to my macOS app. I can't parse the bytes I'm receiving - they seem to be encoded or wrapped or something. My development environment is: macOS Sequoia, Xcode 16.1, targeted minimum deployment macOS 13.5, Objective-C. I've defined my input port using Core MIDI, like this: MIDIInputPortCreateWithProtocol(client, CFSTR("Input port"), kMIDIProtocol_1_0, &inPort, gReceiveBlock); I get the MIDI message in my gReceiveBlock callback routine, so I know everything is setup properly (endpoints, ports, MMC ID, etc). But the bytes in the incoming packet don't line up with what is in the MIDI spec. I'm using the MIDI Monitor app to sniff messages, and it shows the packet sent from Pro Tools: 16:48:30.173 From IAC Driver Bus 1 SysEx Universal Real Time 13 bytes F0 7F 01 06 44 06 01 01 01 0F 23 00 F7 But in my app, when I examine the packet, I see: timeStamp MIDITimeStamp 0x0000000000000000 wordCount UInt32 0x00000004 words UInt32[64] [0] UInt32 0x30167f01 [1] UInt32 0x06440601 [2] UInt32 0x30350101 [3] UInt32 0x0f210000 I've bolded the bytes that don't match between MIDI Monitor's "words" buffer and mine. Specifically, in my buffer the first byte is not a SysEx byte (0xF0), there are extra bytes inserted between the control bytes and the timecode bytes, the frames value of the timecode bytes is incorrect, and there's no ending byte (0xF7). Here's the code that receives the bytes: MIDIReceiveBlock const gReceiveBlock = ^(const MIDIEventList *eventList, void *srcConnRefCon) { // Process each packet in the event list const MIDIEventPacket *packet = &eventList->packet[0]; for (int i = 0; i < eventList->numPackets; ++i) { // Get the MIDI words (32-bit data chunks) for (int w = 0; w < packet->wordCount; ++w) { uint32_t word = packet->words[w]; // Process the packet } packet = MIDIEventPacketNext(packet); } }; What am I not getting? BTW I tried changing kMIDIProtocol_1_0 to kMIDIProtocol_2_0 when creati…
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/139883617
has comment: http://stackoverflow.com/comment/139879646
has title: MIDI Machine Control packet has unexpected bytes
tagged with: objective-c
has comment: http://stackoverflow.com/comment/139985838
has comment: http://stackoverflow.com/comment/139882370
tagged with: coremidi
score: 0
type: Question

http://stackoverflow.com/q/79286805
has comment: http://stackoverflow.com/comment/139814253
score: 0
answer count: 0
has body: I have several NSTableView instances whose draggingDestinationFeedbackStyle is set to NSTableViewDraggingDestinationFeedbackStyleGap. The delegate method tableView:validateDrop:proposedRow:proposedDropOperation: returns NSDragOperationMove. When I drag a row upward, all the rows that are above the dragged row and below the destination move down, to create the "gap", except the row just above the dragged row. This one never moves down. So the next row (which moves down as it should), overlap with the row that doesn't move down. (Moving a row downwards works as it should.) This has been happening on all macOS version I've tested (11 to 15) and in all table views that I tested (even in a test project that contains nothing but the table in a window). What am I doing wrong?
has comment: http://stackoverflow.com/comment/139818500
has title: NSTableView doesn't move row down when using NSTableViewDraggingDestinationFeedbackStyleGap
tagged with: nstableview
type: Question
has comment: http://stackoverflow.com/comment/139818756
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/q/79289144
has comment: http://stackoverflow.com/comment/139818958
has comment: http://stackoverflow.com/comment/139818198
tagged with: objective-c
has title: Why is Clang adding underscore suffixes to Objective-C parameter names in autogenerated headers
tagged with: c++
has body: I had a Swift method with a parameter called module. I noticed that the [Project]-Swift.h autogenerated header renamed that parameter to module_ in the Objective-C signature for that method. After some more investigation, it looks like this is happening for C++ keywords: @objcMembers class SomeClass: NSObject { func someMethod(init: String) {} // ↓ These will append an underscore in the header file. func someMethod(template: String) {} func someMethod(consteval: String) {} } becomes: SWIFT_CLASS("_TtC9iOSTester9SomeClass") @interface SomeClass : NSObject - (void)someMethodWithInit:(NSString * _Nonnull)init; - (void)someMethodWithTemplate:(NSString * _Nonnull)template_; - (void)someMethodWithConsteval:(NSString * _Nonnull)consteval_; - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; @end Is this documented behaviour of the compiler or just some implementation detail? Why would it be necessary?
has comment: http://stackoverflow.com/comment/139818213
type: Question
upvote count: 1
tagged with: clang
favorite count: 0
tagged with: swift
has comment: http://stackoverflow.com/comment/139820144
type: UnansweredQuestion
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/139818239
answer count: 0

http://stackoverflow.com/comment/139925397
type: Comment
comment on: http://stackoverflow.com/q/79344272
score: 0
type: QuestionComment
has text: Who needs SSL pinning when Certificate Transparency is supported from the box.

http://stackoverflow.com/comment/139984640
score: 0
type: Comment
comment on: http://stackoverflow.com/q/79376363
has text: Apple provides an entire documentation page for just this: https://developer.apple.com/documentation/swift/designating-nullability-in-objective-c-apis. You’ll probably want to start with wrapping most of your Objective C headers with `NS_ASSUME_NONNULL_BEGIN`, and then annotating the properties that you’re certain can never be nil.
type: QuestionComment

http://stackoverflow.com/q/79403737
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/140045236
has comment: http://stackoverflow.com/comment/140050790
upvote count: 1
tagged with: swift
has title: @preconcurrency import does not silence Sendable warning
has comment: http://stackoverflow.com/comment/140050984
has comment: http://stackoverflow.com/comment/140033431
has comment: http://stackoverflow.com/comment/140035141
has answer: http://stackoverflow.com/a/79418966
has comment: http://stackoverflow.com/comment/140033361
has comment: http://stackoverflow.com/comment/140036202
downvote count: 1
type: Question
tagged with: concurrency
answer count: 1
tagged with: objective-c
has comment: http://stackoverflow.com/comment/140050774
type: UnansweredQuestion
has body: I have this Objective-C framework FooModule: // Foo2.h #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN typedef void (^Reply)(id data); typedef void (^Handler)(Reply reply); @interface Foo2 : NSObject - (id)initWithQueue: (dispatch_queue_t)queue; - (void)setupHandler: (Handler)handler; @end NS_ASSUME_NONNULL_END // Foo2.m #import "Foo2.h" @implementation Foo2 { dispatch_queue_t _queue; } - (id)initWithQueue: (dispatch_queue_t)queue { if ((self = [super init])) { _queue = queue; } return self; } - (void)setupHandler:(Handler)handler { dispatch_async(_queue, ^{ handler(^(id data){ NSLog(@"data is %@", data); }); }); } @end Then in my app binary, I do @preconcurrency import FooModule func aGlobalFreeFunction() { let foo = Foo2(queue: .global()) foo.setupHandler { reply in Task { reply("foo") } } } This gives me error (not warning) in swift 6 mode: Passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure I wonder why @preconcurrency import doesn't silence the error. I tried out another non-closure type: @interface FooNonSendable : NSObject @property int foo; @end @implementation FooNonSendable @end Then in my swift code, after using @preconcurrent import: func aGlobalFreeFunction() { let fooNonSendable = FooNonSendable() Task { Task { @MainActor in print(fooNonSendable) } } } This code does not give any errors or warnings, meaning that @preconcurrency is able to silence error for fooNonSendable, but not reply closure.

http://stackoverflow.com/comment/139916717
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79316528
has text: @Jack Update your question with your new code trying to implement my answer. You must be doing something incorrectly.

http://stackoverflow.com/q/79321316
has answer: http://stackoverflow.com/a/79321383
favorite count: 0
has comment: http://stackoverflow.com/comment/139876069
tagged with: cocoa-touch
type: Question
tagged with: swift
has title: Check if shift/cmd/option/caps-lock key is pressed in iOS app
has comment: http://stackoverflow.com/comment/139876034
has body: I'm making an iOS application which can use hardware keyboard or run on Apple-Silicon macs. It seems that macos apps can take use of a very convenient APIs for checking if some of the modifier keys are pressed (How to check if Option key is down when user clicks a NSButton) like BOOL alt = [NSEvent modifierFlags] &amp; NSAlternateKeyMask. This is exactly what I want, but I can't find anything like this for iOS-based app. UIEvent has modifierFlags but only as an instance property. NSEvent has both instance modifierFlags as well as static modifierFlags which can be used for querying the state anywhere inside the app without bothering with observing keyboard events.
score: 1
tagged with: ios
accepted answer: http://stackoverflow.com/a/79321383
downvote count: 1
upvote count: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/139876052
linked to: http://stackoverflow.com/q/30035131
answer count: 1
tagged with: objective-c
linked to: http://stackoverflow.com/q/16532789

http://stackoverflow.com/comment/139897779
type: Comment
score: 0
has text: You would have better luck asking in the github repo for this plugin.
comment on: http://stackoverflow.com/q/79331889
type: QuestionComment

http://stackoverflow.com/q/79291730
type: Question
has body: I am trying to prepare a Cocoa Swift / Objective-C GUI around a binary executable on macOS, and this binary executable is shipped with a webmin module to edit its configuration file. Would it be possible to run this module into webmin in a WKWebView ? Thanks a lot for your attention and for any suggestion. I am not a skilled web developer so I really don't know how to convince :) WKWebView to render cgi and perl. I can put all the webmin and webmin module files into the application bundle in a separate folder and point to that folder with a NSURLRequest. Something like: // Mac WebMin // // Created by Alfonso Maria Tesauro on 18/12/24. // #import <Cocoa/Cocoa.h> #import <WebKit/WebKit.h> @interface AppDelegate : NSObject <NSApplicationDelegate> @property (assign) IBOutlet WKWebView *webMinWKWebView; @end // // AppDelegate.m // Mac WebMin // // Created by Alfonso Maria Tesauro on 18/12/24. // #import "AppDelegate.h" @interface AppDelegate () @property (strong) IBOutlet NSWindow *window; @end @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application NSString *webminFolderPath = [[NSBundle mainBundle] pathForResource:@"webMinFiles" ofType:@""]; NSURL *webMinFilesURLInBundle = [NSURL fileURLWithPath:[webminFolderPath stringByAppendingPathComponent:@"index.cgi"]]; NSURLRequest *webMinRequest = [[NSURLRequest alloc] initWithURL:webMinFilesURLInBundle]; [self.webMinWKWebView loadRequest:webMinRequest]; } - (void)applicationWillTerminate:(NSNotification *)aNotification { // Insert code here to tear down your application } - (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app { return YES; } @end
tagged with: wkwebview
type: UnansweredQuestion
tagged with: webmin
tagged with: cgi
answer count: 0
score: 0
has title: Is it possible to run Webmin in a Cocoa Application written in Swift or Objective-C using a WKWebView?
tagged with: objective-c

http://stackoverflow.com/a/79316528
has comment: http://stackoverflow.com/comment/139913627
score: 2
has comment: http://stackoverflow.com/comment/139997243
downvote count: 0
has comment: http://stackoverflow.com/comment/139910351
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/79316508
upvote count: 2
answers question: http://stackoverflow.com/q/79316508
has comment: http://stackoverflow.com/comment/139916717
has comment: http://stackoverflow.com/comment/139871071
type: Answer
has comment: http://stackoverflow.com/comment/139870162
has body: You have two issues with your non-working code: You are not calling an appropriate init method on CustomClass. You need at least something like: [[CustomClass alloc] init] addTarget does not retain the object you pass to the target parameter. This is stated in the documentation: The control does not retain the object in the target parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a control. So you need to store the CustomClass instance in an instance variable of the class that is creating the UISwitch in addition to initializing the instance correctly. For example, add an instance variable to the class that has the UISwitch and name it _handler (or whatever you want). @implementation SomeViewController { CustomClass *_handler; } Then your switch code becomes something like: _handler = [[CustomClass alloc] init]; UISwitch *uiSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(100, 100, 50, 50)]; [uiSwitch addTarget:_handler action:@selector(test) forControlEvents:UIControlEventValueChanged]; [self addSubview:uiSwitch]; Your working code works because no instance of CustomClass needs to be created to call the static test method. FYI - You wrote: But if the function is deallocated it gets called normally. What you mean is: But if the function is static, it gets called normally.

http://stackoverflow.com/q/79374739
tagged with: macos
favorite count: 0
answer count: 0
downvote count: 1
has body: I'm developing macOS application that uses NSURLSession to sent remote https requests. Some connections uses client-side authentication as part of the tis flow and I've coded a non-default behavior to unlock the system keychain and lookup for a suitable certificate that matches one of the acceptedIssuers in the server request. When trying to unlock the system keychain, I get popup window asking to provide user credential in order to get access. However, the popup keeps showing up on every attempt to unlock the keychain and I'd like the OS to "remember" the user credentials and avoid re-asking the user for approval. when running the application in elevated mode by calling its binary directly from sudo I get and additional option which is "always allow". I'd like to be able to do the same when app runs in regular user mode. This is the API I use to unlock the keychain which likely trigger the popup: OSStatus SecKeychainUnlock(SecKeychainRef __nullable keychain, UInt32 passwordLength, const void * __nullable password, Boolean usePassword) I call is without password in the following way : status = SecKeychainUnlock(keychain, 0, nullptr, false); How is this possible ? Thanks
has title: How to present the "always allow" button when typing credentials to access system keychain
tagged with: objective-c
score: 0
tagged with: keychain
type: Question
tagged with: swift
upvote count: 1
type: UnansweredQuestion

conditional-binding
tag name: conditional-binding
type: Tag
tags question: http://stackoverflow.com/q/79376363

http://stackoverflow.com/a/79388016
has body: If I understand the goal of your visibleRange method, the following code (converted to a category on UITextView) seems to be what you are looking for using TextKit 2 code: @interface UITextView (MyApp) - (NSRange)visibleRange; // TextKit 1 code - (NSRange)visibleRange2; // TextKit 2 code @end @implementation UITextView (MyApp) // Your original TextKit 1 code - (NSRange)visibleRange { // Get the layout manager associated with the text view NSLayoutManager *layoutManager = self.layoutManager; // Get the visible rectangle of the text view CGRect visibleRect = self.bounds; // Convert the visible rectangle into a glyph range NSRange glyphRange = [layoutManager glyphRangeForBoundingRect:visibleRect inTextContainer:self.textContainer]; // Convert the glyph range into a character range and return it return [layoutManager characterRangeForGlyphRange:glyphRange actualGlyphRange:NULL]; } // Updated to use TextKit 2 - (NSRange)visibleRange2 { NSTextLayoutManager *layoutManager = self.textLayoutManager; NSTextViewportLayoutController *controller = layoutManager.textViewportLayoutController; // Get the text range visible in the viewport NSTextRange *range = controller.viewportRange; if (range.isEmpty) { return NSMakeRange(0, 0); } else { id&lt;NSTextLocation&gt; start = range.location; id&lt;NSTextLocation&gt; end = range.endLocation; // Convert the abstract text locations into offset indexes to the actual text NSInteger si = [layoutManager offsetFromLocation:layoutManager.documentRange.location toLocation:start]; NSInteger ei = [layoutManager offsetFromLocation:layoutManager.documentRange.location toLocation:end]; // Return the indexes as a start and length return NSMakeRange(si, ei - si); } } @end With this category you can call visibleRange or visibleRange2 directly on your UITextView. Only call one or the other, not both. If you call visibleRange before calling visibleRange2, visibleRange2 will return an empty result due to the fallback to TextKit 1. At least this is true whe…
score: 0
has comment: http://stackoverflow.com/comment/140004457
has comment: http://stackoverflow.com/comment/140004899
answers question: http://stackoverflow.com/q/79379840
has comment: http://stackoverflow.com/comment/140004448
accepted answer of: http://stackoverflow.com/q/79379840
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/139870029
type: QuestionComment
has text: As your comment implies, don't use `sleep`. You have passed a completion handler, so you already have wrapped the asynchronous Swift code in something that will work with Objective C. Now you just have to handle it as you would any other asynchronous result in Objective C. It is a mistake to try and make it synchronous. Your UI needs to show some activity state and once you have the result you can update the UI and move on
type: Comment
comment on: http://stackoverflow.com/q/79318039
score: 1

http://stackoverflow.com/comment/139942856
comment on: http://stackoverflow.com/q/79355825
type: QuestionComment
type: Comment
score: 0
has text: @DavidPasztor it is an existing project with an existing bridging header. I am currently importing a bunch of Objective-C code into Swift via the bridging header, but I would like to add various Objective-C++ files to that as well.

http://stackoverflow.com/q/79251108
tagged with: objective-c
has title: How to migrate the NCWidgetProviding to WidgetKit in Objective-C iOS app
score: 0
has body: I need to migrate the NCWidgetProviding to WidgetKit, because the widget is not working in the iOS latest version like 18.1 and other versions. How to migrate this in Objective-C
tagged with: widget
has comment: http://stackoverflow.com/comment/139760153
type: Question
upvote count: 1
type: UnansweredQuestion
answer count: 0
favorite count: 0
tagged with: widgetkit
tagged with: ios
downvote count: 1

http://stackoverflow.com/a/79378181
answers question: http://stackoverflow.com/q/79376363
score: 0
type: Answer
has body: The best way is HangarRash's way: you modify the headers in your Objective-C code to say that things that can be nil (what Swift would call an Optional) are nullable. If you can't do that, you can use the following absolutely horrible approach. Suppose theVideo has arrived as a Data, but you know that it might in fact be nil. Then say if let theVideo = theVideo as Any as? Optional&lt;Data&gt;, let theVideo { Here you are casting theVideo up to an Any so that you can cast it down to anything it all, including what you suspect it to be, an Optional wrapping a Data. Now you can (and do) safely unwrap it. I really can't recommend this trick, though. It's better to update the headers of your Objective-C code to be more friendly to Swift.

http://stackoverflow.com/q/79394234
type: Question
answer count: 1
tagged with: objective-c
type: UnansweredQuestion
tagged with: xcode16
tagged with: crash
score: 0
has answer: http://stackoverflow.com/a/79394310
has title: Application Crashes in Xcode 16 After macOS Upgrade, Worked Fine in Xcode 15.4
tagged with: macos-sequoia
has body: I'm experiencing an issue where my application crashes when I try to run it in Xcode 16. The application was running fine in Xcode 15.4 before I upgraded macOS. Below is the crash log. I've tried several solutions, including reinstalling the pod files, but nothing seems to work. I would greatly appreciate any suggestions on what modifications might be required at the project end to resolve this issue. Crash Log: Error creating LLDB target at path '/Users/tapas.mukherjee/Library/Developer/Xcode/DerivedData/MyBB-evzcojyxpgcemkczklduotjqrkpb/Build/Products/Debug-iphonesimulator/My BB Live.app', target architecture: arm64 : the specified architecture 'arm64-*-*' is not compatible with 'x86_64-apple-ios15.0.0-simulator' in '/Users/tapas.mukherjee/Library/Developer/Xcode/DerivedData/MyBB-evzcojyxpgcemkczklduotjqrkpb/Build/Products/Debug-iphonesimulator/My BB Live.app/My BB Live'. Using an empty LLDB target instead but this can cause slow memory reads.warning: (x86_64) /Users/tapas.mukherjee/Library/Developer/CoreSimulator/Devices/3C76D943-FB74-4300-8DFB-D367B196D0B8/data/Containers/Bundle/Application/6B59D8DB-7A93-4D89-9012-26EFDE3C4856/My BB Live.app/My BB Live empty dSYM file detected, dSYM was created with an executable with no debug info. dyld[29372]: Symbol not found: __ZN5swift34swift50override_conformsToProtocolEPKNS_14TargetMetadataINS_9InProcessEEEPKNS_24TargetProtocolDescriptorIS1_EEPFPKNS_18TargetWitnessTableIS1_EES4_S8_E Referenced from: &lt;4B33FED0-BDFE-3506-A7E7-D22FDC44F7E9&gt; /Users/tapas.mukherjee/Library/Developer/Xcode/DerivedData/My_BB-evzcojyxpgcemkczklduotjqrkpb/Build/Products/Debug-iphonesimulator/MyFileFramework.framework/MyFileFramework Expected in: &lt;8132C051-30BA-3316-B5A5-8D8C1070184B&gt; /Users/tapas.mukherjee/Library/Developer/CoreSimulator/Devices/3C76D943-FB74-4300-8DFB-D367B196D0B8/data/Containers/Bundle/Application/6B59D8DB-7A93-4D89-9012-26EFDE3C4856/My BB Live.app/Frameworks/Device_swift.framework/Device_swift Message from debugger:…

http://stackoverflow.com/a/79260158
answers question: http://stackoverflow.com/q/79259549
type: Answer
has body: I figured out what the problem was, which had to do with my custom comparison method, as opposed to anything I was doing in the storyboard or setting up the sort descriptors. Apple's Table View Programming Guide goes into some detail about the comparison selector stating, "This comparison selector expects a single parameter" (Table View Programming Guide for Mac), where I had been expecting a method that takes a pair of parameters like sorting an NSArray. The correct custom comparison method goes in the custom object that will be compared and looks like this: - (NSComparisonResult) myCompare:(id) obj { myObject *objToCompare = (myObject *) obj; if (objToCompare.value < value) return NSOrderedAscending; else if (objToCompare.value > value) return NSOrderedDescending; else return NSOrderedSame; // they must be the same };
score: 0

wkwebviewconfiguration
tags question: http://stackoverflow.com/q/79402308
type: Tag
tag name: wkwebviewconfiguration

http://stackoverflow.com/comment/139837719
type: Comment
has text: @Evan93 What exactly is _"an extendedSRGB color taken from a Swift program"_? Do you get numbers from it, and if yes, then do you have an example **integer** or **float** for us to discuss? Not even clear if here you are dealing with 10-bits per channel or 16-bits or 32-bits...
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/79279193

http://stackoverflow.com/q/79334360
duplicate of: http://stackoverflow.com/q/25833508
has body: So basically I have this empty view with an NSProgressIndicator: @interface TestVC : NSViewController @property IBOutlet NSProgressIndicator *progress; @end I want to make it really big like say 300x300, but Xcode only allows a "Small" or a "Regular" size: I tried changing the frame in the awakeFromNib function: -(void)awakeFromNib { NSRect customFrame = NSMakeRect(50, 50, 300, 300); [progress setFrame:customFrame]; } but it doesn't work, is there any way to arbitrarily scale an NSProgressIndicator? I also tried subclassing it: @implementation CustomProgressBar - (void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; } -(void)awakeFromNib { [super awakeFromNib]; [self setFrameSize:NSMakeSize(300, 300)]; } @end
has comment: http://stackoverflow.com/comment/139917269
answer count: 0
has comment: http://stackoverflow.com/comment/139904746
linked to: http://stackoverflow.com/q/25833508
has title: Cocoa Appkit - How do I set a custom size for an NSProgressIndicator?
type: Question
tagged with: appkit
tagged with: objective-c
type: UnansweredQuestion
tagged with: cocoa
tagged with: xcode
has comment: http://stackoverflow.com/comment/139900902
score: 0

http://stackoverflow.com/q/79286630
has body: I have tried this which doesn't work: NSString *string = @"Click Here"; NSURL *url = [NSURL URLWithString:@"https://google.com"]; // Get the shared pasteboard NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; // Create a new pasteboard item NSPasteboardItem *item = [[NSPasteboardItem alloc] init]; [item setString:string forType:NSPasteboardTypeString]; [item setString:url.absoluteString forType: @"org.chromium.source-url"]; // Clear the pasteboard and write the new item [pasteboard clearContents]; [pasteboard writeObjects:@[item]]; NSLog(@"Hyperlink copied to pasteboard: %@ -> %@", string, url); I have also tried this which doesn't work: NSString *string = @"Click Here"; NSURL *url = [NSURL URLWithString:@"https://google.com"]; // Get the shared pasteboard NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; // Create a new pasteboard item NSPasteboardItem *item = [[NSPasteboardItem alloc] init]; [item setString:string forType:NSPasteboardTypeString]; [item setString:url.absoluteString forType:NSPasteboardTypeURL]; // Clear the pasteboard and write the new item [pasteboard clearContents]; [pasteboard writeObjects:@[item]]; NSLog(@"Hyperlink copied to pasteboard: %@ -> %@", string, url); I only get a string to paste.
has answer: http://stackoverflow.com/a/79286829
score: 1
accepted answer: http://stackoverflow.com/a/79286829
type: Question
upvote count: 1
answer count: 1
tagged with: objective-c
tagged with: cocoa
favorite count: 0
type: AnsweredQuestion
has title: How do I put a hyperlink into NSPasteboard that other apps recognize?
has comment: http://stackoverflow.com/comment/139813846
downvote count: 0

http://stackoverflow.com/comment/139863452
score: 1
type: Comment
has text: macOS 14 doesn't know about macOS 15 APIs, hence the error. Build with Xcode 16 on a Mac with macOS 15 to use macOS 15 APIs.
type: QuestionComment
comment on: http://stackoverflow.com/q/79312237

widget
tag name: widget
tags question: http://stackoverflow.com/q/79251108
type: Tag

widgetkit
tags question: http://stackoverflow.com/q/79251108
tag name: widgetkit
type: Tag

http://stackoverflow.com/comment/139882370
type: QuestionComment
comment on: http://stackoverflow.com/q/79322635
type: Comment
has text: @willeke Ok just edited my post to include the code that receives the bytes
score: 0

http://stackoverflow.com/comment/139800233
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79279193
type: Comment
has text: I only handled this once long time ago, so I don't have details, but I think you can treat values `[0, 1]` as is, like normal sRGB, but then for everything else, you need to treat it as HDR, so either clamp them or apply some other gamma transfer function. Take a look here: https://learnopencv.com/high-dynamic-range-hdr-imaging-using-opencv-cpp-python/

http://stackoverflow.com/comment/140048533
type: Comment
score: 0
type: QuestionComment
has text: it still exists when I open my projects and control click on various bits & pieces of my code in Xcode 16.2... have you compiled your project yet?
comment on: http://stackoverflow.com/q/79412250

http://stackoverflow.com/comment/139984748
has text: This should not be a subclass of `UIColor`. It should subclass `NSObject`. It's just a class that happens to have four `UIColor` properties. This subclass does not pass the classic "is a" relationship.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/79376958
type: QuestionComment

http://stackoverflow.com/q/79246671
tagged with: objective-c
answer count: 0
tagged with: nstableview
tagged with: keydown
score: 0
type: Question
has body: I have an NSTableView that doesn't allow selecting rows. I'd like keyDown: events (edit: from arrow keys) to reach the view's controller (which is also its delegate). By default, a table view "consumes" these events, so they don't go up the responder chain. How can I prevent that, preferably without subclassing NSTableView?
has title: Prevent NSTableView from responding to keyDown:
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/139741711
has comment: http://stackoverflow.com/comment/139744846
has comment: http://stackoverflow.com/comment/139745590

keydown
tag name: keydown
type: Tag
tags question: http://stackoverflow.com/q/79246671

xcuielement
tags question: http://stackoverflow.com/q/79259799
tag name: xcuielement
type: Tag

http://stackoverflow.com/q/79259799
tagged with: xcuielement
score: 0
has comment: http://stackoverflow.com/comment/139766600
downvote count: 1
type: Question
upvote count: 1
tagged with: xcuitest
type: UnansweredQuestion
favorite count: 0
has body: How to get the content of a notification in XCUITest, specifically the notification's identifier I have a piece of code in my app to show a notification as follows: - (NSString *)showNotificationWithIdentifier:(NSString * _Nullable)identifier title:(NSString *)title description:(NSString *)description { NSString *_id; // No ID specified (automatic increment) if (identifier == nil) { NSUserDefaults *prefer = [[NSUserDefaults alloc] initWithSuiteName:AfibNotificationManager.TAG]; NSString *latestIdStr = [prefer stringForKey:AfibNotificationManager.LATEST_ID_KEY]; int tmpId; if (latestIdStr == nil) { tmpId = INT_MIN; } else { tmpId = [latestIdStr intValue]; tmpId += 1; } _id = [NSString stringWithFormat:@"%d", tmpId]; [prefer setValue:_id forKey:AfibNotificationManager.LATEST_ID_KEY]; } // ID specified else { _id = identifier; } UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init]; content.title = title; content.body = description; content.sound = [UNNotificationSound defaultSound]; UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:_id content:content trigger:nil]; dispatch_async(dispatch_get_main_queue(), ^{ [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:nil]; }); return _id; } This is my UITest code: - (void)checkNotification { XCUIApplication *app = [[XCUIApplication alloc] init]; [app launch]; [app.buttons[@"btn"] tap]; //click button will call method showNotificationWithIdentifier to show notification XCUIApplication *springboard = [[XCUIApplication alloc]; initWithBundleIdentifier:@"com.apple.springboard"]; XCUICoordinate *start = [app coordinateWithNormalizedOffset:CGVectorMake(0.5, 0.0)]; XCUICoordinate *finish = [app coordinateWithNormalizedOffset:CGVectorMake(0.5, 1.5)]; [start pressForDuration:0.1 thenDragToCoordinate:finish]; XCUIElement *notification = springboard.buttons[@"NotificationCell"]; XCTAssertTrue([notification waitForExistenceWi…
tagged with: ios
has title: How to get the content of a notification in XCUITest?
has comment: http://stackoverflow.com/comment/139802925
has comment: http://stackoverflow.com/comment/139771698
tagged with: objective-c
answer count: 0

http://stackoverflow.com/comment/140050984
type: Comment
type: QuestionComment
has text: Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/259168/discussion-between-rob-and-hl666).
score: 0
comment on: http://stackoverflow.com/q/79403737

http://stackoverflow.com/comment/139997243
score: 0
comment on: http://stackoverflow.com/a/79316528
has text: @HangerRash, A friend of mine came and explained it to me because my code situation was a bit different but it was mostly similar to your answer!
type: AnswerComment
type: Comment

http://stackoverflow.com/q/79245494
tagged with: nstoolbar
type: Question
has body: In my mac application, validateToolBarItem: isn't called after a row of a NSTableView is dropped. The docs list events that don't trigger toolbar validation, but mouseUp: isn't one of them. So I'm not sure why the toolbar doesn't validate after that a table row is dropped, since this is associated with a mouse up event. To force validation, I call setWindowsNeedUpdate: on NSApp within tableView:acceptDrop:row:dropOperation:. I wonder if there is a better solution.
has title: validateToolBarItem not called
type: UnansweredQuestion
score: 0
answer count: 0
tagged with: appkit
tagged with: objective-c

http://stackoverflow.com/comment/139995350
score: 0
has text: `when accessed from Swift, they are ingested as non-optional` that is odd. They should be ingested as optionals or as undetermined. May be you have NS_ASSUME_NONNULL_BEGIN in bridging file, what is wrong.
type: QuestionComment
comment on: http://stackoverflow.com/q/79376363
type: Comment

cgi
tags question: http://stackoverflow.com/q/79291730
type: Tag
tag name: cgi

angular
type: Tag
tag name: angular
tags question: http://stackoverflow.com/q/79331889

http://stackoverflow.com/comment/139985049
type: Comment
comment on: http://stackoverflow.com/q/79376958
type: QuestionComment
score: 0
has text: That was the answer I was afraid to hear about. I didn’t implement this myself but I understand why they did so and it still makes sense to a degree. Unfortunately, seems like we’re paying the debt for that decision now.

http://stackoverflow.com/comment/139848147
type: Comment
comment on: http://stackoverflow.com/q/79305765
type: QuestionComment
score: 2
has text: You might have better luck web searching for “Master-Detail view” it is the old name for Navgation Split View

http://stackoverflow.com/comment/139898632
type: QuestionComment
comment on: http://stackoverflow.com/q/79333775
score: 2
has text: Don't use `try?`. Use `try/catch` and print `error` in the `catch` so you can see why it fails.
type: Comment

http://stackoverflow.com/comment/139818213
has text: Standard C++ name mangling?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/79289144
type: QuestionComment

http://stackoverflow.com/comment/139814253
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79286805
has text: It looks like a bug in `NSTableView` to me. Try a different Row Size Style in the XIB/Storyboard.
type: Comment

http://stackoverflow.com/comment/140004457
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79388016
has text: Glad it worked. I'm not sure what the edits were intended for. `UITextView` already has a `textLayoutManager` property. No need to add the property to the category. And it makes no sense to add a `viewDidLoad` method to `UITextView`. `viewDidLoad` is for a `UIViewController`, not a `UITextView`.

http://stackoverflow.com/a/79418966
type: Answer
has body: You ask why “@preconcurrency import does not silence Sendable warning?” The error you are receiving is not about trying to send a non-Sendable type. It is about your use of this sending closure (as outlined in SE-0430), which is an specific extension to region-based isolation. Do not conflate Sendable types with sending parameters; they are two different things. The @preconcurrency import addresses the former (temporarily silencing non-Sendable warnings for legacy types that have not gone through a review for concurrency), but not the latter.
upvote count: 1
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/79403737

http://stackoverflow.com/comment/140048664
type: QuestionComment
comment on: http://stackoverflow.com/q/79412250
type: Comment
score: 0
has text: I would suggest quitting Xcode and deleting the derived data and caches.

http://stackoverflow.com/comment/140116790
type: Comment
comment on: http://stackoverflow.com/q/79376958
has text: The public status of the idle property seems like it should not affect anything. I do wonder if the -copy and copyWithZone: methods should simply return self -- i.e. that is pretty much a read-only instance. Maybe the -copy is doing something strange in some situations. (Normally, -copy simply calls -copyWithZone: with a NULL zone parameter, so you don't duplicate code.) If you are re-setting the "idle" value based on state, then maybe copy returning a new instance is required. Can't fathom how the idle property is declared would matter, though you should probably declare it atomic.
score: 0
type: QuestionComment

http://stackoverflow.com/q/79290109
upvote count: 3
tagged with: cgo
type: Question
has body: I'm encountering an interesting performance pattern when running a Go benchmark on iOS using gomobile. The CPU usage shows regular gaps of 30ms and 40ms between execution periods when monitored using Instruments. Here's my minimal reproduction: // benchmark/benchmark.go package benchmark func BasicOperations() { var sum float64 for i := int32(1); i != 0; i++ { sum += 1 sum *= 2 sum -= 1 sum /= 2 } } I build the framework using: gomobile bind -target=ios -o Benchmark.xcframework ./benchmark When running this on an iOS device and profiling with Instruments, I observe: Regular CPU usage patterns of about 30ms and 40ms duration (shown as blue bars in the CPU profile) Gaps between these CPU usage periods of varying lengths This pattern repeats consistently throughout execution Questions: Why does Go's runtime introduce these regular execution gaps on iOS? Is this expected behavior for Go on mobile platforms? How can I minimize these gaps to achieve more consistent CPU utilization? Environment: iOS 18.2 Go 1.21 gomobile latest version Testing on physical iPhone device
score: 3
type: UnansweredQuestion
answer count: 0
favorite count: 0
tagged with: gomobile
tagged with: ios
has title: Go Mobile Performance: Regular CPU Usage Gaps on iOS
tagged with: objective-c
tagged with: go
downvote count: 0

http://stackoverflow.com/comment/139741711
type: Comment
comment on: http://stackoverflow.com/q/79246671
has text: `NSTableView` does send unused keyDown events to the next responder. What are you trying to accomplish? Why don't you want to subclass `NSTableView`?
score: 0
type: QuestionComment

http://stackoverflow.com/q/79318039
downvote count: 1
upvote count: 2
tagged with: objective-c
tagged with: app-store
has answer: http://stackoverflow.com/a/79326854
tagged with: async-await
has comment: http://stackoverflow.com/comment/139870029
type: Question
tagged with: swift
answer count: 1
type: UnansweredQuestion
has body: EDIT: changed this question into an answer, for those needing a solution for old Objective-C apps. Soon Apple will change the receipts for mac Apps to SHA-256 encoding, so if you like me still use SHA-1 to verify receipts you will be in trouble as of January 25 2025. To just verify the receipt for the App after download, no in-app purchases, AppTransaction seems the way to go. Objective-C code below calls AppTransaction from Swift, returning an int. Technote 3138 explains via Validating receipts on the device: "The receipt isn’t necessary if you use AppTransaction to validate the app download, or Transaction to validate in-app purchases". Swift module: import Foundation import StoreKit public final class ReceiptValidation : NSObject { private func ValidityOfAppStoreReceipt() async -> Int { do { let verificationResult = try await AppTransaction.shared print("verificationResult=",verificationResult) switch verificationResult { case .verified(let appTransaction): // StoreKit verified that the user purchased this app and the properties in the AppTransaction instance. Add your code here. return 1; case .unverified(let appTransaction, let verificationError): // The app transaction didn't pass StoreKit's verification. Handle unverified app transaction information according to your business model. Add your code here. return 99; } } catch { // Handle errors. print("error.localizedDescription=", error.localizedDescription) return 99; } } @objc public func getValidityOfAppStoreReceipt() async throws -> Int { let validity = await ValidityOfAppStoreReceipt(); print("(swift) validity=", validity); return validity; } } Objective-c code: - (void) ReceiptValidatedWith:(int)validation_code // Called from completion block { if (validation_code != 1) { ALog(@"AppStore receipt invalid, exiting."); [NSApp terminate:self]; } else { ALog(@"AppStore receipt VALID, continuing."); } } - (void) validateReceipt // Validating receipt now only possible via Swift, call method AppTransaction.shared…
score: 1
tagged with: macos
has title: Mac AppStore local receipt validation using StoreKit AppTransaction from Swift - async problems
favorite count: 0

http://stackoverflow.com/comment/139818198
has text: Some people compile source code with Objective-C++. Probably to avoid keyword collisions, is my guess.
comment on: http://stackoverflow.com/q/79289144
type: QuestionComment
score: 3
type: Comment

http://stackoverflow.com/comment/139941344
comment on: http://stackoverflow.com/q/79355825
has text: Is this an existing project or new project? Do you have a pre-existing bridging header? If so, what headers are you importing in your bridging header?
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/139929968
type: Comment
has text: Could you please elaborate and reference the Apple Developer documents? I found SSL pinning using NSURLConnection but that's deprecated
comment on: http://stackoverflow.com/q/79344272
score: 0
type: QuestionComment

http://stackoverflow.com/comment/140071983
has text: this problem is related to getting file types from web page itself @Willeke
type: Comment
score: 0
comment on: http://stackoverflow.com/q/79402308
type: QuestionComment

http://stackoverflow.com/a/79270247
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/79270160
has body: The problem is requiringSecureCoding:NO. You must use secure coding at this point. That means you must make Grade adopt NSSecureCoding, not NSCoding; and you must list all the classes you intend to unarchive in a set at unarchiving time. So, Grade is now an NSObject<NSSecureCoding>; I'll fill in a few blanks you omitted from your question: @implementation Grade + (BOOL) supportsSecureCoding { return YES; } - (instancetype)initWithName:(NSString*)name grade:(NSInteger)grade { self = [super init]; if(self) { self.name = name; self.grade = grade; } return self; } - (NSString*) description { return [NSString stringWithFormat: @"name: %@, grade: %ld", self.name, self.grade]; } // And the rest is as you have it: -(void)encodeWithCoder:(NSCoder *)coder { [coder encodeObject:self.name forKey:@"name"]; [coder encodeInt64:self.grade forKey:@"grade"]; } - (instancetype)initWithCoder:(NSCoder *)coder { self = [super init]; if(self) { self.name = [coder decodeObjectForKey:@"name"]; self.grade = [coder decodeInt64ForKey:@"grade"]; } return self; } @end And now, let's make an array of Grade, archive it, and unarchive it: NSArray<Grade*> *array = @[ [[Grade alloc] initWithName: @"Matt" grade: 4], ]; NSData *data = [NSKeyedArchiver archivedDataWithRootObject: array requiringSecureCoding:YES error: nil]; NSLog(@"archived data: %@", data); NSError *error = nil; NSSet *classesSet = [NSSet setWithObjects:[NSString class], [Grade class], [NSArray class], nil]; NSArray *arrayFromData = (NSArray*)[NSKeyedUnarchiver unarchivedObjectOfClasses: classesSet fromData: data error: &error]; NSLog(@"array: %@", arrayFromData); Result: archived data: {length = 279 ... } array: ( "name: Matt, grade: 4" ) Quod erat demonstrandum.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/79270160
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/140004899
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/79388016
has text: Unfortunately, I had a 'property not found on object of type viewController' error. However, when I specify the name of the textVIew, it now works as is: `NSTextLayoutManager *layoutManager = self.textView.textLayoutManager;`

skia
tag name: skia
type: Tag
tags question: http://stackoverflow.com/q/79321725

http://stackoverflow.com/comment/140048627
has text: I still see that and Jump To Definition at the top of that popup menu still works.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79412250
type: Comment

http://stackoverflow.com/comment/139887317
has text: This all has to do with KVO change notifications. Assigning to `self.ivar` will fire them, while assigning to `_ivar` will not. Because KVO would access above getter, the lazy initialization should NOT fire a KVO notice. So in the `ivar` accessor replace all `self.ivar` with `_ivar`. However if you are also setting a derived `ivar2` in the accessor, for that you should use `self.ivar2`.
type: Comment
comment on: http://stackoverflow.com/q/79327312
score: 0
type: QuestionComment

http://stackoverflow.com/comment/139882316
type: Comment
comment on: http://stackoverflow.com/q/79321725
has text: The way you describe your memory issues, it sounds like out of bounds/trying to access memory you shouldn't access from that point in code. It doesn't turn up as an error immediately, but can have all kinds of effects later on, which is what you're observing. If you can run a suitable sample with address sanitizer, that could reveal where the first invalid access lies. I don't expect static lib to be the cause.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/140033431
type: Comment
comment on: http://stackoverflow.com/q/79403737
has text: @matt re- "preconcurrency reduces an error to a warning. It does not make the facts magically go away." I believe this is false, with preconcurrency import, I was able to silence the error for a non-closure type. see my new code added at the end
score: 0
type: QuestionComment

http://stackoverflow.com/comment/139818500
type: QuestionComment
type: Comment
score: 0
has text: Thanks. Most row size styles fix the issue, except "custom" and "match canvas".
comment on: http://stackoverflow.com/q/79286805

http://stackoverflow.com/comment/140048567
has text: The project compiles and runs. Now that I look at it, same in an Objective C++ iOS project. Haven't tried with a Swift one. Looks like my Xcode is broken.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/79412250
type: Comment

cocoa-touch
type: Tag
tags question: http://stackoverflow.com/q/79321316
tag name: cocoa-touch

http://stackoverflow.com/comment/139820144
has text: Why do you care how Objective-C header is generated? That `module_` doesn't used anywhere. For me it looks like as minor bag. You can report it if you want.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/79289144

http://stackoverflow.com/comment/139898858
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79333775
type: Comment
has text: To rephrase Hangars' statement: there's no input of any text encoding which fails when trying utf8 and succeeds with ASCII. So, your statement in the title "Swift ASCII string fails, but works in Objective-C" can never happen - unless something else is badly wrong (for example, but very unlikely, the implementation of Objective-C's character encoding). Can you please provide the input?

http://stackoverflow.com/comment/139883617
type: Comment
has text: `eventList` isn't a MIDI event. Enumerate the events in the list with `MIDIEventListForEachEvent`. Check `message.type` and get the sysEx data. In Swift: `let sysExMessage = message.sysEx` and `sysExMessage.data.0` .. `sysExMessage.data.5`.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79322635

http://stackoverflow.com/comment/139985586
type: Comment
comment on: http://stackoverflow.com/q/79376363
score: 0
has text: @Alexander If you add `NS_ASSUME_NONNULL_BEGIN` then you only need to annotate properties, parameters, and return values that *can* be `nil` since that macro makes everything non-nil by default.
type: QuestionComment

http://stackoverflow.com/q/79270160
score: 0
tagged with: cocoa
type: Question
has answer: http://stackoverflow.com/a/79270247
has title: Appkit Cocoa - NSCoding decoding error - NSCocoaErrorDomain 4864
accepted answer: http://stackoverflow.com/a/79270247
has body: I'm having some trouble with NSCoding, I have this simple "Grade" class: @interface Grade : NSObject<NSCoding> @property (copy) NSString *name; @property NSInteger grade; @end It implements NSCoding as follows: -(void)encodeWithCoder:(NSCoder *)coder { [coder encodeObject:self.name forKey:@"name"]; [coder encodeInt64:self.grade forKey:@"grade"]; } - (instancetype)initWithCoder:(NSCoder *)coder { self = [super init]; if(self) { self.name = [coder decodeObjectForKey:@"name"]; self.grade = [coder decodeInt64ForKey:@"grade"]; } return self; } I have an NSMutableArray of these objects which I put into an archive like so: NSArray<Grades*> *array = [NSArray arrayWithArray:self.tableContents]; NSData *data = [NSKeyedArchiver archivedDataWithRootObject: array requiringSecureCoding:NO error: nil]; NSLog(@"archived data: %@", data); This is working fine but the problem is when I try to extract from this archive: NSError *error = nil; NSArray *arrayFromData = [NSKeyedUnarchiver unarchivedObjectOfClass:[NSArray class] fromData:data error:&error]; I keep getting an error: 'NSCocoaErrorDomain - code: 4864' in my NSError variable and the NSKeyedUnarchiver keeps returning nil. What am I doing wrong here?
type: AnsweredQuestion
answer count: 1
tagged with: appkit
tagged with: objective-c

http://stackoverflow.com/comment/140034006
type: Comment
comment on: http://stackoverflow.com/q/79402308
has text: Is the problem how to get the file types from the web page or how to specify the file types in the open panel?
type: QuestionComment
score: 0

http://stackoverflow.com/comment/140048632
comment on: http://stackoverflow.com/a/79412316
type: AnswerComment
type: Comment
score: 0
has text: It's set to "Jump to definition", and it jumps for *my* classes etc., but not for *framework* classes.

http://stackoverflow.com/comment/140023145
has text: I see. Then request to install certificate is right solution. You can use single CA authority for your servers and install CA's certificate. Also it's sound like that you have enterprise app and MDM solutions can help: for example install remotely you app already with certificate.
type: QuestionComment
comment on: http://stackoverflow.com/q/79344272
score: 0
type: Comment

http://stackoverflow.com/comment/139818239
has text: Reduced too much code for demonstrating the question object.
score: 1
comment on: http://stackoverflow.com/q/79289144
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/140048743
score: 1
type: Comment
has text: @matt: that worked. Specifically, I deleted `~/Library/Developer/Xcode/DerivedData/SymbolCache.noindex`, restarted Xcode, and it came back. Make an answer, I'll accept.
comment on: http://stackoverflow.com/q/79412250
type: QuestionComment

http://stackoverflow.com/comment/139879646
type: Comment
has text: How do you get the packet? Post your code please.
type: QuestionComment
comment on: http://stackoverflow.com/q/79322635
score: 0

http://stackoverflow.com/q/79402308
tagged with: objective-c
tagged with: wkwebviewconfiguration
has title: Unable to Specify File Types in WKWebView Using runOpenPanelWithParameters on macOS
tagged with: wkwebview
score: 0
has body: I am write a wkwebview application in macos where I want to enable file upload to my website loaded in wkwebview. I found few articles telling to use runOpenPanelWithParameters which runs for me but I stuck in a problem. Problem: The method works to open the file dialog, but I'm stuck on how to properly handle the file(s) selected by the user and upload them to my website. i.e: If website only want img upload, from chrome it fade out files other then img, I want to achieve same in wkwebview. - (void)webView:(WKWebView *)webView runOpenPanelWithParameters:(WKOpenPanelParameters *)parameters initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSArray&lt;NSURL *&gt; * _Nullable))completionHandler { NSOpenPanel *openPanel = [NSOpenPanel openPanel]; openPanel.canChooseFiles = YES; openPanel.canChooseDirectories = NO; openPanel.allowsMultipleSelection = parameters.allowsMultipleSelection; [openPanel beginWithCompletionHandler:^(NSModalResponse result) { if (result == NSModalResponseOK) { completionHandler(openPanel.URLs); } else { completionHandler(nil); } }]; }
type: Question
has comment: http://stackoverflow.com/comment/140078071
tagged with: swift
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/140077822
has comment: http://stackoverflow.com/comment/140034006
has comment: http://stackoverflow.com/comment/140078068
has comment: http://stackoverflow.com/comment/140071983

http://stackoverflow.com/comment/140036202
type: Comment
has text: @matt did you enable swift 6?
score: 0
comment on: http://stackoverflow.com/q/79403737
type: QuestionComment

http://stackoverflow.com/comment/140050774
score: 0
has text: Sorry I got confused. The code is NOT inside viewDidLoad, but inside a global free function.
comment on: http://stackoverflow.com/q/79403737
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/139802925
has text: That would be a different question. I'm responding to what you asked. I'm suggesting that you should complete revise your desires.
type: QuestionComment
comment on: http://stackoverflow.com/q/79259799
type: Comment
score: 0

coremidi
tags question: http://stackoverflow.com/q/79322635
tag name: coremidi
type: Tag

http://stackoverflow.com/comment/139760153
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79251108
has text: The only way is to implement new widget with SwiftUI. You will bet even not able to use `UIViewRepresentable`.
type: Comment

http://stackoverflow.com/comment/139900228
has text: Thanks, although it is just opening a file with a few digits, and I’m also supporting macOS before async/await
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79333775

http://stackoverflow.com/a/79394310
has body: It seems your application is using a framework that refers to an older version of the swift library. Also see the thread here, especially the following comment (quote): This issue happens for chained dependencies. Suppose you have App -&gt; A.framework -&gt; B.framework. If you change B's target OS version and rebuilt B, this error occures. The solution is to rebuilt A as well. Of course, if you don't have the source code of A, you will have to revert to the old version of B from iOS developer @ authing The demangled name of the symbol you that is used by your (or the framework's) code is (maybe that helps): _swift::swift50override_conformsToProtocol( swift::TargetMetadata&lt;swift::InProcess&gt; const*, swift::TargetProtocolDescriptor&lt;swift::InProcess&gt; const*, swift::TargetWitnessTable&lt;swift::InProcess&gt; const* (*)(swift::TargetMetadata&lt;swift::InProcess&gt; const*, swift::TargetProtocolDescriptor&lt;swift::InProcess&gt; const*) ) If this does not help, maybe if you add more information to your question, a better response can be given...
type: Answer
answers question: http://stackoverflow.com/q/79394234
has comment: http://stackoverflow.com/comment/140017549
score: 0

http://stackoverflow.com/comment/140050790
type: Comment
has text: @Rob I have updated my code snippet on caller side
score: 0
comment on: http://stackoverflow.com/q/79403737
type: QuestionComment

http://stackoverflow.com/comment/139902231
score: 0
type: QuestionComment
type: Comment
has text: That fails too. It seems that Swift has a strict ASCII decoder and will fail if there's any bytes outside the standard ASCII range. Whereas Obj-C's ASCII initialiser is more lenient. (Info obtained from ChatGPT)
comment on: http://stackoverflow.com/q/79333775

http://stackoverflow.com/comment/140078071
type: Comment
comment on: http://stackoverflow.com/q/79402308
has text: It will not detect what kind of allowed files are requested by web
score: 0
type: QuestionComment

http://stackoverflow.com/comment/139818958
type: QuestionComment
score: 2
has text: It is not renaming the parameters at all. In Objective-C, the parameter name is part of the method name. In `someMethodWithTemplate:`, the `Template` part is the parameter name, based directly on your `template` but with an initial capital letter, which is standard convention and part of "renamification". The `template_` you are asking about is merely an _internal_ name, and is effectively meaningless (it is thrown away and affects nothing).
type: Comment
comment on: http://stackoverflow.com/q/79289144

http://stackoverflow.com/comment/139800216
has text: Can you show some examples of how your code incorrectly converts the color? Show the extended sRGB color components, the expected result and the actual result.
type: QuestionComment
comment on: http://stackoverflow.com/q/79279193
type: Comment
score: 1

gomobile
tags question: http://stackoverflow.com/q/79290109
tag name: gomobile
type: Tag

language-interoperability
tag name: language-interoperability
type: Tag
tags question: http://stackoverflow.com/q/79355825

ascii
tag name: ascii
type: Tag
tags question: http://stackoverflow.com/q/79333775

http://stackoverflow.com/comment/139913627
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79316528
score: 0
has text: @HangerRash, it still doesnt work, can you join a zoom call and help me implement it bec I tried it 5 times and it doesnt work

portsip
type: Tag
tag name: portsip
tags question: http://stackoverflow.com/q/79351022

http://stackoverflow.com/comment/140004448
has text: Great job - it really works. Thank you so much.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79388016

iobluetooth
tags question: http://stackoverflow.com/q/79317378
type: Tag
tag name: iobluetooth

http://stackoverflow.com/comment/140078068
type: Comment
has text: But this api is used to set allowsFileExtentions to be uploaded.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79402308

uicolor
tag name: uicolor
type: Tag
tags question: http://stackoverflow.com/q/79376958

http://stackoverflow.com/comment/139900902
comment on: http://stackoverflow.com/q/79334360
has text: How does it not work?
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/139876052
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/79321316
has text: I want to query current state of modifierFlags anywhere in the app, without observing the key presses manually. UIEvent has only modifierFlags only as instance property, NSEvent has modifierFlags as a static property as well for that - https://developer.apple.com/documentation/appkit/nsevent/modifierflags-swift.type.property?language=objc

http://stackoverflow.com/comment/139900221
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79333775
has text: Btw this API is only really for small scripts and fiddling around. It blocks the thread, so for a real app you should use the async file APIs instead, which you can await without blocking the thread

http://stackoverflow.com/comment/140048614
type: Comment
has text: I remember the former - right-click (or Ctrl+click) on a class name in the source code editor, then "Jump to definition", the topmost command in the popup menu. That's what, it seems, broke somehow.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79412250

node.js
tags question: http://stackoverflow.com/q/79310010
tag name: node.js
type: Tag

colors
type: Tag
tag name: colors
tags question: http://stackoverflow.com/q/79279193

http://stackoverflow.com/comment/139989324
score: 0
has text: What point to use self-signed certificate? You can use Let's Encrypt at least.
type: Comment
comment on: http://stackoverflow.com/q/79344272
type: QuestionComment

http://stackoverflow.com/comment/140040309
has text: Finally got resolved the issue. I had to inject the javascript into WKWeView to fire the browser unload event.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/79393501

macos-sequoia
tags question: http://stackoverflow.com/q/79394234
type: Tag
tag name: macos-sequoia
tags question: http://stackoverflow.com/q/79518299

http://stackoverflow.com/comment/139870162
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79316528
score: 0
has text: @HangerRash. thanks for the edit and taking your time to answer this but sadly it still doesnt get called :/ [uiSwitch addTarget:[[CustomClass alloc] init] action:@selector(test) forControlEvents:UIControlEventValueChanged];

http://stackoverflow.com/comment/139900437
score: 0
type: QuestionComment
has text: `NSASCIIStringEncoding` typically allows lossy encoding conversions by default; presumably, some of the data is getting thrown away. Can you try with `NSNonLossyASCIIStringEncoding` and see what you get?
type: Comment
comment on: http://stackoverflow.com/q/79333775

http://stackoverflow.com/comment/139848674
score: 0
has text: Why delete your [previous question](https://stackoverflow.com/questions/79301650/whats-the-cocoa-appkit-equivalent-of-swiftui-navigationsplitview) and repost it again as a new question? Why not just update the original as needed?
type: Comment
comment on: http://stackoverflow.com/q/79305765
type: QuestionComment

http://stackoverflow.com/comment/139876916
score: 0
has text: Thank you! How would you find out if caps-lock is on or off before any event has been occurred, for example at the application launch? If I understand correctly on macos you can query this static NSEvent.modifierFlags.capsLock. It's just so unfortunate that iOS SDK omitted this feature, I was hoping I've missed something. Seems obvious that those states should be static just like on macos.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79321383

http://stackoverflow.com/comment/139879518
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/79321383
has text: thank you for doing such a thoughtful research on that! From an SDK design point of view I personally think it would better to have an ability to query an array of keyboard devices from the singleton UIDevice/UIApplication, from which you would be able to query the state of each keyboard as an instance properties. I don't know why they made this so hard for us! But now I know I'm not missing anything obvious
type: Comment

core-foundation
type: Tag
tags question: http://stackoverflow.com/q/79310010
tag name: core-foundation

http://stackoverflow.com/comment/140048637
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/79412316
has text: I can't account for that.

webmin
tags question: http://stackoverflow.com/q/79291730
tag name: webmin
type: Tag

midi
tags question: http://stackoverflow.com/q/79322635
tag name: midi
type: Tag

http://stackoverflow.com/comment/139910351
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79316528
has text: @Jack Let me know if my updated answer clarifies the changes you need to make.

http://stackoverflow.com/comment/139771698
type: QuestionComment
has text: Hi @matt , could you please give me an example about mocking the notification center by object-c(unit test)? Thank you very much.
score: 0
comment on: http://stackoverflow.com/q/79259799
type: Comment

http://stackoverflow.com/comment/139876034
has text: `UIEvent` has [`modifierFlags`](https://developer.apple.com/documentation/uikit/uievent/3538961-modifierflags) too. What exactly are you trying to create? Please be more specific.
type: Comment
comment on: http://stackoverflow.com/q/79321316
score: 0
type: QuestionComment

darkmode
type: Tag
tags question: http://stackoverflow.com/q/79376958
tag name: darkmode

http://stackoverflow.com/comment/139878500
has text: @simd Actually I just found some private API in IOKit that allows you to do this. It's not exposed in the IOKit headers on iOS (but they are exposed on macOS, that's how I found them) so App Store might reject your app if you use those.
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/79321383

http://stackoverflow.com/comment/139986219
type: Comment
comment on: http://stackoverflow.com/q/79376363
has text: Ah yes, that’s what I meant to say.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/139878454
type: AnswerComment
comment on: http://stackoverflow.com/a/79321383
score: 1
type: Comment
has text: @simd I don't think there is a way to do that on launch, and as far as I know, one can connect multiple keyboards to a mac and they can all have their own independent caps locks, so a static property isn't really as "obvious" as you think.

react-native-call-keep
tag name: react-native-call-keep
tags question: http://stackoverflow.com/q/79351022
type: Tag

srgb
type: Tag
tags question: http://stackoverflow.com/q/79279193
tag name: srgb

sslpinning
type: Tag
tag name: sslpinning
tags question: http://stackoverflow.com/q/79344272

http://stackoverflow.com/q/79524757
has title: react native - create location tracking library for iOS
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/79524874
has body: I am researching on creating library for react native new arch. At the moment, I am dealing with create-react-native-library to create a location tracking lib for iOS for better customization. I am new to both Objective-C and Swift, so truly need your helps. My current version: create-react-native-library: 0.48.3 react-native: 0.78.0 My iOS project already has: background location tracking enable info.plist with: NSLocationWhenInUseUsageDescription NSLocationAlwaysUsageDescription NSLocationAlwaysAndWhenInUseUsageDescription On simulator, app settings: Location tracking set to Always allow Checked on Maps app and the blue dot is moving. Please find code below MyLocationTracking.h #import "generated/RNMyLocationTrackingSpec/RNMyLocationTrackingSpec.h" @interface MyLocationTracking : NativeMyLocationTrackingSpecBase <NativeMyLocationTrackingSpec> @end MyLocationTracking.mm #import <CoreLocation/CoreLocation.h> #import "MyLocationTracking.h" #import "MyLocationTracking-Swift.h" @implementation MyLocationTracking RCT_EXPORT_MODULE() - (void)setInfo:(nonnull NSString *)baseURL token:(nonnull NSString *)token pushGPSInterval:(double)pushGPSInterval pushGPSDistance:(double)pushGPSDistance integrationId:(nonnull NSString *)integrationId { MyLocationTrackingImpl *swiftInstance = [MyLocationTrackingImpl shared]; [swiftInstance setInfo:baseURL rnToken:token rnPushGPSInterval:pushGPSInterval rnPushGPSDistance:pushGPSDistance rnIntegrationId:integrationId callback:^(NSDictionary *locationData) { [self emitOnLocationChanged:locationData]; }]; } - (nonnull NSNumber *)isProviderEnabled { return @1; } - (nonnull NSNumber *)isServiceRunning { return @1; } - (void)startWatchLocation { [[MyLocationTrackingImpl shared] startWatchLocation]; } - (void)stopWatchLocation { [[MyLocationTrackingImpl shared] stopWatchLocation]; } - (void)updateIntegrationId:(nonnull NSString *)integrationId { [[MyLocationTrackingImpl shared] updateIntegrationId:integrationId]; } - (std::shared_ptr<facebook::re…
tagged with: ios
tagged with: objective-c
score: 0
tagged with: react-native
type: Question
tagged with: swift
tagged with: create-react-native-library
answer count: 1

http://stackoverflow.com/q/79507593
has comment: http://stackoverflow.com/comment/140227775
type: Question
has comment: http://stackoverflow.com/comment/140218608
tagged with: objective-c
type: UnansweredQuestion
tagged with: nsnotifications
has comment: http://stackoverflow.com/comment/140218902
has comment: http://stackoverflow.com/comment/140218300
has comment: http://stackoverflow.com/comment/140218314
tagged with: nsdocument
score: 0
has title: NSView needsDisplay is ignored?
answer count: 0
has comment: http://stackoverflow.com/comment/140217289
has body: I struggle to understand what I'm doing wrong here. In my document-based app the document's model is modified in a notification. The model is correctly updated with the new content and I just want to tag the view as needing update. To my surprise, nothing happened until I manually resized the window which led me to the following workaround-wart (a dummy change to the window size): NSWindow *window = document.window; #if false window.contentView.needsDisplay = YES; #else NSSize sz = document.model.canvasSize; [window setContentSize:NSMakeSize(0,0)]; [window setContentSize:sz]; #endif [window makeKeyAndOrderFront:self]; Obviously, that's not how it's supposed to be done, but I'm at my wits end here. The inital model renders perfectly, but any changes to the model are ignored. I tried dispatching needsDisplay on the main thread using performSelectorOnMainThread but that didn't seem to matter. Any clues to what goes on here would be greatly appreciated. Update I've created a minimal(?) example showing the same behaviour available on github: https://github.com/persquare/DrawBug Most of the functionality is in AppDelegate.m: @interface AppDelegate () { Document *_documentRef; } @end @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationHandler:) name:@"foo" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationHandler:) name:@"foo" object:nil]; } - (void)applicationWillTerminate:(NSNotification *)aNotification { [[NSDistributedNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self]; } - (Document *)document { Document *doc = _documentRef; NSLog(@"_documentRef: %@", _documentRef); if (doc == nil) { Document *doc = [[Document alloc] init]; NSLog(@"Created document: %@", doc); _documentRef = doc; NSDocumentController *docController …
has comment: http://stackoverflow.com/comment/140216405

http://stackoverflow.com/comment/140236774
type: Comment
comment on: http://stackoverflow.com/q/79518299
score: 0
has text: Yes there are several things that might be off: 1) is the receiving window focused (you are taking the frontmost window, but just outlining that out of focus windows will not receive the event) 2) having the Accessibility (not sure about Automation) permissions enabled for the app, you can actually verify the Accessibility permissions from within the app via AXIsProcessTrusted 3) Try sending the event via CGEventPostToPSN (and using the serial number) instead of pid and CGEventPostToPid
type: QuestionComment

http://stackoverflow.com/q/79504242
type: Question
has title: UISlider thumb to move without touching the thumb
upvote count: 0
tagged with: ios
type: AnsweredQuestion
downvote count: 1
has body: I have a custom UISlider inside UICollectionViewCell. I would like to be able to move the slider thumb by touching anywhere on the cell (on the purple bit). For instance, if I was to put my finger on the top right corner of the cell and slide down, I would like the thumb to slide downwards from its current position (-19.0 in this case), instead of jumping up first. Here is my code: @implementation CDCFaderSlider - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame: frame]; if (self) { [self setOpaque: true]; [self setTransform: CGAffineTransformMakeRotation((CGFloat)(M_PI * -0.5f))]; [self constructSlider]; } return self; } - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder: aDecoder]; if (self) { [self setTransform: CGAffineTransformMakeRotation((CGFloat)(M_PI * -0.5f))]; [self constructSlider]; } return self; } #pragma mark - UIControl touch event tracking - (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event { CGPoint touchPoint = [touch locationInView: self]; if (CGRectContainsPoint(CGRectInset(self.thumbRect, -12.0, -12.0), touchPoint)) { [self positionAndUpdateValueView]; [self fadeValueViewInAndOut: true]; } return [super beginTrackingWithTouch: touch withEvent: event]; } - (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event { [self positionAndUpdateValueView]; return [super continueTrackingWithTouch: touch withEvent: event]; } - (void)cancelTrackingWithEvent:(UIEvent *)event { [self fadeValueViewInAndOut: false]; [super cancelTrackingWithEvent: event]; } - (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event { [self fadeValueViewInAndOut: false]; [super endTrackingWithTouch: touch withEvent: event]; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [self fadeValueViewInAndOut: false]; [super touchesEnded: touches withEvent: event]; } - (BOOL) pointInside:(CGPoint)point withEvent:(UIEvent*)event { CGRect bounds = self.bounds; bounds = CGRectInset(bo…
tagged with: objective-c
has answer: http://stackoverflow.com/a/79504791
tagged with: uislider
answer count: 1
accepted answer: http://stackoverflow.com/a/79504791
favorite count: 0
score: -1

http://stackoverflow.com/q/79496234
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/140219334
has comment: http://stackoverflow.com/comment/140206951
tagged with: ios
score: 0
tagged with: objective-c
tagged with: core-bluetooth
has comment: http://stackoverflow.com/comment/140204466
type: Question
tagged with: swift
has title: App crashes when BLE SDK callback is not executed with missing data
has comment: http://stackoverflow.com/comment/140207838
answer count: 0
has comment: http://stackoverflow.com/comment/140222255
has comment: http://stackoverflow.com/comment/140206136
has body: Problem I'm integrating the Runmefit SDK into my React Native app using Expo Modules API to communicate with a BLE device. When the device doesn't send any data (e.g., empty exercise history), my app crashes with Thread 1: EXC_BAD_ACCESS (code=1, address=0x0) because the callback in the SDK method notifyRunmefit is never executed. My implementation Here's how I set up the Bluetooth delegate and call the SDK method: // Set up the peripheral delegate public func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) { print("Connected to \(peripheral.name ?? "unknown device")") self.peripheral = peripheral peripheral.delegate = self // Setting the delegate here peripheral.discoverServices([CBUUID(string: UUID_Service)]) } // Handling discovered service and characteristics public func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) { guard let services = peripheral.services else { return } for service in services { peripheral.discoverCharacteristics([CBUUID(string: UUID_Write_Char), CBUUID(string: UUID_Notify_Char)], for: service) } } public func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) { guard let characteristics = service.characteristics else { return } for characteristic in characteristics { if characteristic.uuid.uuidString == UUID_Write_Char { self.writeCharacter = characteristic } else if characteristic.uuid.uuidString == UUID_Notify_Char { peripheral.setNotifyValue(true, for: characteristic) } } } // Problem occurs in this delegate method public func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) { print("Received: \(String(describing: characteristic.value))") guard let writeCharacter = writeCharacter else { print("No write characteristic found") return } let nsError = error as NSError? ?? NSError(domain: "", code: 0, userInfo: nil) STBlueToothData.sharedInstance().notifyRunmefit( peripheral…

http://stackoverflow.com/comment/140227489
type: AnswerComment
type: Comment
has text: On macOS you can run out you memory only if your application is working wrong: have memory leaks everywhere, caching in memory BLOBs.
comment on: http://stackoverflow.com/a/79492089
score: 0

http://stackoverflow.com/comment/140212545
type: Comment
has text: Yes, you should use a delegation pattern. This will also avoid the tight-coupling of the two view controllers. VC-B shouldn't manipulate controls in VC-A directly. It should just tell its delegate that it is being dismissed and then the logic as to what to do is in the delegate.
type: QuestionComment
comment on: http://stackoverflow.com/q/79505321
score: 0

thread-safety
type: Tag
tag name: thread-safety
tags question: http://stackoverflow.com/q/79472383

http://stackoverflow.com/q/79466619
tagged with: objective-c-category
tagged with: objective-c
has body: I have the following header and implementation files where NSURLMyObject is a category of NSURL, and contains a readonly class property myString: NSURL+MyClass.h @interface NSURL (NSURLMyClass) @property(class, readonly) NSString* myString; @end NSURL+MyClass.mm @implementation MyObject static NSString* _myString; + (NSString*) myString { if (_myString == nil) { _myString = @"Hello"; } return _myString; } @end I have seen other threads where either: a property is re-declared readwrite in the implementation and then synthesised or the underscored member variable is accessed directly, but there is no discussion of class properties, nor of class properties of categories. I believe such class readonly properties are roughly equivalent to static constexpr member variables in modern C++, where initialising them is a one-liner in the header: MyClass.hxx #include <string> using std::literals; struct MyClass { static constexpr auto myString = "Hello"s; }; // access with, for example, `std::println("{}", MyClass::myString);` Now on to my questions: Can MyClass.myString be initialised more compactly, similar to C++ without having to declare the static underscore-prefixed variable, the getter, and the test for nullity? Should I declare an + (instancetype) init method and then initialise myString inside it? Would this not override the provided +init method that NSURL already has? Is there some other way altogether, i.e. subclass rather than category? I'm not intimately familiar with Objective-C semantics so I'm not sure if an NSURL* returned by some Foundation class can be straightforwardly cast to MyClass* where @interface MyClass : NSURL.
tagged with: objective-c++
has title: How to compactly initialise a class readonly property of a category in Objective-C?
type: Question
upvote count: 1
linked to: http://stackoverflow.com/q/4586516
answer count: 1
score: 1
downvote count: 0
has answer: http://stackoverflow.com/a/79466863
accepted answer: http://stackoverflow.com/a/79466863
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/q/79519362
tagged with: swift
downvote count: 0
tagged with: swiftui
answer count: 0
score: 1
has body: I'm having an issue specifically with SwiftUI previews in my iOS project. The project builds and runs fine on devices and simulators (in Rosetta mode), but SwiftUI previews fail to load in both Rosetta and native arm64 simulator environments. The main error in the preview is related to the Alamofire dependency in my SiriKit Intents extension: Module map file '[DerivedData path]/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.modulemap' not found This error repeats for multiple Swift files within my SiriKit Intents extension. Additionally, I'm seeing: Cannot load underlying module for 'Alamofire Environment Xcode version: 16.2 macOS version: Sonoma 14.7 Swift version: 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1) Dependency management: CocoaPods Alamofire version: 5.8 My project is a large, older codebase that contains a mix of UIKit, Objective-C and Swift Architecture Issue: The project only builds successfully in Rosetta mode for simulators. SwiftUI previews are failing in both Rosetta and native arm64 environments. This suggests there may be a fundamental issue with how the preview system interacts with the project's architecture configuration. What I've Tried I've attempted several solutions without success: Cleaning the build folder (⇧⌘K and Option+⇧⌘K) Deleting derived data Reinstalling dependencies Restarting Xcode Removing and re-adding Alamofire
has comment: http://stackoverflow.com/comment/140236695
has title: SwiftUI Preview Fails to Load While Project Builds and Runs Fine: Alamofire Module Map Issue
type: Question
upvote count: 1
tagged with: objective-c
type: UnansweredQuestion
tagged with: xcode
favorite count: 0
tagged with: uikit

http://stackoverflow.com/comment/140235668
score: 0
type: QuestionComment
has text: The code editted. [uiwebview loadrequest] is now deleted (at the end of the code) and some codes are added at the "good" (search the word in the code) to show the index.html on the webview. It shows the index.html. Still the webview, however, is not responding... wondering what is wrong? thanks!
comment on: http://stackoverflow.com/q/79512314
type: Comment

http://stackoverflow.com/q/79518299
has answer: http://stackoverflow.com/a/79526560
tagged with: macos-sequoia
linked to: http://stackoverflow.com/q/79003342
has comment: http://stackoverflow.com/comment/140236317
has comment: http://stackoverflow.com/comment/140243772
answer count: 1
tagged with: appkit
tagged with: macos
type: Question
has comment: http://stackoverflow.com/comment/140236320
tagged with: objective-c
type: UnansweredQuestion
has title: Posting key-press CGEvent fails in macOS 15 Sequoia
has comment: http://stackoverflow.com/comment/140236774
has body: I have a Mac menubar app that tries to show/hide the Emoji picker (Character palette) in the frontmost app via a menu item. The best way I found to do this was to trigger the Emoji picker's system keyboard shortcut — fn-E (Globe-E) — via simulated key press sent to the frontmost app: pid_t psn = NSWorkspace.sharedWorkspace.frontmostApplication.processIdentifier; CGEventRef keyup, keydown; CGEventFlags flags = kCGEventFlagMaskSecondaryFn; keydown = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)kVK_ANSI_E, true); CGEventSetFlags(keydown, flags); keyup = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)kVK_ANSI_E, false); CGEventSetFlags(keyup, flags); CGEventPostToPid(psn, keydown); CGEventPostToPid(psn, keyup); CFRelease(keydown); CFRelease(keyup); This no longer works in macOS 15 Sequoia. The code above simply fails without error. I found one similar question on StackOverflow, with a suggestion from @Rudolfs-Bundulis to set timestamps on the events before posting them, e.g. add these lines: CGEventSetTimestamp(keydown, clock_gettime_nsec_np(CLOCK_UPTIME_RAW)); CGEventSetTimestamp(keyup, clock_gettime_nsec_np(CLOCK_UPTIME_RAW)); This still doesn't work. I also tried creating an NSEvent key event with a timestamp and windowId, but that also doesn't work. Am I doing something wrong with the timestamps, or is there something else I'm missing?
score: 0
has comment: http://stackoverflow.com/comment/140237685
has comment: http://stackoverflow.com/comment/140239780

http://stackoverflow.com/comment/140237685
comment on: http://stackoverflow.com/q/79518299
has text: @RudolfsBundulis 1) The event is sent to the frontmost app (and its menus), not a window. 3) `CGEventPostToPSN` is deprecated in CGEvent.h. How do you get a psn nowadays?.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/79505570
score: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/79505321
upvote count: 1
has body: The best option is using delegation. It prevents tight coupling between controllers and ensures clean, modular, and reusable code. CustomVC.h: @protocol CustomVCDelegate <NSObject> - (void)customVCDidFinish:(BOOL)enableButton; @end @interface CustomVC : UIViewController @property (nonatomic, weak) id<CustomVCDelegate> delegate; @end FirstCustomVC.h: #import "CustomVC.h" @interface FirstCustomVC : UIViewController <CustomVCDelegate> @property (weak, nonatomic) IBOutlet UIButton *myButton; @end FirstCustomVC.m: - (void)customVCDidFinish:(BOOL)enableButton { self.myButton.enabled = enableButton; } - (void)launchSecondVC { UIStoryboard *storyBoard = self.storyboard; CustomVC *myVC = [storyBoard instantiateViewControllerWithIdentifier:@"myvc"]; myVC.delegate = self; // Назначаем делегата UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:myVC]; [self presentViewController:nav animated:YES completion:nil]; } CustomVC.m: - (void)dismissAndSendData { if ([self.delegate respondsToSelector:@selector(customVCDidFinish:)]) { [self.delegate customVCDidFinish:YES]; // Сообщаем делегату включить кнопку } [self dismissViewControllerAnimated:YES completion:nil]; // Закрываем ViewController B }
answers question: http://stackoverflow.com/q/79505321
downvote count: 0

http://stackoverflow.com/a/79545539
type: Answer
has body: I managed to resolve this by changing the nsmanagedobject parameter to a standard nsobject. There must have been an issue with the context I was using.
answers question: http://stackoverflow.com/q/79542554
score: 0

http://stackoverflow.com/q/79498059
tagged with: macos
tagged with: ms-word
linked to: http://stackoverflow.com/q/64880406
answer count: 0
score: 0
has body: I am using Objective-C and using the openURL method to open a URL with scheme. This is the URL: ms-word:https://website.com/WorFile.docx This works fine and opens the document in Microsoft Word app. But when the URL consists of commands: ms-word:ofe|u|https://website.com/WorFile.docx, it is not opening the document in the Word app. How to fix this? Code: void openUri(const char* uri) { NSString* nsUri = [NSString stringWithUTF8String:uri]; NSURL* url = [NSURL URLWithString:nsUri]; [[NSWorkspace sharedWorkspace] openURL:url]; }
tagged with: objective-c
type: Question
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/140203114
has title: How to open a URL with scheme and commands in macOS?

http://stackoverflow.com/comment/140217289
type: Comment
score: 0
type: QuestionComment
has text: How is the data displayed? Post a [mre] please.
comment on: http://stackoverflow.com/q/79507593

http://stackoverflow.com/comment/140239013
type: QuestionComment
comment on: http://stackoverflow.com/q/79520311
type: Comment
score: 0
has text: Is your app localized? Is `NSMenu.userInterfaceLayoutDirection` what you're looking for?

http://stackoverflow.com/q/79487100
downvote count: 1
type: UnansweredQuestion
upvote count: 0
tagged with: ios
tagged with: jsonmodel
tagged with: cllocationcoordinate2d
tagged with: objective-c
answer count: 0
favorite count: 0
score: -1
has body: I am using JSONModel (https://github.com/jsonmodel/jsonmodel) to turn my objects into JSON. One of my objects is a Waypoint object that contains a CLLocationCoordinate2D property. I have created a ValueTransformer: - (id)CLLocationCoordinate2DFromNSDictionary:(NSDictionary *)dictionary { CLLocationDegrees latitude = [dictionary[@"latitude"] doubleValue]; CLLocationDegrees longitude = [dictionary[@"longitude"] doubleValue]; CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(latitude, longitude); if (CLLocationCoordinate2DIsValid(coordinate)) { return [NSValue valueWithMKCoordinate:coordinate]; } coordinate = kCLLocationCoordinate2DInvalid; return [NSValue valueWithMKCoordinate:coordinate]; } - (NSDictionary *)JSONObjectFromCLLocationCoordinate2D:(CLLocationCoordinate2D)coordinate { NSDictionary *dict = @{ @"latitude": [NSNumber numberWithDouble:coordinate.latitude], @"longitude": [NSNumber numberWithDouble:coordinate.longitude] }; return dict; } This works fine, but it seems like the value is getting set as the NSValue object rather than unwrapping and providing the CLLocationCoordinate2D struct. Somehow I need to have JSONModel use CLLocationCoordinate2D coordinate = [value MKCoordinateValue]; to get the coordinate. Is this possible?
type: Question
has title: JSONModel ValueTransformer not working with CLLocationCoordinate2D

http://stackoverflow.com/q/79456745
type: Question
tagged with: swift
upvote count: 1
tagged with: xcode
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/140139079
favorite count: 0
tagged with: bridging-header
downvote count: 1
has body: I recently updated my macOS to version 15.3 (24D60) and Xcode to version 16.2. After the update, I started encountering the following error in my project: Using bridging headers with module interfaces is unsupported This error occurs when I try to build my project, which includes a mix of Swift and Objective-C code. Previously, everything worked fine, but after the update, the build fails with this error. Details About My Project: My project is a framework that includes both Swift and Objective-C code. I was using a bridging header (MyFramework-Bridging-Header.h) to expose Objective-C code to Swift. The project was working perfectly before the update. What I’ve Tried: I checked the build settings and confirmed that the Defines Module setting is set to YES. I tried cleaning the build folder (Product > Clean Build Folder) and rebuilding, but the error persists. I verified that the bridging header is correctly referenced in the Objective-C Bridging Header build setting. I replaced the bridging header with a module map and umbrella header. Here’s my current setup: Umbrella Header (MyFrameworkName.h): #import <Foundation/Foundation.h> // Public headers #import "GeneratedPluginRegistrant.h" #import "Flutter.h" #import "FlutterPlugin.h" Module Map (module.modulemap): framework module MyFrameworkName { umbrella header "MyFrameworkName.h" export * module * { export * } } I removed the bridging header and added the Module Map File path in the build settings. The Defines Module setting is set to YES. Despite these changes, I’m now encountering a new error: flutter not found on AppDelegate Error Messages: Original Error: Using bridging headers with module interfaces is unsupported New Error After Changes: flutter not found on AppDelegate Questions: Why is the original error occurring after updating to macOS 15.3 and Xcode 16.2? How can I resolve the flutter not found on AppDelegate error while using a module map and umbrella header? Is there a recommended approach to replace th…
answer count: 1
has answer: http://stackoverflow.com/a/79465487
has title: Using bridging headers with module interfaces is unsupported" error after updating to macOS 15.3 (24D60) and Xcode 16.2
score: 0
tagged with: objective-c

http://stackoverflow.com/a/79485539
has comment: http://stackoverflow.com/comment/140194821
has comment: http://stackoverflow.com/comment/140184133
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/140194808
accepted answer of: http://stackoverflow.com/q/79483025
has body: It's not supported. You are not able to generate an Xcode project from a MAUI iOS project. Note: If you want to link the Objective-C static library into your MAUI project, you have to make a .net-ios binding project. Please see Native Library Interop - .NET MAUI Community Toolkit - Community Toolkits for .NET | Microsoft Learn Getting Started with Native Library Interop - Community Toolkits for .NET | Microsoft Learn Creating Bindings for .NET MAUI with Native Library Interop - .NET Blog
answers question: http://stackoverflow.com/q/79483025
score: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/140241649
type: Comment
has text: I've added now "webView.navigationDelegate = self" to my viewDidLoad and now it works. This question pointed me in the right direction. Thank you.
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/79521891

http://stackoverflow.com/q/79472383
has title: is the MyThreadSafeMutableDictionary thread safe。 if unsafe, what's the problem。
tagged with: objective-c
has body: is the MyThreadSafeMutableDictionary thread safe? actually, i get some NSDictionary crash issues, i just call [MyThreadSafeMutableDictionary objectForkey:@"key"] and [MyThreadSafeMutableDictionary removeAllObjects] in different thread. the call stack like: EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x000a00130008000c 0 libobjc.A.dylib objc_msgSend + 8 1 CoreFoundation -[__NSDictionaryM objectForKey:] + 168 2 VSTThreadSafeMutableDictionary.m - line 154 __47-[VSTThreadSafeMutableDictionary objectForKey:]_block_invoke + 154 3 libdispatch.dylib _dispatch_client_callout + 20 4 libdispatch.dylib _dispatch_sync_invoke_and_complete + 56 5 MyThreadSafeMutableDictionary.m line 153 -[VSTThreadSafeMutableDictionary objectForKey:] + 153 MyThreadSafeMutableDictionary.m line 153 -[VSTThreadSafeMutableDictionary objectForKey:] + 153** **the MyThreadSafeMutableDictionary.h source code as follows:** #import "MyThreadSafeMutableDictionary.h" @interface MyThreadSafeMutableDictionary () @property (nonatomic, strong) NSMutableDictionary *mutableDictionary; @end @implementation MyThreadSafeMutableDictionary + (NSString *)queueName { CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault); NSString *uuid = (NSString *)CFBridgingRelease(CFUUIDCreateString(kCFAllocatorDefault, uuidRef)); CFRelease(uuidRef); NSString *queueName = [NSString stringWithFormat:@"com.my.thread.safe.Dictionary.%@", uuid]; return queueName; } + (instancetype)dictionary { MyThreadSafeMutableDictionary *mutableDictionary = [MyThreadSafeMutableDictionary new]; return mutableDictionary; } + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { MyThreadSafeMutableDictionary *mutableDictionary = [[MyThreadSafeMutableDictionary alloc] initWithCapacity:numItems]; return mutableDictionary; } + (instancetype)dictionaryWithDictionary:(NSDictionary *)dict { MyThreadSafeMutableDictionary *mutableDictionary = [self dictionary]; [mutableDictionary addEntriesFromDictionary:dict]; return mutableDictionary; } - (instancetype)init { retu…
type: UnansweredQuestion
tagged with: thread-safety
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/140159046
type: Question
tagged with: nsdictionary

http://stackoverflow.com/comment/140206951
type: QuestionComment
comment on: http://stackoverflow.com/q/79496234
type: Comment
has text: According to the stacktrace, it seems that the call back is called... Unsure why it crashes. If you remove all your code in the callback and just put a log, does it prints? Does it still crashes? I'm wondering if the issue is not on the SDK code, but that would might need a ticket on their end if it's private...
score: 0

http://stackoverflow.com/comment/140262734
type: Comment
has text: I just read that you can't modify the phone app source. Do you not have access to that source code? If it is provided by a 3rd party, perhaps you need to raise the issue with them?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/79534149

http://stackoverflow.com/q/79508792
has body: I have a command line program to convert images to JPEG which works but is very slow at converting some HEIC images from an iPhone 16. For example, a 3MB (5712x4284) HEIC image takes 1.4s to process, whereas converting the same image saved as a 100MB TIFF only takes 0.25s. Is there any way to speed this up? (All the time is spent in drawInRect, actually compressing it to JPEG etc. only takes about 25ms.) #import <Foundation/Foundation.h> #import <AppKit/AppKit.h> #include <sys/xattr.h> #include <sys/time.h> #include <stdio.h> long currentTimeMillis() { struct timeval t; gettimeofday(&t, NULL); return t.tv_sec*1000L + t.tv_usec/1000; } void convertToJPEG(const char* inf, const char* outf) { long t0 = currentTimeMillis(); NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSString* str = [NSString stringWithUTF8String:inf]; NSImage *image = [[NSImage alloc]initWithContentsOfFile:str]; NSSize size = [image size]; printf("+%ld origsize %g x %g\n", currentTimeMillis()-t0, size.width, size.height); size.width /= 2; size.height /= 2; NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:size.width pixelsHigh:size.height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bytesPerRow:0 bitsPerPixel:0]; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:rep]]; printf("+%ld setup\n", currentTimeMillis()-t0); // Draw scaled image into representation **** THIS STEP IS SLOW **** [image drawInRect:NSMakeRect(0, 0, size.width, size.height) fromRect:NSZeroRect operation:NSCompositingOperationCopy fraction:1.0]; printf("+%ld drawInRect\n", currentTimeMillis()-t0); [NSGraphicsContext restoreGraphicsState]; // Compress representation to JPEG [rep setProperty:NSImageColorSyncProfileData withValue:nil]; NSDictionary *imageProps = [NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:0.5] forKey:NSImageCompressi…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/140221802
tagged with: core-image
tagged with: macos
has comment: http://stackoverflow.com/comment/140242001
has comment: http://stackoverflow.com/comment/140221799
tagged with: appkit
tagged with: objective-c
has title: NSImage is very slow with HEIC images
answer count: 0
linked to: http://stackoverflow.com/q/58855049
score: 0
type: Question

uipresentingcontroller
tags question: http://stackoverflow.com/q/79505321
tag name: uipresentingcontroller
type: Tag

http://stackoverflow.com/comment/140221802
score: 0
type: Comment
has text: Related: [NSImage drawInRect is more than 10 times slower on a much faster MacBook Pro?](https://stackoverflow.com/questions/58855049/nsimage-drawinrect-is-more-than-10-times-slower-on-a-much-faster-macbook-pro)
comment on: http://stackoverflow.com/q/79508792
type: QuestionComment

http://stackoverflow.com/comment/140247672
has text: So do you happen to know what would be the problem in my code of Objective-c(not swift) UIwebview? Both objective-c and uiwebview are old but so is http basic auth, which should work in this environment as well.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79512314
type: Comment

http://stackoverflow.com/comment/140243237
type: Comment
has text: WOOOOW Thanks a lot !!!!!!! It magicaly works
comment on: http://stackoverflow.com/q/79520311
type: QuestionComment
score: 0

http://stackoverflow.com/comment/140204466
has text: Could you share the stacktrace when it crashes? Also, there is no error message in console? What's the method `notifyRunmefit` do you have code from that? Are you sure the callback is not called? Did you put a log at the start of the closure?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/79496234
type: QuestionComment

http://stackoverflow.com/comment/140244968
type: QuestionComment
comment on: http://stackoverflow.com/q/79524037
has text: Which method does "Save As…" call?
type: Comment
score: 0

http://stackoverflow.com/comment/140239114
type: QuestionComment
comment on: http://stackoverflow.com/q/79520311
has text: I don't want to get the layout direction, I want to set it.
type: Comment
score: 0

http://stackoverflow.com/comment/140239066
score: 0
has text: What do you mean by localized app ? is this about an info in a plist
type: QuestionComment
comment on: http://stackoverflow.com/q/79520311
type: Comment

http://stackoverflow.com/comment/140241628
type: QuestionComment
has text: In my application, I am already properly detecting in which direction I have to display the layout. `NSMenu.userInterfaceLayoutDirection` is just getter, not a setter.
type: Comment
comment on: http://stackoverflow.com/q/79520311
score: 0

http://stackoverflow.com/comment/140257347
has text: What's a point of adding `dynamic` property? You can add property in model and set it default value and get generated by xcode h,m files.
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/79527661

http://stackoverflow.com/q/79485734
score: 0
type: UnansweredQuestion
has body: I started picking up Objective-C and noticed most of the code I'd seen, when handling errors, eventually calls: [NSError errorWithDomain:domain code:code userInfo:@{NSLocalizedDescriptionKey : desc}]; , but it never checks for the possibility of failing to allocate memory for the NSError. Do we need to worry about that, or do we just assume it always succeeds (or rarely fails)? And if we do consider the possibility of an NSError creation failure, what should we return? In C, we'd typically just log the error and return an integer error code, but in Objective-C, creating an error object itself requires memory, I find it to be sort of a chicken-and-egg problem
has title: Objective-C handling class instantiation failure
tagged with: objective-c
has answer: http://stackoverflow.com/a/79492089
type: Question
answer count: 1

http://stackoverflow.com/q/79455766
answer count: 1
tagged with: lldb
has body: I'm using lldb to debug an application and I have this breakpoint right before a call SCNetworkReachability imp___stubs__SCNetworkReachabilityCreateWithAddress: jmp qword [_SCNetworkReachabilityCreateWithAddress_10000c0c8] right here the RDI register contains a sockaddr structure that I want to inspect, so I'm trying to somehow cast the address to this type to get further information,I've tried the following commands: expr *((sockaddr *)$rsi) expr *((sockaddr_in *)$rsi) p *((sockaddr *)$rsi) p *((sockaddr_in *)$rsi) the problem is that lldb does not recognize this structure, I need to somehow import this symbol but how do I go about this? I also tried to manually import the structure: expr struct $sockaddr { unsigned char sa_len; unsigned char sa_family; char sa_data[14]; } and then cast it: expr ($sockaddr)$rdi but now LLDB gives a different error: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'unsigned long' to 'const $sockaddr' for 1st argument candidate constructor (the implicit move constructor) not viable: no known conversion from 'unsigned long' to '$sockaddr' for 1st argument andidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided
type: AnsweredQuestion
tagged with: objective-c
tagged with: debugging
has answer: http://stackoverflow.com/a/79458467
has title: LLDB - how do I import a symbol so I can access a struct definition?
score: 0
accepted answer: http://stackoverflow.com/a/79458467
type: Question

http://stackoverflow.com/q/79512314
type: Question
has comment: http://stackoverflow.com/comment/140228692
type: UnansweredQuestion
tagged with: http
tagged with: webview
linked to: http://stackoverflow.com/q/60508114
has comment: http://stackoverflow.com/comment/140235668
has comment: http://stackoverflow.com/comment/140245230
linked to: http://stackoverflow.com/q/2834946
has comment: http://stackoverflow.com/comment/140247672
has comment: http://stackoverflow.com/comment/140251008
has comment: http://stackoverflow.com/comment/140246602
tagged with: objective-c
has comment: http://stackoverflow.com/comment/140238539
tagged with: authentication
has body: I am developing ios app implementing basic auth with objective-c. (it is an old app). This was a good reference and asynchronous code was used for my app. NSURLConnection and Basic HTTP Authentication in iOS The code is shown below. It works and shows a html file in a webview. The problem is that webview is not responding after it shows the page. Namely it has a link to a certain site, but it does not follow the link. How can I fix the code? Thank you very much. Have a nice weekend :) - (void)viewDidLoad { [super viewDidLoad]; NSString *urlString = @"https://test.com/test/"; //username and password value NSString *username = @"test1"; NSString *password = @"test1"; //HTTP Basic Authentication NSString *authenticationString = [NSString stringWithFormat:@"%@:%@", username, password] ; NSData *authenticationData = [authenticationString dataUsingEncoding:NSASCIIStringEncoding]; NSString *authenticationValue = [authenticationData base64Encoding]; //Set up your request NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:urlString]]; [request setHTTPMethod:@"GET"]; // Set your user login credentials [request setValue:[NSString stringWithFormat:@"Basic %@", authenticationValue] forHTTPHeaderField:@"Authorization"]; // Send your request asynchronously [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *responseCode, NSData *responseData, NSError *responseError) { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) responseCode; NSLog(@"response status code: %ld", (long)[httpResponse statusCode]); // do stuff if ([responseData length] > 0 && responseError == nil){ //logic here NSLog(@"good!"); //logic here and added. NSLog(@"good!: %@", responseData); //[NSString stringWithFormat:@"ID %@", DevID]; NSString *html = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; NSLog(@"%@", html); NSURL *url = [NSURL URLWithString:urlString]; [self->_webV…
answer count: 0
has comment: http://stackoverflow.com/comment/140233761
has comment: http://stackoverflow.com/comment/140243522
score: 0
has title: Objective-c http basic auth asynchronously (with no specific library)
has comment: http://stackoverflow.com/comment/140247486
has comment: http://stackoverflow.com/comment/140248082
linked to: http://stackoverflow.com/q/1973325

http://stackoverflow.com/comment/140262909
comment on: http://stackoverflow.com/q/79534149
score: 0
type: QuestionComment
has text: You're absolutely right for pointing this out. I am storing a reference to the value returned by `[MPNowPlayingInfoCenter defaultCenter]` rather than always using the `defaultCenter` property directly. I'll update my question accordingly. Thank you @paulw11
type: Comment

http://stackoverflow.com/comment/140218314
comment on: http://stackoverflow.com/q/79507593
has text: @Willeke I've updated the question and put a mre on github: <https://github.com/persquare/DrawBug>
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/79457893
answer count: 1
tagged with: objective-c
tagged with: cocoa
favorite count: 0
upvote count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/79457932
tagged with: macos
score: -1
has title: Disable or intercept keyboard navigation in NSTableView
downvote count: 1
has body: MacOS app. I have a window with a NSTableView on it. Whenever the window is active, when a key is pressed that corresponds to the initial letter of a table item text, the table selects that item. How do I disable or intercept that behavior? I want my app to react to key presses, but in more ways than just selecting a table item. Tried setting refusesFirstResponder on the table view and on the item template - doesn't help. Tried creating menu items in the main menu with a respective keyEquivalent - they only fire sometimes (see below), it looks like the table gets the first dibs on keyboard events. In addition, the table view has a keyboard navigation timeout - if one presses keys in quick succession, only the first one leads to a selection change, the subsequent ones produce a click and the action of the menu item for that key fires. I don't want the timeout, or the clicks. If this can be done without subclassing system classes (views, NSWindow) that are normally not meant to be subclassed - even better.
type: Question
accepted answer: http://stackoverflow.com/a/79457932

http://stackoverflow.com/comment/140241102
type: QuestionComment
has text: (Asking because it's not visible from the posted code.) Are you setting `LESSViewController` as `webview`'s `navigationDelegate`?
comment on: http://stackoverflow.com/q/79521891
score: 1
type: Comment

http://stackoverflow.com/comment/140275182
type: Comment
has text: It’s generally a custom `UICollectionViewLayout`, not a `UICollectionViewFlowLayout`. See the second example in https://stackoverflow.com/questions/41837170/ios-uicollectionview-cells-with-circular-view-in-alternating-grid-alignment/41839446#41839446 for a Swift example. If you need me to translate to Objective-C, I can, but hopefully that illustrates the idea.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/79538671

http://stackoverflow.com/comment/140207838
type: QuestionComment
has text: @Larme I tried it, and it still crashes. It must have something to do with no data being sent. When I try to read other data from the device, the method is called, and it works perfectly. It only crashes when there is no data.
type: Comment
comment on: http://stackoverflow.com/q/79496234
score: 0

http://stackoverflow.com/comment/140245814
type: QuestionComment
comment on: http://stackoverflow.com/q/79524037
type: Comment
has text: It calls `-saveDocumentAs:`, the full call sequence is `saveDocumentAs: -> writableTypes -> prepareSavePanel: -> dataOfType:` with type showing up as `net.sourceforge.foo` regardless of selection.
score: 0

http://stackoverflow.com/comment/140219171
type: Comment
comment on: http://stackoverflow.com/q/79505321
has text: @HangarRash why did you remove the [tag:swift] tag? OP intentionally asked about Swift as well as Objective C and accepted an answer in Swift.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/140275423
has text: Note that once you’ve got this positioning the cells correctly, since they overlap, you may want to set the `zIndex` to appropriate values for all the cells, so the more central cells are laid out over the less central ones.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/79538671

http://stackoverflow.com/q/79451132
has body: Here's my sample project: https://github.com/Tj3n/TestProject I'm trying to create a Swift framework to use in an Objective-C app, build works fine, configuration all keep to default, added the framework in the app, imported ok, but I cannot access the class written in Swift, which already marked with @objc and public, not sure if anyone have an idea where I did wrong Framework: @objc(TVNFoo) @objcMembers public class Foo: NSObject { public static let shared = Foo() public func foo() { print("foo") } } App: @import TestFramework; [TVNFoo shared]; // Use of undeclared identifier 'TVNFoo' Edit: By default Defines Module and Build Libraries for Distribution are set to Yes
answer count: 1
score: 0
tagged with: frameworks
type: Question
tagged with: swift
has title: How to configure Swift framework to works in Objective-c app?
has answer: http://stackoverflow.com/a/79453231
accepted answer: http://stackoverflow.com/a/79453231
type: AnsweredQuestion
tagged with: objective-c

http://stackoverflow.com/comment/140263403
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79534149
has text: Thanks. I tried that and I thought this was fixed with your suggestion, but then I kept on testing my app and the issue happened again. This is a weird issue because it seems to work sometimes ( which is better than when it was never working). It may be noteworthy, that when it does not work, another usage of default center takes over ( such as Spotify) or the phone app simply just loses control over the default center ( as if it was deallocated).
type: Comment

http://stackoverflow.com/comment/140262680
has text: Can you provide more code that demonstrates the problem? Are you storing a reference to the value returned by `[MPNowPlayingInfoCenter defaultCenter]` rather than always using the `defaultCenter` property directly?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/79534149
type: QuestionComment

http://stackoverflow.com/comment/140245230
score: 0
has text: Thank you very much for your reply. This is an old project and it has 4 views, two out of which have a (UI)webview. I think mixing UIwebview and wkwebview in a project is not a good idea. Note: the code above is a minimum testable code. Thank you very much!
type: QuestionComment
comment on: http://stackoverflow.com/q/79512314
type: Comment

http://stackoverflow.com/comment/140222255
score: 0
has text: Yeah. Thank you for your help. I rewrote the stuff completely to Objective-C, because the sdk also uses Objective-C and now it works. Even though the documentation said, that Swift should work. I am still planning to use swift in the future, but for now it works :)
comment on: http://stackoverflow.com/q/79496234
type: QuestionComment
type: Comment

nssavepanel
type: Tag
tags question: http://stackoverflow.com/q/79524037
tag name: nssavepanel

http://stackoverflow.com/a/79453231
has comment: http://stackoverflow.com/comment/140122963
accepted answer of: http://stackoverflow.com/q/79451132
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/140138987
answers question: http://stackoverflow.com/q/79451132
score: 0
has body: Finally found the fix, for some reason the build setting SWIFT_INSTALL_OBJC_HEADER is responsible for copying the generated header to the built framework, but by default it's being set to No. Change to Yes and it can find the symbols now.
has comment: http://stackoverflow.com/comment/140138537

http://stackoverflow.com/q/79521778
type: UnansweredQuestion
tagged with: macos
has title: macOS Key Logger works in Terminal but not with launchd
answer count: 0
has body: macOS Key Capture App Works in Terminal but Not with launchd I have developed a macOS application in Golang that captures key presses. The application uses CGO to call Objective-C code for handling key events. #cgo LDFLAGS: -framework Foundation -framework Foundation -framework Carbon #include "keylogger.h" typedef enum State { Up, Down, Invalid } State; extern void handleButtonEvent(int k, State s); static inline void listen() { CGEventMask eventMask = { CGEventMaskBit(kCGEventKeyDown) | CGEventMaskBit(kCGEventKeyUp) }; CFMachPortRef eventTap = CGEventTapCreate( kCGSessionEventTap, kCGHeadInsertEventTap, 0, eventMask, CGEventCallback, NULL ); // Exit the program if unable to create the event tap. if(!eventTap) { fprintf(stderr, "ERROR: Unable to create event tap.\n"); exit(1); } // Create a run loop source and add enable the event tap. CFRunLoopSourceRef runLoopSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, eventTap, 0); CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopCommonModes); CGEventTapEnable(eventTap, true); CFRunLoopRun(); } It works correctly when I run the code inside my IDE. It also works when I build the binary and run it directly from the terminal. However, when I run the application using launchd (added to /Library/LaunchAgents), it runs in the background under user permissions but fails to capture keyboard input. How can I fix this issue?
tagged with: objective-c
tagged with: agent
tagged with: keylogger
score: 0
type: Question

http://stackoverflow.com/q/79483025
has title: How to generate an Xcode project from a MAUI iOS project?
tagged with: maui
score: 0
type: Question
has body: I am trying to link an Objective-C static library against my MAUI iOS app and be able to debug it from Xcode. In order to do that, I'd need to generate the Xcode project out of the MAUI one. I cannot find any relevant information under the MAUI docs, other than a reference to an open sourced project called xcsync. However, when I run the tool, the project gets generated but it won't event build. (Multiple targets producing Info.plist, and missing MAUI class references) xcsync generate \ --project ./MyMauiApp.csproj \ --target-framework-moniker net9.0-ios -f \ --verbosity Detailed Is generating the Xcode project even possible?
has answer: http://stackoverflow.com/a/79485539
accepted answer: http://stackoverflow.com/a/79485539
tagged with: ios
tagged with: .net
type: AnsweredQuestion
tagged with: objective-c
tagged with: xcode
answer count: 1

http://stackoverflow.com/comment/140138537
has text: I did tried this option as well, but when trying to consume SPM package for another framework target, it cause duplicate symbol, but does not happen for static library/framework project.
score: 0
comment on: http://stackoverflow.com/a/79453231
type: AnswerComment
type: Comment

http://stackoverflow.com/a/79522314
score: 1
type: Answer
upvote count: 1
has body: webView.navigationDelegate = self was missing in my viewDidLoad. Thanks to lazarevzubov to ask the right question
downvote count: 0
answers question: http://stackoverflow.com/q/79521891

http://stackoverflow.com/q/79520311
has comment: http://stackoverflow.com/comment/140241628
score: 0
has comment: http://stackoverflow.com/comment/140239114
has comment: http://stackoverflow.com/comment/140243237
has comment: http://stackoverflow.com/comment/140241725
has title: Align NSMenuItem title to right
has comment: http://stackoverflow.com/comment/140239066
answer count: 0
has comment: http://stackoverflow.com/comment/140239122
tagged with: macos
tagged with: nsmenu
has comment: http://stackoverflow.com/comment/140239138
has body: In my application, I am creating a simple NSMenu with NSMenuItems. The title of the NSMenuItems are adapted to the system language. So, when the system language is an RTL language (right to left), I want my NSMenuItem to be aligned at the right. I can't see anyone talking about this, or any option that could make me achieve that easily. NSMenuItem* item1; NSMenuItem* item2; item1 = [[NSMenuItem alloc] init]; item2 = [[NSMenuItem alloc] init]; item1.title = "foo"; item2.title = "bar"; item1.action = @selector(fooAction); item2.action = @selector(barAction); NSMenu *menu = [[NSMenu alloc] init]; [menu addItem:item1]; [menu addItem:item2];
has comment: http://stackoverflow.com/comment/140239013
type: Question
tagged with: objective-c
type: UnansweredQuestion

http://stackoverflow.com/q/79442054
has body: I have a WKWebView running a website that supports login with pintrest. By clicking on It I am opening a new window to not render in same webview and simulate like we see in other browsers. - (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures { // if (navigationAction.targetFrame == nil) { NSWindow *newWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(100, 100, 800, 600) // Adjust window size styleMask:(NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskResizable) backing:NSBackingStoreBuffered defer:NO]; // Create a new WKWebView for this new window WKWebView *popupWebView = [[WKWebView alloc] initWithFrame:newWindow.contentView.bounds configuration:configuration]; popupWebView.navigationDelegate = self; popupWebView.UIDelegate = self; // Load an initial URL (you can modify this URL as needed) NSURL *url = navigationAction.request.URL; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [popupWebView loadRequest:request]; // Add the WKWebView to the window's content view [newWindow.contentView addSubview:popupWebView]; [newWindow makeKeyAndOrderFront:nil]; return popupWebView; // } There pinterset support login with google as well, clicking on which same method is called and a new window is called. But the problem is that when google auth is successful, window is not getting closed with message "TypeError: null is not an object (evaluating 'window.opener.postMessage')". I tried various form to check how to connect these 2 window and enable "window.opener" but nothing found. I need help in this.
score: 0
type: Question
type: UnansweredQuestion
tagged with: wkwebview
answer count: 0
tagged with: macos
has title: Issue in google oauth login usingWkwebview in Macos
tagged with: objective-c

http://stackoverflow.com/q/79524037
accepted answer: http://stackoverflow.com/a/79524866
type: AnsweredQuestion
has body: I'm trying to modernize a 20+ year old cocoa/objective-c application. It is document-based and it can read/write its own data to file, but the user can also choose saveAs… to export the document in standard formats (not read by the app). From the (somewhat confusing) documentation I got the impression that an accessory panel shouldn't be needed to achieve this, given the correct information in Info.plist. I was expecting the user to pick a file format in the save panel and that that selection would be passed as the type when -dataOfType:error: is invoked. However, type is always the document's native type, regardless of the choice in the save panel. I'm trying this out on a toy project with a vanilla document based project with the following changes: Info.plist <?xml version="1.0" encoding="UTF-8"?> CFBundleDocumentTypes CFBundleTypeRole Editor LSHandlerRank Default LSItemContentTypes net.sourceforge.foo NSDocumentClass Document UTExportedTypeDeclarations UTTypeConformsTo public.data UTTypeIcons UTTypeIdentifier net.sourceforge.foo UTTypeTagSpecification public.filename-extension foo UTImportedTypeDeclarations UTTypeConformsTo public.plain-text UTTypeDescription Example Text UTTypeIdentifier com.example.plain-text UTTypeTagSpecification public.filename-extension exampletext UTTypeConformsTo net.daringfireball.markdown UTTypeIcons UTTypeIdentifier com.example.mrkdwn UTTypeTagSpecification public.filename-extension mrkdwn Document.m + (BOOL)autosavesInPlace { return NO; } + (NSArray *)writableTypes { return @[ @"net.sourceforge.foo", @"com.example.plain-text", @"com.example.mrkdwn", @"net.daringfireball.markdown" ]; } - (BOOL) prepareSavePanel:(NSSavePanel *) savePanel { savePanel.allowedContentTypes = @[ [UTType typeWithIdentifier:@"com.example.plain-text"], [UTType typeWithIdentifier:@"net.sourceforge.foo"], [UTType typeWithIdentifier:@"com.example.mrkdwn"], ]; savePanel.showsContentTypes = YES; return true; } - (NSData *)dataOfType:(NSString *)typeName error:(NSErr…
tagged with: objective-c
answer count: 1
has comment: http://stackoverflow.com/comment/140246024
score: 0
has answer: http://stackoverflow.com/a/79524866
has comment: http://stackoverflow.com/comment/140244968
has comment: http://stackoverflow.com/comment/140245814
tagged with: uti
type: Question
has title: Cocoa app refuses to save document in user selected file format (export)
tagged with: nsdocument
tagged with: info.plist
tagged with: nssavepanel

http://stackoverflow.com/comment/140248082
score: 0
has text: I'd detect with the delegate method when URL change, and redo the basic auth there if needed... https://stackoverflow.com/questions/2834946/get-notified-about-a-page-change-in-uiwebview After all, basic auth is just setting the needed info in the header
type: QuestionComment
comment on: http://stackoverflow.com/q/79512314
type: Comment

http://stackoverflow.com/a/79458467
score: 1
type: AcceptedAnswer
type: Answer
upvote count: 1
downvote count: 0
has body: The sockaddr structure most likely doesn't fit in a single register, so $rdi holds a pointer to the structure, and you have to cast it as such: (lldb) expr *($sockaddr *)$rdi
accepted answer of: http://stackoverflow.com/q/79455766
answers question: http://stackoverflow.com/q/79455766

http://stackoverflow.com/comment/140266877
type: QuestionComment
comment on: http://stackoverflow.com/q/79534149
has text: Here is what I found: When Phone app is running and then CarPlay is connected and then CarPlay is disconnected, default center gets lost. When CarPlay app is running and then phone app gets ran and then CarPlay disconnects default center remains just fine. @Paulw11
type: Comment
score: 0

http://stackoverflow.com/comment/140239122
has text: FYI, I am not using localized strings, because my application is cross platform
comment on: http://stackoverflow.com/q/79520311
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/79463591
answer count: 0
score: 0
type: Question
type: UnansweredQuestion
has body: There's a crash from our Firebase Crashlytics dashboard that I cannot replicate no matter what and I'm quite cluless. The stacktrace that I have does not specify where it happens specifically: The logs &amp; breadcrumbs as well are not that helpful since it does not show a common pattern. Right now what I'm trying is to check the leaks through Instruments. What could be the reason for this crash? Or what are the ways to easily debug this?
tagged with: crashlytics
tagged with: firebase
has title: Crashed: com.apple.network.connections EXC_BAD_ACCESS KERN_INVALID_ADDRESS from Crashlytics
tagged with: ios
tagged with: objective-c

http://stackoverflow.com/comment/140269331
has text: What's your current output (visually)?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/79538671
type: Comment

http://stackoverflow.com/comment/140243772
comment on: http://stackoverflow.com/q/79518299
score: 0
type: QuestionComment
type: Comment
has text: The app did have Analytics permission. Removing and adding the app from permissions actually fixed the issue on my Mac but *not* my customer's Mac (we both have US keyboard layout and macOS 15.3.2 so I'm not sure what the difference is). The frontmost app does have an "Emoji & Symbols" menu item and we tested pressing Fn-E manually, which works. I tried with CGEventPostToPSN but no change.

http://stackoverflow.com/q/79521891
type: Question
has title: How do I get a click reported in WKWebView?
tagged with: wkwebview
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/140241102
has comment: http://stackoverflow.com/comment/140241649
has body: I'm late, I know. But now I have to update an old app in objective c and replace UIWebView with WKWebView. That's largely done and works fine – with one exception: I have to react to clicked links. But my routine for this is not called. What do I have to do to get the following snippet to be called when a link is clicked? - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { NSURLRequest *request = navigationAction.request; // Do whatever you want with the request decisionHandler(WKNavigationActionPolicyAllow); } The Interface in my ViewController is this: @interface LESSViewController : UIViewController &lt;WKNavigationDelegate&gt; { WKWebView *webview; ScriptAppDelegate *appDelegate; ... } @property (nonatomic, retain) IBOutlet WKWebView *webview; @property (nonatomic, retain) ScriptAppDelegate *appDelegate; @end What is missing or wrong here? Any tip in objective c is welcome.
answer count: 1
tagged with: objective-c
has answer: http://stackoverflow.com/a/79522314
score: 0

http://stackoverflow.com/comment/140206136
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79496234
type: Comment
has text: @Larme Thank you for your answer. Yes I did put a log at the start which doesn't get logged. The notifyRunmefit is a method of a third party SDK (.framework) which I have to use. And no sadly there is no message in the console, when the app crashes. I added the stacktrace to the question, because it is too long. I am a complete swift beginner, so any help is appreciated.

mpnowplayinginfocenter
type: Tag
tag name: mpnowplayinginfocenter
tags question: http://stackoverflow.com/q/79534149

http://stackoverflow.com/comment/140219334
type: QuestionComment
score: 0
type: Comment
has text: Without the code of that method it's hard to tell what's wrong...
comment on: http://stackoverflow.com/q/79496234

http://stackoverflow.com/comment/140221515
score: 0
comment on: http://stackoverflow.com/a/79492089
has text: @YijueXu I was commenting on the answer. `applicationDidReceiveMemoryWarning` is specific to iOS (UIKit) and is not available for macOS (AppKit).
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/140263067
score: 0
comment on: http://stackoverflow.com/q/79534149
has text: Why do you store a reference? Does the problem go away if you don't do that?
type: QuestionComment
type: Comment

http://stackoverflow.com/a/79524866
has body: Here's how to implement Export in the vanilla document based project: Add the imported file types (with a description) to info.plist Implement writableTypes Add a menu item "Export…" and connect it to the First Responder and action saveDocumentTo: I vaguely remember reading documentation about this somewhere, but I can't find it anymore.
accepted answer of: http://stackoverflow.com/q/79524037
answers question: http://stackoverflow.com/q/79524037
downvote count: 0
score: 1
type: AcceptedAnswer
type: Answer
upvote count: 1

webview
tag name: webview
type: Tag
tags question: http://stackoverflow.com/q/79512314

http://stackoverflow.com/comment/140233761
score: 0
type: QuestionComment
has text: Thank you very much for your reply. so either one of [uiwebview loadrequest], NSURLConnection or NSURLSession is enough? It means my code makes http get requests two times? I would like to make it sure and check the server log (/var/log/apache2/access.log) but it seems there is only one "get" log in the log. why? (is the response cached? )
comment on: http://stackoverflow.com/q/79512314
type: Comment

http://stackoverflow.com/comment/140194821
has text: I just realized you have an `Objective-C` library. Consider writing a small project in `XCode` on a Mac, in an **Apple** language (Objective-C or Swift), to test calls into the library. You'll get better information there than from Visual Studio. Especially If you have the source code or debug symbols for that library. Microsoft .Net is a step removed from those languages. Once you are confident in usage of the library, in your c# project, make similar calls to the C# binding methods.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/79485539

http://stackoverflow.com/comment/140219281
type: Comment
score: 0
comment on: http://stackoverflow.com/q/79505321
has text: @TylerH Because the code in the question is only Objective-C and nothing in the question is about Swift.
type: QuestionComment

http://stackoverflow.com/q/79518919
has title: CGImage to vImage buffer conversion leads to wrong colors
tagged with: ios
tagged with: cgimage
tagged with: objective-c
answer count: 1
score: 0
has answer: http://stackoverflow.com/a/79526806
tagged with: vimage
has body: I am converting a UIImage to a vImage_Buffer. The code looks as follows: CGImageRef originalImageRef = [image CGImage]; CGColorSpaceRef originalColorSpace = CGImageGetColorSpace(originalImageRef); CGColorRenderingIntent intent = CGImageGetRenderingIntent(originalImageRef); vImage_CGImageFormat inputImageFormat = { .bitsPerComponent = (uint32_t) CGImageGetBitsPerComponent(originalImageRef), .bitsPerPixel = (uint32_t) CGImageGetBitsPerComponent(originalImageRef) * (uint32_t)(CGColorSpaceGetNumberOfComponents(originalColorSpace) + (kCGImageAlphaNone != CGImageGetAlphaInfo(originalImageRef))), .colorSpace = originalColorSpace, .bitmapInfo = CGImageGetBitmapInfo(originalImageRef), .version = 0, .decode = NULL, .renderingIntent = kCGRenderingIntentDefault }; vImage_Error error = vImageBuffer_InitWithCGImage(inputImageBuffer, &inputImageFormat, NULL, originalImageRef, kvImageNoFlags); if (error == kvImageNoError) { NSLog(@"image to vimage buffer conversion complete"); } else { NSLog(@"image to vimage buffer conversion failed"); } But the resulting buffer colors are all different. All the Blue tones change into Yellow and so on. I tried the following code as well: CGImageRef sourceRef = [image CGImage]; NSUInteger sourceWidth = CGImageGetWidth(sourceRef); NSUInteger sourceHeight = CGImageGetHeight(sourceRef); CGDataProviderRef provider = CGImageGetDataProvider(sourceRef); CFDataRef bitmapData = CGDataProviderCopyData(provider); unsigned char *sourceData = (unsigned char*)calloc(sourceHeight * sourceWidth * 4, sizeof(unsigned char)); NSUInteger bytesPerPixel = 4; NSUInteger sourceBytesPerRow = bytesPerPixel * sourceWidth; CFDataGetBytes(bitmapData, CFRangeMake(0, CFDataGetLength(bitmapData)), sourceData); vImage_Buffer v_image = { .data = (void *)sourceData, .height = sourceHeight, .width = sourceWidth, .rowBytes = sourceBytesPerRow }; CFRelease(bitmapData); But this also seems to have same problem. Any help in this regard is highly appreciated.
type: Question
type: UnansweredQuestion

http://stackoverflow.com/comment/140246024
type: QuestionComment
type: Comment
has text: Hmm. I think I found the problem, overriding `+isNativeType:` to return `true` works. I was assuming (and still suspect) that this property should be obtained from `Info.plist`, but that is a problem for later.
score: 0
comment on: http://stackoverflow.com/q/79524037

maui
tags question: http://stackoverflow.com/q/79483025
type: Tag
tag name: maui

http://stackoverflow.com/comment/140184133
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/79485539
has text: Thanks! I will try the binding approach. Will I be able to debug the native code after adding the binding?

http://stackoverflow.com/comment/140228692
type: QuestionComment
has text: It's unclear, you call yourself URL with `NSURLConnection` (why not `NSURLSession`) and call at the same time `UIWebView` for the same request?
score: 1
comment on: http://stackoverflow.com/q/79512314
type: Comment

http://stackoverflow.com/comment/140138987
score: 0
type: AnswerComment
type: Comment
has text: You should consume SPM package with SPM and it will solve duplicate symbol problem.
comment on: http://stackoverflow.com/a/79453231

http://stackoverflow.com/comment/140246602
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/79512314
type: Comment
has text: Going from `UIWebView` to `WKWebview` isn't too much work, and since you only have 4 views, it should be quick enough...

http://stackoverflow.com/q/79474422
tagged with: macos
has title: How I can detect when the screenshot tool is open so I can stop listening to CGEventSourceButtonState input?
type: Question
tagged with: objective-c
type: UnansweredQuestion
has body: I'm using things like CGEventSourceButtonState or CGEventSourceKeyState to detect input in my game. I call them every frame to check if there was an event and so far it works fine. I also check if the cursor is on top of the window or if the window is focused to know if I should ignore or not the input update // check if window is focused window.focused = nswindow.isKeyWindow; // check if mouse is on_top of window static bool cursor_on_top = false; @interface Content_View : NSView @end @implementation Content_View - (void)updateTrackingAreas { [super updateTrackingAreas]; for (NSTrackingArea *tracking_area in [self trackingAreas]) { [self removeTrackingArea:tracking_area]; } NSTrackingAreaOptions options = NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways | NSTrackingInVisibleRect; NSTrackingArea *tracking_area = [[NSTrackingArea alloc] initWithRect:self.bounds options:options owner:self userInfo:nil ]; [self addTrackingArea:tracking_area]; } - (void)mouseEntered:(NSEvent *)event { cursor_on_top = true; } - (void)mouseExited:(NSEvent *)event { cursor_on_top = false; } @end The problem is that when I press command+shift+4 the system screenshot tool opens but that won't make window.focused or cursor_on_top false with the code above. Because of this I get the events that are supposed to be for screenshot tool inside my game, since the left click will trigger camera movement. It tried searching but there seems to not be a way of properly detecting if the screenshot tool has the input focus?
score: 0
answer count: 0

http://stackoverflow.com/q/79505321
tagged with: uipresentingcontroller
tagged with: ios
has comment: http://stackoverflow.com/comment/140212545
has title: Get reference to View ControllerA from ViewControllerB to change property
type: Question
tagged with: objective-c
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/79505570
has comment: http://stackoverflow.com/comment/140212286
type: AnsweredQuestion
tagged with: uiviewcontroller
has comment: http://stackoverflow.com/comment/140219330
has comment: http://stackoverflow.com/comment/140219281
has body: I have a custom ViewController A with an instance variable or property that I want to change from a second custom view controller launched by a navigation controller for ViewControllerA. Here is my code to launch ViewController B from within A In FirstCustomVC: - (void) launchSecondVC { UIStoryboard *storyBoard = self.storyboard; CustomVC * myVC = [storyBoard instantiateViewControllerWithIdentifier:@"myvc"]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController: CustomVC; [self presentViewController:nav animated:YES completion:nil]; } After ViewController B is launched and the user does something, I want to dismiss ViewController B and enable a button back in ViewController A. I can dismiss VCB but I am having trouble grabbing a reference to A in order to enable the button. The following successfully dismisses VCB. However, the presenting ViewController is a navigation controller and does not have the property I need so it crashes if I try to access the property. [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];//dismisses successfully self.presentingViewController.myButton.enabled = YES;//crashes as the property is on the VC, not the nav I've tried various methods to get the topViewController but can only get a generic UIViewController rather than the custom one with the button property. How can I grab a reference to the custom VC that is actually displayed on the screen?
upvote count: 1
has comment: http://stackoverflow.com/comment/140213654
has comment: http://stackoverflow.com/comment/140219171
has answer: http://stackoverflow.com/a/79505570
score: 1
answer count: 1

http://stackoverflow.com/comment/140241725
comment on: http://stackoverflow.com/q/79520311
type: Comment
has text: Sorry, wrong link: [NSMenu.userInterfaceLayoutDirection](https://developer.apple.com/documentation/appkit/nsmenu/userinterfacelayoutdirection?language=objc) is not read only. Try `menu.userInterfaceLayoutDirection = NSUserInterfaceLayoutDirectionRightToLeft;`
score: 1
type: QuestionComment

http://stackoverflow.com/q/79470730
tagged with: background
has body: I am working on an app which is a MQTT Client to io.Adafruit Broker. I subscribe to various of my feeds including an image feed. I can also Publish to the image feed from another Client camera by touching a button in my app. My problem is that sometimes when I start Publishing to the image feed I don't stop the Publishing before I put my app in the background. It is then continuously Publishing an image in the background until I open the app back up and manually stop the image Publishing. I would like to have the image Publish to stop when the app enters the background but i can't seem to be able to accomplish this. I have tried the following code in the app delegate.m. I initialize and start the communication in the main view controller and everything works fine. - (void)applicationDidEnterBackground:(UIApplication *)application { NSLog(@"Entering background"); NSString *movie = @"8"; NSData* data = [movie dataUsingEncoding:NSUTF8StringEncoding]; [session3 publishData:data onTopic:self.avideo retain:NO qos:1 publishHandler:nil]; NSLog(@"movie:%@", movie); [UIApplication sharedApplication].idleTimerDisabled = NO; } I get a printout that I enter background and the value of "movie" but It does not publish the value to io.adafruit so the camera continues to Publish images to the image feed. How can I do this?
answer count: 0
tagged with: ios
score: 0
tagged with: objective-c
has title: How do I send MQTT feed data when app enters background?
type: Question
type: UnansweredQuestion
tagged with: mqtt

http://stackoverflow.com/q/79534149
has comment: http://stackoverflow.com/comment/140266877
type: UnansweredQuestion
has title: MPNowPlayingInfoCenter being deallocated when disconnecting CarPlay despite still being used by phone app
tagged with: carplay
has comment: http://stackoverflow.com/comment/140262680
has comment: http://stackoverflow.com/comment/140262734
tagged with: ios
score: 0
tagged with: objective-c
has comment: http://stackoverflow.com/comment/140262909
tagged with: mpnowplayinginfocenter
type: Question
has comment: http://stackoverflow.com/comment/140263403
has comment: http://stackoverflow.com/comment/140263067
answer count: 0
has body: Problem I'm developing an app that has both a CarPlay and phone interface. My CarPlay app uses MPNowPlayingInfoCenter defaultCenter through a NowPlaying Template. However, I have another module which uses the default center in the phone app scene (not the CarPlay scene). When disconnecting from CarPlay, the singleton shared instance of [MPNowPlayingInfoCenter defaultCenter] gets deallocated along with my NowPlayingTemplate, despite the phone app still requiring it. This causes issues with my audio playback state. This problem only occurs on a physical CarPlay device - in the CarPlay device simulator, my code works fine with a proxy class implementation. What I've tried Implementing a proxy class (works in simulator but not on physical device) Various forms of method swizzling I cannot modify the third-party library code that calls [MPNowPlayingInfoCenter defaultCenter] in the phone app Environment iOS version: 18.1.1 CarPlay framework version: iOS 18 CarPlay framework Xcode version: Version 16.2 (16C5032a) Questions How can I prevent MPNowPlayingInfoCenter defaultCenter from being deallocated when disconnecting from CarPlay while ensuring it remains available for the phone app? Is there a recommended approach for sharing the now playing info between CarPlay and phone interfaces? Code Example @interface CarPlayCoordinator : NSObject @property (nonatomic, strong) CPNowPlayingTemplate *nowPlayingTemplate; - (void)setupNowPlayingTemplate; @end @implementation CarPlayCoordinator - (void)setupNowPlayingTemplate { self.nowPlayingTemplate = [NowPlayingTemplate shared]; // Configure template and then.. // MPNowPlayingInfoCenter is used in the template's lifecycle } @end #import <AVFoundation/AVFoundation.h> #import <CarPlay/CarPlay.h> #import <MediaPlayer/MediaPlayer.h> @interface NowPlayingTemplate () <CPNowPlayingTemplateObserver> @property(nonatomic, strong) CPInterfaceController *interfaceController; // This reference gets deallocated @property(nonatomic, strong) MPNowPl…

http://stackoverflow.com/q/79538671
tagged with: ios
has comment: http://stackoverflow.com/comment/140275423
has comment: http://stackoverflow.com/comment/140269331
downvote count: 1
has title: Custom UICollectionViewFlowLayout With Half Circle
linked to: http://stackoverflow.com/q/41837170
has comment: http://stackoverflow.com/comment/140275182
tagged with: objective-c
has body: I want to use UICollection to display the cards. Each card is a cell; maybe it needs a custom UICollectionViewFlowLayout. How can I do this? This is my code, But it can not switch cards. I log self.collectionView.contentOffset.x, it is 0. What is wrong? @interface ArcCollectionViewFlowLayout() @property (nonatomic, assign) NSInteger currentPage; @property (nonatomic, assign) CGSize topItemSize; @end static const int kFlowLayoutVisibleItemCount = 7; @implementation ArcCollectionViewFlowLayout - (void)prepareLayout { [super prepareLayout]; } - (CGSize)collectionViewContentSize { return self.collectionView.frame.size; } - (NSArray&lt;__kindof UICollectionViewLayoutAttributes *&gt; *)layoutAttributesForElementsInRect:(CGRect)rect { NSInteger itemsCount = [self.collectionView numberOfItemsInSection:0]; if (itemsCount &lt;= 0) { return nil; } NSInteger minVisibleIndex = MAX(self.currentPage, 0); NSInteger contentOffset = (int)self.collectionView.contentOffset.x; NSInteger collectionBounds = (int)self.collectionView.bounds.size.width; CGFloat offset = contentOffset % collectionBounds; CGFloat offsetProgress = offset / collectionBounds*1.0f; CGFloat offsetAngle = offsetProgress / self.itemSize.width * 30; NSInteger maxVisibleIndex = MAX(MIN(itemsCount - 1, self.currentPage + kFlowLayoutVisibleItemCount), minVisibleIndex); NSMutableArray *attributeArray = [NSMutableArray array]; for (NSInteger i = minVisibleIndex; i&lt;= maxVisibleIndex; i++) { NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0]; UICollectionViewLayoutAttributes *attributes = [[self layoutAttributesForItemAtIndexPath:indexPath] copy]; attributes.center = CGPointMake(collectionBounds/2.0, self.collectionView.bounds.size.height / 2.0); if (i == minVisibleIndex) { attributes.zIndex = 1000; [self rotate:attributes offsetAngle:-90+offsetAngle]; } else if (i == minVisibleIndex + 1) { attributes.zIndex = 1000 + 1; [self rotate:attributes offsetAngle:-60+offsetAngle]; } else if (i == minVisibleIndex…
favorite count: 0
tagged with: uicollectionviewlayout
score: 0
type: Question
upvote count: 1
type: UnansweredQuestion
answer count: 0

nsnotifications
type: Tag
tags question: http://stackoverflow.com/q/79507593
tag name: nsnotifications

http://stackoverflow.com/q/79542554
tagged with: core-data
score: 0
tagged with: cloudkit
has answer: http://stackoverflow.com/a/79545539
type: Question
answer count: 1
type: UnansweredQuestion
has title: App data update issue thru Core data sync to CloudKit
has body: I have setup push notifications and updates in CK are updating UI well. The issue I have is Syncing between Core Data and CK. It's set to use NSPersistentCloudKitContainer with NSMergeByPropertyObjectTrumpMergePolicy option. Its a very simple CD managed object for Player including lastUpdated field - I have private dB with equivalent CD_Player record type and fields paired with the Core Data entities. - (void)savePlayerToCoreData:(Player *)player { NSLog(@" savePlayerToCoreData"); NSManagedObjectContext *context = self.persistentContainer.viewContext; [context performBlock:^{ // Fetch the existing player using playerId NSFetchRequest *fetchRequest = [Player fetchRequest]; fetchRequest.predicate = [NSPredicate predicateWithFormat:@"playerId == %@", player.playerId]; fetchRequest.fetchLimit = 1; NSError *fetchError = nil; NSArray *results = [context executeFetchRequest:fetchRequest error:&fetchError]; Player *managedPlayer = results.firstObject; if (managedPlayer) { NSLog(@" Fetched Player: %@ (playerId: %@, objectID: %@)", managedPlayer.nickName, managedPlayer.playerId, managedPlayer.objectID); } else if (!managedPlayer) { NSLog(@"❌ Player not found in Core Data. Aborting update to prevent duplicate CloudKit records."); return; } // ✅ Update existing player managedPlayer.nickName = player.nickName; managedPlayer.avatarHexRgbColor = player.avatarHexRgbColor; managedPlayer.gamesWon = player.gamesWon; managedPlayer.gamesLost = player.gamesLost; managedPlayer.matchesWon = player.matchesWon; managedPlayer.matchesLost = player.matchesLost; managedPlayer.organizationKey = player.organizationKey; managedPlayer.strengths = player.strengths; managedPlayer.weaknesses = player.weaknesses; managedPlayer.lastUpdated = [NSDate date]; if (player.avatar) { managedPlayer.avatar = player.avatar; } if (![managedPlayer hasChanges]) { NSLog(@"⚠️ No changes detected in Core Data. CloudKit sync may not trigger."); } else { NSLog(@"✅ Changes detected. Saving to trigger sync..."); } NSError *…
tagged with: objective-c

http://stackoverflow.com/q/79527661
has body: I would like to create a temporary BOOL property in a custom NSManagedObject class to track whether an async download of a remote image is underway so as not to start a second download while the first is underway. This value would not be stored in Core Data and is not included in xcmodel. It is supposed to be short term state variable to prevent recursive downloads. In the past, I've often added properties to custom NSManagedObject class files with no problem. However, in this case, the managedobjects are being fetched with a FetchedResultsController into a tableview. Aalthough adding a BOOL to the class gets past the compiler it crashes at runtime. When I look at the custom class in the debugger, it appears the BOOL property is not listed. Could it be that when you fetch managed objects using a fetchedResultsController, it ignores any properties that are not in the xcmodeldata file? Here is the error message(abbreviated): CoreData: error: Serious application error. Exception was caught during Core Data change processing. This is usually a bug within an observer of NSManagedObjectContextObjectsDidChangeNotification. -[Feed awaitingResponse]: unrecognized selector sent to instance 0x6000021d8910 with userInfo (null) *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Feed awaitingResponse]: unrecognized selector sent to instance 0x6000021d8910' Here is my code. Feed.h @property (nonatomic, assign) BOOL awaitingResponse; Feed.m @dynamic awaitingResponse; - (void)awakeFromInsert { self.awaitingResponse = NO;//Attempt to set a default value. Compiles okay. } The crash occurs, although the following compiles, when I try to access the property from another class as follows: @implementation FeedViewController - (void)configureCell:(FeedCell *)cell withFeed: (Feed *)aFeed { BOOL awaitingResponse = aFeed.awaitingResponse;//CRASH OCCURS HERE } I would like to use this BOOL to condition remote fetches of data, however, I can't even try to acc…
tagged with: objective-c
has comment: http://stackoverflow.com/comment/140257347
has title: Access value of convenience property in custom NSManagedObject class in Objective-C causing crash
tagged with: nsfetchedresultscontroller
tagged with: core-data
score: 0
type: Question
type: UnansweredQuestion
answer count: 0

http://stackoverflow.com/comment/140218902
has text: Thanks, that worked, but I'm no wiser... I'm trying to modernize a pre 10.5 app that I haven't touched in 20 years, I guess a lot has happened since then. Any pointers to some good docs? Apple's documentation is somewhat confusing.
type: QuestionComment
comment on: http://stackoverflow.com/q/79507593
type: Comment
score: 0

http://stackoverflow.com/comment/140219330
comment on: http://stackoverflow.com/q/79505321
score: 0
has text: @HangarRash I see. It seems odd that the answer appears to be using Objective C code but links to Swift documentation.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/140213654
comment on: http://stackoverflow.com/q/79505321
type: QuestionComment
score: 0
type: Comment
has text: You can use unwind segues and in `prepareForSegue` enable button

http://stackoverflow.com/comment/140236695
has text: I would recommend a general clean up: use solely SPM for your project. Divide your project into several packages. For libraries (or parts) in your project, where it is not possible to be built a _package_, try to create a XCFramework that includes all architectures, then wrap it into a package. Ensure all architectures can be built and are included in the binaries. Prefer static (the default) for build and linkage with SPM. In other words, avoid CocoaPods. Note, that in Xcode 16, the binaries for Preview and the regular built are the same.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/79519362
type: Comment

http://stackoverflow.com/comment/140194808
score: 0
type: AnswerComment
has text: I have not used bindings in Maui, but if it is similar to older binding solutions, the result is a small c# file that has one c# declaration per library's public member. In VS, you can place a `breakpoint` on any of those lines. Thus pausing when that member is called. To learn about debugging native code, I think start [here](https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-debug-in-mixed-mode?view=vs-2022#enable-mixed-mode-for-managed-calling-app-c-or-visual-basic). I have not done this, so you might need to search for other information.
type: Comment
comment on: http://stackoverflow.com/a/79485539

http://stackoverflow.com/comment/140203114
score: 0
comment on: http://stackoverflow.com/q/79498059
type: Comment
type: QuestionComment
has text: There was a discussion of a similar issue at https://stackoverflow.com/questions/64880406/problem-opening-office-uri-scheme-urls-in-office-js-on-mac-safari . I do not know if it is possible or easy to translate that into objective-c

uti
type: Tag
tag name: uti
tags question: http://stackoverflow.com/q/79524037

http://stackoverflow.com/comment/140146831
type: AnswerComment
comment on: http://stackoverflow.com/a/79466863
type: Comment
score: 1
has text: This is a fantastic and detailed answer, thanks very much. You asked: `For example, does myString necessarily need to be associated with NSURL?` Strictly speaking, no. `myString` and others are a bunch of named constants that are used everywhere, and falling back to the C-style `extern const` is a good idea and what I ended up using.

http://stackoverflow.com/comment/140236320
type: Comment
comment on: http://stackoverflow.com/q/79518299
has text: Off topic: Calling the pid variable `psn` is confusing.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/140139079
type: Comment
has text: When develop frameworks: use SPM and forged all you know about build settings, bridging headers and module maps: it's too low level knowledge where it easily make mistakes without root knowledges how binaries are build in one ready product.
comment on: http://stackoverflow.com/q/79456745
type: QuestionComment
score: 0

http://stackoverflow.com/comment/140218608
comment on: http://stackoverflow.com/q/79507593
score: 1
type: Comment
has text: `window.contentView` redraws but it isn't the `MyView`. If you want `MyView` to redraw then set `needsDisplay` of `MyView`.
type: QuestionComment

http://stackoverflow.com/a/79457932
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/79457893
has body: Set the NSTableView property allowsTypeSelect to NO. Or if you use Interface Builder there is a Type Select checkbox.
type: Answer
accepted answer of: http://stackoverflow.com/q/79457893
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/140236317
comment on: http://stackoverflow.com/q/79518299
type: QuestionComment
has text: I tried your code and it works for me. Does your app have permission in the System Prefs and did you remove and add your app again? Does the frontmost app have a "Emoji & Symbols" menu item with Fn-E?
score: 2
type: Comment

http://stackoverflow.com/comment/140247486
comment on: http://stackoverflow.com/q/79512314
score: 0
type: QuestionComment
type: Comment
has text: Thank you very much for your message. It probably is for me. I would not like to risk any inconsistency to move to wkwebview now. (at least it is not now.) I would do things one by one. if you do multiple things at the same time, there would be hard to say what is the problem. (And this basic auth thing is the last portion of the project.)

nsdocument
tags question: http://stackoverflow.com/q/79507593
type: Tag
tag name: nsdocument
tags question: http://stackoverflow.com/q/79524037

http://stackoverflow.com/comment/140206621
has text: Oh, is there a difference on MacOS? I guess I was asking in a general sense, as I've seen this pattern in apps for both iOS and MacOS.
comment on: http://stackoverflow.com/a/79492089
score: 0
type: AnswerComment
type: Comment

nsmenu
tags question: http://stackoverflow.com/q/79520311
tag name: nsmenu
type: Tag

http://stackoverflow.com/comment/140227775
type: Comment
has text: No, I don't know of any good docs. Apple's documentation is getting worse and worse, especially AppKit.
comment on: http://stackoverflow.com/q/79507593
score: 0
type: QuestionComment

http://stackoverflow.com/comment/140239780
type: Comment
has text: @Willeke GetProcessForPID, and yeah they are deprecated, just mentioned those since they seem to work for me.
comment on: http://stackoverflow.com/q/79518299
score: 0
type: QuestionComment

http://stackoverflow.com/comment/140216405
has text: Are your updated properties using KVC-compliant accessors?
comment on: http://stackoverflow.com/q/79507593
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/79504791
has body: I would highly recommend writing a custom UIControl subclass, but, if you want to stick with the transformed UISlider ... 1 - we can't limit begin tracking to only a touch inside the thumb 2 - we need to track the start touch point and update the slide value based on the y-coordinate "delta" from start touch to continued touch Here's your class, with a few changes: CDCFaderSlider.h #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface CDCFaderSlider : UISlider @end NS_ASSUME_NONNULL_END CDCFaderSlider.m - note: you didn't provide your CDCFaderValueView class, so I just implemented a simple one at the top... #import "CDCFaderSlider.h" @interface CDCFaderValueView : UIView @property (assign, readwrite) float value; @end @implementation CDCFaderValueView @end @interface CDCFaderSlider () { double curVal; CGPoint startPT; } @property (strong, nonatomic) CDCFaderValueView *valueView; @property (assign, readwrite) NSInteger count; @end @implementation CDCFaderSlider - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame: frame]; if (self) { [self setOpaque: true]; [self setTransform: CGAffineTransformMakeRotation((CGFloat)(M_PI * -0.5f))]; [self constructSlider]; } return self; } - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder: aDecoder]; if (self) { [self setTransform: CGAffineTransformMakeRotation((CGFloat)(M_PI * -0.5f))]; [self constructSlider]; } return self; } #pragma mark - UIControl touch event tracking - (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event { // get touch point in superview CGPoint touchPoint = [touch locationInView: self.superview]; // is the touch inside my frame? if (CGRectContainsPoint(self.frame, touchPoint)) { [self positionAndUpdateValueView]; [self fadeValueViewInAndOut: true]; // save start point startPT = touchPoint; // save current value curVal = self.value; return YES; } return [super beginTrackingWithTouch: touch withEvent: event]; } - (BOOL)continueTrackingWithTouch:(UITouch *)t…
downvote count: 0
score: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/79504242
answers question: http://stackoverflow.com/q/79504242
upvote count: 1

core-bluetooth
type: Tag
tag name: core-bluetooth
tags question: http://stackoverflow.com/q/79496234

http://stackoverflow.com/comment/140243522
score: 0
has text: Since you want WebView, I'd suggest you use `WKWebView` and its delegate `WKNavigationDelegate` See https://stackoverflow.com/questions/60508114/wkwebview-with-basic-auth
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/79512314

cllocationcoordinate2d
type: Tag
tag name: cllocationcoordinate2d
tags question: http://stackoverflow.com/q/79487100

jsonmodel
tag name: jsonmodel
tags question: http://stackoverflow.com/q/79487100
type: Tag

http://stackoverflow.com/a/79526806
answers question: http://stackoverflow.com/q/79518919
has body: CGImage supports a wide variety of content, including formats that are 16 bits per channel, and have non RGB colorspaces, half-float samples, etc. So the above code (second example) doesn’t necessarily handle these cases correctly. The vImage function will do conversions and such, but data provider doesn’t and it isn’t guaranteed that the source colorspace combined with a 32-bit four channel pixel make any sense. Also your assumptions about bytes per row may be invalid, but that isn’t the error you are reporting. Get the bytes per row from the data provider. More likely, it may just be you are visualizing the contents of the vImage buffer incorrectly. I would be especially cautious of endian problems. The image could be BGRA and you might be visualizing it as ARGB or RGBA, for example. As you can see for some of these cases the alpha and blue channels can be swapped and in those cases the mostly opaque alpha will become a mostly blue image, with some swapping also of red and green. Your description sounds most like BGRA &lt;-&gt; RGBA, which swaps blue and red and would cause cyan to become yellow. bGRA is alpha first, little endian 32. RGBA is big endian alpha last. BGRA is the default format for iOS. Although I’ve never seen it myself in a CGImage, this kind of color swizzle might also occur with 444 YUV content that somehow made it into a CGImage, perhaps due to an busted upstream conversion from a CVPixelBuffer. There is no colorspace description for YUV per se. instead you get a RGB colorspace and a separate conversion matrix that has to be applied outside of ColorSync. (There isn’t any YUV in ICC color profiles, which is the issue there) What is primarily missing in this problem description is how you are visualizing the vImage buffer. You also should go find out what the colorspace and CGBitmapInfo for the image are and report back to see how you should be visualizing it. The colorspace will self report its contents using the po command in the debugger. The C…
score: 0
type: Answer

http://stackoverflow.com/comment/140159046
score: 0
has text: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/79472383

http://stackoverflow.com/comment/140221799
has text: Have you tried replacing `NSImage` with `CGImage` or `CIImage`?
type: QuestionComment
score: 1
type: Comment
comment on: http://stackoverflow.com/q/79508792

http
tags question: http://stackoverflow.com/q/79512314
tag name: http
type: Tag

http://stackoverflow.com/comment/140251008
has text: Thank you very much for your info. I thought this is it! It does not, however, change the situation, even though the delegate method is properly called. The code is put in the original post. Thank you very much! Have a nice weekend :)
comment on: http://stackoverflow.com/q/79512314
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/140239138
comment on: http://stackoverflow.com/q/79520311
has text: See [Localization](https://developer.apple.com/localization/) and [NSMenu.userInterfaceLayoutDirection](https://developer.apple.com/documentation/Xcode/localization/).
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/140218300
score: 0
has text: @red_menace I don't think KVC-compliance is involved here as I'm replacing the entire model by calling document's `readFromData:`, see updated question.
type: QuestionComment
comment on: http://stackoverflow.com/q/79507593
type: Comment

nsfetchedresultscontroller
type: Tag
tags question: http://stackoverflow.com/q/79527661
tag name: nsfetchedresultscontroller

http://stackoverflow.com/a/79466863
upvote count: 2
answers question: http://stackoverflow.com/q/79466619
has body: tl;dr: If you don't need myString to be associated with the NSURL class specifically, and myString is a string literal, the most succinct way to express this would be // MyString.h extern NSString * const myString; // MyString.mm NSString * const myString = @"Hello"; // OtherFile.mm NSString *someThing = myString; // accessed like a global var If you do want or need this to be associated with NSURL and myString is a string literal, you can avoid the intermediate storage: + (NSString *)myString { return @"Hello"; } If myString is not a string literal, or would otherwise need to be computed, then the existing pattern you've seen with _myString storage and initialization is the most common and succinct way to do it I believe such class readonly properties are roughly equivalent to static constexpr member variables in modern C++, where initialising them is a one-liner in the header: This isn't quite right. In Objective-C, properties are a way to succinctly synthesize methods, and offer an alternative syntax for calling those methods. In general, a property called foo: Creates a foo getter method and a setFoo: setter method, which Then allows for calling those methods as x.foo ≍ [x foo] and x.foo = f ≍ [x setFoo:f] This is the same for both instance properties and class properties — though the storage semantics are a little different for class properties by default. The approximate C++ equivalent to your example would be generating something like #include <string> using std::literals; struct MyClass { static constexpr auto myString() { return "Hello"s; } }; and the very rough equivalent to your Objective-C code would be something like struct MyClass { static auto myString() { if (!myString_) { myString_ = "Hello"; } return *myString_; } private: static const char *myString_; }; Depending on what you're actually trying to do here, this can both be wasteful, and unnecessary. Can MyClass.myString be initialised more compactly, similar to C++ without having to declare the st…
has comment: http://stackoverflow.com/comment/140146831
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/79466619

http://stackoverflow.com/a/79492089
type: Answer
answers question: http://stackoverflow.com/q/79485734
has body: You will receive applicationDidReceiveMemoryWarning first. If you doesn't release release enough memory during low-memory conditions, the system may terminate it outright. So you don't need to care about possibility of failing to allocate memory: if it will be not enough just whole application will be terminated. You just need to consider new feature of Objective-C nullability annotations: Some initializers can return nullable result.
has comment: http://stackoverflow.com/comment/140227489
score: 0
has comment: http://stackoverflow.com/comment/140190695
has comment: http://stackoverflow.com/comment/140206621
has comment: http://stackoverflow.com/comment/140221515

keylogger
tags question: http://stackoverflow.com/q/79521778
tag name: keylogger
type: Tag

agent
tags question: http://stackoverflow.com/q/79521778
type: Tag
tag name: agent

http://stackoverflow.com/comment/140238539
comment on: http://stackoverflow.com/q/79512314
type: QuestionComment
score: 0
has text: Update: There are two links on the index.html; one is google (no restricted area) and the other is under the current directory which is the area where the basic auth is necessary. The page transition to google was successful now, but that to the restricted area is not. Would it be solved if a session is used to maintain user and pwd info?
type: Comment

http://stackoverflow.com/comment/140212286
type: Comment
comment on: http://stackoverflow.com/q/79505321
has text: I don't get it. Why do you want to enable a button within a dismissed controller? Maybe the delegation pattern works here? Let's say VC A -> present VC B and holds a weak ref delegate of VC B -> VC B delegate back to A to enable the button.
score: 0
type: QuestionComment

http://stackoverflow.com/a/79465487
type: Answer
answers question: http://stackoverflow.com/q/79456745
has body: After updating firebase_messaging from ^14.6.9 to ^15.0.0 and firebase_core from ^2.17.0 to ^3.0.0, the issue was resolved. There was no need to add a module interface, and the project build successfully.
score: 0

http://stackoverflow.com/comment/140242001
score: 0
comment on: http://stackoverflow.com/q/79508792
type: QuestionComment
has text: @Willeke Thank you! Using CGImage (CGImageSourceCreateWithURL, CGImageSourceCreateImageAtIndex, then NSBitmapImageRep initWithCGImage) works and is an order of magnitude quicker!
type: Comment

http://stackoverflow.com/comment/140190695
score: 1
comment on: http://stackoverflow.com/a/79492089
has text: This assumes the OP is asking about an iOS app. The question isn't clear on that point.
type: AnswerComment
type: Comment

info.plist
tags question: http://stackoverflow.com/q/79524037
type: Tag
tag name: info.plist

.net
tag name: .net
tags question: http://stackoverflow.com/q/79483025
type: Tag

http://stackoverflow.com/comment/140122963
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/79453231
has text: Use SPM for building frameworks and it will manage all options for you.

http://stackoverflow.com/a/79526560
has body: Okay, with a little help I have figured out what was going on. There were two issues: First, I needed to reset permissions. That is, I had to go to System Settings &gt; Privacy &amp; Security &gt; Accessibility, remove my app, then add it back again (toggling the switch was insufficient). In my app, calling AXIsProcessTrusted() returned true both before and after the reset. This seems to me to be a macOS bug. Second, I was not accounting for how fn+e works as compared to many other hotkeys. Many hotkeys are remapped when you switch keyboard layouts, but fn+e is not, meaning I need to send the key code for the current layout's E key. kVK_ANSI_E is the virtual key code that represents the ANSI keyboard layout's E key. So the solution was to figure out which CGKeyCode corresponds to the current keyboard layout's E key and use that instead of hard-coding kVK_ANSI_E. I used the Sauce library to do this.
answers question: http://stackoverflow.com/q/79518299
score: 0
type: Answer

create-react-native-library
tags question: http://stackoverflow.com/q/79524757
tag name: create-react-native-library
type: Tag

uicollectionviewlayout
type: Tag
tags question: http://stackoverflow.com/q/79538671
tag name: uicollectionviewlayout

ms-word
tag name: ms-word
type: Tag
tags question: http://stackoverflow.com/q/79498059

http://stackoverflow.com/a/79524874
score: 0
type: Answer
has body: It is because of the thread. After checking, I realize that my Swift code is running on the other thread, not the main thread. I am able to receive the location update data after making it run on the main thread. Below is the code import Foundation import CoreLocation class MyLocationTrackingCore: NSObject, CLLocationManagerDelegate { var locationManager : CLLocationManager? var BASE_URL : String = "" var token : String = "" var pushGPSInterval : Double = 10_000 var pushGPSDistance : Double = 0 var integrationId : String = "{}" var pushGPSTimer: Date = Date() var locationCallback: (([String: Any]) -> Void)? func setInfo(_ baseURL: String, rnToken token: String, rnPushGPSInterval pushGPSInterval: Double, rnPushGPSDistance pushGPSDistance: Double, rnIntegrationId integrationId: String, callback: @escaping ([String: Any]) -> Void) { DispatchQueue.main.async { print("= Initializing....") self.BASE_URL = baseURL self.token = token self.integrationId = integrationId // The minTime is in millisecond, here we need second self.pushGPSInterval = (pushGPSInterval == 0 ? 10_000 : pushGPSInterval) / 1_000 self.pushGPSDistance = pushGPSDistance < 0 ? 0 : pushGPSDistance // Callback self.locationCallback = callback print("Base url : \(self.BASE_URL)"); print("token : \(self.token)"); print("integrationId : \(self.integrationId)"); print("pushGPSInterval : \(self.pushGPSInterval)"); print("pushGPSDistance : \(self.pushGPSDistance)"); print("trigger callback :"); // Callback: try send data if let locationCallback = self.locationCallback { let newLocationData: [String: Any] = [ "lat": 37.7859, "lng": -122.4364, "alt": 15.0, "spd": 6.0, "course": 45.0 ] locationCallback(newLocationData) print("- Location Callback triggered") } else { print("= Location Callback is nil") } print("= Initialized"); } } func updateIntegrationId(_ integrationId: String) { DispatchQueue.main.async { print("Integration ID: \(self.integrationId)") self.integrationId = integrationId print("Updated Integration I…
answers question: http://stackoverflow.com/q/79524757