Post

Replies

Boosts

Views

Activity

Reply to async await invalid conversion from throwing function
OK. That may or may not work. It's certainly not best practice to block the UI thread while you do networking. The documented place to validate UITextField content is the UITextFieldDelegate's textFieldShouldEndEditing method. But that is also a synchronous method called on the main thread, so it doesn't solve this problem. I would try this: Start the network request from shouldEndEditing, and return false. When you get the response to the network request, if it's OK, call resignFirstResponder. I think shouldEndEditing is now called again, and you need to return true if the content has not changed. Or something like that. Don't block the main thread for networking.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’22
Reply to Xcode warning, Unknown escape sequence '\ '
how to turn off some warning I don't want to be bothered with From the command-line, -Wno-THING, where THING is the warning to turn off. For example, I have -Wno-unused-parameter in some of my Makefiles. In XCode - yeah, it's somewhere in the build settings. You can do it for specific files if you want, I forget how exactly. It might be unwise to turn this off, though. If you write "\ ", did you mean " " or "\\ " ? There are also complex issues with octal and unicode escape sequences where you may not get what you wanted. P.S. I now see that this forum mangles backslash characters, so some of what I've written makes less sense than it should. I hope you can decipher it.
Aug ’22
Reply to Xcode warning, Unknown escape sequence '\ '
It's not an incorrect warning. In C/C++/objC quoted strings, the characters that you need to escape are ", newline, tab, , and a few other control characters. This is true whether the string is a filename or anything else. This is similar to what you need to do in quoted strings in the shell. But it differs from what you need with unquoted strings in the shell. Examples: fopen("Hello World"); // C cat "Hello World" # shell cat Hello\ World # shell Now say you have a file with a literal \ in the name (which would be unwise, if you might one day port to Windows, I think, but anyway): fopen("back\\slash") cat "back\\slash" cat back\\slash
Aug ’22
Reply to How to verify App certificate at runtime?
avoid re-compile from IPA or APP file The .ipa file etc. do not contain the app's source code, so the app cannot be recompiled from that. It can be modified in other ways, though, so... Is there something like HASH key and it will be changed if be re-complile? That's what AppAttest does. But it's only useful if your app has some sort of server communication, i.e. the app sends an AppAttest-signed request to your server, which can check it. If there is no server communication it doesn't help. Note also that AppAttest is not supported on all devices, specifically if an iOS app is run on a Mac in "made for iPad" mode AppAttest is not available. Apple tells us that an AppAttest failure is just a factor that we should take into account, not a definitive yes/no. Which makes it much less useful than it would be otherwise. Fundamentally, my advice has always been to avoid app types / demographics where piracy is a problem. There was a great Dilbert where he says "We will be targeting this type of customer..." and he is pointing to a chart where it says "Rich/Poor", "Smart/Stupid". If you can come up with an app that rich stupid people will buy, they will neither be motivated to pirate it, nor will they have the skills to do so. The other bit of advice is to avoid apps where you actually have costs associated with pirated users, i.e. server costs or royalties that you pay to third parties. If you have royalties to pay, make sure that your contract only requires you to pay royalties for legitimate users. And try to ensure that your server costs are either fixed, or minimal.
Topic: Code Signing SubTopic: General Tags:
Aug ’22
Reply to async await invalid conversion from throwing function
OK. That may or may not work. It's certainly not best practice to block the UI thread while you do networking. The documented place to validate UITextField content is the UITextFieldDelegate's textFieldShouldEndEditing method. But that is also a synchronous method called on the main thread, so it doesn't solve this problem. I would try this: Start the network request from shouldEndEditing, and return false. When you get the response to the network request, if it's OK, call resignFirstResponder. I think shouldEndEditing is now called again, and you need to return true if the content has not changed. Or something like that. Don't block the main thread for networking.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Xcode warning, Unknown escape sequence '\ '
how to turn off some warning I don't want to be bothered with From the command-line, -Wno-THING, where THING is the warning to turn off. For example, I have -Wno-unused-parameter in some of my Makefiles. In XCode - yeah, it's somewhere in the build settings. You can do it for specific files if you want, I forget how exactly. It might be unwise to turn this off, though. If you write "\ ", did you mean " " or "\\ " ? There are also complex issues with octal and unicode escape sequences where you may not get what you wanted. P.S. I now see that this forum mangles backslash characters, so some of what I've written makes less sense than it should. I hope you can decipher it.
Replies
Boosts
Views
Activity
Aug ’22
Reply to Xcode warning, Unknown escape sequence '\ '
It's not an incorrect warning. In C/C++/objC quoted strings, the characters that you need to escape are ", newline, tab, , and a few other control characters. This is true whether the string is a filename or anything else. This is similar to what you need to do in quoted strings in the shell. But it differs from what you need with unquoted strings in the shell. Examples: fopen("Hello World"); // C cat "Hello World" # shell cat Hello\ World # shell Now say you have a file with a literal \ in the name (which would be unwise, if you might one day port to Windows, I think, but anyway): fopen("back\\slash") cat "back\\slash" cat back\\slash
Replies
Boosts
Views
Activity
Aug ’22
Reply to How to verify App certificate at runtime?
avoid re-compile from IPA or APP file The .ipa file etc. do not contain the app's source code, so the app cannot be recompiled from that. It can be modified in other ways, though, so... Is there something like HASH key and it will be changed if be re-complile? That's what AppAttest does. But it's only useful if your app has some sort of server communication, i.e. the app sends an AppAttest-signed request to your server, which can check it. If there is no server communication it doesn't help. Note also that AppAttest is not supported on all devices, specifically if an iOS app is run on a Mac in "made for iPad" mode AppAttest is not available. Apple tells us that an AppAttest failure is just a factor that we should take into account, not a definitive yes/no. Which makes it much less useful than it would be otherwise. Fundamentally, my advice has always been to avoid app types / demographics where piracy is a problem. There was a great Dilbert where he says "We will be targeting this type of customer..." and he is pointing to a chart where it says "Rich/Poor", "Smart/Stupid". If you can come up with an app that rich stupid people will buy, they will neither be motivated to pirate it, nor will they have the skills to do so. The other bit of advice is to avoid apps where you actually have costs associated with pirated users, i.e. server costs or royalties that you pay to third parties. If you have royalties to pay, make sure that your contract only requires you to pay royalties for legitimate users. And try to ensure that your server costs are either fixed, or minimal.
Topic: Code Signing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Apple Developer enrollment could not be completed.
it will be my pleasure to assist you today "Chris" is a chatbot who is "happy to help" by repeating fragments of your original message back to you, posting links to FAQs, etc. You need to find the magic words that will connect you with an actual human. Try things like "escalate", "human", "complaint", "xyzzy" etc. Good luck.
Replies
Boosts
Views
Activity
Aug ’22
Reply to Xcode 9.4 unable to find .txt file despite it being in the directory
Why do you want to use relative paths? I guess it should probably work, but you don't know what other code outside your control is doing to the current directory. You need to debug this by checking what the current directory is at the point where you call open(), enumerating the directory to see what files are actually present, etc.
Replies
Boosts
Views
Activity
Aug ’22