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
PT6A
Jan 5, 2006

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

Martytoof posted:

How do you guys manage multiple NSURLConnections in the same class? Do you key off something in the connection:DidReceiveData: delegate method and route the data to the appropriate property or what? I'm coding on flu meds so if this is really obvious I apologize :(

I've never had this exact situation, but if I'm writing a controller with two tableviews to deal with, I'll link each tableview to a property in the controller, and compare tableView sent by the delegate/data source method to those properties to determine what to do.

So, essentially, I would recommend storing each URLConnection as a weak property, then using those to determine in connection:didReceiveData: what behaviour to do.

Adbot
ADBOT LOVES YOU

LP0 ON FIRE
Jan 25, 2006

beep boop
Since my other two iOS apps were enterprise, today is the first time I'm submitting an app to the App Store, and I'm kind of freaking out figuring out some last minute very important things.

One is that I'm trying to figure out how to have this app only show up in the App Store for iPad 2 and up. Is it possible? The results I found on Google about that haven't looked so optimistic.

edit: UIRequiredDeviceCapabilities to use font-facing-camera will make it be iPad 2 and up?

If I did it right, it should look like this?


Second, the developer account my work has been invited to another developer account. We need have it so when we add the app it will show up on their store. I hope we don't need a new bundle identifier and such. I went to their provision portal and I can't choose to create anything.

LP0 ON FIRE fucked around with this message at 18:58 on Jan 10, 2013

Doh004
Apr 22, 2007

Mmmmm Donuts...
My first app just started showing up in the app store :3:

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

LP0 ON FIRE posted:

Since my other two iOS apps were enterprise, today is the first time I'm submitting an app to the App Store, and I'm kind of freaking out figuring out some last minute very important things.

One is that I'm trying to figure out how to have this app only show up in the App Store for iPad 2 and up. Is it possible? The results I found on Google about that haven't looked so optimistic.

edit: UIRequiredDeviceCapabilities to use font-facing-camera will make it be iPad 2 and up?

Second, the developer account my work has been invited to another developer account. We need have it so when we add the app it will show up on their store. I hope we don't need a new bundle identifier and such. I went to their provision portal and I can't choose to create anything.

Requiring iOS6 is one way to do it. I've seen murmurs about people getting rejected for using UIRequiredDeviceCapabilities without actually needing the camera at all.

LP0 ON FIRE
Jan 25, 2006

beep boop

ultramiraculous posted:

Requiring iOS6 is one way to do it. I've seen murmurs about people getting rejected for using UIRequiredDeviceCapabilities without actually needing the camera at all.

Crap. Thanks for mentioning this. I looked up a response of this happening to someone:

Apple posted:

Please ensure that the application's UIRequiredDeviceCapabilities key configuration is correct. Attributes should only be placed in the UIRequiredDeviceCapabilities key if that attribute is either required for the function of the application or if it must not be present on the device. For additional information on specific keys, please review the dictionary keys tables found in the iPhone Application Programming Guide, under the "Device Support" section

I updated the code a while back for iOS 6 but what do you have to do to make the store see this?
edit: iOS Deployment Target?

LP0 ON FIRE fucked around with this message at 19:07 on Jan 10, 2013

LP0 ON FIRE
Jan 25, 2006

beep boop
Ahhh, and it looks like even though we've been invited to a company's developer program, I don't have permission to create a bundle ID. I'm guessing this is what's needed to have the app show up on their store.

newreply.php
Dec 24, 2009

Pillbug

Martytoof posted:

How do you guys manage multiple NSURLConnections in the same class? Do you key off something in the connection:DidReceiveData: delegate method and route the data to the appropriate property or what? I'm coding on flu meds so if this is really obvious I apologize :(

In my experience it'll always be messy. What I've done for an app that needs to pull in lots of files of varyings sizes (easily 1GB+ with single downloads of over 500 MB) is make a ContentDownload class that is inited with a source URL, a target path or URL, and makes it's own NSURLConnection (of which it is also the delegate) and then use NSNotifications or a delegate method to inform the class that initialised it of it's started/failed/finished status.
Do remember to limit both your in-memory and disk NSURLCache when using this though.

Doc Block
Apr 15, 2003
Fun Shoe

LP0 ON FIRE posted:

Crap. Thanks for mentioning this. I looked up a response of this happening to someone:


