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
carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

I'm doing an iOS 11 conversion and my UITabBar now looks like this



I can't find anything about how to tell it to go back to the label under icon appearance. Is this worth filing a bug over?

Adbot
ADBOT LOVES YOU

lord funk
Feb 16, 2004

carry on then posted:

I can't find anything about how to tell it to go back to the label under icon appearance. Is this worth filing a bug over?

You should, but I'll warn you that I gave up on UITabBar after having poo poo like this happen every other major update.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I'm trying to test my multiplayer game now between the Simulator and my phone. The phone is logged into Game Center with my normal Apple ID and the simulator is logged in with a newly-made account. I don't see a way to directly invite it to a game though since the Simulator doesn't accept iMessages. I tried starting a matchmaking session on each of them but they didn't connect after 3 or 4 minutes. Is there a better way to test turn-based multiplayer games?

e: Aha, I forgot I have an iPhone 5 sitting around. Can I use that for testing this without a SIM?

Luigi Thirty fucked around with this message at 21:28 on Jul 11, 2017

Doc Block
Apr 15, 2003
Fun Shoe
Yes. SIM only needed for phone service.

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

Luigi Thirty posted:

I'm trying to test my multiplayer game now between the Simulator and my phone. The phone is logged into Game Center with my normal Apple ID and the simulator is logged in with a newly-made account. I don't see a way to directly invite it to a game though since the Simulator doesn't accept iMessages. I tried starting a matchmaking session on each of them but they didn't connect after 3 or 4 minutes. Is there a better way to test turn-based multiplayer games?

e: Aha, I forgot I have an iPhone 5 sitting around. Can I use that for testing this without a SIM?

Please file a bug on this though so we can look into it.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Sent, bug 33255143.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Is there a way to deploy my app to two connected devices at once through Xcode?

vvv I was hoping there was a way to do it with one button :v:

Luigi Thirty fucked around with this message at 06:55 on Jul 13, 2017

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Plug them both in. Select one device from the dropdown menu, build and run. Select other device from dropdown menu, build and run.

Froist
Jun 6, 2004

There's this old Xcode plugin which claims to do it, but I've never tried it.

I gave up building workflows around Xcode plugins as they break and/or cause warnings on every Xcode version upgrade.

LP0 ON FIRE
Jan 25, 2006

beep boop
I haven't tried it, but theoretically you could create a Build Phase and insert a command after your project builds to build to an additional device:
https://developer.apple.com/library/content/technotes/tn2339/_index.html

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Luigi Thirty posted:

vvv I was hoping there was a way to do it with one button :v:

Oh whoops. AppleScript?

Luigi Thirty
Apr 30, 2006

Emergency confection port.

pokeyman posted:

Oh whoops. AppleScript?

Probably, yeah. I got my game working and am polishing it to hopefully submit it this week! (Free of course since it's a Babby's First Project full of warts.) But I kinda got sidetracked on messing with Swift 4 in the Xcode 9 beta and making a little SS13 recipe tool.

I have a YAML file full of recipes. I want to be able to look up recipes by their tag parameter. The tags are strings and there's a limited number of them so I made an enum. Is there a way to do this lookup directly instead of a bunch of if/else statements? There's more tags so I'm paraphrasing.

code:
enum ItemTag: String {
    case kitchen    = "kitchen"
    case produce    = "produce"
    case food       = "food"
}

