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
orenronen
Nov 7, 2008

This one stumped me for an hour or so today. Ultimately, I think this is a case where Apple is technically correct but is doing something dumb.

We got a report that searches containing the quotation mark character aren't returning results in our iOS app. This was baffling, because both our website and our Android application, which uses the same web service, work just fine.

The problem turned out to be that when using the Hebrew keyboard in iOS, Apple maps the quotation mark key to unicode U+05F4, "Hebrew Punctuation Gershayim". In the real world, pretty much every computer application is using the good old ASCII quotation mark character, and the only people who care about the tiny visual difference between the two characters are typesetters and designers. Apple's own OS X Hebrew keyboard layout uses the regular quotation mark, as do Windows and Android. I'm sure our application isn't the only one broken by this.

Adbot
ADBOT LOVES YOU

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
Has anybody messed around with app ownership transfers yet? I've recently migrated an app to a different account and noticed that its in-app-purchases are no longer showing up in the app store version. They show up just fine under Simulator though, but I can't run the app on a device yet because the new account has no signing key nor a single provisioning profile :| I imagine that might be part of the issue?

It's an odd situation because the new account has apps in the App Store in it, but it also has no keys or profiles. I imagine you're expected to create new ones for the same apps, which sounds like a giant PITA if you have many apps.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
On an unrelated note, is there a replacement for the UIDevice's uniqueIdentifier method that would return the same exact value?

The guy who wrote the first draft of an app I'm working with now has made sure to make uniqueIdentifier the primary key for every single user and use that to keep track of IAPs, scores, user-generated submissions etc. Basically if I don't have that value, I can't find out anything about the user from the api we're using. Apple also decided not to let you submit code with that call in it anymore, which is reasonable since they were complaining about its deprecation for over a year.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

DreadCthulhu posted:

On an unrelated note, is there a replacement for the UIDevice's uniqueIdentifier method that would return the same exact value?

Nope, they didn't just rename the method. It's gone.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
Be slightly wary of using MKStoreKit, it's accumulated over 80 issues and 16 pull requests at this point and was updated last 5 months ago. Apple won't accept anything committed with it, because of deprecated API use similar to what I mentioned above, unless you make a manual fix to some of the code. I've used it fine myself, but you probably want to dig through the code make sure you understand it.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

DreadCthulhu posted:

On an unrelated note, is there a replacement for the UIDevice's uniqueIdentifier method that would return the same exact value?

The guy who wrote the first draft of an app I'm working with now has made sure to make uniqueIdentifier the primary key for every single user and use that to keep track of IAPs, scores, user-generated submissions etc. Basically if I don't have that value, I can't find out anything about the user from the api we're using. Apple also decided not to let you submit code with that call in it anymore, which is reasonable since they were complaining about its deprecation for over a year.

There's an identifierForVendor that's basically the same concept. It's different from app to app, and from device to device. It's a really poo poo way to identify users, though, because you're guaranteed to "lose" the user if they get their device replaced. Use the GameKit identifier or something.

Also apps in the store already using uniqueIdentifier in the app store are gonna start reporting a completely different value as of iOS 7. It's the deviceIdentifier padded with Fs, if I remember correctly.

lord funk
Feb 16, 2004

I just submitted a UI/Usability request through the bug reporter for UIPopoverController screen dimming to have a toggle. The new behavior in 7 automatically dims the screen behind it, but that doesn't make sense when the popover allows for user interaction (adding views to its 'passthroughViews' property).

The dimming makes sense for an alert view, because it really is the sole focus when it appears. But if you have a popover that allows for interaction behind it, it's sending the wrong message.

Only registered members can see post attachments!

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

orenronen posted:

This one stumped me for an hour or so today. Ultimately, I think this is a case where Apple is technically correct but is doing something dumb.

We got a report that searches containing the quotation mark character aren't returning results in our iOS app. This was baffling, because both our website and our Android application, which uses the same web service, work just fine.