I updated the code a while back for iOS 6 but what do you have to do to make the store see this?
edit: iOS Deployment Target?

Yes, set the deployment target to iOS 6.

fankey
Aug 31, 2001

Martytoof posted:

How do you guys manage multiple NSURLConnections in the same class? Do you key off something in the connection:DidReceiveData: delegate method and route the data to the appropriate property or what? I'm coding on flu meds so if this is really obvious I apologize :(
I use [NSURLConnection sendAsynchronousRequest]. That way the class isn't a delegate - the completion block is what handles when you download the data. Something like
Objective-C code:
-(void)downloadProperty:(NSString*)propName fromUrl:(NSString*)url
{
  NSURLRequest* urlReq = [NSURLRequest requestWithURL:[NSURL URLWithString:url]
                                          cachePolicy:NSURLRequestReloadIgnoringCacheData
                                      timeoutInterval:15.0];

  [NSURLConnection sendAsynchronousRequest:urlReq
                                     queue:[NSOperationQueue mainQueue]
                         completionHandler:^(NSURLResponse * resp, NSData * fileData, NSError * err)
                         {
                           if( err )
                           {
                             NSLog(@"error downloading %@", err);
                           }
                           else
                           {
                             // you'd probably convert fileData to something useful here...
                             [self setValue:fileData forKey:propName];
                           }
                         }];
}

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch

Martytoof posted:

How do you guys manage multiple NSURLConnections in the same class? Do you key off something in the connection:DidReceiveData: delegate method and route the data to the appropriate property or what? I'm coding on flu meds so if this is really obvious I apologize :(

This is exactly what I did. I wrote an app that syncs about 4 gigs of data currently across a few hundred files and I found the best way to do it was to create an array of files to be downloaded, kick off the NSURLConnection to get it started, update the user as it progresses and then when it's finished just start the process all over again with the next file in the array. The only time I've run into problems is when something times out due to a garbage internet connection but that's more the problem of my building's wireless.

some kinda jackal
Feb 25, 2003

 
 
Thanks for all the replies guys. Since I have about four or five API calls that I need to make I think I'm going to go the completion blocks route so I can easily throw all relevant code together.



Also I have another question that I'm almost ashamed to ask because I'm sure I'm overlooking something so ridiculously basic that when I figure out what's wrong it'll make my eyes roll:

I have a preferences window that I launch from an NSMenu in an NSStatusItem. The NSMenuItem in my status bar just calls a "requestPreferenceWindow" method in my overall app controller class:

code:
- (IBAction)requestPreferenceWindow:(id)sender {
    NSLog(@"Preference window requested");
    if (!preferenceWindowController) {
        preferenceWindowController = [[LJPreferenceWindowController alloc] init];
    }
    [preferenceWindowController showWindow:self];
}
The first time I open the preference window everything is fine. If I close the window and then try to reopen it from the statusitem nothing happens. I get the second "preference window requested" nslog in my console but no window ever shows up.

In my interface, the preferenceWindowController is just defined as:

LJPreferenceWindowController* preferenceWindowController;

This feels like some sort of "cocoa programming 101" error but I've been racking my brain for the past half hour trying to figure it out.




edit: Ugggggggggh I didn't have my controller's window property bound to the actual window. Fuckin' a. I spent a day trying to fix this stupid bug.

some kinda jackal fucked around with this message at 20:21 on Jan 11, 2013

LP0 ON FIRE
Jan 25, 2006

beep boop

Doc Block posted:

Yes, set the deployment target to iOS 6.

Thanks.

Since I'm validating it on the other company that we are a guest for, I need to import their developer profile. So I'm just waiting for that and then hopefully I'll be good.

cheese eats mouse
Jul 6, 2007

A real Portlander now
A really stupid newbie question, but I'm having trouble navigating the developer library so I'll get a quicker answer here.

What view controller is responsible for pushing a button in a top nav and having the main content slide left/right to review a UITableView? Is it just a reverse engineered table view? I thought it was a split view controller, but that is iPad only.

I'm rewriting an app my boss made in Flex as an exercise and that's the main navigation.

lord funk
Feb 16, 2004

That would be the navigation controller. See View Controller Programming Guide for iOS

lord funk
Feb 16, 2004

Are distributed builds gone for good in Xcode? I have a monster Mac Pro right next door to my office I could use, but from what I've read it was removed in the 4.3 release.

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
Last I heard is that they're gone with no plans to come back. My dream of a 200 Mac Mini build cluster died with 4.3.

