Dive into the world of programming languages used for app development.

Posts under General subtopic

Post

Replies

Boosts

Views

Activity

Programmatic way to find the language of an application
Hello, I would like to know if there is any way to programmatically find out the current language of an application(either budle info, plist,any function from CoreFoundation, etc ). Only information I found relating to this is in CFBundleDevelopmentRegion from plist of the app but its not reliable in all cases. We are coding in C++ but we can also run Objective-C code. Thank you in advance!
9
0
3.2k
Apr ’22
OpenVPNProvider
am using to NETunnelProvider in a openvpn client that is bridged in react-native but no luck there .. the connection to server keep disconnect every time. the Network Extension is configurated. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>NSExtension</key> <dict> <key>NSExtensionPointIdentifier</key> <string>com.apple.networkextension.packet-tunnel</string> <key>NSExtensionPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).PacketTunnelProvider</string> </dict> </dict> </plist> typescript side is getting events from vpnStateObserver connecting ... Object { "message": "The VPN is in the process of connecting", "state": 1, } Object { "message": "The VPN is in the process of disconnecting", "state": 3, } Object { "message": "The VPN is disconnected", "state": 0, } tunel: type = plugin identifier = xxxxxxxxx-6E77-47BA-B41C-52251D2D2C47 serverAddress = x.x.x.x:1194 identityDataImported = NO disconnectOnSleep = NO disconnectOnIdle = NO disconnectOnIdleTimeout = 0 disconnectOnWake = NO disconnectOnWakeTimeout = 0 includeAllNetworks = YES excludeLocalNetworks = NO enforceRoutes = NO authenticationMethod = 0 reassertTimeout = 0 providerConfiguration = { ovpn = {length = 8437, bytes = 0x636c6965 6e740a64 65762074 756e0a70 ... 732d6175 74683e0a } } providerBundleIdentifier = dev.***.xxxxxxx.vpn
1
0
619
Mar ’22
Cannot sign app
I am trying to sign an ios app using company cert. I get the below error.  /usr/bin/codesign --force --sign 6A29F3EED12E0F0152A7C7510E35EC72623C2F85 --entitlements /Users/afonsomiu/Library/Developer/Xcode/DerivedData/Firma-btcqegchqjjqvuevtxbkjydqgqkp/Build/Intermediates.noindex/ArchiveIntermediates/Firma/IntermediateBuildFilesPath/Firma.build/Release-iphoneos/Firma.build/Firma.app.xcent /Users/afonsomiu/Library/Developer/Xcode/DerivedData/Firma-btcqegchqjjqvuevtxbkjydqgqkp/Build/Intermediates.noindex/ArchiveIntermediates/Firma/InstallationBuildProductsLocation/Applications/Firma.app Please help.
1
0
695
Mar ’22
Memory allocation and deallocation issues in c++ code
I am porting an image processing app using a camera developed by Android to IOS, and try to use C++ code used by Android in IOS. Install the necessary library and link the target c++ code using objective-c wrapper. The problem is that when a function with particularly large number of memory allocation/release ends in the C++ code, an error is definitely issued as the local variables are released. Error: Corrupt value: 0x3fc93ba18499360a GBCare(20641,0x16bcfb000) malloc: *** set a breakpoint in malloc_error_break to debug GBCare(20641,0x16bcfb000) malloc: Incorrect checksum for freed object 0x11556d1e0: probably modified after being freed. Corrupt value: 0x3fc93ba18499360a Additionally, the same error occurs sometimes at the location where the type of memory is allocated (e.g., cv::Mat.clone, cv:Mat::zeros) and we checked that the correct parameter was included. I don't know what it means, but if you do it as shown in the picture below in Product-Scheme-Edit Scheme, it works normally without errors. I think it's not a code problem, but a problem that occurs in the environment setting, so please help me. Development environment: Xcode 13.2.1 / Swift5 / OpenCV 4.3
2
0
2.5k
Feb ’22
objc_copyClassList() not enumerable?
This is a derivative of this and this. On iOS 15(.3.1), if I just try to fetch and enumerate the classes of the objc runtime, waiting until viewDidAppear() to make sure there wasn't some initialization issue: var count = UInt32(0) var classList = objc_copyClassList(&count)! print("COUNT \(count)") print("CLASS LIST \(classList)") for i in 0..<Int(count) { print("\(i)") classList[i] } produces the following before a Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1820e0cdc) COUNT 28353 CLASS LIST 0x000000010bf24000 0 1 2 2022-02-17 16:24:02.977904-0800 TWiG V[2504:705046] *** NSForwarding: warning: object 0x1dbd32148 of class '__NSGenericDeallocHandler' does not implement methodSignatureForSelector: -- trouble ahead 2022-02-17 16:24:02.978001-0800 TWiG V[2504:705046] *** NSForwarding: warning: object 0x1dbd32148 of class '__NSGenericDeallocHandler' does not implement doesNotRecognizeSelector: -- abort I don't know how to do any less with it than just fetching the value. I'm not trying to print it or anything, and yet it still fails. Is there some magic I'm missing? Why have the API if the results crash your program? If the issue is legit, it would be nice of the docs pointed out a workaround, or at least the proper way to cope with the result. (I do not have hardened runtime turned on, XCode 13.2.1)
3
0
1.3k
Feb ’22
Use of undeclared identifier
I'm working on an objective c based macos project for years, containing numerous Objective C classes. For some reason, in a particular class I can bind new IBOutlets in Interface builder, but in my .m file I get always the error: Use of undeclared identifier ' my buttoname ' Someone any idea? I'm working with: XCode 13.2.1
1
0
3.5k
Feb ’22
how to retrieve a writing direction?
I'd like to be able to retrieve a writing direction from an arbitrary string... but how? I have tried getGlyphsInRange:glyphs:properties:characterIndexes:bidiLevels:    NSLayoutManager* layoutManager = [[NSLayoutManager alloc] init];   NSTextStorage* textStorage = [[NSTextStorage alloc] initWithString:@"abc"];   [textStorage addLayoutManager:layoutManager];   NSRange stringRange=NSMakeRange(0,[@"abc" length]);   NSMutableData* glyphData=[NSMutableData dataWithLength:sizeof(CGGlyph)*stringRange.length+1];   CGGlyph* glyphs=(CGGlyph*)[glyphData mutableBytes];       unsigned char *bidiLevelBuffer = calloc([@"abc" length], sizeof(unsigned char));   int glyphCount = (int)[layoutManager getGlyphsInRange:stringRange                           glyphs:glyphs properties:NULL                      characterIndexes:NULL                         bidiLevels:bidiLevelBuffer];       NSLog(@"--- %i, \"%s\"", glyphCount, bidiLevelBuffer); with the result: 2021-12-29 10:39:54.694104+0300 aTypeTrainer4Mac[61412:3479843] --- 3, "" ... any ideas?
2
0
886
Jan ’22
Using UNNotificationCenterCalendarTrigger did not receive a local notification(s) repeat on each day for every hour
We did not get the local notification on next day for every hour using UNNotificationCenterCalendarTrigger. What we have currently, the current day receiving local notification(s) on repeated hour interval, but from next day on-words does not received notification using UserNotifications framework, but with deprecated UILocalNotification framework notification delivered with the help of fireDate, repeatCalendar and repeatInterval property.  So is there any exact replacement for fireDate, repeatCalendar and repeatInterval property of UILocalNotification framework with UserNotifications framework.
0
0
571
Dec ’21
Objective-C Syntax for a Block that has a Block as a Parameter?
I'm not sure this is even possible (and I'm sure there will be questions as to why) but I'm curious how one could define a block that takes a block as a parameter? For instance... MyFunctionWithSuccess:(void(^)((void(^)(NSString* value))blockAsParameter)success This of course doesn't work. The only thing I could find is on StackOverflow but I think in this case it returns a block. Regardless the syntax throws a compiler error.. StackOverflow - Syntax to define a Block that takes a Block and returns a Block in Objective-C There it says to define it as : void (^(^complexBlock)(void (^)(void)))(void) However this throws a "Type-id cannot have a name" which it complains about the ^complexBlock part. Again it just may be that this is not possible and bad to do. However I'd like to confirm that it is or isn't.
1
0
527
Dec ’21
Is Objective - C Dead?
I know that Xcode still lets you write apps in Objective - C, but there is hardly any (new) documentation, and very few new apps are written in it. To add to the question - how viable would it be to learn and write a new app in Objective - C in 2021?
3
0
1.5k
Dec ’21
Emulator file scan problem
I tried to find the file inside the ios emulator. When I scan the directory all the time, it finds my Mac Book local directory. I don't know why the external folder is being read by the emulator. Turn it off or Is there any way to access the folder inside the emulator? The code proceeds from a test application written in Objective-C. Here's the code:    if ((dir = opendir("/Users/macAccount")) != nullptr) {     while ((diread = readdir(dir)) != nullptr) {       printf ("target : %s", diread-&gt;d_name);     }     closedir (dir);   } ==&gt; result (This is the contents of my account on the macbook.)  .android| DataGripProjects| Public| .ssh| Movies| .vimrc| Applications| .gradle| .Trash| Mon.tar.gz| .npm| ...
1
0
698
Dec ’21
How to disable to open system apps
Hello everyone, I need to disable to open "Settings" and "Files" apps in iphone/ipads. In my scenario, an iphone/ipad device can be used by more than one people. So I want to a disable/hide mechanism so those users can not open Files and Settings apps in the device. How can i achieve that programmatically or other solutions?
Replies
1
Boosts
0
Views
690
Activity
Apr ’22
How can i delete all sms on IOS programmatically?
Hello everyone, I need to delete all sms's in iphone/ipads. In my scenario, an iphone/ipad device can be used by more than one people. So I want to delete all sms in the device which belongs to previous user. How can i achieve that in programmatically or other solutions?
Replies
1
Boosts
0
Views
583
Activity
Apr ’22
How to logout apple account on ios devices
Hello everyone, I need an automation to logout appleid from iphone/ipads. In my scenario, an iphone/ipad device can be used by more than one people. So I want to logout the apple account in device which belongs to previous user So new user can not see the previous user's account. How can i achieve that in programmatically or other solutions?
Replies
1
Boosts
0
Views
1.4k
Activity
Apr ’22
Programmatic way to find the language of an application
Hello, I would like to know if there is any way to programmatically find out the current language of an application(either budle info, plist,any function from CoreFoundation, etc ). Only information I found relating to this is in CFBundleDevelopmentRegion from plist of the app but its not reliable in all cases. We are coding in C++ but we can also run Objective-C code. Thank you in advance!
Replies
9
Boosts
0
Views
3.2k
Activity
Apr ’22
ZebrePrinter SDK conncection open freezes iPad app
I have zebra printer sdk from Zebra page in my objective C iPad app. App freezes when -[ZebraPrinterConnection open] from this library is executed.
Replies
1
Boosts
0
Views
347
Activity
Mar ’22
OpenVPNProvider
am using to NETunnelProvider in a openvpn client that is bridged in react-native but no luck there .. the connection to server keep disconnect every time. the Network Extension is configurated. &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt; &lt;plist version="1.0"&gt; &lt;dict&gt; &lt;key&gt;NSExtension&lt;/key&gt; &lt;dict&gt; &lt;key&gt;NSExtensionPointIdentifier&lt;/key&gt; &lt;string&gt;com.apple.networkextension.packet-tunnel&lt;/string&gt; &lt;key&gt;NSExtensionPrincipalClass&lt;/key&gt; &lt;string&gt;$(PRODUCT_MODULE_NAME).PacketTunnelProvider&lt;/string&gt; &lt;/dict&gt; &lt;/dict&gt; &lt;/plist&gt; typescript side is getting events from vpnStateObserver connecting ... Object { "message": "The VPN is in the process of connecting", "state": 1, } Object { "message": "The VPN is in the process of disconnecting", "state": 3, } Object { "message": "The VPN is disconnected", "state": 0, } tunel: type = plugin identifier = xxxxxxxxx-6E77-47BA-B41C-52251D2D2C47 serverAddress = x.x.x.x:1194 identityDataImported = NO disconnectOnSleep = NO disconnectOnIdle = NO disconnectOnIdleTimeout = 0 disconnectOnWake = NO disconnectOnWakeTimeout = 0 includeAllNetworks = YES excludeLocalNetworks = NO enforceRoutes = NO authenticationMethod = 0 reassertTimeout = 0 providerConfiguration = { ovpn = {length = 8437, bytes = 0x636c6965 6e740a64 65762074 756e0a70 ... 732d6175 74683e0a } } providerBundleIdentifier = dev.***.xxxxxxx.vpn
Replies
1
Boosts
0
Views
619
Activity
Mar ’22
Cannot sign app
I am trying to sign an ios app using company cert. I get the below error.  /usr/bin/codesign --force --sign 6A29F3EED12E0F0152A7C7510E35EC72623C2F85 --entitlements /Users/afonsomiu/Library/Developer/Xcode/DerivedData/Firma-btcqegchqjjqvuevtxbkjydqgqkp/Build/Intermediates.noindex/ArchiveIntermediates/Firma/IntermediateBuildFilesPath/Firma.build/Release-iphoneos/Firma.build/Firma.app.xcent /Users/afonsomiu/Library/Developer/Xcode/DerivedData/Firma-btcqegchqjjqvuevtxbkjydqgqkp/Build/Intermediates.noindex/ArchiveIntermediates/Firma/InstallationBuildProductsLocation/Applications/Firma.app Please help.
Replies
1
Boosts
0
Views
695
Activity
Mar ’22
ios 15.2 beta app stuck
on iOS 15.2, when I call [PHPhotoLibrary registerChangeObserver:],app will stuck
Replies
6
Boosts
0
Views
3.3k
Activity
Mar ’22
Memory allocation and deallocation issues in c++ code
I am porting an image processing app using a camera developed by Android to IOS, and try to use C++ code used by Android in IOS. Install the necessary library and link the target c++ code using objective-c wrapper. The problem is that when a function with particularly large number of memory allocation/release ends in the C++ code, an error is definitely issued as the local variables are released. Error: Corrupt value: 0x3fc93ba18499360a GBCare(20641,0x16bcfb000) malloc: *** set a breakpoint in malloc_error_break to debug GBCare(20641,0x16bcfb000) malloc: Incorrect checksum for freed object 0x11556d1e0: probably modified after being freed. Corrupt value: 0x3fc93ba18499360a Additionally, the same error occurs sometimes at the location where the type of memory is allocated (e.g., cv::Mat.clone, cv:Mat::zeros) and we checked that the correct parameter was included. I don't know what it means, but if you do it as shown in the picture below in Product-Scheme-Edit Scheme, it works normally without errors. I think it's not a code problem, but a problem that occurs in the environment setting, so please help me. Development environment: Xcode 13.2.1 / Swift5 / OpenCV 4.3
Replies
2
Boosts
0
Views
2.5k
Activity
Feb ’22
objc_copyClassList() not enumerable?
This is a derivative of this and this. On iOS 15(.3.1), if I just try to fetch and enumerate the classes of the objc runtime, waiting until viewDidAppear() to make sure there wasn't some initialization issue: var count = UInt32(0) var classList = objc_copyClassList(&count)! print("COUNT \(count)") print("CLASS LIST \(classList)") for i in 0..<Int(count) { print("\(i)") classList[i] } produces the following before a Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1820e0cdc) COUNT 28353 CLASS LIST 0x000000010bf24000 0 1 2 2022-02-17 16:24:02.977904-0800 TWiG V[2504:705046] *** NSForwarding: warning: object 0x1dbd32148 of class '__NSGenericDeallocHandler' does not implement methodSignatureForSelector: -- trouble ahead 2022-02-17 16:24:02.978001-0800 TWiG V[2504:705046] *** NSForwarding: warning: object 0x1dbd32148 of class '__NSGenericDeallocHandler' does not implement doesNotRecognizeSelector: -- abort I don't know how to do any less with it than just fetching the value. I'm not trying to print it or anything, and yet it still fails. Is there some magic I'm missing? Why have the API if the results crash your program? If the issue is legit, it would be nice of the docs pointed out a workaround, or at least the proper way to cope with the result. (I do not have hardened runtime turned on, XCode 13.2.1)
Replies
3
Boosts
0
Views
1.3k
Activity
Feb ’22
how to get the IMEI of IPhone or IPad device?
my IOS version is 9.0, Now i want to get the unique value of the Device, i think of using IMEI, but i did some tests, i always cannot get the IMEI of the device,could you tell me other ways to know unique value of the device?
Replies
9
Boosts
0
Views
19k
Activity
Feb ’22
Use of undeclared identifier
I'm working on an objective c based macos project for years, containing numerous Objective C classes. For some reason, in a particular class I can bind new IBOutlets in Interface builder, but in my .m file I get always the error: Use of undeclared identifier ' my buttoname ' Someone any idea? I'm working with: XCode 13.2.1
Replies
1
Boosts
0
Views
3.5k
Activity
Feb ’22
Xcode 13 doesnt have Objective C option?
Hi I wanted to create a new Objective C Console application or a Single Page application but cant seem to find the option in my Xcode 13.2.1 can anyone help?
Replies
2
Boosts
0
Views
4.1k
Activity
Jan ’22
#c xcode error
someone can tell me why on xcode with #c language the compiler does not read the command system ("cls"), system ("clear") and system ("pause")?
Replies
1
Boosts
0
Views
399
Activity
Jan ’22
how to retrieve a writing direction?
I'd like to be able to retrieve a writing direction from an arbitrary string... but how? I have tried getGlyphsInRange:glyphs:properties:characterIndexes:bidiLevels:    NSLayoutManager* layoutManager = [[NSLayoutManager alloc] init];   NSTextStorage* textStorage = [[NSTextStorage alloc] initWithString:@"abc"];   [textStorage addLayoutManager:layoutManager];   NSRange stringRange=NSMakeRange(0,[@"abc" length]);   NSMutableData* glyphData=[NSMutableData dataWithLength:sizeof(CGGlyph)*stringRange.length+1];   CGGlyph* glyphs=(CGGlyph*)[glyphData mutableBytes];       unsigned char *bidiLevelBuffer = calloc([@"abc" length], sizeof(unsigned char));   int glyphCount = (int)[layoutManager getGlyphsInRange:stringRange                           glyphs:glyphs properties:NULL                      characterIndexes:NULL                         bidiLevels:bidiLevelBuffer];       NSLog(@"--- %i, \"%s\"", glyphCount, bidiLevelBuffer); with the result: 2021-12-29 10:39:54.694104+0300 aTypeTrainer4Mac[61412:3479843] --- 3, "" ... any ideas?
Replies
2
Boosts
0
Views
886
Activity
Jan ’22
Using UNNotificationCenterCalendarTrigger did not receive a local notification(s) repeat on each day for every hour
We did not get the local notification on next day for every hour using UNNotificationCenterCalendarTrigger. What we have currently, the current day receiving local notification(s) on repeated hour interval, but from next day on-words does not received notification using UserNotifications framework, but with deprecated UILocalNotification framework notification delivered with the help of fireDate, repeatCalendar and repeatInterval property.  So is there any exact replacement for fireDate, repeatCalendar and repeatInterval property of UILocalNotification framework with UserNotifications framework.
Replies
0
Boosts
0
Views
571
Activity
Dec ’21
Objective-C Syntax for a Block that has a Block as a Parameter?
I'm not sure this is even possible (and I'm sure there will be questions as to why) but I'm curious how one could define a block that takes a block as a parameter? For instance... MyFunctionWithSuccess:(void(^)((void(^)(NSString* value))blockAsParameter)success This of course doesn't work. The only thing I could find is on StackOverflow but I think in this case it returns a block. Regardless the syntax throws a compiler error.. StackOverflow - Syntax to define a Block that takes a Block and returns a Block in Objective-C There it says to define it as : void (^(^complexBlock)(void (^)(void)))(void) However this throws a "Type-id cannot have a name" which it complains about the ^complexBlock part. Again it just may be that this is not possible and bad to do. However I'd like to confirm that it is or isn't.
Replies
1
Boosts
0
Views
527
Activity
Dec ’21
Is Objective - C Dead?
I know that Xcode still lets you write apps in Objective - C, but there is hardly any (new) documentation, and very few new apps are written in it. To add to the question - how viable would it be to learn and write a new app in Objective - C in 2021?
Replies
3
Boosts
0
Views
1.5k
Activity
Dec ’21
Emulator file scan problem
I tried to find the file inside the ios emulator. When I scan the directory all the time, it finds my Mac Book local directory. I don't know why the external folder is being read by the emulator. Turn it off or Is there any way to access the folder inside the emulator? The code proceeds from a test application written in Objective-C. Here's the code:    if ((dir = opendir("/Users/macAccount")) != nullptr) {     while ((diread = readdir(dir)) != nullptr) {       printf ("target : %s", diread-&gt;d_name);     }     closedir (dir);   } ==&gt; result (This is the contents of my account on the macbook.)  .android| DataGripProjects| Public| .ssh| Movies| .vimrc| Applications| .gradle| .Trash| Mon.tar.gz| .npm| ...
Replies
1
Boosts
0
Views
698
Activity
Dec ’21
Create ObjC project with Storyboards in Xcode 13
I'm getting back to coding after a while and I don't see the option to create an ObjC project with Storyboards in Xcode 13. Please tell me how? Thanks Neerav
Replies
2
Boosts
0
Views
722
Activity
Dec ’21