The problem turned out to be that when using the Hebrew keyboard in iOS, Apple maps the quotation mark key to unicode U+05F4, "Hebrew Punctuation Gershayim". In the real world, pretty much every computer application is using the good old ASCII quotation mark character, and the only people who care about the tiny visual difference between the two characters are typesetters and designers. Apple's own OS X Hebrew keyboard layout uses the regular quotation mark, as do Windows and Android. I'm sure our application isn't the only one broken by this.

Your web service doesn't handle Unicode input properly.

You can try CFStringTransform with kCFStringTransformToLatin but I don't know that it translates that punctuation mark. However that's a terrible idea because then you get inconsistent results between platforms.

Your web service should be doing a conversion to normalized forms. This applies to indexing, lookups, hash tables in many cases, etc. Whatever the case, you should be matching the same record whether the user types in "中文" vs "zhōng wén", or "resumè" vs "resume". There are also multiple ways to encode stuff like diacritics so if you aren't normalizing those strings that appear identical will in fact be byte-different; bonus points for coworkers who don't know and mix ordinal, invariant, and culture-aware string comparisons. Punctuation marks also have equivalency categories, in this case "Punctuation - Final" and "Puctuation - Initial" though for our cases they can generally be considered the same.

Depending on the situation this is also a great way to introduce massive security holes or bugs when the values are primary keys, usernames, passwords, etc. For example, converting a UTF-16 password to bytes for hashing using ASCII, which will spit out the unknown character code point for everything not in the basic lower ASCII set, or worse map it to the system code page for the upper characters in which case a bunch of French, Chinese, Japanese, etc people get to unknowingly share the same password regardless of what they type in.


Every string comparison should be checked for the kind of comparison you want to do and noted as having been reviewed (eg: usernames compared invariant normalized so they are treated identically no matter who input them, with what keyboard, etc). Same deal for any output to a file/stream, hashing, etc.



Edit: for some insane reason that Hebrew quote is listed in the "Puctuation - Other" category. Unicode is hard, mostly because humans are easily offended tribalistic assholes.

Simulated fucked around with this message at 19:29 on Jul 5, 2013

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

lord funk posted:

I just submitted a UI/Usability request through the bug reporter for UIPopoverController screen dimming to have a toggle. The new behavior in 7 automatically dims the screen behind it, but that doesn't make sense when the popover allows for user interaction (adding views to its 'passthroughViews' property).

The dimming makes sense for an alert view, because it really is the sole focus when it appears. But if you have a popover that allows for interaction behind it, it's sending the wrong message.



I think it's a question of intent. Pass through view is basically there to allow the user to dismiss the popover with the same button they brought it up with. Popovers are modal in intent: you interact with the popover only while it is onscreen according to my reading of the HIG. Dimming visually reinforces this. Maybe things changed in 6 or something, but that dimming behavior seems fine to me, since popovers are meant to be quickly used then dismissed.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Lumpy posted:

I think it's a question of intent. Pass through view is basically there to allow the user to dismiss the popover with the same button they brought it up with. Popovers are modal in intent: you interact with the popover only while it is onscreen according to my reading of the HIG. Dimming visually reinforces this. Maybe things changed in 6 or something, but that dimming behavior seems fine to me, since popovers are meant to be quickly used then dismissed.

I'm not so sure.

iOS 6.1 HIG posted:

Popovers and modal views are similar, in the sense that people typically can’t interact with the main view while a popover or modal view is open. But a modal view is always modal, whereas a popover can be used in two different ways:

  • Modal, in which case the popover dims the screen area around it and requires an explicit dismissal. This behavior is very similar to that of a modal view, but a popover’s appearance tends to give the experience a lighter weight.
  • Nonmodal, in which case the popover does not dim the screen area around it and people can tap anywhere outside its bounds (including the control that reveals the popover) to dismiss it. This behavior makes a nonmodal popover seem like another view in the app.

I see nothing to counter this in the iOS 7 HIG. The position seems to consistently avoid framing popovers as strictly modal views.

(Obviously, whether the UIPopoverController class functions according to the HIG is another question entirely. If it doesn't, that's a bug in either the class or the HIG.)

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

pokeyman posted:

I'm not so sure.


I see nothing to counter this in the iOS 7 HIG. The position seems to consistently avoid framing popovers as strictly modal views.

