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
I only recently discovered the "Archive" build option because apparently I am a little slow, but I've been using it now and I have a question: when you open a crash report in xCode, which corresponds to an archived version of an app, will it automatically be symbolicated based on the dSYM in the archive, or will I have to extract the dSYM from the archive and associate it manually (as I was doing before I noticed the Archive option)?

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
How have you been distributing your apps if you've only just now discovered the Archive build option?

PT6A
Jan 5, 2006

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

Doc Block posted:

How have you been distributing your apps if you've only just now discovered the Archive build option?

Build -> View in Finder -> Submit to App Store, after creating a separate build profile for distribution. The book I learned from did it this way (why, I'm not entirely sure), and it just never occurred to me that there was a better way. I even put the app and the dSYM in a zip-archive after building so I could easily read crash reports.

So, uh, are the crash reports now going to automatically symbolicate or not?

Doc Block
Apr 15, 2003
Fun Shoe
I'm not sure, I use Crashlytics so all my crash reports are symbolicated by them before I even see them.

But I don't think so.

haveblue
Aug 15, 2005



Toilet Rascal

PT6A posted:

The book I learned from did it this way (why, I'm not entirely sure)

Probably because it was written very early in the app store's life, before the modern process was established. If you think submission and provisioning is an onerous pain in the rear end today, imagine what it was like in 2008.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

PT6A posted:

So, uh, are the crash reports now going to automatically symbolicate or not?

Pretty sure they do, if they're in the list of archives in the Organizer.

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
If you have an xcarchive anywhere that's indexed by Finder, Xcode will symbolicate its crash logs.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

ManicJason posted:

If you have an xcarchive anywhere that's indexed by Finder, Xcode will symbolicate its crash logs.

Right, that was it. I had to muck with Spotlight when logs stopped getting symbolicated.

PT6A
Jan 5, 2006

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

gooby on rails posted:

Probably because it was written very early in the app store's life, before the modern process was established. If you think submission and provisioning is an onerous pain in the rear end today, imagine what it was like in 2008.

I figured that was the most likely cause. I'm also under the impression that I could manage provisioning through xCode instead of the developer.apple.com website, but I haven't looked into it fully. If I stopped being a lazy jerk, I could save myself a lot of work!

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

PT6A posted:

I figured that was the most likely cause. I'm also under the impression that I could manage provisioning through xCode instead of the developer.apple.com website, but I haven't looked into it fully. If I stopped being a lazy jerk, I could save myself a lot of work!

Watch out; things get... messy... if you've setup a bunch of stuff before Xcode4 then try to manage it via Xcode now. If you are starting out I highly recommend letting Xcode manage it. Personally I've got multiple Bundle Seed IDs, some of which I can't select in the provisioning portal anymore, so when I created app-specific IDs it picked the "wrong" seed; fortunately I didn't have anything stored in keychains, iCloud, or whatever that could have screwed my users. All my certificates are just "My Name" so I have to be really careful about which one I select in the drop-downs. And the loving "team" profiles for my different development teams all say "iOS Team Provisioning Profile" so I have to look up the App Identifiers to figure out which is which.

The whole thing could use a nice diagram of how your certificate works to sign the builds, then profiles are signed by Apple and contain a list of devices; your personal dev profile says "run code signed by this dude's personal certificate on these listed devices"... whereas the ad-hoc profile (IIRC) allows builds from anyone on your team. I'm confusing myself just trying to explain it, heh :v:

Anyway open up the .mobileprovision files in a text editor and you can see it's just a list of certificates that are allowed to sign code (Your certs listed under "Teams" in Organizer), a list of device UDIDs, then Apple's signature which is what the device checks to make sure you didn't tamper with the file.

When you build, the code is signed using the chosen cert; those are grouped by Xcode according to whatever profile lists that identity as valid to sign for the profile.
At runtime, the device looks at the .mobileprovision, validates Apple's signature, then validates that its own UDID is listed, then adds the signing cert to the list of allowed signers. When your ad-hoc or dev app runs it gets validated and magically your cert is on the allowed list. Yay!

LP0 ON FIRE
Jan 25, 2006

beep boop
To tidy up instance variables in a class, do people usually go about grouping together related variables into a typedef struct? Better alternatives?

edit: Seems like a pain in the rear end to set the values whenever I need to. Only other alternative I can think of is a class, but that seems over the top too in many cases.

LP0 ON FIRE fucked around with this message at 18:38 on Mar 12, 2013

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

LP0 ON FIRE posted:

To tidy up instance variables in a class, do people usually go about grouping together related variables into a typedef struct? Better alternatives?

edit: Seems like a pain in the rear end to set the values whenever I need to. Only other alternative I can think of is a class, but that seems over the top too in many cases.

Maybe post an example so you can receive 50 different suggestions entirely unaccompanied by evidence of utility?

I'll go first: I've largely stopped using ivars, preferring to declare properties (in a class extension if they're not part of the API).

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
Any examples of great iOS code you guys are aware of? I'm eager to learn from others, especially if their code doesn't blow.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
On an unrelated notes: what are my options as far as distributing apps not off the App Store? I need to put apps on iPads in schools, so I'm trying to figure out what people out there use. Is enterprise distribution my only option?

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
If its for in-house only the school district should get an enterprise account, then you can use that. Otherwise you can use the B2B App Store, but there are some price and other requirements there.

NoDamage
Dec 2, 2000
I'm trying to replace ASIHTTPRequest with AFNetworking, but one part of my app uses the synchronous API's available in ASIHTTPRequest and I'm not seeing a clear way to implement the same thing using AFNetworking. Should I look for another library?

This portion of code is already running entirely in a background thread (to sync a Core Data database with a remote API). Having the synchronous API makes the code much cleaner than chaining a whole bunch of async callbacks together, which is why I am hoping to be able to keep it synchronous.

(To be honest ASIHTTPRequest has been working fine for me for years and I'm not terribly keen on replacing it, but since it has been deprecated for a while I figured I'd upgrade if I could. It's not looking so simple anymore though...)

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

Ender.uNF posted:

If its for in-house only the school district should get an enterprise account, then you can use that. Otherwise you can use the B2B App Store, but there are some price and other requirements there.

Hm, having someone over there pay 300 bucks for that license is going to be rough.. I looked into the B2B App Store, but it looks like K-12 institutions are not meant to use it, and instead they have to go to the Volume Purchase Program Education Store, which you cannot publish custom b2b apps for. What the Christ?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

NoDamage posted:

I'm trying to replace ASIHTTPRequest with AFNetworking, but one part of my app uses the synchronous API's available in ASIHTTPRequest and I'm not seeing a clear way to implement the same thing using AFNetworking. Should I look for another library?

This portion of code is already running entirely in a background thread (to sync a Core Data database with a remote API). Having the synchronous API makes the code much cleaner than chaining a whole bunch of async callbacks together, which is why I am hoping to be able to keep it synchronous.

(To be honest ASIHTTPRequest has been working fine for me for years and I'm not terribly keen on replacing it, but since it has been deprecated for a while I figured I'd upgrade if I could. It's not looking so simple anymore though...)

If your poo poo ain't broke, don't fix it.

That said, you can send -start to your operation to have it run synchronously.

Objective-C code:
AFHTTPRequestOperation *op = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[op start];
// dum dee doo
if (op.hasAcceptableStatusCode) {
    [self doSomethingWith:op.responseData];
}

NoDamage
Dec 2, 2000

pokeyman posted:

If your poo poo ain't broke, don't fix it.
Yeah, I'm starting to lean in that direction too.

quote:

That said, you can send -start to your operation to have it run synchronously.

Objective-C code:
AFHTTPRequestOperation *op = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[op start];
// dum dee doo
if (op.hasAcceptableStatusCode) {
    [self doSomethingWith:op.responseData];
}
Wait, really? I did not think calling start would block until the operation completed. Doesn't it just spawn another thread to perform the operation and then return immediately?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

NoDamage posted:

Wait, really? I did not think calling start would block until the operation completed. Doesn't it just spawn another thread to perform the operation and then return immediately?

Just try it and see what happens!

Somewhere in the NSOperation docs it explains that there are two kinds of operation subclasses: the kind that implement -start and spin up their own thread, and the kind that only implement -main and don't. I'm not sure of the historical reasons for this difference. The correct answer seems to be to implement -main and make the operation asynchronous by passing it off to an NSOperationQueue, or make it synchronous by... not passing it to a queue. It is this kind of operation that blocks when it receives -start, and AFNetworking's operations are this kind of operation.

Most of the value of AFNetworking is implementing an NSOperation subclass that handles an HTTP request, which is surprisingly hard to do correctly. The rest of the library builds handy abstractions around these operations.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

NoDamage posted:

Yeah, I'm starting to lean in that direction too.
Wait, really? I did not think calling start would block until the operation completed. Doesn't it just spawn another thread to perform the operation and then return immediately?

Concurrent operations have a "start" method, which is what gets called by the queue, which is basically what pokeyman is saying. When you throw an NSOperation onto a queue, it basically calls "start" on a separate thread. If you call start yourself, you're generally running the operation on whatever thread you're running on. You can also start an operation on another thread and call "waitUntilFinished", which will block the current thread until the concurrent operation ends. This is possibly useful if you have something you can you can do between the start of the HTTP operation and before the HTTP IO comes back.

Feenix
Mar 14, 2003
Sorry, guy.
Copy Paste from the iOS Games thread (didn't know there was a thread here...)

==============

All opinions welcome, but I'm mostly speaking to the esteemed iOS devs up in this piece...

I moved to Seattle 5 months ago, whereby I work from home. I also have a 10 week old son. So I'm home like, a lot. A LOT!

I've always had strong opinions about games/game design. But zero technical know-how. Anyway, the wife suggested I look into a class or hobby to cure my boredom and get me out of the house occasionally. And couple that with eeenmachine telling me a while back that I should learn to code and make an app (and pointing me to that Polymer dude's blog which was a pretty cool read.)

Anyway, for someone who knows nothing computer-languagey other than some basic SQL, what would be the best FIRST coding language to learn that would be applicable to ios game/app coding?

Thanks for your input!
===============

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

Feenix posted:

Copy Paste from the iOS Games thread (didn't know there was a thread here...)

==============

All opinions welcome, but I'm mostly speaking to the esteemed iOS devs up in this piece...

I moved to Seattle 5 months ago, whereby I work from home. I also have a 10 week old son. So I'm home like, a lot. A LOT!

I've always had strong opinions about games/game design. But zero technical know-how. Anyway, the wife suggested I look into a class or hobby to cure my boredom and get me out of the house occasionally. And couple that with eeenmachine telling me a while back that I should learn to code and make an app (and pointing me to that Polymer dude's blog which was a pretty cool read.)

Anyway, for someone who knows nothing computer-languagey other than some basic SQL, what would be the best FIRST coding language to learn that would be applicable to ios game/app coding?

Thanks for your input!
===============


Well the somewhat-deep end of the pool is Objective-C, but its a lot easier these days with ARC handling memory management. Cocos2d is a popular open source game engine you can check out.

Another alternative is something like monoTouch, which lets you use a fully modern garbage collected language C#, but call the iOS APIs so you aren't learning some odd API like Flash or using some weird glue layer.


Despite the fact that I write C# code for a living, when I started doing iOS work I learned Objective-C because I wanted to experience the platform natively. YMMV.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

ultramiraculous posted:

Concurrent operations have a "start" method, which is what gets called by the queue, which is basically what pokeyman is saying.

I was trying to avoid the word "concurrent". All operations are concurrent when you have a queue.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

pokeyman posted:

I was trying to avoid the word "concurrent". All operations are concurrent when you have a queue.

Yeah, true.

LP0 ON FIRE
Jan 25, 2006

beep boop

LP0 ON FIRE posted:

To tidy up instance variables in a class, do people usually go about grouping together related variables into a typedef struct? Better alternatives?

edit: Seems like a pain in the rear end to set the values whenever I need to. Only other alternative I can think of is a class, but that seems over the top too in many cases.

pokeyman posted:

Maybe post an example so you can receive 50 different suggestions entirely unaccompanied by evidence of utility?

I'll go first: I've largely stopped using ivars, preferring to declare properties (in a class extension if they're not part of the API).

code:
@interface ThingClass : CCLayer {

     @public

          bool _invulnerableToggled;
          int _invulnerableCount;
          int _invulnerableMax;

}

@property(nonatomic, assign) bool invulnerableToggled;
@property(nonatomic, assign) int invulnerableCount;
@property(nonatomic, assign) int invulnerableMax;
In my case, I'm using a subclass of this and allocating an x number of instances in another class. I have a timer that checks the subclasses ivars many times a second and may make modifications to them. Since all of these "invulnerable" variables relate to each other, maybe it would make sense to make them into a struct? Although there seems to be some negative things that come along with that, like what it takes to set any value within the struct.

I'm not really sure exactly what you're saying about not using ivars and declaring properties instead, probably because I don't know what I'm talking about, but I am using properties with these. Anyway, sounds intriguing.

Carthag Tuek
Oct 15, 2005

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



LP0 ON FIRE posted:

code:
@interface ThingClass : CCLayer {

     @public

          bool _invulnerableToggled;
          int _invulnerableCount;
          int _invulnerableMax;

}

@property(nonatomic, assign) bool invulnerableToggled;
@property(nonatomic, assign) int invulnerableCount;
@property(nonatomic, assign) int invulnerableMax;
In my case, I'm using a subclass of this and allocating an x number of instances in another class. I have a timer that checks the subclasses ivars many times a second and may make modifications to them. Since all of these "invulnerable" variables relate to each other, maybe it would make sense to make them into a struct? Although there seems to be some negative things that come along with that, like what it takes to set any value within the struct.

I'm not really sure exactly what you're saying about not using ivars and declaring properties instead, probably because I don't know what I'm talking about, but I am using properties with these. Anyway, sounds intriguing.

Remove the ivars entirely, they aren't needed at all unless you're doing something creative with/in your getters/setters (and if they're @synthesized either explicitly or implicitly, you aren't).

code:
@interface ThingClass : CCLayer

@property(nonatomic, assign) bool invulnerableToggled;
@property(nonatomic, assign) int invulnerableCount;
@property(nonatomic, assign) int invulnerableMax;
Always use self.invulnterableToggled instead of _invulnerableToggled inside your class. Always use thingInstance.invulnerableToggled outside your class. The overhead of using properties versus ivars is tiny (I believe I read somewhere that it's something like 7 vs 1 instructions), and is very unlikely to ever become a problem by itself - it's more likely a problem in the design.

And if you DO need ivars, put them in your @implementation, and don't declare them @public. They should be strictly for private use.

LP0 ON FIRE
Jan 25, 2006

beep boop

Carthag posted:

Remove the ivars entirely, they aren't needed at all unless you're doing something creative with/in your getters/setters (and if they're @synthesized either explicitly or implicitly, you aren't).

Thank you for your words of wisdom. If I remove the ivars, I get a ton of "undeclared use of identifier" errors. Not sure what to do to overcome it. I even tried putting them in my implementation.

Carthag posted:

Always use self.invulnterableToggled instead of _invulnerableToggled inside your class.

I'm embarrassed to admit that I forget why I do this in the first place, but I remember that someone told me that I needed to access the properties from another class properly, and that I need to do this when synthesizing my variables:

code:
@synthesize

invulnerableToggled = _invulnerableToggled,
invulnerableCount = _invulnerableCount,
invulnerableMax = _invulnerableMax;

Carthag posted:

Always use thingInstance.invulnerableToggled outside your class.

Good, I do.

Doc Block
Apr 15, 2003
Fun Shoe
You don't need @synthesize statements anymore, getters/setters and instance variables are now auto-synthesized, and the instance variables will be in the form of _whatever for property whatever.

Doc Block
Apr 15, 2003
Fun Shoe
And I don't know about the speed of setters/getters vs accessing the ivars directly. Calling the setter is a method call, which in turn calls more methods (all the KVO notification stuff).

By all means, though, use the setters/getters outside of the class implementation.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
Does anybody have advice / good resources for how to get more visibility in the app store? I recently discovered that all of our income was coming from one single keyword we were using, which the company that trademarked it wasn't super excited about, and we had to remove it. Now are sales are down to 1/10 what they were before, simply because people don't discover / run across the app anymore and thus the top of the funnel is significantly smaller.

Carthag Tuek
Oct 15, 2005

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



Yeah, @synthesize will implicitly be prop = _prop if you don't explicitly write your own. This should also mean that you can access them directly even without ivar declarations, so the undeclared warnings surprise me. I'm not near a dev machine, so I unfortunately cannot test, but it might be your explicit @synthesize statements messing it? Total guess, though.

As for directly accessing ivars, you can do it inside the class, but be aware that KVO/bindings/observers/etc will not trigger unless you wrap changes in will/didChange. Basically you should always use properties/setters/getters unless profiling shows that it's a major source of slowness.

E: Here, Ash Furrow - objc_msgSend is not your bottleneck.

Carthag Tuek fucked around with this message at 21:12 on Mar 13, 2013

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
How many provisioning profiles do you guys create? I have about 3 per app right now, one for dev, one for adhoc and one for app store. Am I doing it wrong?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
If using properties rather than ivars manages to cause performance issues then you're probably working with something that conceptually should be a struct rather than an obj-c class anyway.

NoDamage
Dec 2, 2000

pokeyman posted:

Just try it and see what happens!
code:
NSURL *url = [NSURL URLWithString:@"http://www.google.com"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation start];
if (operation.hasAcceptableStatusCode)
    NSLog(@"%@",operation.responseString);
else
    NSLog(@"Not ready.");
This prints "Not ready." unless I add [operation waitUntilFinished] after [operation start], in which case it works as expected.

quote:

Somewhere in the NSOperation docs it explains that there are two kinds of operation subclasses: the kind that implement -start and spin up their own thread, and the kind that only implement -main and don't. I'm not sure of the historical reasons for this difference. The correct answer seems to be to implement -main and make the operation asynchronous by passing it off to an NSOperationQueue, or make it synchronous by... not passing it to a queue. It is this kind of operation that blocks when it receives -start, and AFNetworking's operations are this kind of operation.

Most of the value of AFNetworking is implementing an NSOperation subclass that handles an HTTP request, which is surprisingly hard to do correctly. The rest of the library builds handy abstractions around these operations.
Looking at the AFNetworking source code, it looks like it implements -start (in AFURLConnectionOperation) and runs the actual request on another thread.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

NoDamage posted:

Looking at the AFNetworking source code, it looks like it implements -start (in AFURLConnectionOperation) and runs the actual request on another thread.

So it does! It looks like all connections go through the same background thread. I'm not totally sure why it's done that way, but I guess you have your answer?

tarepanda
Mar 26, 2011

Living the Dream

DreadCthulhu posted:

Does anybody have advice / good resources for how to get more visibility in the app store? I recently discovered that all of our income was coming from one single keyword we were using, which the company that trademarked it wasn't super excited about, and we had to remove it. Now are sales are down to 1/10 what they were before, simply because people don't discover / run across the app anymore and thus the top of the funnel is significantly smaller.

How did you find out what keyword was getting downloads?

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

tarepanda posted:

How did you find out what keyword was getting downloads?

Because when we got an angry letter from the lawyers of that company and removed the specific keyword, the rather consistent sales numbers over the past few months dropped to one tenth (and are still there days later) of what they were as soon as the submission went through. That was the only difference, so I feel it's safe to assume it was the keyword. Wasn't a major bug or anything of that genre, Crashlytics has been pretty happy.

tarepanda
Mar 26, 2011

Living the Dream

DreadCthulhu posted:

Because when we got an angry letter from the lawyers of that company and removed the specific keyword, the rather consistent sales numbers over the past few months dropped to one tenth (and are still there days later) of what they were as soon as the submission went through. That was the only difference, so I feel it's safe to assume it was the keyword. Wasn't a major bug or anything of that genre, Crashlytics has been pretty happy.

Oh. I was hoping you knew some way to see how efficient each keyword was.

Adbot
ADBOT LOVES YOU

NoDamage
Dec 2, 2000

pokeyman posted:

So it does! It looks like all connections go through the same background thread. I'm not totally sure why it's done that way, but I guess you have your answer?
Yeah, it's kind of a moot point since I decided to stick with ASIHTTPRequest for now, but if it ever breaks in the future at least I'll have a somewhat clear upgrade path.

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