func getTagForString(tagString: String) -> ItemTag {
    if(tagString == "kitchen") {
        return .kitchen
    } else if(tagString == "produce") {
        return .produce
    } else if(tagString == "food") {
        return .food
}

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?

Luigi Thirty posted:

Probably, yeah. I got my game working and am polishing it to hopefully submit it this week! (Free of course since it's a Babby's First Project full of warts.) But I kinda got sidetracked on messing with Swift 4 in the Xcode 9 beta and making a little SS13 recipe tool.

I have a YAML file full of recipes. I want to be able to look up recipes by their tag parameter. The tags are strings and there's a limited number of them so I made an enum. Is there a way to do this lookup directly instead of a bunch of if/else statements? There's more tags so I'm paraphrasing.

code:
enum ItemTag: String {
    case kitchen    = "kitchen"
    case produce    = "produce"
    case food       = "food"
}

func getTagForString(tagString: String) -> ItemTag {
    if(tagString == "kitchen") {
        return .kitchen
    } else if(tagString == "produce") {
        return .produce
    } else if(tagString == "food") {
        return .food
}

You don't need to do the = "kitchen" parts, and can create an ItemTag? from its raw value directly; that is, ItemTag(rawValue: String) returns ItemTag? so if you pass one of its legal values, it returns an instance of the enum, and if you pass something else it returns nil.

This makes your getTagForString(tagString:) superfluous too.

Dog on Fire
Oct 2, 2004

Luigi Thirty posted:

Probably, yeah. I got my game working and am polishing it to hopefully submit it this week! (Free of course since it's a Babby's First Project full of warts.) But I kinda got sidetracked on messing with Swift 4 in the Xcode 9 beta and making a little SS13 recipe tool.

I have a YAML file full of recipes. I want to be able to look up recipes by their tag parameter. The tags are strings and there's a limited number of them so I made an enum. Is there a way to do this lookup directly instead of a bunch of if/else statements? There's more tags so I'm paraphrasing.

code:
enum ItemTag: String {
    case kitchen    = "kitchen"
    case produce    = "produce"
    case food       = "food"
}

func getTagForString(tagString: String) -> ItemTag {
    if(tagString == "kitchen") {
        return .kitchen
    } else if(tagString == "produce") {
        return .produce
    } else if(tagString == "food") {
        return .food
}

My projects are still fully on Objective-C, so the following might not be entirely correct or it might not be following some conventions and whatnot.

But Swift enum's "rawValue" seems to be good for this sort of a thing:

code:

func tag(rawValue: String) -> ItemTag {
    if let t = ItemTag(rawValue: rawValue) {
        return t

    } else {
        return ItemTag.none
    }
}

let tagFromRawValue = tag(rawValue: "kitchen") // returns .kitchen

Theoretically another way would be to use a dictionary for this sort of a thing. And I think on Objective-C we still might have to it this way (using NSNumber values), although I haven't had to do this for a while:

code:

func tag(string: String) -> ItemTag {
    let d: [String: ItemTag] = ["kitchen": .kitchen]

    if let t = d[string] {
        return t

    } else {
        return ItemTag.none
    }
}

let tagUsingDictionary = tag(string: "produce") // returns .none

But if the rawValue thing works, then there's no need to go for the dictionary.

And then I don't think you have to have the explicit values defined for the enum (I also put in the default value of "none" in case you don't have it defined in your full enum):
code:

enum ItemTag: String {
    case none
    case kitchen
    case produce
    case food
}

Dog on Fire fucked around with this message at 09:54 on Jul 19, 2017

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Dog on Fire posted:

Swift code:

func tag(rawValue: String) -> ItemTag {
    if let t = ItemTag(rawValue: rawValue) {
        return t

    } else {
        return ItemTag.none
    }
}

This is just ItemTag(rawValue: rawValue) ?? .none, although in general it feels like adding .none to the enum instead of using optionals is a mistake.

Doc Block
Apr 15, 2003
Fun Shoe
I'm late to the party, but Xcode 9 is so nice.

Working on a project that uses Objective-C++ in a couple places (so that <simd/simd.h> stuff is nicer to use; rest of the project is in Objective-C) and switching to Xcode 9 has greatly improved my quality of life.

:swoon:

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?

Doc Block posted:

I'm late to the party, but Xcode 9 is so nice.

Working on a project that uses Objective-C++ in a couple places (so that <simd/simd.h> stuff is nicer to use; rest of the project is in Objective-C) and switching to Xcode 9 has greatly improved my quality of life.

:swoon:

Thanks!

Doh004
Apr 22, 2007

Mmmmm Donuts...
Yeah, Xcode 9 is definitely a huge step forward. That said, I am seeing that whenever we build to a dev device, we're doing full rebuilds of our main target. I generally chalk that up to our terrible build settings, but I don't think it was happening in Xcode 8.

Kallikrates
Jul 7, 2002
Pro Lurker

rjmccall posted:

This is just ItemTag(rawValue: rawValue) ?? .none, although in general it feels like adding .none to the enum instead of using optionals is a mistake.

Opinion: Having used both styles I often prefer an explicit .none case for cutting down some optional boilerplate.

Our coding style heavily favors exhaustive switches maybe that colors it some.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
It really depends on the type. If "none" is a reasonable value for the thing and all clients should handle that — i.e. if not having "none" means you would always pass around an optional whatever — then you should absolutely have "none". If, in contrast, you're adding a "none" case just to have something to do in some corner/error case, and you find yourself inventing bogus semantics for "none" in all the clients, then you should use optionals to fix your corner case instead of forcing it on everything else.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

It’s possible for a recipe to have no tags. With my setup it just writes an empty array of ItemTags. :shrug:

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Yeah, assuming that recipes can have multiple tags, I really can't imagine why you would need a none ItemTag; it seems like it would just create the possibility of none-propagation bugs.

epswing
Nov 4, 2003

Soiled Meat
A couple years ago I bought a Mac Mini, wrote a small iOS app, and submitted it to the iOS App Store. That Mac Mini has been off since then, until today. Turned it on, ran the suggested updates, all seems ok.

I'd like to write another small iOS app, and again submit it to the iOS App Store. Do I need to update the OS, or Xcode, or can I get away with the existing versions? I suppose the app would be targeting iOS 8.4, which is what was out last time around (2 years ago).

OS X Yosemite 10.10.5
Xcode 6.4 (6E35b)

I barely know anything about Apple products, please feel free to talk to me as if I'm 5 years old!

Edit: PS, I know that I probably *should* update Xcode to the latest version, but for some reason when I try, it just spins forever and doesn't actually update (I've even left it updating overnight). No error message is displayed, the App Store program just doesn't do anything but show me an animated spinning icon after I click the Update button. What I'm really asking is, "can I get away with not updating Xcode?" or is there some App Store requirement that I must have a later version of Xcode.

epswing fucked around with this message at 06:06 on Jul 20, 2017

Luigi Thirty
Apr 30, 2006

Emergency confection port.

developer.apple.com has DMG downloads of Sierra and Xcode 8.3.3 if you want to bypass the store. I’ve had the App Store gently caress up huge downloads too much to download it through there.

Doc Block
Apr 15, 2003
Fun Shoe

epalm posted:

A couple years ago I bought a Mac Mini, wrote a small iOS app, and submitted it to the iOS App Store. That Mac Mini has been off since then, until today. Turned it on, ran the suggested updates, all seems ok.

I'd like to write another small iOS app, and again submit it to the iOS App Store. Do I need to update the OS, or Xcode, or can I get away with the existing versions? I suppose the app would be targeting iOS 8.4, which is what was out last time around (2 years ago).

OS X Yosemite 10.10.5
Xcode 6.4 (6E35b)

I barely know anything about Apple products, please feel free to talk to me as if I'm 5 years old!

Edit: PS, I know that I probably *should* update Xcode to the latest version, but for some reason when I try, it just spins forever and doesn't actually update (I've even left it updating overnight). No error message is displayed, the App Store program just doesn't do anything but show me an animated spinning icon after I click the Update button. What I'm really asking is, "can I get away with not updating Xcode?" or is there some App Store requirement that I must have a later version of Xcode.