(Obviously, whether the UIPopoverController class functions according to the HIG is another question entirely. If it doesn't, that's a bug in either the class or the HIG.)

Yeah, it is kind of vague, but even the non-dimming non-modal description you quoted states that tapping anywhere outside of the popover should dismiss it. To me that reads as "while the popover is up, you either interact with it or get rid of it when you tap anywhere outside of it." I guess there are use cases for not wanting dimming to see the results of actions in the popover (like color picker for font or something) without the fade interfering, but the 'leave the popover up while you use the app' case still seems sketchy to me, and reading what you quoted reinforces that.

So, yes, there probably be a non-dimming option, but not for the reasons lord funk wants it. :)

lord funk
Feb 16, 2004

Lumpy posted:

Yeah, it is kind of vague, but even the non-dimming non-modal description you quoted states that tapping anywhere outside of the popover should dismiss it. To me that reads as "while the popover is up, you either interact with it or get rid of it when you tap anywhere outside of it."
The class reference is pretty clear that it's okay to allow for touches outside the popover:

UIPopoverController Class Reference posted:

When displayed, taps outside of the popover window cause the popover to be dismissed automatically. To allow the user to interact with the specified views and not dismiss the popover, you can assign one or more views to the passthroughViews property. Taps inside the popover window do not automatically cause the popover to be dismissed. Your view and view controller code must handle actions and events inside the popover explicitly and call the dismissPopoverAnimated: method as needed.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Lumpy posted:

Yeah, it is kind of vague, but even the non-dimming non-modal description you quoted states that tapping anywhere outside of the popover should dismiss it. To me that reads as "while the popover is up, you either interact with it or get rid of it when you tap anywhere outside of it." I guess there are use cases for not wanting dimming to see the results of actions in the popover (like color picker for font or something) without the fade interfering, but the 'leave the popover up while you use the app' case still seems sketchy to me, and reading what you quoted reinforces that.

So, yes, there probably be a non-dimming option, but not for the reasons lord funk wants it. :)

The HIG doesn't say "popovers are modal". You're extrapolating, and in fact I largely agree with you, but that's not canonical HIG.

lord funk posted:

The class reference is pretty clear that it's okay to allow for touches outside the popover:

Well, no, the class reference is pretty clear that it's possible to allow for touches outside the popover. Doesn't mean it's a good idea!

lord funk
Feb 16, 2004

pokeyman posted:

Well, no, the class reference is pretty clear that it's possible to allow for touches outside the popover. Doesn't mean it's a good idea!

Right, but we're getting pretty pedantic here. In my case people want to continue playing the instrument while they look for the next patch. That's a good reason not to dismiss the popover with touches outside the popover.

In other news I'm tired of collection views again. Go home, cell; you are drunk.

Only registered members can see post attachments!

Bozart
Oct 28, 2006

Give me the finger.
Hopefully this is the right place for a homebrew question:

I've set up a formula after forking someone else's and I'm having difficulty getting a test to run correctly - the problem is pretty self explanatory at https://github.com/Bozart/homebrew-mono/blob/master/mono.rb

Basically I try to compile and run a hello world in mono but it errors out, and it doesn't help that I am completely clueless in ruby, homebrew, and osx in general. Also I think the same problem exists in the go lang formula, because I get an error with that one's test as well, and that's where I got the hello world test code from.

So what am I doing wrong in the mono formula? brew install mono --devel works correctly, and that's all I'm working on right now.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
Have you tried compiling it from scratch and running the test outside of homebrew?

quote:

Prerequisite: the OSX build expects autotools and dependency libraries from Xcode's standard toolchain. If you have macports or fink installed, disable them when you are building mono. (e.g. remove /opt/local/bin

Homebrew fits that bill. Are you specifically trying to make it work with homebrew for some reason?

also line 39:
code:
(testpath/'hello.cs').write <<-EOS.undent
should probably be
code:
 ('#{testpath}/hello.cs').write <<-EOS.undent
testpath might also need to be defined but I dont know if it comes from homebrew somewhere.

DONT THREAD ON ME fucked around with this message at 05:54 on Jul 7, 2013

