Post

Replies

Boosts

Views

Activity

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 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 Adding concurrency reduces processing time – and then increases it!
It may be memory bandwidth or some other common factor. It's hard to say without seeing some code. One thing to think about is cache line sharing. If your objects are small they may end up close enough together that they occupy the same cache line, which is almost as bad as actually accessing the same memory location from different cores. Frankly the speedup you are seeing is not at all bad, compared to some of the things I've tried to do. Question for anyone else reading this: what tools (e.g. in Instruments) are available for studying this?
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’22
Reply to Do I need to establish LLC in the US when we launch an app in App store in the US
Are there specific rules for dating apps? Otherwise - no, you don't need a US LLC. You just need the US taxpayer number. This looks a bit intimidating but it's not difficult. The most challenging part is spelling your foreign address over the phone. Get a "NATO Phonetic Alphabet" on the screen before you start! The person I dealt with was very friendly. Have you ever been though US customs/immigration? - it's the exact opposite experience. When the US govt recruits people, if they are arseholes they send them to immigration, and if they are lovely they send them to the foreign tax registration helpline. There used to be something odd about tax in Japan but I think that has gone.
Aug ’22
Reply to Is it possible to obtain the clipping path of CGContext?
I was hoping to find a solution with using only the standard libraries Apple provide Bad idea IMO. Apple's code is (a) closed source, so you can't debug it yourself, (b) not well supported; if you find a bug it will at best be fixed with a future OS update in at least a year's time, with no visibility about whether a fix is actually being worked on, and (c) not portable to other platforms. If you've found another library that does what you want, just use it!
Topic: Media Technologies SubTopic: Audio Tags:
Aug ’22
Reply to Send and receive IP packets from iOS
The high level goal is to route the IP packets from accessory device (which connects to iphone via bluetooth). The accessory will send data as IP packets. Since we can't send raw IP packets from iPhone, wanted to analyse the IP packet received from the accessory, find if it is TCP/UDP and construct the corresponding packet and send it to the destination. How are the IP packets encapsulated over Bluetooth? Is it using something like 6LoWPAN? I believe that, as you said, you will need to analyse the IP packets received from the accessory. But they rather than just forwarding those packets, you will need some more complex logic that acts as a proxy, I.e. when you see a packet with a TCP SYN, you should open a TCP socket and send an encapsulated ACK back to the accessory over bluetooth. A fully-general proxy would be quite complicated, but if you know that the accessory uses only a certain subset of the possible functionality then it becomes easier. Are you the manufacturer of the accessory?
Aug ’22