The Mac App Store is... less than great, especially when it comes to updating Xcode for some reason. As Luigi Thirty said, just grab it off http://developer.apple.com after you've updated to the latest macOS version (Xcode generally requires you to be running on whatever was the latest OS when that version of Xcode was released). You can still target iOS 8 if you want.

Be aware that you can't put your app on the app store if it was built with a beta version of Xcode. But if your app won't be finished until after macOS High Sierra gets released (and Xcode 9 along with it), you might as well develop your new app with the Xcode 9 beta (which only requires macOS 10.12) and then publish it with the Xcode 9 public release. Xcode 9 runs a lot better on my old 2011 iMac than Xcode 8 does, and will probably run better on your old Mac Mini too.

Doc Block fucked around with this message at 07:33 on Jul 20, 2017

epswing
Nov 4, 2003

Soiled Meat
I should have just asked this: is there anything stopping me from writing a small iPhone app and submitting it to the iOS App Store with OS X Yosemite 10.10.5 and Xcode 6.4?

(I just want to knock out a teenie little app over a weekend and not have to wrestle with updating the entire operating system to do so, if I don't have to.)

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Xcode 6 is currently the minimum supported version for submitting to the app store, but expect that to go up to 7 in a few months when 9 comes out.

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
Wait, Xcode 9 is actually stable for people? It has never been able to build a project with xibs for me without choking.

I guess I should dig into that a bit if it's just me.

SaTaMaS
Apr 18, 2003
I'm working on an OSX Cocoa application and using NSArrayControllers for the first time. I have the table displaying data, but one of the variables in my model is an array of strings. For some reason it's only displaying a single value out of the array. I have a workaround by using a derived variable, but is there some way to get a table cell to display an array as a comma-delimited string? (Having a Model Key Path of objectValue.array.description just returns a KVO error)

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
It’s been ages since I futzed with cocoa bindings but adding a derived property to your model sounds like exactly the correct approach. You’ll probably want to implement -keyPathsForValuesAffecting... so it keeps working with bindings.

If for whatever reason you don’t want to gunk up your model with display bits, you could maybe use a view model.

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
Is the CFI sanitizer supported for iPhone targets? I'm getting a linker crash (!)

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
Nevermind, in trying to reduce the test case I must have triggered a clean-up of build files because I can't reproduce it anymore

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I'm trying to run my app on the iPhone 7 simulator in Xcode 9. The simulator starts, says "Invalid Device State" and crashes. How can I reset it? I tried restarting Xcode, the simulator, and rebooting a few times. I can't submit my app without screenshots on a 5.5" device. :(

I have Xcode 8.3.3 and 9.0 installed. Xcode 8.3.3 has no simulators listed at all.

Doc Block
Apr 15, 2003
Fun Shoe
You can't submit your app if it was built with Xcode 9 yet, just FYI. Have to wait until Xcode 9 is out of beta or build & submit it with Xcode 8.

edit: never mind, didn't see your ninja edit

edit 2: did you try redownloading the simulators in Xcode 8? Also, AFAIK, you don't *have* to submit 5.5" screenshots. I think 5.5" devices will just show the next size available (4.7", 4", etc.)

Doc Block fucked around with this message at 02:07 on Jul 22, 2017

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Doc Block posted:

You can't submit your app if it was built with Xcode 9 yet, just FYI. Have to wait until Xcode 9 is out of beta or build & submit it with Xcode 8.

edit: never mind, didn't see your ninja edit

edit 2: did you try redownloading the simulators in Xcode 8? Also, AFAIK, you don't *have* to submit 5.5" screenshots. I think 5.5" devices will just show the next size available (4.7", 4", etc.)

I have 4.7" screenshots, it won't let me proceed without submitting 5.5" screenshots unless I'm doing something wrong.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Luigi Thirty posted:

I have 4.7” screenshots, it won’t let me proceed without submitting 5.5” screenshots unless I’m doing something wrong.

You don’t need the 4.7. Just the big phone.

Also iPhone 7 is not a big phone. You want an iPhone 7+.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Installing the simulators in 8.3.3 didn't help. They don't show up anywhere. I can "add" them in the Additional Simulators menu but nothing happens.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Check ~/Library/Logs/CoreSimulator/CoreSimulator.log. You can also run "xcrun simctl list" and see what it says about the devices and runtimes.

My guess is that the wrong version of CoreSimulator is running or two versions are fighting each other. It could also be a crash due to a known rendering bug - the release notes discuss what to do if that is the case.

We need a lot more information before we can really start figuring this out.

Doc Block
Apr 15, 2003
Fun Shoe

Luigi Thirty posted:

I have 4.7" screenshots, it won't let me proceed without submitting 5.5" screenshots unless I'm doing something wrong.

Weird. I could've sworn the last update for an app I submitted only had the 4.7" screenshots and below.

Adbot
ADBOT LOVES YOU

Luigi Thirty
Apr 30, 2006

Emergency confection port.

It looks like the problem was the two versions not cooperating. xcode-select told me I had the beta version enabled which lacked a 10.3 runtime. 8.3.3 was trying to start the simulators with 10.3 and failing. 9.0 was failing to start them because they were in an invalid state. I swapped back to Xcode.app, killed CoreSimulatorService and the simulator starts now.

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