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
Doc Block
Apr 15, 2003
Fun Shoe
It says right in the documentation for AVAudioPlayer, in the -prepareToPlay section:

quote:

Calling this method preloads buffers and acquires the audio hardware needed for playback, which minimizes the lag between calling the play method and the start of sound output.

Calling the stop method, or allowing a sound to finish playing, undoes this setup.
(emphasis mine)

It most likely releases the buffers and audio resources after a short interval so as not to be a resource hog. The docs for the -play method state that it will call the -prepareToPlay method if the audio player isn't ready to play.

AVAudioPlayer is meant for stuff where a little lag doesn't matter and there isn't much justification for holding onto the audio resources for an extended period of time, like short UI sounds or something.

Doc Block fucked around with this message at 04:54 on Apr 3, 2013

Adbot
ADBOT LOVES YOU

haveblue
Aug 15, 2005



Toilet Rascal
That's exactly what I was using it for and hitching for a third of a second is not acceptable, it's very noticeable if there is any accompanying visual change.

Doh004
Apr 22, 2007

Mmmmm Donuts...
For anyone that does Ad Hoc distribution builds:

Where do you keep your provisioning profiles? We have our TC server set up and it has an old, outdated distribution profile on it because we're too lazy to have to VNC in and update it ourselves. So whenever we push out a new build number to TC, we have to manually upload the newest provisioning profile so that new devices that we've added will have correct permissions. (This is through Testflight)

Do you keep it in source control, and whenever you add a device, simply download and update the profile? And then have your CI/Build process use the profile from the source?

Doh004 fucked around with this message at 17:59 on Apr 3, 2013

Small White Dragon
Nov 23, 2007

No relation.
I thought I saw something about making or accessing iTunes purchases in-app? (Not purchases related to your app, but generic music, video, .etc) Am I imagining things?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Small White Dragon posted:

I thought I saw something about making or accessing iTunes purchases in-app? (Not purchases related to your app, but generic music, video, .etc) Am I imagining things?

I'm not really sure what you're asking for but maybe SKStoreProductViewController?

Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do

pokeyman posted:

Pick up whatever language you like and write yourself a shiny server,

Okay, this is probably a really dumb question, but what is meant by this? Watching the Stanford class (if a bit behind), the guy's made reference to this before, and I'm just wondering what's up with this.

Is it basically an AJAX thing, except instead of Javascript, it's your app? Like, with everything over HTTP and probably messages in XML of some sort? Or is it more involved than that?

If I wanted to learn more about that sort of thing (writing an app that has a server), what classes should I be looking at?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Axiem posted:

Okay, this is probably a really dumb question, but what is meant by this? Watching the Stanford class (if a bit behind), the guy's made reference to this before, and I'm just wondering what's up with this.

Is it basically an AJAX thing, except instead of Javascript, it's your app? Like, with everything over HTTP and probably messages in XML of some sort? Or is it more involved than that?

If I wanted to learn more about that sort of thing (writing an app that has a server), what classes should I be looking at?

It's basically an AJAX thing, except instead of JavaScript, it's your app. Your app sends HTTP requests, your server sends responses in XML or whatever.

I don't have any suggestions for classes, sorry. Maybe head to the Cocoa Literature List and search for "server" or "http"? I'm sure you'll find something useful. And there's nothing better than firing up Xcode, starting a new project, and trying to make sense of it!

Small White Dragon
Nov 23, 2007

No relation.

pokeyman posted:

I'm not really sure what you're asking for but maybe SKStoreProductViewController?
That will do the trick! Well, it should anyway, but it doesn't seem to accept some media types. Bug tracker time!

Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do

pokeyman posted:

And there's nothing better than firing up Xcode, starting a new project, and trying to make sense of it!

Having a starting point helps, though. I guess what I'm asking is: how do I make an HTTP request to a server? Like, what is the Obj-C equivalent to jquery.ajax()?

Doc Block
Apr 15, 2003
Fun Shoe
NSURLRequest plus NSURLConnection if you want to do it yourself, otherwise, AFNetworking.

Of course, if you simply want to download a file at a specific URL, you could just do something like
Objective-C code:
NSURL *fileURL = [NSURL URLWithString:@"http://example.com/file.whatever"];
NSData *data = [NSData dataWithContentsOfURL:fileURL];
if(data != nil) {
	NSLog(@"Download succeeded!");
} else {
	NSLog(@"Download failed!");
}
Which will block until the download is finished, so do it on a background thread.

Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do

Doc Block posted:

NSURLRequest plus NSURLConnection if you want to do it yourself, otherwise, AFNetworking

Cool, I'll take a look.

And jeez, there seem to be a lot of frameworks and other useful things on github.

dustgun
Jun 20, 2004

And then the doorbell would ring and the next santa would come
OS X thing I can't get to work: I have a NSMenuItem with a custom subview, and I can't get the thing to highlight.
Objective-C code:
- (void)menu:(NSMenu *)menu willHighlightItem:(NSMenuItem *)item

