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
Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

Doctor w-rw-rw- posted:

Apologies, this was the common wisdom when I was doing iOS dev pre-iPad, pre-iPhone 3GS even. I haven't revisited localization since then. Should have thought more about that. My more recent iOS dev was mostly iterating on an English-only app.

tare: how much of it can you automate, i.e. with UIAutomation and captureScreenWithName?

It's all good; I finally got UIAutomation going so at least I can rip through the 180 screenshots in a somewhat automated way, but if you use the names (accessibility labels) its useless because those get translated too... So you have to access everything by index, which is fairly brittle.

I will say that German has had the best sales for me, like double the next which is Japan. Of course the US is #1 by such a ridiculous margin, then the commonwealth countries UK/Canada/Australia/NZ next (25% of US), then Germany (like 10% of commonewealth), then Japan, then France, then the Spanish countries.

Localizing to Chinese was a massive waste.


I haven't tried Korean, Russian, Italian, Dutch, etc so far.

Simulated fucked around with this message at 15:57 on Jan 17, 2013

Adbot
ADBOT LOVES YOU

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
A bit of a noobish question here: on the iPad version, I have a couple of visible controllers up at all times. One of them displays a bunch of stubbed content when the app initially loads, but then eventually it should refresh itself when it receives a notification through NSNotificationCenter and display the final data.

What I'm seeing though is that modifying the view doesn't seem to redraw it right away. In fact I have to wait 5-20 seconds for the new content to suddenly appear on the screen. Same thing if I pop open a full-screen modal and close it, viewDidLoad for that controller kicks in and displays the correct content.

I imagine I might have to force the view to be re-drawn on the screen, or is that always wrong and thus I should be using a more idiomatic approach to this problem?

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

DreadCthulhu posted:

A bit of a noobish question here: on the iPad version, I have a couple of visible controllers up at all times. One of them displays a bunch of stubbed content when the app initially loads, but then eventually it should refresh itself when it receives a notification through NSNotificationCenter and display the final data.

What I'm seeing though is that modifying the view doesn't seem to redraw it right away. In fact I have to wait 5-20 seconds for the new content to suddenly appear on the screen. Same thing if I pop open a full-screen modal and close it, viewDidLoad for that controller kicks in and displays the correct content.

I imagine I might have to force the view to be re-drawn on the screen, or is that always wrong and thus I should be using a more idiomatic approach to this problem?

[self setNeedsDisplay] when the content is updated might do the trick.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

Ender.uNF posted:

[self setNeedsDisplay] when the content is updated might do the trick.

That was the first thing I tried, but it doesn't seem to do the trick. I could be doing this wrong though, no guarantee there.

I wonder if the fact that this specific controller is a "contained controller" under another controller screws something up in the redrawing. What's odd is that the same logic works perfectly fine on iPhone, when that controller occupies the whole screen. I receive the notification, the screen updates immediately. Not on iPad though.

Red Rox
Aug 24, 2004

Motel Midnight off the hook
Finally got my first app up on the app store! So proud of myself - pretty much learnt everything from scratch starting in August last year.

Stackoverflow and Ray Wenderlich are amazing resources when you get stuck. Any problem I had, someone else had figured it out already and posted about it there. Oh and of course lurking in this thread is great too.

If you want to check out my free app and give me some feedback it's called the NorthStar Battery App. It's kind of a specialized app for the telecom, datacenter and engine start industry, but I tried to make it easy for anyone to use.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
Ok, retard me. I was completely oblivious to the fact that NSNotificationCenter receives messages on the same queue they're sent to (or the system is simply synchronous, thus quite similar) and so I was modifying the view in the background queue. What surprises me is that there was nothing in the logs about it. I thought it always lets you know when you're modifying the UI from outside the main thread..

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

DreadCthulhu posted:

Ok, retard me. I was completely oblivious to the fact that NSNotificationCenter receives messages on the same queue they're sent to (or the system is simply synchronous, thus quite similar) and so I was modifying the view in the background queue. What surprises me is that there was nothing in the logs about it. I thought it always lets you know when you're modifying the UI from outside the main thread..

Ah, the always entertaining "behavior is undefined". It might do nothing, it might crash, it might cause your computer to vomit rainbows. All are equally valid responses! On dotnet WinForms and WPF have the same problem; only one UI thread and you had better be doing all your UI modifications on that thread or you'll be sorry.