edit: But if you have the extra beast Mac sitting around, setting up Jenkins to build Xcode projects on OSX is not nearly as difficult as it was six months ago when I struggled through it for the first time.

LP0 ON FIRE
Jan 25, 2006

beep boop
My company's Apple dev account was invited as an administrator to another company. I created a new App ID on their iOS Provisioning Portal but on iTunes Connect this bundle ID does not appear on the drop down list. What gives?

edit: Argh. I guess that's now how it works. I definitely need the user/pw for their account. I have to mention though that I'm amazed with Apple's customer service. I submitted a question about this on a form in the member center and they got back to me about it 20 minutes later by calling me.

LP0 ON FIRE fucked around with this message at 19:50 on Jan 14, 2013

Doh004
Apr 22, 2007

Mmmmm Donuts...
I'm about to start converting our iPhone only app to be Universal. The design documents that I'm getting for our iPad version are quite different from the iPhone. We don't use any IB files, it's all done by hand.

Am I going to have to go around and put in if([MyApp isTablet]) checks everywhere to set view positions and selecting the correct views to be placed?

Or is there some cleaner way to go about this?

dizzywhip
Dec 23, 2005

Depending on how different the design is, using autolayout may help you reuse the same layout code across both devices in many cases. Otherwise you'll need to do it manually, yeah. Rather than sprinkling conditionals all throughout your layout code you might consider separating the iPhone layout entirely from the iPad layout if possible via different layout methods or whatever.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Gordon Cole posted:

Depending on how different the design is, using autolayout may help you reuse the same layout code across both devices in many cases. Otherwise you'll need to do it manually, yeah. Rather than sprinkling conditionals all throughout your layout code you might consider separating the iPhone layout entirely from the iPad layout if possible via different layout methods or whatever.

Yeah it's very different. I might be able to reuse some lower level views, but otherwise the positioning of everything is completely new.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Inherit from the phone controllers and override the layout code, you can also re-use phone views in popovers, etc.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Ender.uNF posted:

Inherit from the phone controllers and override the layout code, you can also re-use phone views in popovers, etc.

This sounds like the correct course of action.

tarepanda
Mar 26, 2011

Living the Dream
I jumped through all the hoops and uploaded my binary yesterday... now I'm just sitting here refreshing iTunes Connect, hoping that it gets out of the "Waiting for Review" stage quickly.

Doctor w-rw-rw-
Jun 24, 2008

Ender.uNF posted:

Inherit from the phone controllers and override the layout code, you can also re-use phone views in popovers, etc.


Doh004 posted:

This sounds like the correct course of action.

gently caress. NO.

We did this for our iOS app and it was the worst decision we've ever made. It caused a maintenance nightmare so bad we rewrote the app rather than rescue it (well, I tried, for a while).

Branch the application to launch a different UI for iPhone/iPod vs. iPad. Inheriting from the phone controllers ties the behavior and UI of the iPad code to the iPhone/iPod code. If you have a straightforward or trivial app you might get away with it for a while, but otherwise, DON'T reuse through inheritance. Share code some other way - especially if the tablet design is going to deviate from the phone design.

Doc Block
Apr 15, 2003
Fun Shoe

tarepanda posted:

I jumped through all the hoops and uploaded my binary yesterday... now I'm just sitting here refreshing iTunes Connect, hoping that it gets out of the "Waiting for Review" stage quickly.

It'll sit in Waiting for Review status for at least a week. The shortest I've ever had something in Waiting for Review was 2 or 3 days, but that was just adding iPhone 5 support to an existing app right around the iPhone 5 launch.

Doc Block fucked around with this message at 02:25 on Jan 16, 2013

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
How long does it take if you are just adding a new image/updating a plist or something else that doesn't change the code? Any shorter?

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

Doctor w-rw-rw- posted:

gently caress. NO.

We did this for our iOS app and it was the worst decision we've ever made. It caused a maintenance nightmare so bad we rewrote the app rather than rescue it (well, I tried, for a while).

Branch the application to launch a different UI for iPhone/iPod vs. iPad. Inheriting from the phone controllers ties the behavior and UI of the iPad code to the iPhone/iPod code. If you have a straightforward or trivial app you might get away with it for a while, but otherwise, DON'T reuse through inheritance. Share code some other way - especially if the tablet design is going to deviate from the phone design.

