Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do
Given that the apps we're building are for internal ad-hoc distribution only, I'm quite fine with not doing bitcode, then :)

Adbot
ADBOT LOVES YOU

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Doctor w-rw-rw- posted:

Apple released iOS kernel source code: awesome!
Still no launchd: :(

Eh, the OS X kernel was close enough, I'm not terribly impressed. What I want to see is UIKit, or failing that, Foundation

Doctor w-rw-rw-
Jun 24, 2008

hackbunny posted:

Eh, the OS X kernel was close enough, I'm not terribly impressed. What I want to see is UIKit, or failing that, Foundation

Eh. Swift foundation will eventually get there and meh, UIKit is never gonna happen.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

Doctor w-rw-rw- posted:

Apple released iOS kernel source code: awesome!
Still no launchd: :(

Open-sourcing launchd and libxpc is an interesting idea.

Doctor w-rw-rw-
Jun 24, 2008

Simulated posted:

Open-sourcing launchd and libxpc is an interesting idea.
The launchd part was open-source before it was subsumed into XPC; that was around 10.9 I think? Launchd's always seemed like a fairly decent init system and XPC a pretty good IPC system.

brap
Aug 23, 2004

Grimey Drawer
I've been playing around with the NetService APIs and have been wondering how the heck I am supposed to convert this "addresses" property to something I can use. I'm writing a simple iOS app in Swift 4 and I guess I should be looking for some way of turning this NSData into a struct sockaddr (yeah...)

https://developer.apple.com/documentation/foundation/netservice/1408528-addresses?changes=latest_beta

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

fleshweasel posted:

I've been playing around with the NetService APIs and have been wondering how the heck I am supposed to convert this "addresses" property to something I can use. I'm writing a simple iOS app in Swift 4 and I guess I should be looking for some way of turning this NSData into a struct sockaddr (yeah...)

https://developer.apple.com/documentation/foundation/netservice/1408528-addresses?changes=latest_beta

Get the bytes of the data and bind to an UnsafePointer to the socket struct type you are working with.

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
It kills me that you can't drag around the iPhone X simulator by the bezel now that it is so small. I never remember to click on the sensor bar or the little subtitle bar. I end up whiffing on moving it around constantly.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

ManicJason posted:

It kills me that you can't drag around the iPhone X simulator by the bezel now that it is so small. I never remember to click on the sensor bar or the little subtitle bar. I end up whiffing on moving it around constantly.

You can turn off drawing the bezels and it gives you a standard MacOS titlebar.

LP0 ON FIRE
Jan 25, 2006

beep boop
Edit: I wasn't looking at the scaled size in the last panel. Needed to be scaled down considerably to work correctly.

AR Kit... I created a new project that uses the AR kit demo with the jet airplane. That works, but when I import my own scn object, and use that asset and launch the app, I can see the object, but it does not rotate as I move around it, or change size when I move further or closer to it. I checked the object's utilities pane and different sections, but I can't see anything different, except for it's size is noticeably larger, so I tried much smaller versions with no difference, except it is actually smaller on screen. The only extra panel section that the jet does not have is "Geometry". Is it important to change anything here? Any guess to why it's tracking, but not rotating or changing scale with the phone's movement?

LP0 ON FIRE fucked around with this message at 16:41 on Oct 4, 2017

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

ManicJason posted:

It kills me that you can't drag around the iPhone X simulator by the bezel now that it is so small. I never remember to click on the sensor bar or the little subtitle bar. I end up whiffing on moving it around constantly.

This should be better in the beta. Initially we interpreted a drag away from the virtual screen as a move and everything else as swiping. The new behavior also treats drags parallel to the virtual screen as moves.


carry on then posted:

You can turn off drawing the bezels and it gives you a standard MacOS titlebar.

Do most people here run with bezels on or off?

(Bezels on is clearly superior)

Simulated fucked around with this message at 22:02 on Oct 2, 2017

dc3k
Feb 18, 2003

what.
bezels off because trying to drag an X sim around the screen is loving annoying

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
Interesting. I had never noticed that certain drag directions work on the bezel, but they do. I'm not sure that any of that fuzziness is needed with the precision of a mouse pointer.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Simulated posted:

Do most people here run with bezels on or off?

Off. I'm not sure why, but the bezels look so silly to me.

Toady
Jan 12, 2009

Plorkyeran posted:

I'm not sure what's so confusing about the idea that it's really nice to get some acknowledgement that yes, the thing you reported is a bug and we'd like to fix it one day.

An automatic notification that the bug was screened would probably just lead to complaints that someone looked at the bug and then "nothing happened," and you're back to the same situation as before.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

ManicJason posted:

Interesting. I had never noticed that certain drag directions work on the bezel, but they do. I'm not sure that any of that fuzziness is needed with the precision of a mouse pointer.

It’s not about fuzziness; hardware distinguishes gestures that begin on the edge or not. The bezel does the same thing: swipes that begin on the bezel are edge swipes. It’s far more accurate. Distinguishing between an edge swipe vs a drag move is ultimately what the issue is here.

As I said, it should be much nicer in the beta.

The bezel is also the only way to interact with certain hardware buttons.

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
Ah, I was playing around with it some more and suspected as much. I think I'll eventually get used to grabbing the sensor bar. The X looks so silly with bezels off.

Dog on Fire
Oct 2, 2004

Dog on Fire posted:

Thanks, all, for the info on Amazon Basics. I sent the request to order a batch to the necessary people and one of them had had experience with a company named Aukey Anker so it was in turn recommended that we'd order theirs. Some nylon braided things. And yeah, they did seem to be sturdier. Will try to remember to write how they are once they get here.

So I don't know if anyone cares, but I've now had a few days now to use these 3rd party Lightning cables: https://www.amazon.co.uk/Anker-Lightning-Connector-Certified-Ultra-High-Space-Gray/dp/B00UBLOJJG/

Unsurprisingly, it seems, I also don't have anything bad to say about them. They seem sturdy, they are cheap and they seem to work just as well as Apple's cables.

LP0 ON FIRE
Jan 25, 2006

beep boop
Is there anything more involved than the materials inspector to get a 3D scn object to have smooth shading? I've played around with a lot of the settings in the Material Inspector tab, and I can only ever get my model to be a solid color.



If it's a lot more involved, any good tutorials anyone can share?

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Dog on Fire posted:

So I don't know if anyone cares, but I've now had a few days now to use these 3rd party Lightning cables: https://www.amazon.co.uk/Anker-Lightning-Connector-Certified-Ultra-High-Space-Gray/dp/B00UBLOJJG/

Unsurprisingly, it seems, I also don't have anything bad to say about them. They seem sturdy, they are cheap and they seem to work just as well as Apple's cables.

Anker specifically makes fully licensed cables, chargers, and other bits.

My wife and I have a huge (26000mAh) 3-outlet battery, a Bluetooth speaker that doubles as a battery, a bunch of cables including a couple 3m, a couple of big solar chargers, and a multi-outlet wall charger, all Anker, and it's all good gear.

Dog on Fire
Oct 2, 2004

I noticed today that Apple's Remote app has something resembling the device's home screen showing behind the whole thing when the Details modal view is brought up. So I got kind of curious as to how this sort of a thing could have been done. There are no really obvious ways to achieve this, right?

Edit: Because as far as I know, if there is "nothing" behind the whole view hierarchy, it's represented as all-black.

Dog on Fire fucked around with this message at 14:49 on Oct 8, 2017

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Not with public API, as far as I know.

Back in iOS let’s say 7 you could do something that caused the user's wallpaper to show up behind your app window if you made the window transparent. But I don’t think that was intentional, it might’ve only been in the betas.

SaTaMaS
Apr 18, 2003
I'm trying to import a mesh from Blender into iOS OpenGL. I'm trying two different ways to do it, either would be fine but both are running into problems.

1. Convert a mesh from an OBJ file into a .h file. I've been using mtl2opengl, but it doesn't seem to like the fact that the file contains multiple meshes, and each one is basically a curved line (I'm creating a grid which needs to go over a person's head in my AR app). It counts the vertices, but just outputs an empty file.
2. Import the mesh using Model I/O and render it using GLKit. I'm able to import the file into a GLKMesh, but Apple's documentation for GLKMesh is non-existent (since they want everyone to use Metal instead, but I really want this to be a cross-platform as possible). I have no idea what the rendering call should look like, and my current attempt just crashes -
glDrawElements(_mesh.submeshes[0].mode, _mesh.submeshes[0].elementCount, _mesh.submeshes[0].type, (__bridge GLvoid*)_mesh.submeshes[0].elementBuffer);
I can't find any sample code, but it seems like there should be some repo somewhere that someone has already done this.

Doc Block
Apr 15, 2003
Fun Shoe
GLKit is (relatively) old and seems to have mostly been intended as a stopgap to help developers switch from OpenGL ES 1.1 to ES 2.0.

If you're concerned about your app being cross platform, why are you using GLKit and/or Model I/O? Maybe take a look at something like AssImp for loading your model instead.

Does your drawing code work if you replace the GLKMesh with a hand-written cube? You've set up your VAO, VBO, and element buffer correctly, and they're bound?

SaTaMaS
Apr 18, 2003

Doc Block posted:

GLKit is (relatively) old and seems to have mostly been intended as a stopgap to help developers switch from OpenGL ES 1.1 to ES 2.0.

If you're concerned about your app being cross platform, why are you using GLKit and/or Model I/O? Maybe take a look at something like AssImp for loading your model instead.

Does your drawing code work if you replace the GLKMesh with a hand-written cube? You've set up your VAO, VBO, and element buffer correctly, and they're bound?

The main reason is because I'm having a hard time figuring out which method I should go with for loading OBJ files. Model I/O seemed like a straightforward solution except for the lack of sample code. I have everything working with a cube loaded in from a .h file, though I'm just using a simple array buffer instead of an element buffer. I briefly looked at AssImp, maybe that's the solution instead of Model I/O.

Doc Block
Apr 15, 2003
Fun Shoe
Not really sure if this is the right thread, but is there a reason macOS/Xcode doesn't include uchar.h or cuchar? This is on 10.13 with Xcode 9.

My game needs to convert a UTF-8 string to UTF-32. I was going to use mbrtoc32() to do it since it needs to be cross platform, and it needs the char32_t's one at a time, but neither uchar.h nor cuchar exist on my system.

This is in C++.

Maybe I could use mbrtowc(), but that converts to wchar_t, and my game needs to match the result to another program's UTF-32 output.

I hate dealing with this Unicode crap

Doc Block fucked around with this message at 15:30 on Oct 9, 2017

Doctor w-rw-rw-
Jun 24, 2008
Plorkyeran may know: https://www.reddit.com/r/cpp/comments/4aaorj/questions_regarding_stdcodecvt/

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
Looks like a C11 thing. Have you filed a bug report?

Doc Block
Apr 15, 2003
Fun Shoe
Not yet. I just discovered it. Wasn't sure if it was a bug or what.

edit: anyway, my game is already using PhysFS, which has its own Unicode functions, so I'm just gonna borrow their UTF-8 to UTF-32 function and be done with it.

Will still file a bug when I get the chance, probably later today.

Doc Block fucked around with this message at 15:27 on Oct 9, 2017

SaTaMaS
Apr 18, 2003

Doc Block posted:

GLKit is (relatively) old and seems to have mostly been intended as a stopgap to help developers switch from OpenGL ES 1.1 to ES 2.0.

If you're concerned about your app being cross platform, why are you using GLKit and/or Model I/O? Maybe take a look at something like AssImp for loading your model instead.

Does your drawing code work if you replace the GLKMesh with a hand-written cube? You've set up your VAO, VBO, and element buffer correctly, and they're bound?

It looks like AssImp also blows up when I try to load lines instead of meshes. I'm getting the error "aiScene::mNumMeshes is 0. At least one mesh must be there". Is there a way to make AssImp expect lines instead of triangle meshes?

Doc Block
Apr 15, 2003
Fun Shoe
Dunno. I've never personally used it. But it sounds like you have an edge case (no pun intended). Maybe just have it be a regular mesh in the file? You can still draw that mesh with lines.

If it's a grid or something you might be better off just generating it in code.

Doc Block
Apr 15, 2003
Fun Shoe

eschaton posted:

Looks like a C11 thing. Have you filed a bug report?

Finally got the chance to file a bug report for this.

rdar://34924430

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
I know that someone already mentioned this, but I have to agree.

It was super cheesy when removing a breakpoint made a little poof animation/sound. Now that it's gone, I miss it terribly. :(

Dog on Fire
Oct 2, 2004

A basic question: what's a good data type in Swift to make floating point calculations with?

This is for a helper app for myself that I'm making, so I'm not in a hurry or anything here and I'm most interested in just getting some new information.

I have a UITextField that I'm writing a decimal in. Then I'm going to get the text field's value, and then I'm going to add this value to some other decimal. Good old NSNumber seems to handle this well, but I'm seeing new Swift types like the struct Decimal that I thought I'd try out.

Initializing Decimal from String like this:
code:
Decimal(string: "1.523")

seems to create a Decimal instance with the correct value – 1.523.

But when I create a Decimal instance with a number literal like this (in a unit test):
code:
let expected: Decimal = 1.523
then I get a good old floating point problem like so:
code:
Printing description of expected:
1.5229999999999995904
So does anyone know if there is any reason to use anything but NSNumber for this? There is NSDecimalNumber which I haven't used ever, but it seems to bridge to Decimal anyway and sure enough I'm seeing the same number representation problem that I'm seeing with Decimal.

Edit: or is it safest to store the numbers as integers and divide them by the necessary amount to get the decimal places?

Dog on Fire fucked around with this message at 23:14 on Oct 16, 2017

Doc Block
Apr 15, 2003
Fun Shoe
Decimal/NSDecimal are fixed point types. The problem might be that when you’re writing the literal “1.523” in code it’s getting represented in the binary as a float or double and then converted to a Decimal at runtime. Whereas when parsing it from a string, it has no intermediary floating point representation so the precision is left intact.

I’m not at a computer right now, but NSDecimalNumber is probably just an NSDecimal in Objective-C object form.

edit: yep, NSDecimalNumber is a subclass of NSNumber that’s functionally equivalent to NSDecimal but can be put in NSArrays, etc

Doc Block fucked around with this message at 23:18 on Oct 16, 2017

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Decimal not getting parsed correctly as a decimal and instead round-tripping through some binary FP type is a bug we should fix.

Doc Block
Apr 15, 2003
Fun Shoe

Dog on Fire posted:

But when I create a Decimal instance with a number literal like this (in a unit test):
code:
let expected: Decimal = 1.523
then I get a good old floating point problem like so:
code:
Printing description of expected:
1.5229999999999995904

That's weird, because when I do:
Swift code:
import Foundation

let expected: Decimal = 1.523

let formatter = NumberFormatter()
formatter.minimumFractionDigits = 10
formatter.maximumFractionDigits = 10

print(formatter.string(from: NSDecimalNumber(decimal: expected)) ?? "no string")
I just get 1.5230000000

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
It is, unfortunately, probably target-specific, because the literal protocol is defined in terms of the target’s max fp type

LP0 ON FIRE
Jan 25, 2006

beep boop
Finally getting my hands dirty into Swift. I'm curious if there's any convincing reason behind prepending "@obj" before some of the functions, for instance ones that are called by Timers (I think because of the selector parameter). I know it's using Obj-C, but why did they design it this way? It seems confusing to remember that some calls must have this. So why didn't they just make it Swift, or have the language know to do whatever it needs to do without adding "@obj"? Maybe there's not a good reason..

Adbot
ADBOT LOVES YOU

Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do
Things with @objc are visible to Objective-C; things without it aren't. This has effects in how it's compiled under the hood in ways that people more knowledgable than I can explain, but it basically comes down to "avoiding @objc will make more performant code".

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply