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
Toady
Jan 12, 2009

https://vimeo.com/98146708

Adbot
ADBOT LOVES YOU

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Yeah, a naive player isn't going to see much benefit at first, but once you realize what it's actually keying off of (hit area size) it's a much better way to encode velocity than the previous y-position. I look forward to this showing up in iMaschine :)


The eraser is what blows my mind. Also, that was really fast.

Dessert Rose fucked around with this message at 01:12 on Jun 19, 2014

Pivo
Aug 20, 2004


So we have a client that we need to build an app for, but they don't want to give us access to their Apple account, and we don't want to send them the source code. So we want to send them an unsigned binary thing that they can sign with whatever the gently caress they please. Apparently there is a way to "re-sign" IPAs but that looks like that's all for ad-hoc or enterprise distribution, not App Store distribution. Now, on Stack Overflow, a lot of people have a lot of different ways to *maybe* do this, but Apple's official stance is that you can't do it. Y'all ever try anything similar?

Also, jerk clients, jeez.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Pivo posted:

So we have a client that we need to build an app for, but they don't want to give us access to their Apple account, and we don't want to send them the source code. So we want to send them an unsigned binary thing that they can sign with whatever the gently caress they please. Apparently there is a way to "re-sign" IPAs but that looks like that's all for ad-hoc or enterprise distribution, not App Store distribution. Now, on Stack Overflow, a lot of people have a lot of different ways to *maybe* do this, but Apple's official stance is that you can't do it. Y'all ever try anything similar?

Also, jerk clients, jeez.

I'm sure there's a better way, but if it comes down to it you could possibly ship them a compiled static library, whatever assets, and an Xcode project with a hollow shell of an app target (could probably get away with nothing but a main.m). They can build and archive the app using their private key and such, you keep your code hidden, and you don't have to gently caress around with codesign.

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?

Pivo posted:

So we have a client that we need to build an app for, but they don't want to give us access to their Apple account, and we don't want to send them the source code. So we want to send them an unsigned binary thing that they can sign with whatever the gently caress they please.

You should already using Xcode's Archive feature to produce builds you distribute for testing or submit for App Store review and posting. Just export an archive and send it to them. They should be able to import it and do exactly the same kind of distribution for testing or submission for review and posting.

Pivo
Aug 20, 2004


eschaton posted:

You should already using Xcode's Archive feature to produce builds you distribute for testing or submit for App Store review and posting. Just export an archive and send it to them. They should be able to import it and do exactly the same kind of distribution for testing or submission for review and posting.

No? You archive a signed copy. Sure, we can send them a copy signed with *our* keys... Lotta good that'll do 'em.

I mean Apple's official stance is that you can't do this. People have found workarounds, of dubious quality.

If it was as easy as that...

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?

Pivo posted:

No? You archive a signed copy. Sure, we can send them a copy signed with *our* keys... Lotta good that'll do 'em.

The .app in the archive will be signed using your keys, my understanding is that any export or upload will cause the .app to be re-signed.

quote:

I mean Apple's official stance is that you can't do this.

Where have you seen this stated? (By Apple, I mean, not third parties who think they can infer Apple's stance.)

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Uhh when you create an archive then re-run the "distribute" action, doesn't that resign the binary anyway? Worst case you could strip the Mach-O signature and have them resign it.

That's the only really relevant part. You can stick any profile in the IPA, depending on what you want to use it for.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer
Yeah. That's when it actually gets signed/resigned for real. You do have to configure it to build with a distribution cert, but that appears to effectively just set a "not-debug-build" flag for the binary. After that you can just zip up the archive and send it to someone else and they can sign it.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Well everyone treats the provisioning profiles and signing like some kind of black art but it's actually fairly simple once you dig into it. As I've recommended before, open them in a text editor and it should become much clearer what is happening.

Doc Block
Apr 15, 2003
Fun Shoe
Magic is what's happening, duh! ;)

Normy
Jul 1, 2004

Do I Krushchev?


I have a Master-Detail app with a view drawn on top in the bottom right corner. When I pull up the keyboard, I want to move this view up out of the way. I got that working as it should, but if I have the keyboard open and change orientation, the view doesn't stay positioned above the keyboard. In fact, the view disappears all together. I'm assuming it's flying out of frame somewhere.

I think I have to implement willRotateToInterfaceOrientation but when I do, the Master view blanks out on rotation. I'm so close to figuring this out, any ideas or direction I can go?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Normy posted:

I think I have to implement willRotateToInterfaceOrientation but when I do, the Master view blanks out on rotation. I'm so close to figuring this out, any ideas or direction I can go?

Are you calling super?

What does "blanks out" mean? Who are you making responsible for repositioning the view? What is your view's superview?

Normy
Jul 1, 2004

Do I Krushchev?


No, I wasn't calling super. Thanks.

ljw1004
Jan 18, 2005

rum
I'm really confused by auto-layout. Using Xcode 6 beta 2. Here's a minimal repro:


(1) File > New Project > SingleView > Swift+Universal

(2) Main.storyboard > drag a "Table View" into the IB so it fills the View

(3) TableView > Pin > pin it to the border i.e. Top = Bottom = Leading = Trailing = 0 > Add 4 constraints


What I see is the Interface Builder's "structure view" now has a little red auto-layout error icon. I click it and it says
"Table View... has ambiguous scrollable content height"
"Table View... has ambiguous scrollable content width"

I don't know how to get rid of these. The answers I've seen on stackoverflow have all been about "UIScrollView" rather than TableView, and they've suggested "stick the content into a UIView". But that doesn't seem to apply to me because I'm working with a table, and can't stick my content into a View. Other answers on stackoverflow have suggested to set placeholder width+height constraints, but I don't know which object needs those placeholder width+height constraints, and don't know how to set them.


(4) TableView > Content="DynamicPrototypes", PrototypeCells=1

(5) PrototypeCell > Style="Subtitle", Identifier="reuseId1"


What I see now are two additional identical "auto layout" errors:
"Missing Constraints" [it doesn't say which element is missing constraints]. If I click on the red "fix-it" icon it says
"Add missing constraints for ? This will add enough constraints to resolve the ambiguity".

I can click the "Add Missing Constraints" button but it does nothing.



This has had me stumped for two days now, no kidding. I'd love some advice!

dizzywhip
Dec 23, 2005

I don't have any advice for you, but I feel your pain. I like the idea of autolayout and the advantages it offers like internationalization, but I just get so frustrated and confused using it that I stick to resizing masks and manual layout code. I don't really see it happening, but I desperately hope that Apple doesn't somehow make autolayout mandatory one day.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

I can't reproduce it on Xcode 5, but when I create the project you mention, 1) it isn't Swift of course, and 2) I get separate storyboards for iPhone and iPad. Possible bug report?

WORLDS BEST BABY
Aug 26, 2006

ljw1004 posted:

Using Xcode 6 beta 2.

It’s a boring answer, but this is probably it.

carry on then posted:

I can't reproduce it on Xcode 5, but when I create the project you mention, 1) it isn't Swift of course, and 2) I get separate storyboards for iPhone and iPad. Possible bug report?

Xcode 6 now uses unified storyboards where you can use size classes to configure the interface for different screen sizes.

Gul Banana
Nov 28, 2003

ljw, I've experienced the EXACT same problem. swift ios app, top level tableviewcontroller, constraints seemingly satisfied but with an unresolvable error about scrollable content ambiguity.
this github repo exhibits the problem. i think we just have to assume its a bug in the New Stuff...

Doc Block
Apr 15, 2003
Fun Shoe

WORLDS BEST BABY posted:

It’s a boring answer, but this is probably it.


Xcode 6 now uses unified storyboards where you can use size classes to configure the interface for different screen sizes.

I haven't started with Xcode 6 yet (holding off looking at the iOS 8 stuff until my current app is released), so apologies if this isn't the case, but this seems kind of dumb and Android-y to me.

Please tell me that it still lets you have completely different controls and view controller types for different devices/size classes/whatever. Otherwise, it seems like if the iPhone interface was based on a table view then the iPad version would have to be too, which is a waste.

Gul Banana
Nov 28, 2003

Size classes do let you have completely different controls. they can be 'installed' or otherwise for any combo of traits.

They're pretty clever, but the thing about them which alarms me are the backwards compatibility implications. They *seem* to just work, but then sort of don't? You can compile a size-classes storyboard for iOS 7 or 6, and it will run with the Any/Any constraints. But.. how the heck do you actually design like this? You create constraints in your various classes and get a nice visual preview of how it will look on various devices and orientations... which only applies to ios 8. On 7/6 half the stuff just won't work. You'd have to manually replicate the effect of the size classes in your view controllers, adding and removing the appropriate constraints.. but you can't even REFERENCE the non any/any constraints with outlets, they're nil on ios 7. You'd have to write them in code instead? So you have this autolayout design where half the constraints are in code and so not visible to the designer and you can't see what it looks like at all??

WORLDS BEST BABY
Aug 26, 2006

Doc Block posted:

I haven't started with Xcode 6 yet (holding off looking at the iOS 8 stuff until my current app is released), so apologies if this isn't the case, but this seems kind of dumb and Android-y to me.

Please tell me that it still lets you have completely different controls and view controller types for different devices/size classes/whatever. Otherwise, it seems like if the iPhone interface was based on a table view then the iPad version would have to be too, which is a waste.

Good news: you can add/remove views per size class. The limitation seems to be that you can't change some attributes of items: you can't change the title of a button between size classes, for instance.

haveblue
Aug 15, 2005



Toilet Rascal

dizzywhip posted:

I desperately hope that Apple doesn't somehow make autolayout mandatory one day.

What's probably going to happen is that's not explicitly mandatory but once Apple expands the range of supported screen sizes, aspect ratios, and pixel counts the "manual code" portion of the old way is going to get so complicated that autolayout naturally becomes preferred.

Gul Banana
Nov 28, 2003

rumour has it that the next iphone will introduce *two* new screen sizes, so that day could come quite soon

Toady
Jan 12, 2009

After they updated autolayout editing in Xcode 5, I haven't had any problems with it.

dizzywhip
Dec 23, 2005

haveblue posted:

What's probably going to happen is that's not explicitly mandatory but once Apple expands the range of supported screen sizes, aspect ratios, and pixel counts the "manual code" portion of the old way is going to get so complicated that autolayout naturally becomes preferred.

Well I do a lot of Mac development, so I'm already used to working with arbitrary sizes and aspect ratios. It's not too bad.

And yeah, it definitely got WAY better in Xcode 5. I think part of my disdain for autolayout comes from the traumatic memories of when I tried to convert an entire app to use it in Xcode 4. That was probably the most frustrating experience I've had doing any kind of Mac or iOS development ever.

Hughlander
May 11, 2005

So I’m trying to do something fairly simple with GCD but running into the strangest issues.

I have an Objective-C++ object that controls some queues around a BSD socket that maintains connection to a remote server over a custom protocol. I’m adding zlib stream compression to the protocol. So in the constructor to the object I construct a serial dispatch queue:
code:
SocketQueue::SocketQueue()
{
    _compressQueue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);

}
Then the main thread gets a message, wraps it in an envelope and passes it to be written to the network on a background thread. I then add a step where it uses _compressQueue to compress it instead:
code:
SocketQueue::write(const std::string & data)
{
    LockGuard __unused guard(_stateLock);
    if (_state == eAsyncSocketStateConnected)
    {
        log("%s", data.c_str());
        // Copy of data to keep it around for the lifetime of the block
        std::string blockData = data;


        dispatch_async(_compressQueue, ^{
            log("Sending %s to compression", blockData.c_str());
            std::string compressedData = _compressStream.compress(blockData);
            dispatch_async(dispatch_get_main_queue(), ^{
                MethodRequest_ref mr(new AsyncSocketWrite(compressedData));

                _upCallQueue.push_back(mr);
                log("Sending to upCallQueue");

            });
        });
    }
}
Now the odd part is that this works fine for almost exactly 3 minutes. I can send 10 packets or 100 packets and the server receives them and responds to them. After 3 minutes however, I get the log statement inside the Connected block and then don’t get the log statement from the _compressQueue. If I break and look at the queue view in the debugger, I don’t see any blocks on my queue. (My queue isn’t actually shown unless there’s something queued for it.) The destructor is never called so _compressQueue should still be in scope and maintained by ARC. I’ve checked this under Xcode 5.1.1/iOS7.1 and Xcode 6.0 Beta 2 / iOS8.

As a sanity check, I’m going to wrap all the GCD calls into an Objective-C object, but everything I know about GCD + ARC says that it should work as written even inside Objective-C++.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Say I'm implementing a protocol that has a property. Do you guys prefer to autosynthesize the property by putting it in the class' interface in the .h, or just synthesize it in the implementation?

haveblue
Aug 15, 2005



Toilet Rascal

dizzywhip posted:

Well I do a lot of Mac development, so I'm already used to working with arbitrary sizes and aspect ratios. It's not too bad.

I did a lot of Mac development before switching to iPhone when it came out, and it was pretty nice to get away from all that and just design for the single iPhone (until the iPad, at least).

dizzywhip
Dec 23, 2005

haveblue posted:

I did a lot of Mac development before switching to iPhone when it came out, and it was pretty nice to get away from all that and just design for the single iPhone (until the iPad, at least).

It is really nice from a design standpoint, although I still code my iOS UIs to theoretically support an arbitrary screen size. That's pretty important for supporting portrait/landscape orientations anyways, but it also makes it fairly trivial to support new screen sizes whenever they come out.

duck pond
Sep 13, 2007

Say, I've been playing around with iOS 8 extensions, shamelessly gunning for some low-hanging fruit and developing a custom keyboard -

While doing this, I can't get it to debug properly, or even print an NSLog at all! Especially terrifying as I keep apparently running up against the extension's memory limit, and all I get is

code:
viewServiceDidTerminateWithError:: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=0xb006400 {Message=Service Connection Interrupted}
before the service is teminated...

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Extensions are sandboxed so that could maybe be why you can't log??? Iunno :(

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

All this sandbox talk made me hopeful that they'd exposed the XPC Services in iOS8, for doing things like running WebKit out of process. Alas.

haveblue
Aug 15, 2005



Toilet Rascal

Subjunctive posted:

All this sandbox talk made me hopeful that they'd exposed the XPC Services in iOS8, for doing things like running WebKit out of process. Alas.

I think this is what's actually going to happen behind the scenes with UIWebView. They mentioned in the keynote that one of the side effects of the extension mechanism was that third-party apps will be given access to the high-performance javascript runtime and that seems like a natural way to do it.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

haveblue posted:

I think this is what's actually going to happen behind the scenes with UIWebView. They mentioned in the keynote that one of the side effects of the extension mechanism was that third-party apps will be given access to the high-performance javascript runtime and that seems like a natural way to do it.

That would be fantastic. Doubly so if they can figure out how to do it with the direct JSC access.

Toady
Jan 12, 2009

Subjunctive posted:

All this sandbox talk made me hopeful that they'd exposed the XPC Services in iOS8, for doing things like running WebKit out of process. Alas.

WKWebView is the new API on iOS 8 and OS X 10.10.

Pivo
Aug 20, 2004


when is Cordova gonna release iOS 8 compatible poo poo, I'm going to be so hosed when this release drops if they're not ready

Gotta update from 3.0.0 and we've hacked the poo poo out of it, it's gonna be SO much fun

Kallikrates
Jul 7, 2002
Pro Lurker

Doh004 posted:

Say I'm implementing a protocol that has a property. Do you guys prefer to autosynthesize the property by putting it in the class' interface in the .h, or just synthesize it in the implementation?

Might depend if your conformance is something you want to make public. If so .h, if not .m

Doctor w-rw-rw-
Jun 24, 2008

Subjunctive posted:

All this sandbox talk made me hopeful that they'd exposed the XPC Services in iOS8, for doing things like running WebKit out of process. Alas.

Running WK out of process: yes.
Using XPC directly: no. :(

I was pretty excited too, but from my questions at WWDC, I wouldn't expect it until iOS 9 at the earliest, if at all. Extensions are also powered by XPC - if they plan to enable it on iOS, Apple's probably taking it slow and building things on top of XPC that they'd like to see people use it for first.

They also appear to be looking into deeper iOS-Javascript integration, but it's early stages.

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe

Doh004 posted:

Say I'm implementing a protocol that has a property. Do you guys prefer to autosynthesize the property by putting it in the class' interface in the .h, or just synthesize it in the implementation?

If by "synthesize it in the implementation" you mean "put a @synthesize statement in the .m file for that property" then no, there's rarely a good reason to do that anymore.

If the property needs to be public, put it in the header file. If not, put it in the implementation file. Properties declared in either the header or the implementation file can both be autosynthesized.

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