That, from the NSMenuDelegate, is called each time I mouseover a different NSMenuItem/NSView, but item is always null. I feel like I'm missing some really simple boolean somewhere, but all I can find on this are a few StackOverflow questions that have what looks like 1/3 the code I need.

dustgun fucked around with this message at 03:52 on Apr 5, 2013

xenilk
Apr 17, 2004

ERRYDAY I BE SPLIT-TONING! Honestly, its the only skill I got other than shooting the back of women and calling it "Editorial".
I'm wondering if someone here could give me a good idea of the work that would need to be done to have the following iOS application made.

I have a site with a form that consist in one text area that's site to website.com/process.php afterwards. Is it possible to have an App that would consist of this form + possibility to take a picture and add it (I imagine this could be submitted as $_FILES?) that would also be submitted to that process.php file.

Is that easily doable for someone who has little but no knowledge in Cocoa/Objective-C ? If so, any pointers as to where should I start to learn around that?

Carthag Tuek
Oct 15, 2005

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



That's very simple to implement.

You'll basically only need an interface + an action that sends (auth+)text+image to your url.

Look into NSMutableURLRequest or a wrapper library.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Anyone know why my UIBarButtonItem's aren't actually changing their backgrounds when highlighted or selected? I'm calling the setBackgroundImage for the correct states in a subclassed UIBarButtonItem, but it's not actually changing it. I made sure the style is Plain, which explicitly states that it glows when touched.

In the mean time I'm trying to recreate the UIBarButtonItem look with setting a UIButton as the custom view. However, I don't know how to recreate the bottom lighter border that shows up on the bottom of the button. It's like a gray thin line, if the rest of my border was black. Any ideas?

Doh004
Apr 22, 2007

Mmmmm Donuts...

Doh004 posted:

Anyone know why my UIBarButtonItem's aren't actually changing their backgrounds when highlighted or selected? I'm calling the setBackgroundImage for the correct states in a subclassed UIBarButtonItem, but it's not actually changing it. I made sure the style is Plain, which explicitly states that it glows when touched.

In the mean time I'm trying to recreate the UIBarButtonItem look with setting a UIButton as the custom view. However, I don't know how to recreate the bottom lighter border that shows up on the bottom of the button. It's like a gray thin line, if the rest of my border was black. Any ideas?

Double post, but we found out why:

We had set the tint to blackColor, which means the highlighted/pressed state was no different from its default color. I guess the highlighting isn't smart enough to detect that it cannot go any darker and should instead go lighter.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer
Oh God, they redid the Provisioning Center. THIS IS THE END HOW DO I DO THINGS.

Edit: Oh, cool. You can finally delete App IDs you made by mistake.

ultramiraculous fucked around with this message at 23:46 on Apr 8, 2013

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Just start mashing buttons until it works.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer
Word of warning: You currently cannot add new devices to provisioning profiles via the web interface. If you hit "Generate" on an Ad-Hoc/Development certificate's page, it'll save it with no devices attached and no way to attach them again. The only recourse is to delete the profile and make a new one.



So, don't:

Yodzilla posted:

Just start mashing buttons until it works.

Doh004
Apr 22, 2007

Mmmmm Donuts...
What do people use for automated testing? This Monkey Talk seems nice: http://www.gorillalogic.com/monkeytalk

I'd need it to integrate into CI (we use TeamCity).

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Speaking of testing, Travis CI recently added support for open source Objective-C and Xcode projects. If you have one, get some continuous testing going!

Hughlander
May 11, 2005

Doh004 posted:

What do people use for automated testing? This Monkey Talk seems nice: http://www.gorillalogic.com/monkeytalk

I'd need it to integrate into CI (we use TeamCity).

We use a combination of KIF kicked off with WaxSym from Jenkins onto Mac Minis and GoogleTest

Doh004
Apr 22, 2007

Mmmmm Donuts...

Hughlander posted:

We use a combination of KIF kicked off with WaxSym from Jenkins onto Mac Minis and GoogleTest

Awesome, thanks. KIF was the other that we've been looking into and it seems awesome. The only issue is our tester guy(s) don't have Macs or use XCode, so we'd have to teach them how to use it and we'd also have some worries about maintaining the tests down the road with new people.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Anyone else experiencing a bunch of issues with the simulator not attaching to Xcode when debugging? The only way I can reliably connect to the simulator is by switching the debugger from LLDB to GDB. :(

plasticbugs
Dec 13, 2006

Special Batman and Robin

Doh004 posted:

Anyone else experiencing a bunch of issues with the simulator not attaching to Xcode when debugging? The only way I can reliably connect to the simulator is by switching the debugger from LLDB to GDB. :(

I ran into this. I tried switching debuggers, but ultimately the only fix for me was to reboot my machine twice, Build Clean and pray very hard. When it doesn't attach, I have to force quit Xcode.

Carthag Tuek
Oct 15, 2005

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



Say I have a tool generating a bunch of .m an .h files. I then include them as a folder reference, as they might change names, some might appear/disappear. Is there an easy way to get that to compile in XCode?

haveblue
Aug 15, 2005



Toilet Rascal
Have the tool emit a permanent header which contains up-to-date includes for all of the dynamic headers.

Carthag Tuek
Oct 15, 2005

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



Doh. Thanks! :)

NoDamage
Dec 2, 2000
I'm considering options for sending real-time updates from a server to an iOS client, and it's mostly down to WebSockets vs push notifications. My thinking is that push notifications aren't quite the right tool because 1) there's no real-time delivery guarantee and 2) I don't really need updates to be sent unless the app is actually open.

