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
pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Alright I need a sanity check. Can someone pop this into an iOS playground in Xcode 7.1 and tell me what happens?

Swift code:
import UIKit
import XCPlayground

let label = UILabel()
label.text = "Updog"
label.sizeToFit()
XCPlaygroundPage.currentPage.liveView = label

Adbot
ADBOT LOVES YOU

lord funk
Feb 16, 2004

A black box?

Only registered members can see post attachments!

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

An error. Something's up with mine.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Ok cool, not just me. Best case I get the black box, otherwise I get beachball.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

UIApplication posted:

Why/how does this happen because it brings my piss to a boil too

What's happening here is straightforward. In the C compilation model, every single source file ("translation unit") is independent. The language(s) impose a small number of assumptions about how declarations not defined in the current file will be defined (the "ABI"), but for the most part, every file is supposed to stand alone, allowing other files to be compiled with different options or even use completely different source languages. This creates a really nasty problem for debug info, because in theory you want the debugger to know about everything that the compiler can see, but different files are supposed to be independent, and you don't actually want the compiler to make every single object file include 20MB of redundant and unused declarations, because it would make compile times twenty times longer just from sheer I/O overhead. So instead the compiler drops a ton of stuff, and then it's a really interesting problem to find ways to make it available to the debugger anyway, and sometimes those mechanisms don't quite work perfectly. And Swift is affected because, as much as we've tried to evolve beyond the C compilation model, it's a lot of work to integrate this into tools built around that model, and sometimes the polish is scratched. So please file bugs with as much information as you have, and we'll try to do what we can.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
So as of this AM, my project will not build any more. Well, at least not in the 35 minutes I've let it run both before and after deleting derived data. I made a single line change to a string. Also, it has been "processing files" in indexing for over an hour. Have restarted Xcode many times, deleted derived data as mentioned... Running Version 7.0.1 (7A1001).

Any suggestions? Update to 7.1? :iiam:

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Restart your computer?

Doh004
Apr 22, 2007

Mmmmm Donuts...

pokeyman posted:

Restart your computer?

Pull it out and blow into the cartridge.

lord funk
Feb 16, 2004

rjmccall posted:

What's happening here is straightforward. In the C compilation model, every single source file ("translation unit") is independent. The language(s) impose a small number of assumptions about how declarations not defined in the current file will be defined (the "ABI"), but for the most part, every file is supposed to stand alone, allowing other files to be compiled with different options or even use completely different source languages. This creates a really nasty problem for debug info, because in theory you want the debugger to know about everything that the compiler can see, but different files are supposed to be independent, and you don't actually want the compiler to make every single object file include 20MB of redundant and unused declarations, because it would make compile times twenty times longer just from sheer I/O overhead. So instead the compiler drops a ton of stuff, and then it's a really interesting problem to find ways to make it available to the debugger anyway, and sometimes those mechanisms don't quite work perfectly. And Swift is affected because, as much as we've tried to evolve beyond the C compilation model, it's a lot of work to integrate this into tools built around that model, and sometimes the polish is scratched. So please file bugs with as much information as you have, and we'll try to do what we can.

Thanks for the info, but this is in an Obj-C project (no Swift). Bug reported anyway.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

pokeyman posted:

Restart your computer?

If only it were that easy.

It has something to do with dictionary literals. I have code along the lines of:

Swift code:
let userData = [
    "TEST": [
        ["firstName":"Test", "lastName":"Tester","participantIdentifier":"abc123"],
        ["firstName":"Blah","lastName":"Splatter","participantIdentifier":"qazwsx"],
        ["firstName":"Cow","lastName":"Bell","participantIdentifier":"ttggf"],
    ]
]
And that's wonderful. If I have 10 test users, formatted exactly like that, everything grinds to a halt. :argh:

EDIT: and SourceKitService is taking ~400% CPU and causing center of the sun heat when this happens...

EDIT2: If I remove any of the rows so there are NINE users... it builds and runs. :wtf:

Lumpy fucked around with this message at 21:01 on Oct 26, 2015

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

pokeyman posted:

code:
(lldb) e @import UIKit
Still a pain in the butt though, I know.

This was touted as a feature in the LLDB session at WWDC.

I had to repeatedly punch my own leg to avoid jumping up and screaming "THEN WHY THE gently caress DOESN'T IT DO THAT BY DEFAULT". Debugging in Xcode compares to debugging in Visual Studio like a go-kart compares to a Ferrari, only the guys building the go-kart think they've built something awesome.


Now back to Test Flight being an utter piece of poo poo and sitting on random builds for hours. Oh world's most profitable company? Too bad, you get old Bondi-Blue iMacs for Test Flight servers. Hate your own life fuckers, haha! *


* When I asked some Apple folks if they had VM farms or the ability to spin up instances internally they told me people just run everything on Mac Minis under their desks. It's just a sad state of affairs.

jawbroken
Aug 13, 2007

messmate king

Lumpy posted:

It has something to do with dictionary literals…
EDIT2: If I remove any of the rows so there are NINE users... it builds and runs. :wtf:

Expressions with a lot of literals can currently cause exponential behaviour in the type inference engine. Add some explicit types somewhere.

Also your test users should clearly be structs, if your example is representative.

fankey
Aug 31, 2001

I have an app which dynamically creates a bunch of UIViews, all of which override drawRect:. After upgrading to XCode 7.1 my memory usage has gone through the roof and am getting out of memory errors. I understand that overriding drawRect: will create a backing bitmap but did anything change with 7 or 7.1 to make doing this have a bigger memory footprint? I really need to have custom drawing for my views - is there a more memory efficient way to go about it compared to drawRect:? Maybe using CALayers or something?

EDIT: A little bit of data. In one example I'm creating 117 444x555 size images on an iPad Mini. By my simple math ( 444 x 555 x 4 bytes for ARGB ) each backing bitmap should be about 1MB so I should see about 117MB of memory usage. I'm seeing 480MB which would make sense if the backing bitmap was being created at retina resolution - maybe previously they were being created at the view resolution which was not the case before??

fankey fucked around with this message at 00:18 on Oct 27, 2015

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Ender.uNF posted:

When I asked some Apple folks if they had VM farms or the ability to spin up instances internally they told me people just run everything on Mac Minis under their desks. It's just a sad state of affairs.

Well I guess it's kinda nice to know that OS X servers are such a shitshow because the infrastructure just hasn't been developed at all and not because someone at Apple decided not to release important tools.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

jawbroken posted:

Expressions with a lot of literals can currently cause exponential behaviour in the type inference engine. Add some explicit types somewhere.

Also your test users should clearly be structs, if your example is representative.

Thank you x2. Switching to structs not only was the smarter thing, it resolved my issue completely.

lord funk
Feb 16, 2004

Lumpy posted:

Thank you x2. Switching to structs not only was the smarter thing, it resolved my issue completely.

WE MUST RETAIN ALL CLASSES ALL THE TIME. RETAIN RETAIN RETAIN.

Kallikrates
Jul 7, 2002
Pro Lurker

lord funk posted:

WE MUST RETAIN ALL CLASSES ALL THE TIME. RETAIN RETAIN RETAIN.

Except when you get them from (some?) factory methods.

lord funk
Feb 16, 2004

Nice. Time Profiler just doesn't do anything. Is it because I'm running on a 7.1.1 device? I'm going numb.

edit: yeah it's a bug

lord funk fucked around with this message at 19:09 on Oct 27, 2015

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
Am I missing a very obvious cause for this crash? I may be doing something unsavory to a UIWebView. I don't expect any relevant delegates or views to be disappearing while a request is running. It's possible that I'm sending a UIWebView multiple calls to loadRequest without canceling an already-running one. I tried doing that on purpose and was unable to reproduce this.

ManicJason fucked around with this message at 20:39 on Oct 27, 2015

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

pokeyman posted:

code:
(lldb) e @import UIKit
Still a pain in the butt though, I know.