Doctor w-rw-rw-
Jun 24, 2008
When it comes to installing language platforms I tend to prefer to go outside of homebrew - though don't get me wrong, it's great for all kinds of open-source projects. Consider installing mono from outside homebrew, using whatever installation packages are officially provided.

kitten smoothie
Dec 29, 2001

edit: n/m

kitten smoothie fucked around with this message at 05:54 on Jul 8, 2013

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
I found this on a design blog, but seems very appropriate to post here: Teehan-Lax posted about messing with collection view in a calendar app named Upcoming, which they created to explore UI stuff. That in and of itself is pretty cool but they talk about Reactive Cocoa which seems pretty interesting and / or cool.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I haven't actually written anything that uses ReactiveCocoa yet, but the one question in my mind when reading about it last year was "how does this work with collection/table views?" I don't have a complete answer but "a signal that delivers arrays" had eluded me.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

pokeyman posted:

I haven't actually written anything that uses ReactiveCocoa yet, but the one question in my mind when reading about it last year was "how does this work with collection/table views?" I don't have a complete answer but "a signal that delivers arrays" had eluded me.

Teehan+Lax open sourced all their code for that app, so go find out!

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Lumpy posted:

Teehan+Lax open sourced all their code for that app, so go find out!

That's what I was looking at. Makes sense for collections that don't change much, but my complete answer would basically include the ReactiveCocoa equivalent of NSFetchedResultsController. Someday I'll actually make something with ReactiveCocoa and figure it out!

Captain Pike
Jul 29, 2003

I have two questions about iAds:

I have written interactive javascript code that pans the 'camera' around a quasi-3D jpg image. I have gotten this code to appear in my iAd, but I do not know if Apple will accept the way I have done it.

1. The initial 'Banner' portion: iAd Producer only provides widgets for images, text, and 'view'. However, exported iAds are just HTML and .js files. I have hand-edited the banner files and I have added javascript to them, to display my 3D effect in the banner. Is this allowed?

2. The 'Main Page' ad section: I was able to import all of my javascript files into iAd Producer, and use the 'HTML' widget to create my 3D scene. However, iAd has written the javascript file includes in the incorrect order. I hand-edited the index.html file to correct this. Will this be allowed?

movax
Aug 30, 2008

Just to be sure, if I want to write a little app for myself that serves as a private tracking beacon and run it on (pretty much) only my iPhone, my only option is a developer account, correct?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

movax posted:

Just to be sure, if I want to write a little app for myself that serves as a private tracking beacon and run it on (pretty much) only my iPhone, my only option is a developer account, correct?