Of course the answer is mainQueue or BeginInvoke respectively, which begs the question: why can't these drat UI toolkits just do that for me?

Zhentar
Sep 28, 2003

Brilliant Master Genius
A while back, when I was trying to figure out some random, drawing related crashes, I tried using swizzling to make it throw an exception when doing off-main thread UI work. I got it to work but it wasn't usable - UIKit was, as far as I could tell, intentionally splitting off some UITableView drawing onto a background thread. I'm still not sure that wasn't causing some of the issues I was seeing, either.

Plorkyeran
Mar 22, 2007

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

Ender.uNF posted:

Of course the answer is mainQueue or BeginInvoke respectively, which begs the question: why can't these drat UI toolkits just do that for me?
It would do very bad things to performance.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
I will have my cake and eat it too, thank you very much.

Doc Block
Apr 15, 2003
Fun Shoe
Weird. An update for an iPhone-only camera app I wrote was just rejected because the reviewer couldn't take pictures with it on an iPad. Except that I specifically tested it on an iPad, knowing that iPhone-only apps are still expected to work on iPads, and it works fine. Release builds, Ad-Hoc builds, etc., all work fine.

The iPad 2 and iPad mini have rear cameras, right? I only have an iPad 3 to test on.

tarepanda
Mar 26, 2011

Living the Dream
They do.

My app was waiting for review, then hit review after 3 days, then approved in under an hour. First submission.

It's great timing since we have a big expo today too...

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Added those links from last page to the 2OP, thanks!

Doc Block
Apr 15, 2003
Fun Shoe
There's also NSScreencast, which is byte sized iOS stuff, like how to use UIContainerView, etc. First few articles are free, to see anymore you need a $9/month subscription.

duck pond
Sep 13, 2007

Carthag posted:

A bunch of links

This is awesome and pretty definitive imo, thanks!

Was also wondering what everybody thought about this?

https://github.com/snakajima/neunode

snakajima posted:

neu.Node is an implementation of Node.js-compatible API for iOS devices, which allows the application developer to embed variety of micro servers (http server, chat server, proxy server, game server, etc.) in their iOS applications.

With neu.Node, iOS devices are no longer just "client" devices. They become network "nodes", which actively participate in providing distributed computing services and enriching the user experience.

neu.Node enables new breeds of applications, such as:
    • Server-less multi-player games
    • Ad-Hoc/local social networking applications
    • Peer-to-peer sharing, co-producing, and collaborations
    • Real-time media transport (such as security camera)
    • HTML5 apps with embedded proxy server for better caching and off-line support

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I don't get it. It's node.js running in a web view because ???

haveblue
Aug 15, 2005



Toilet Rascal
Because some people feel they have a need, nay, an obligation to port every open source project to every platform.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I mean we already have little http servers written in objective-c, too many "JavaScript-objective-c bridges"...

Doc Block
Apr 15, 2003
Fun Shoe
Because web developers.

tarepanda
Mar 26, 2011

Living the Dream
How do I understand the Sales and Trends page in iTunes Connect?

If I'm in the daily view, it shows 3, 70, and 69 for the last three days and below the graph, the breakdowns of the numbers for the selected day, which is fine.

But if I switch to weekly view, I get 142 downloads. The math works out there. But the numbers on the "Top Markets" chart only total to 84? What gives? Did I really have 58 downloads from other countries?

Paolomania
Apr 26, 2006

Noob problem with UIWebView that is driving me nuts:

Context:
1. I am working on a storyboard app that I started from scratch. I like starting from scratch and wiring up the storyboard has not been a problem.
2. The initial view controller is a vanilla UINavigationController. The app is mostly a hierarchical navigation of various menus and content pages, but deeper and more varied than the Master/Detail template.
3. The root view controller of the nav controller is a vanilla UIViewController with a few controls, one of which is an "About" button.
4. Pressing the "About" button should segues to a view displaying a nicely formatted 'about' page that will be larger than the device display. Judging from the data views at my disposal, and Interface Builder's ease-of-use, it would appear that formatting content like this is better done in a HTML resource and displayed in a UIWebView than constructed using various UIKit objects (is this correct?).
5. In my attempt to use a UIWebView to display a nicely formatted 'about' page, it appears that the only way to get local content into a UIWebView is by sending a message such as loadHTMLString or loadData (is this correct?)
6. From the documentation that I can find it seems that such messages should be sent by the parent ViewController of the WebView in response to something like a viewWillAppear or viewDidLoad event, and thus will require a custom ViewController.
7. I created a custom AboutViewController that has an outlet for a WebView, wired up an instance of it as the target of the 'About' button segue from the root view controller, and wired up a UIWebView as its child and connect it to the outlet.
8. The custom view controller appears to never be getting messages such as viewDidLoad or viewWillAppear. It never hits breakpoints set in implementations for these.
9. Testing with a single-view application definitely shows that this technique of initializing WebViews works in other contexts, so I can only conclude that I am missing something about how navigation controllers work - which is frustrating because I've been scouring xcode's own docs such as "UI Navigation Controller Class Reference" and can find no warnings about such events being swallowed up.

Code for my custom view controller that is the target of the segue:
code:
@interface AboutViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIWebView *webview;
@end

code:
@implementation AboutViewController
- (void) viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [_webview loadHTMLString:@"<html><body><h1>TEST</h1></body></html>" baseURL:nil];
}

-(void) viewDidLoad
{
    [super viewDidLoad]
    [_webview loadHTMLString:@"<html><body><h1>TEST</h1></body></html>" baseURL:nil];
}
@end
The WebView is a child of an AboutViewController and hooked up to its _webview outlet. All I get after the segue to the AboutViewController is a blank page. I have to be missing something pretty basic here.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Paolomania posted:

Noob problem with UIWebView that is driving me nuts:


90% of the time when this happens to me, it's because I forgot to change the class of the view controller in my storyboard from UIViewController to MyCustomViewController.

As for loading your HTML into you UIWebView, correct, you either load a string or a loadData to the view a la:

code:
NSString* path = [[NSBundle mainBundle] pathForResource:@"myFile" ofType:@"html"];
NSURL* url = [NSURL fileURLWithPath:path];
NSURLRequest* request = [NSURLRequest requestWithURL:url] ;
[_webView loadRequest:request];
or

code:
NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"myFile" ofType:@"html"]; 
NSString *htmlString = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil];
[_webView loadHTMLString:htmlString baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] resourcePath]]];
The second example is in the viewDidLoad of a navigation-based app I have in the store, so I know it works in that context.

I found cleaning target helps a lot too when wondering why changes in web views weren't showing up; maybe it clears the view's cache or something? :iiam:

Paolomania
Apr 26, 2006

Thanks. I cleared the simulator's content and it worked.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Is the iOS 6.0 simulator busted in regards to app rotation? We have an iPad app that was built for 5.1 and is landscape only. It works fine in the 5.1 simulator and on all versions of iOS 5 and 6 on the actual devices but when I try to run it from Xcode in the 6.0 simulator all of the views are rotated 90° counter-clockwise.

I found this thread that sounds similar to my issue but the answer posted there doesn't seem to work at all. Has anyone else seen this? I know the simulators have their quirks and bugs but as of now I can't use the iOS 6 one with my app at all.

burmart
Sep 14, 2002

10,000 Cunts
I'm not quite sure where I would even start to ask these questions, but as far as I can tell, this is the best place.

I've created spreadsheets for several things, utilizing vbasic for some of the functions. If all that stuff is already done, how difficult would it be to have an app developer turn it into a usable app for me?

What I'd like is my sales guys to be able to run the quote and other spreadsheets while they're at a meeting, and have a quote/engagement agreement ready for signature immediately. So, bonus points for having the ability to sign a document with a stylus on the ipad.

Would this be a super costly thing? Where would I even find good freelancers to do this for me?

Is this totally the wrong place to ask this question? Is it possible to have the app only available to my salesguys and not the general public through the app store?

I know, very dumb basic questions for this thread, but I'm not quite sure how to proceed.

burmart fucked around with this message at 23:25 on Jan 22, 2013

tarepanda
Mar 26, 2011

Living the Dream
I'm really weirded out now.

I pushed out an update to change a few things my boss isn't a fan of. No major changes, just some UI stuff.

When I uploaded the binary, I checked the control panel for the app -- the current version has the icon with the gloss etc. applied, the newest version that I just uploaded... doesn't? Has something changed in the last week or is this normal?