I'm interesting in knowing more about this. What do you recommend? Having different xibs? Not going the universal route in the first place?

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
I've only worked on one universal app and it was one where someone wrote the initial iPhone app and I was tasked with making it also work on the iPad. To accomplish this I created separate xibs for iPhone and iPad but kept the same code behind. If something existed in one and not the other I just had to make sure that code wasn't executed by checking what platform the user was on. It ended up being mostly painless once I got the hand of it.

I say mostly because the client demanded halfway into dev that the iPhone version be portrait only and the iPad be either portrait or landscape so for each page I had three xib files since the design for iPad portrait and landscape was wildly different from one another. Never. Again.

Doc Block
Apr 15, 2003
Fun Shoe

Sinestro posted:

How long does it take if you are just adding a new image/updating a plist or something else that doesn't change the code? Any shorter?

Nope. 7-10 days from upload to approved for sale is pretty standard, sometimes as low as 5. Shorter review times do happen, but plan on at least a week.

And for most of that your app will be in Waiting for Review status. Like, one time an update sat waiting for a week, then the actual review was under 5 minutes.

Doc Block fucked around with this message at 02:27 on Jan 16, 2013

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
Well, I guess I will need to figure out a way to grab stuff between the upgrades.

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

Doctor w-rw-rw- posted:

gently caress. NO.

We did this for our iOS app and it was the worst decision we've ever made. It caused a maintenance nightmare so bad we rewrote the app rather than rescue it (well, I tried, for a while).

Branch the application to launch a different UI for iPhone/iPod vs. iPad. Inheriting from the phone controllers ties the behavior and UI of the iPad code to the iPhone/iPod code. If you have a straightforward or trivial app you might get away with it for a while, but otherwise, DON'T reuse through inheritance. Share code some other way - especially if the tablet design is going to deviate from the phone design.

It highly depends on the app design. You can do anything from a blown up phone UI to a completely separate iPad UI. But if the functionality of the actual screens is largely the same you can share no problem. You can drop a table view in the left and the detail view on the right in a split view controller with relatively little code... Of course that may not work at all for some apps.

Doc Block
Apr 15, 2003
Fun Shoe
Has anyone seen this? Seems like a decent way to automate taking screenshots instead of doing it by hand or having to mess with Instruments.

Doctor w-rw-rw-
Jun 24, 2008

Ender.uNF posted:

It highly depends on the app design. You can do anything from a blown up phone UI to a completely separate iPad UI. But if the functionality of the actual screens is largely the same you can share no problem. You can drop a table view in the left and the detail view on the right in a split view controller with relatively little code... Of course that may not work at all for some apps.

If ALL you are doing is changing the layout, but you have the same behavior and data, it *might* be okay. However, doing this lends itself well to writing subpar tablet apps. iPad apps lend themselves to being less hierarchical and more flexible to navigate through. This lends itself to greater navigational flexibility. If you use inheritance, if you change the phone version, the tablet version changes with it, so you anchor yourselves to a set of core view controllers. As our mobile app's flow grew more complex to accomodate our needs, the tablet app grew harder and harder to maintain.

DreadCthulhu posted:

I'm interesting in knowing more about this. What do you recommend? Having different xibs? Not going the universal route in the first place?
If you plan on localizing to a bunch of different languages (especially ones that are right to left), xibs are the way to go because the files themselves can be localized. Otherwise, sticking to code is a pretty good route. I would go the universal route but load a different root view controller from the outset, and group the view controllers by iPad and iPhone (and have another group for anything shared or shareable, i.e. "core", so it's clear that whatever is in the iPad or iPhone group is exclusive to those devices). Share views as needed, but not view controllers.

Doctor w-rw-rw- fucked around with this message at 03:23 on Jan 17, 2013

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

Doctor w-rw-rw- posted:

If ALL you are doing is changing the layout, but you have the same behavior and data, it *might* be okay. However, doing this lends itself well to writing subpar tablet apps. iPad apps lend themselves to being less hierarchical and more flexible to navigate through. This lends itself to greater navigational flexibility. If you use inheritance, if you change the phone version, the tablet version changes with it, so you anchor yourselves to a set of core view controllers. As our mobile app's flow grew more complex to accomodate our needs, the tablet app grew harder and harder to maintain.

If you plan on localizing to a bunch of different languages (especially ones that are right to left), xibs are the way to go because the files themselves can be localized. Otherwise, sticking to code is a pretty good route. I would go the universal route but load a different root view controller from the outset, and group the view controllers by iPad and iPhone (and have another group for anything shared or shareable, i.e. "core", so it's clear that whatever is in the iPad or iPhone group is exclusive to those devices). Share views as needed, but not view controllers.

For small or one-man teams, this is a maintenance nightmare. Even minor changes require updated all the XIBs.

Actually the screenshots and translations are a huge pain. I don't know I would translate Storm Sim if I had to do it again.

tarepanda
Mar 26, 2011

Living the Dream

Ender.uNF posted:

Actually the screenshots and translations are a huge pain. I don't know I would translate Storm Sim if I had to do it again.

Agreed... and triply so when your app uses devices and so can't be used in the simulator.

I had to install and manually screenshot on an iPad, iPhone 4, and iPhone 5. Five screenshots each, two localizations, so 30 screenshots total... and setting up the environment/getting the timing right was a pain in the butt too... and of course someone would say "Oh I don't like this screenshot because . . ." and I'd do it alllll over again.

Doctor w-rw-rw-
Jun 24, 2008

Ender.uNF posted:

For small or one-man teams, this is a maintenance nightmare. Even minor changes require updated all the XIBs.

Actually the screenshots and translations are a huge pain. I don't know I would translate Storm Sim if I had to do it again.

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?

Built 4 Cuban Linux
Jul 15, 2007

i own america
I really like NSHipster.com. Are there some other Cocoa/ObjC dev sites that are updated regularly these days? There are a lot of great resources on the web but stuff like CocoaDev (for example) doesn't have any new content and I want to check out sites that might have new or interesting articles and guides.

tarepanda
Mar 26, 2011

Living the Dream

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?

Not much, since the app is a CV app the requires the camera and stuff in the view. So I had to position things in real life and do real-life actions in front of the camera.

Carthag Tuek
Oct 15, 2005

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



Built 4 Cuban Linux posted:

I really like NSHipster.com. Are there some other Cocoa/ObjC dev sites that are updated regularly these days? There are a lot of great resources on the web but stuff like CocoaDev (for example) doesn't have any new content and I want to check out sites that might have new or interesting articles and guides.

I was thinking about asking the same thing actually. The ones I regularly check up on:

http://nshipster.com/ - As you mentioned.
http://www.mikeash.com/pyblog/ - Mike Ash's blog has a great Friday Q&A feature, usually about how lower-level stuff works.
http://www.cimgf.com/ - Cocoa is my Girlfriend has a horrible name, but sometimes there's good stuff.
http://www.cocoacontrols.com/posts - Not really a blog in the same sense, but I think most of the controls linked have source included.
http://useyourloaf.com - Not restricted to Cocoa, but there's useful stuff there too.
http://www.panic.com/blog/ - Panic's blog is good too, they recently looked at how iTunes does its album art color thingie.

And some that I've found good stuff on in the past, but appear to be dead:

http://funwithobjc.tumblr.com
http://cocoasamurai.blogspot.com
http://www.cocoawithlove.com

Any others?

Adbot
ADBOT LOVES YOU

Built 4 Cuban Linux
Jul 15, 2007

i own america

Carthag posted:

I was thinking about asking the same thing actually. The ones I regularly check up on:

http://nshipster.com/ - As you mentioned.
http://www.mikeash.com/pyblog/ - Mike Ash's blog has a great Friday Q&A feature, usually about how lower-level stuff works.
http://www.cimgf.com/ - Cocoa is my Girlfriend has a horrible name, but sometimes there's good stuff.
http://www.cocoacontrols.com/posts - Not really a blog in the same sense, but I think most of the controls linked have source included.
http://useyourloaf.com - Not restricted to Cocoa, but there's useful stuff there too.
http://www.panic.com/blog/ - Panic's blog is good too, they recently looked at how iTunes does its album art color thingie.

And some that I've found good stuff on in the past, but appear to be dead:

http://funwithobjc.tumblr.com
http://cocoasamurai.blogspot.com
http://www.cocoawithlove.com

Any others?
Good suggestions. I'll add http://www.raywenderlich.com/. That site has some really impressive tutorials which can actually be a lot of fun (it's mostly game stuff). I wish I had more time to mess around with them.

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