The $100 iOS Developer Program membership is what you want. (Or I should say "need"; it's pretty lame that you need to fork out $100 to put just your app on just your phone.)

movax
Aug 30, 2008

pokeyman posted:

The $100 iOS Developer Program membership is what you want. (Or I should say "need"; it's pretty lame that you need to fork out $100 to put just your app on just your phone.)

$100 a year for that privilege :( Early access to iOS / OSX betas though I guess.

But, I don't have to deploy it publicly, that just gives me the power to run whatever apps I create on my own iPhone / any other UUIDs I add as a tester or something?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

movax posted:

$100 a year for that privilege :( Early access to iOS / OSX betas though I guess.

Just iOS. OS X betas are another $100 a year.

quote:

But, I don't have to deploy it publicly, that just gives me the power to run whatever apps I create on my own iPhone / any other UUIDs I add as a tester or something?

With the $100 membership you can deploy any number of apps on up to 100 different devices. Submitting an app to the App Store (aka deploying your app publicly) is an entirely optional, separate process.

kitten smoothie
Dec 29, 2001

I've not tried it, but it seems like if you jailbreak you can do some monkeying with Xcode to get it to install and run things with invalid signatures (paying Apple a C-note gets you the signing key to deploy to your own device). So maybe that's an option if you're not above jailbreaking and you only care about running this on your phone and not anyone else's.

http://iphonedevwiki.net/index.php/Xcode#Developing_without_Provisioning_Profile

Toady
Jan 12, 2009

pokeyman posted:

Just iOS. OS X betas are another $100 a year.

Should be noted that you also get the final releases of OS X for free, though that admittedly has a little less value now that they're only $20.

wolffenstein
Aug 2, 2002
 
Pork Pro

movax posted:

Just to be sure, if I want to write a little app for myself that serves as a private tracking beacon and run it on (pretty much) only my iPhone, my only option is a developer account, correct?

Or use Find My iPhone.

Doh004
Apr 22, 2007

Mmmmm Donuts...
I've been doing iOS development for coming up on a year now, and I still haven't found a good way to do dynamically sized UITableViewCell's that doesn't involve prerendering the cell to get its height before cellForRowAtIndexPath. Am I missing something super obvious here?

Doc Block
Apr 15, 2003
Fun Shoe
Shouldn't you be able to compute it based on certain metrics? You can find out how big the text will be, plus the sizes of any other elements, so that + the top and bottom margins = cell height.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doh004 posted:

I've been doing iOS development for coming up on a year now, and I still haven't found a good way to do dynamically sized UITableViewCell's that doesn't involve prerendering the cell to get its height before cellForRowAtIndexPath. Am I missing something super obvious here?

Use NSString's -sizeWithFont: and similar methods to figure out text size. Everything else should already have its height available to you.

bumnuts
Dec 10, 2004
mmm...crunchy

Doc Block posted:

Shouldn't you be able to compute it based on certain metrics? You can find out how big the text will be, plus the sizes of any other elements, so that + the top and bottom margins = cell height.

This is basically my pattern, but I do the calculation in a class method on my cell subclass. That way you can share internal constants (font sizes, padding, etc) without having to expose them in the header. In any controller that uses the cell it's as returning [SomeCell heightForObject:someModelObject].

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

bumnuts posted:

This is basically my pattern, but I do the calculation in a class method on my cell subclass. That way you can share internal constants (font sizes, padding, etc) without having to expose them in the header. In any controller that uses the cell it's as returning [SomeCell heightForObject:someModelObject].

That's a good idea. And if you're like me and prefer to keep your cells oblivious to your models, your method can be something like +[Cell heightForCellWithText:width:].

Doc Block
Apr 15, 2003
Fun Shoe
Just remember that NSString+UIKit's method -sizeWithFont:forWidth:lineBreakMode: is broken (only returns the width, the height is always returned as the height of one line regardless of how many lines it would actually take), and has been broken forever. Apple doesn't seem to care about fixing it.

Instead, use -sizeWithFont:constrainedToSize:lineBreakMode: instead, with the height of the size constraint set to something reasonable.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Doc Block posted:

Shouldn't you be able to compute it based on certain metrics? You can find out how big the text will be, plus the sizes of any other elements, so that + the top and bottom margins = cell height.

I have custom cells that have more than just text - bunch of subviews. I also reuse the cells for performance reasons. The issues comes from the fact that once a cell is queued, its heightForRowAtIndexPath is never called again. So the first time it loads, I could calculate its height just fine by myself, but as I'm scrolling down and it gets reused, it'll reuse the old height.

Could you call reloadRowsAtIndexPaths:<#(NSArray *)#> withRowAnimation:<#(UITableViewRowAnimation)#> while scrolling? I feel like that'd be a big performance hit.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doh004 posted:

I have custom cells that have more than just text - bunch of subviews. I also reuse the cells for performance reasons. The issues comes from the fact that once a cell is queued, its heightForRowAtIndexPath is never called again. So the first time it loads, I could calculate its height just fine by myself, but as I'm scrolling down and it gets reused, it'll reuse the old height.

That's not right. The table view will call -tableView:heightForRowAtIndexPath: as you scroll regardless of whether you reuse cells. Are you sure that method is not called on your delegate as you scroll?

Doh004
Apr 22, 2007

Mmmmm Donuts...

pokeyman posted:

That's not right. The table view will call -tableView:heightForRowAtIndexPath: as you scroll regardless of whether you reuse cells. Are you sure that method is not called on your delegate as you scroll?

I think you're partially right? It gets called when you set the data source and reloadData gets called for all of the rows, even ones that aren't visible yet. At least that's what I'm currently seeing with my NSLogs.

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
So just calculate it then.

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