lord funk
Feb 16, 2004

tarepanda posted:

I'm really weirded out now.

I pushed out an update to change a few things my boss isn't a fan of. No major changes, just some UI stuff.

When I uploaded the binary, I checked the control panel for the app -- the current version has the icon with the gloss etc. applied, the newest version that I just uploaded... doesn't? Has something changed in the last week or is this normal?

This happened to me in reverse. You can contact Apple through iTunes connect and they'll fix it for you.

tarepanda
Mar 26, 2011

Living the Dream

lord funk posted:

This happened to me in reverse. You can contact Apple through iTunes connect and they'll fix it for you.

I went to get a screenshot of it for reporting and it fixed itself. Go figure.

Thanks.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

burmart posted:

I'm not quite sure where I would even start to ask these questions, but as far as I can tell, this is the best place.

I've created spreadsheets for several things, utilizing vbasic for some of the functions. If all that stuff is already done, how difficult would it be to have an app developer turn it into a usable app for me?

What I'd like is my sales guys to be able to run the quote and other spreadsheets while they're at a meeting, and have a quote/engagement agreement ready for signature immediately. So, bonus points for having the ability to sign a document with a stylus on the ipad.

Would this be a super costly thing? Where would I even find good freelancers to do this for me?

Is this totally the wrong place to ask this question? Is it possible to have the app only available to my salesguys and not the general public through the app store?

I know, very dumb basic questions for this thread, but I'm not quite sure how to proceed.

It depends what you're looking to do. If you're just talking about converting the entire thing into an app, that's going to take longer than taking input from a given spreadsheet, crunching numbers, and creating a quote/agreement generated on that basis. If you're only going to be using the app in-house, you'll want to enter into the enterprise developer program, which allows you to bypass the App Store in a legitimate, legal fashion. The cost is $299/year, and that's going to be a fairly small amount compared to what you'll pay to have the app developed. Depending on the complexity of the spreadsheets, data manipulation, network integration, etc., etc. I'd say you're looking at a minimum of $5000, and it's hard to give an upper bound without knowing more about the spreadsheets involved and the exact functionality you need. This is obviously a very quick estimate, but in general there aren't many apps which are going to come in significantly under that number.

In terms of finding a freelance developer, I've picked up work from this forum before, and I'm guessing other developers around here have as well. Apart from that, I'd really have no idea where best to look, as I've picked up all my app development contracts from people I know in person.

Built 4 Cuban Linux
Jul 15, 2007

i own america
Hey guys. Quick question and I can't figure out the correct way to search for this on google. Can I type an id pointer after initializing it? (I know I phrased that poorly, part of the reason I can't find an answer. For example:

code:
id thing = [game returnObject];
if([thing isKindOfClass:[Player class]]) {
// make thing a Player* pointer, permanently
} else if ([thing isKindOfClass:[Enemy class]]) {
// make thing an Enemy* pointer, permanently
}
So I don't have to type it like (Player*)thing or (Enemy*)thing every single time for the rest of the method.

Carthag Tuek
Oct 15, 2005

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



Usually you don't even need to cast, it should only be necessary if there are conflicting method signatures (ie selectors with the same name but different params/return values). But anyway, if all calls made after the if-blocks are equally valid on Enemy- and Player-classes, I'd do one of two things:

Either use their common superclass which should be where their common methods/properties are defined anyway:
Objective-C code:
GameObject *thing = [game returnObject];
// do things 
Or put the common method definitions in a category that they can both implement:
Objective-C code:
id<GameObject> thing = [game returnObject];
// do things 
That way you don't have to do any logic.

tarepanda
Mar 26, 2011

Living the Dream
code:
id thing = [game returnObject];

if([thing isKindOfClass:[Player class]])
    // make thing a Player* pointer, permanently
    Player *curr_player = (Player *)thing;
else if ([thing isKindOfClass:[Enemy class]])
    // make thing an Enemy* pointer, permanently
    Enemy *curr_enemy = (Enemy *)thing;

dizzywhip
Dec 23, 2005

To answer your question, no, you can't change the type of a variable after you've declared it. You would have to create separate variables with the types you want and have them all point to the same object.

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

Yodzilla posted:

Is the iOS 6.0 simulator busted in regards to app rotation? We have an iPad app that was built for 5.1 and is landscape only. It works fine in the 5.1 simulator and on all versions of iOS 5 and 6 on the actual devices but when I try to run it from Xcode in the 6.0 simulator all of the views are rotated 90° counter-clockwise.

I found this thread that sounds similar to my issue but the answer posted there doesn't seem to work at all. Has anyone else seen this? I know the simulators have their quirks and bugs but as of now I can't use the iOS 6 one with my app at all.

They changed how rotation works in iOS 6 so you may be running into that problem. Finding a clear, concise explanation of exactly what was changed and what you need to do to fix it was seemingly impossible for me, I ended up just fussing with the views and whatnot until I got it working correctly. If I recall, previously if a container like UINavigationController or UITabController were the root, they would end up controlling rotation so I had to use a category to take over and return the proper allowed rotations, but under iOS 6 it seems like the view itself is responsible for vending what rotations it can support (supportedInterfaceOrientations I think), and the App delegate and/or parent view controllers get an opportunity to veto that if they want. I can't remember clearly, we just had a baby so I am running on zero sleep.



tarepanda posted:

I went to get a screenshot of it for reporting and it fixed itself. Go figure.

Thanks.

Do you mean in iTunes Connect or on actual devices? My app always shows the wrong icon in iTC before approval, then it eventually corrects itself.

Jam2
Jan 15, 2008

With Energy For Mayhem

Built 4 Cuban Linux posted:

Hey guys. Quick question and I can't figure out the correct way to search for this on google. Can I type an id pointer after initializing it? (I know I phrased that poorly, part of the reason I can't find an answer. For example:

code:
id thing = [game returnObject];
if([thing isKindOfClass:[Player class]]) {
// make thing a Player* pointer, permanently
} else if ([thing isKindOfClass:[Enemy class]]) {
// make thing an Enemy* pointer, permanently
}
So I don't have to type it like (Player*)thing or (Enemy*)thing every single time for the rest of the method.

Beating a dead horse:

You can initialize two new pointers of the specific types and set them to point to the object.

tarepanda posted:

code:
id thing = [game returnObject];

if([thing isKindOfClass:[Player class]])
    // make thing a Player* pointer, permanently
    Player *curr_player = (Player *)thing;
else if ([thing isKindOfClass:[Enemy class]])
    // make thing an Enemy* pointer, permanently
    Enemy *curr_enemy = (Enemy *)thing;

Note that if you do it this way, the pointers will not be in scope outside of the if/else blocks.

tarepanda
Mar 26, 2011

Living the Dream
That was a sloppy mistake on my part, ugh. I've been doing too much Python lately.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch

Ender.uNF posted:

They changed how rotation works in iOS 6 so you may be running into that problem. Finding a clear, concise explanation of exactly what was changed and what you need to do to fix it was seemingly impossible for me, I ended up just fussing with the views and whatnot until I got it working correctly. If I recall, previously if a container like UINavigationController or UITabController were the root, they would end up controlling rotation so I had to use a category to take over and return the proper allowed rotations, but under iOS 6 it seems like the view itself is responsible for vending what rotations it can support (supportedInterfaceOrientations I think), and the App delegate and/or parent view controllers get an opportunity to veto that if they want. I can't remember clearly, we just had a baby so I am running on zero sleep.

OK so I figured it out for my project at least. I guess the old shouldAutorotateToInterfaceOrientation works just fine as none of the new methods that I'm finding as solutions are ever being called and don't make a drat bit of difference. It turns out as per this thread in my AppDelegate's didFinishLaunchingWithOptions I had to change
code:
[self.window addSubview:navigationController.view];
to
code:
[self.window setRootViewController:navigationController];
I still don't get WHY this is the case and it seems there's some confusion in the community as well but at least my app doesn't blow up any more.


e: for a positive iOS6 experience, the fact that you can use Safari to inspect WebViews in an app running in a simulator or attached device is pretty baller

Yodzilla fucked around with this message at 17:53 on Jan 23, 2013

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
This is a bit late, but I had the same issue. It seems that iOS 6 rotation issues are always some combination of settings in the xib being wrong and not having a root view controller set.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Doh, that was a problem for me as well. Lack of sleep is really messing up my ability to code and making me forgetful.

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
The new iOS 6 autorotation methods don't get called if your app's deployment target is anything earlier than iOS 6.

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