HTTP polling is an option too but I figured with a short polling interval there's a lot more overhead compared to WebSockets which might cause more battery drain.

Anyone have experience doing real-time updates?

Carthag Tuek
Oct 15, 2005

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



I have a ragel file in my project, it works fine with a build rule and compiles etc.

Debugging is a bit hard though: Although I can set breakpoints (if I change the filetype to for instance objc source), and it will stop and show me the ragel file at the right spot (and I can tell the stack is right by po-ing local variables in the debugger), it doesn't show the highlighted line so stepping through code is incredibly difficult since I have to keep track of it mentally.

Anybody done a similar thing and got it to work?

duck monster
Dec 15, 2004

gently caress me, never ever ever accept a speech recognition job people. No matter how good your engine is, the client will want it to be better

:negative:

And after a one month job slipping into three months due to this loving client refusing to pay and constantly going "Why can SIRI understand it then huh?" (Our tests have Opensphinx actually getting a better recognition rate, but whatever) I'm loving out. I'm throwing in the towel and leaving the industry because I cant take this poo poo no more.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
:glomp:

You need an iron clad "needs to work thiiiiiiiis well" line in the contract for that job. No, I don't have a clue how you'd ever specify that, why do you ask?

Carthag Tuek
Oct 15, 2005

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



I'm getting a crash when trying to use object_getIvar()

code:
libobjc.A.dylib`ivar_getOffset:
0x7fff86fbe553:  testq  %rdi, %rdi
0x7fff86fbe556:  jne    0x7fff86fbe55b            ; ivar_getOffset + 8
0x7fff86fbe558:  xorl   %eax, %eax
0x7fff86fbe55a:  ret    
0x7fff86fbe55b:  movq   (%rdi), %rax              ; crashes here with EXC_BAD_ACCESS
0x7fff86fbe55e:  movq   (%rax), %rax
0x7fff86fbe561:  ret    
Anyone know what's going on?

E: Turns out I was freeing the Ivar and it wasn't getting captured in the block I was using it in.

Carthag Tuek fucked around with this message at 00:10 on Apr 17, 2013

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

haveblue posted:

Have the tool emit a permanent header which contains up-to-date includes for all of the dynamic headers.

Do folder references actually add/remove .m files for compilation? It would be really, really nice if it did but the last time I tried (with some Apache Thrift generated protocol stuff) Xcode didn't even notice that there were source files in there.

duck monster
Dec 15, 2004

pokeyman posted:

:glomp:

You need an iron clad "needs to work thiiiiiiiis well" line in the contract for that job. No, I don't have a clue how you'd ever specify that, why do you ask?

Done that. Contractually the dude is supposed to have paid but at this stage I'm so loving broke I can't afford a lawyer to chase this drat thing to its conclusion.

Heres the thing. He told me at one point "The app is boring". He didn't seem to accept that I followed his (Fairly detailed) spec to the *letter*, and just because the idea sucks doesn't mean he can just back out. Well after I made him realise that he suddenly started squabbling with the recognition quality.

Heres the thing though, we did prototypes *before the project started* with the exact engine, and he accepted it as quality enough, and it was on that basis we proceeded (all in writing).

So at this stage he hasn't got a leg to stand on, except for one very big leg;- He's got the money and I don't.

ergo: gently caress this industry. I accepted a full time job last week at another company, where some other schmuck can deal with smacking sense into dirtback clients, and I'm lighting this loving bridge on fire. Once my finances are recovered, I'm revisiting this issue with a vengence.

duck monster fucked around with this message at 09:25 on Apr 21, 2013

Doc Block
Apr 15, 2003
Fun Shoe
Wouldn't there be lawyers willing to take the case on contingency, or is that not a thing down under?

Doc Block
Apr 15, 2003
Fun Shoe
An IAP question: when Apple is asking for a screenshot of the product in iTunes Connect, they're asking for a screenshot of the item as it appears in the app, right? As in, not just how it appears in my in app store?

tarepanda
Mar 26, 2011

Living the Dream
As it appears in the app, yeah. The result of the purchase.

Doc Block
Apr 15, 2003
Fun Shoe
Thanks. That's what I thought. Figured I'd better ask before I had to go through another rejection.

Adbot
ADBOT LOVES YOU

HiriseSoftware
Dec 3, 2004

Two tips for the wise:
1. Buy an AK-97 assault rifle.
2. If there's someone hanging around your neighborhood you don't know, shoot him.
How would one illustrate a consumables purchase in a screenshot? Show a "Congratulations you bought 100,000 smurfberries, sucker!" or a before/after currency counter?

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