For real?!? This is what I was needing in the Swift thread the other day. :(

Edit: Maybe not 100% though.

ultramiraculous fucked around with this message at 00:02 on Oct 28, 2015

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
It doesn't always help:

code:
(lldb) po nav
error: <EXPR>:1:11: error: use of undeclared type '$__lldb_context'
extension $__lldb_context {                            
          ^~~~~~~~~~~~~~~
<EXPR>:15:5: error: use of unresolved identifier '$__lldb_injected_self'
    $__lldb_injected_self.$__lldb_wrapped_expr_4(     
    ^~~~~~~~~~~~~~~~~~~~~
(lldb) 
*sigh*

Doh004
Apr 22, 2007

Mmmmm Donuts...
Hot drat, finally tried out the Fastlane tools. Just integrated our alpha builds from our CI onto Crashlytics and beta builds straight to iTunesConnect and TestFlight.

This seriously owns.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I'm normally not a fan of kooky tool/library names but I'm on board with a provisioning profile utility called "sigh".

Glimm
Jul 27, 2005

Time is only gonna pass you by

Doh004 posted:

Hot drat, finally tried out the Fastlane tools. Just integrated our alpha builds from our CI onto Crashlytics and beta builds straight to iTunesConnect and TestFlight.

This seriously owns.

Oh yeah, they are amazing. Totally recommend them. They ought to be first party imo.

Doh004
Apr 22, 2007

Mmmmm Donuts...

pokeyman posted:

I'm normally not a fan of kooky tool/library names but I'm on board with a provisioning profile utility called "sigh".

That's why I was initially hesitant.

But when sigh allows my CI to login to iTunes Connect and download my ad hoc provisioning profile (the one where I can just add devices onto) into the current instance instead of having to download it and put it into git, I'm willing to budge.

Glimm posted:

Oh yeah, they are amazing. Totally recommend them. They ought to be first party imo.

I'm super pumped that Fabric (Twitter) acquired the library. Hopefully it'll increase its adoption among the community even more.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doh004 posted:

I'm super pumped that Fabric (Twitter) acquired the library. Hopefully it'll increase its adoption among the community even more.

And the other shoe drops :sigh:

As long as I don't need to install Fabric.app to use a loving rubygem, I'm ok.

I give it a year.

Doh004
Apr 22, 2007

Mmmmm Donuts...

pokeyman posted:

And the other shoe drops :sigh:

As long as I don't need to install Fabric.app to use a loving rubygem, I'm ok.

I give it a year.

Not a fan of Fabric? I'm genuinely curious as I'm still new to it all. Things have been pretty good so far.

Doc Block
Apr 15, 2003
Fun Shoe
edit: never mind

Doc Block fucked around with this message at 19:02 on Oct 29, 2015

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doh004 posted:

Not a fan of Fabric? I'm genuinely curious as I'm still new to it all. Things have been pretty good so far.

I'm suspicious of agglomeration for no clear benefit. I've never liked the whole "you must install our Mac app to use our framework". Plus it's free. I guess I've been waiting for the other shoe to drop for awhile.

It's very possible my fears are groundless, though, and I don't mean to dissuade anyone who derives value from these products.

While I'm complaining, it would also be nice if they fixed their Crashlytics pod to declare its dependency on the Fabric pod. Why even bother officially embracing a dependency manager just to do everything but?

Doctor w-rw-rw-
Jun 24, 2008

Doh004 posted:

Not a fan of Fabric? I'm genuinely curious as I'm still new to it all. Things have been pretty good so far.
Perhaps my gripes are dated, but:
  • Crashlytics and Fabric would ruin builds by updating its framework files in place. Thanks, I was just looking for an unexpected and automatic change to distract me while debugging something else. Especially if I was bisecting someone else's build with an automatically-updated Crashlytics inserted in an unrelated commit, and and Crashlytics decides now's a great time to update the framework. Sure, not devastating. Persistently annoying, though.
  • Whoever designed the embedded Tweet widget was a blithering idiot who probably didn't think too hard about apps using anything outside conventional tableview
  • Mopub is terrible. Perhaps profitable, but technically rear end.

Fabric makes me angry.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doctor w-rw-rw- posted:

Crashlytics and Fabric would ruin builds by updating its framework files in place. Thanks, I was just looking for an unexpected and automatic change to distract me while debugging something else. Especially if I was bisecting someone else's build with an automatically-updated Crashlytics inserted in an unrelated commit, and and Crashlytics decides now's a great time to update the framework. Sure, not devastating. Persistently annoying, though.

Can't believe I forgot this one. It's fixed if you're using the pod.

Doc Block
Apr 15, 2003
Fun Shoe
Oh God, blocks. :mad:

Trying to use Metal Performance Shaders and getting a compile error. Why doesn't this work:
Objective-C code:
[_boxBlurFilter encodeToCommandBuffer:_currentCommandBuffer
					   inPlaceTexture:&_postTexture
				fallbackCopyAllocator:^id<MTLTexture> _Nonnull(MPSKernel * _Nonnull filter,
									id<MTLCommandBuffer>  _Nonnull commandBuffer,
									id<MTLTexture>  _Nonnull sourceTexture) {
					// stuff
				}];
Xcode refuses to compile it (even though the block signature was inserted by Xcode autocomplete), giving the following error for the line that takes the block:

Incompatible block pointer types sending 'id<MTLTexture> _Nonnull (^)(MPSKernel * _Nonnull __strong, id<MTLCommandBuffer> _Nonnull __strong, id<MTLTexture> _Nonnull __strong)' to parameter of type 'MPSCopyAllocator _Nullable' (aka 'id<MTLTexture> _Nonnull (^)(MPSKernel * _Nonnull __strong, id<MTLCommandBuffer> _Nonnull __strong, id<MTLTexture> _Nonnull __strong)')

What stupid thing am I missing that will make this compile?

Doc Block fucked around with this message at 02:48 on Oct 30, 2015

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Doc Block posted:

Oh God, blocks. :mad:

Trying to use Metal Performance Shaders and getting a compile error. Why doesn't this work:
Objective-C code:

[_boxBlurFilter encodeToCommandBuffer:_currentCommandBuffer
					   inPlaceTexture:&_postTexture
				fallbackCopyAllocator:^id<MTLTexture> _Nonnull(MPSKernel * _Nonnull filter,
									id<MTLCommandBuffer>  _Nonnull commandBuffer,
									id<MTLTexture>  _Nonnull sourceTexture) {
					// stuff
				}];


Xcode refuses to compile it (even though the block signature was inserted by Xcode autocomplete), giving the following error for the line that takes the block:

Incompatible block pointer types sending 'id<MTLTexture> _Nonnull (^)(MPSKernel * _Nonnull __strong, id<MTLCommandBuffer> _Nonnull __strong, id<MTLTexture> _Nonnull __strong)' to parameter of type 'MPSCopyAllocator _Nullable' (aka 'id<MTLTexture> _Nonnull (^)(MPSKernel * _Nonnull __strong, id<MTLCommandBuffer> _Nonnull __strong, id<MTLTexture> _Nonnull __strong)')

What stupid thing am I missing that will make this compile?

Oh god, I'm sorry, I might have advised them on this API.

Look up the actual header, I think you probably needs NS_CONSUMED and/or NS_RETURNS_RETAINED. Alternatively, I think you can use the typedef and the compiler will give you parameters automatically.

ETA: also please file a bug about the inadequate type-printing.

Doc Block
Apr 15, 2003
Fun Shoe

rjmccall posted:

Oh god, I'm sorry, I might have advised them on this API.

Look up the actual header, I think you probably needs NS_CONSUMED and/or NS_RETURNS_RETAINED. Alternatively, I think you can use the typedef and the compiler will give you parameters automatically.

ETA: also please file a bug about the inadequate type-printing.

Thanks. Yeah, it needed NS_RETURNS_RETAINED, once I added that it worked fine:
Objective-C code:
MPSCopyAllocator fxCopyAllocator = ^id <MTLTexture> __nonnull NS_RETURNS_RETAINED( MPSKernel * __nonnull filter,
								id <MTLCommandBuffer> __nonnull commandBuffer,
								id <MTLTexture> __nonnull sourceTexture) {
	// stuff
};

[_boxBlurFilter encodeToCommandBuffer:_currentCommandBuffer inPlaceTexture:&_postTexture fallbackCopyAllocator:fxCopyAllocator];

Glimm
Jul 27, 2005

Time is only gonna pass you by

What is the best way to handle having 3 different versions (dev, staging, prod) of my app installable on a single device, but with different icons / pointing at different web services?

In the past I've used targets for this - it's pretty straight forward, but error prone. Forgetting to add a file to a particular target can cause problems, it's annoying to keep the versions / build numbers in line, and really it feels like using targets incorrectly (it is the same app after all).

The right way to do this seems to be different build configurations. I think I'm missing something straight forward in how to use them though, for example: I send builds out internally on staging, but the 'archive' Xcode option is pointing to the production (Release) configuration. It seems bizarre to manually edit my scheme's Archive option every time I send an internal build out. How do I make archive sometimes use production and at other times use staging?

Kallikrates
Jul 7, 2002
Pro Lurker
Everything can be handled via build settings. App Icon: https://engineering.circle.com/different-app-icons-for-beta-dev-and-release-builds/
For your services you can use compile time flags.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Kallikrates posted:

Everything can be handled via build settings. App Icon: https://engineering.circle.com/different-app-icons-for-beta-dev-and-release-builds/
For your services you can use compile time flags.

Right, sorry I wasn't clear - how do I archive my dev configuration vs staging configuration vs production configuration without creating separate schemes that point to a different configurations within their archive steps?

lord funk
Feb 16, 2004

Are promo codes just not available in iTunes Connect right now, or have they moved again?

Doh004
Apr 22, 2007

Mmmmm Donuts...

Glimm posted:

Right, sorry I wasn't clear - how do I archive my dev configuration vs staging configuration vs production configuration without creating separate schemes that point to a different configurations within their archive steps?

Change the build configuration before archiving:

Adbot
ADBOT LOVES YOU

Kallikrates
Jul 7, 2002
Pro Lurker

Doh004 posted:

Change the build configuration before archiving:



Yeah I think he wants something to set once ( I always forget to unset the release flag). A separate scheme or a build script might be the only options.

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