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
You have to specifically write OpenCL code to have anything execute on the GPU.

Adbot
ADBOT LOVES YOU

haveblue
Aug 15, 2005



Toilet Rascal

lord funk posted:

Stupid question: is Xcode optimized for OpenCL? i.e. - will the new Trashmac be an absolute monster with its dual-GPUs?

No, but it's still going to be a monster from everything else about it. Compilation isn't a good target for GPGPU because it involves a lot of dependent decisions and not a lot of floating-point math.

lord funk
Feb 16, 2004

haveblue posted:

No, but it's still going to be a monster from everything else about it. Compilation isn't a good target for GPGPU because it involves a lot of dependent decisions and not a lot of floating-point math.

Okay, good to know.

Doc Block
Apr 15, 2003
Fun Shoe
Wait, did you mean to ask if Xcode itself was GPGPU-optimized, or if it could output GPGPU code?

lord funk
Feb 16, 2004

Doc Block posted:

Wait, did you mean to ask if Xcode itself was GPGPU-optimized, or if it could output GPGPU code?

Xcode itself. A colleague and I were talking about the new Mac Pros and whether Xcode would make use of the dual-GPUs for building.

kitten smoothie
Dec 29, 2001

Headscratcher of the day:

Got a bug ticket that you cannot import videos into my team's app, if you're on an iPhone 4 and the videos are longer than a minute or so. The UIImagePickerController is re-encoding the video, then the app crashes. No out of memory error, which is the first thing I thought due to it being an iPhone 4. The error logs we got off the device show it crashes somewhere in my delegate callback when the UIImagePickerController has finished its work.

I go into debug it and I just can't replicate it. Under the debugger it works just fine. I go chasing what differences there are between the debug and enterprise distribution build settings to see if there's something goofy there, maybe optimization is messing with something. No dice there.

Dude on the team tries it on his iPhone 4, remarks the screen went to sleep midway through.

Suddenly it dawned on us all - the app is going to sleep while UIImagePickerController is compressing the video. Seemingly this hoses the compression process and ruins the video, even though when you wake the phone back up the delegate method still fires like nothing ever went wrong. It just got garbage back. We just never noticed this because all of us on the team are using at least an iPhone 5 or better and their CPUs are strong enough that the video compresses before the screen timeout kicks in. And the screen never sleeps if you're running it in the debugger.

Keeping the screen awake before presenting the UIImagePickerController solved the problem in the end (and some better error checking in the delegate too). But good god I hate these sorts of bugs.

Doc Block
Apr 15, 2003
Fun Shoe

lord funk posted:

Xcode itself. A colleague and I were talking about the new Mac Pros and whether Xcode would make use of the dual-GPUs for building.

Yeah, no. Like haveblue said, GPGPU is great for mathematical operations that can be done in parallel, but not very good at anything that involves a lot of branching, can't be done in parallel, and/or isn't a mathematical computation.

Doc Block fucked around with this message at 02:11 on Oct 26, 2013

NoDamage
Dec 2, 2000
Jesus christ, I've just run into the most obnoxious bug ever: UICollectionViews do not recycle cells on iPad under iOS 7.

http://stackoverflow.com/questions/19276509/uicollectionview-do-not-reuse-cells
http://stackoverflow.com/questions/19405481/ios7-uicollectionviewcell-not-being-reused-when-dequeuing-cell
https://devforums.apple.com/message/903789

Oddly enough it works fine in the iPad Simulator, it works fine on my iPhone 5S and 4S, but it does not work on my 3rd gen iPad. The exact same code.

It's really tanking my scrolling performance. :(

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

NoDamage posted:

Jesus christ, I've just run into the most obnoxious bug ever: UICollectionViews do not recycle cells on iPad under iOS 7.

http://stackoverflow.com/questions/19276509/uicollectionview-do-not-reuse-cells
http://stackoverflow.com/questions/19405481/ios7-uicollectionviewcell-not-being-reused-when-dequeuing-cell
https://devforums.apple.com/message/903789

Oddly enough it works fine in the iPad Simulator, it works fine on my iPhone 5S and 4S, but it does not work on my 3rd gen iPad. The exact same code.

It's really tanking my scrolling performance. :(

:laffo: Make sure you file a radar! And of course it happens on the shittiest possible device.

NoDamage
Dec 2, 2000

pokeyman posted:

:laffo: Make sure you file a radar! And of course it happens on the shittiest possible device.
It's even worse than I thought. In addition to the above, if you have more than one cell type registered with the collection view, it also doesn't release any of the cells. After scrolling around long enough, the app will run out of memory and crash. :wtf:

The same thing applies to supplementary views. If you have more than one type registered, it doesn't appear to release those either.

Am I crazy? Is my iPad broken? Is anyone else using collection views and seeing this behavior?

lord funk
Feb 16, 2004

I thought it was just me, but yeah the cells have been utterly worthless lately on my iPad app. Did a cell scroll off screen? DELETED IMMEDIATELY.

edit: and just tested in the simulator, and it's working. On the device it's poo poo.

lord funk fucked around with this message at 23:33 on Oct 26, 2013

NoDamage
Dec 2, 2000

lord funk posted:

I thought it was just me, but yeah the cells have been utterly worthless lately on my iPad app. Did a cell scroll off screen? DELETED IMMEDIATELY.

edit: and just tested in the simulator, and it's working. On the device it's poo poo.
Yeah, the slow scrolling blows, but it's something I can deal with. The worse part is that it's not releasing supplementary views (I'm using 3 different supplementary kinds). I've resorted to manually wiping out their contents in collectionView:didEndDisplayingSupplementaryView:forElementOfKind:atIndexPath.

They still never get dealloc-ed but at least I can remove all of their subviews so they aren't gobbling up memory when they go offscreen.

Worst. Hack. Ever.

lord funk
Feb 16, 2004

Bug report site has been completely updated. It's much nicer now:

https://bugreport.apple.com

Toady
Jan 12, 2009

lord funk posted:

Bug report site has been completely updated. It's much nicer now:

https://bugreport.apple.com

Wow. I thought it would never change.

lord funk
Feb 16, 2004

I have no idea why Xcode is logging this:



¿Qué?

EssOEss
Oct 23, 2006
128-bit approved
Is it possible to write plug-ins for Safari (Flash-style) on OS X? If so, can anyone link me to some documentation and/or SDK?

The only things I can find by googling are loads and loads of pages about extensions and a few references to the WebKit plug-in development documentation that has big scary "This is obsolete and you should close this website" warnings from Apple.

duck pond
Sep 13, 2007

I'm beginning to get a little burned out on Xcode, has anyone had any luck working with iOS projects in Sublime Text 2 or JetBrains AppCode?

dizzywhip
Dec 23, 2005

I tried to get a Sublime-based workflow going a while back but found it to be too complicated, unfortunately. A couple times a day on average I find myself pasting things into Sublime just so I can use real multiple selection or whatever and then pasting it back. I'd be really interested to hear if anyone else has been successful getting that set up.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

duck pond posted:

I'm beginning to get a little burned out on Xcode, has anyone had any luck working with iOS projects in Sublime Text 2 or JetBrains AppCode?

You can get pretty far with a Makefile that calls out to xcodebuild. There are tools that run automated tests in the simulator so it may be feasible to use that without Xcode. I'm not sure how you'd install an app on a device and get an lldb session running.

Mr SuperAwesome
Apr 6, 2011

im from the bad post police, and i'm afraid i have bad news
is it particularly normal for apple to take ages approving a small update? just wondering whether to bother poking them with an email. submitted the app monday last week early morning PDT and still no dice :argh:

kitten smoothie
Dec 29, 2001

Mr SuperAwesome posted:

is it particularly normal for apple to take ages approving a small update? just wondering whether to bother poking them with an email. submitted the app monday last week early morning PDT and still no dice :argh:

It's been all over the place for me. Earlier this month I submitted an app for a customer of mine and it took 8 days only to get a rejection. I fixed and resubmitted, and it took another 8.

Meanwhile during that same two week period I had also submitted an update for an app of mine, it took 2 days to go through. My server logs showed they never even opened the app once.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Submitted our update on Thursday morning, got approved Tuesday night and they never actually used the app (no logs either). Who knows what actually goes on in that process.

Mr SuperAwesome
Apr 6, 2011

im from the bad post police, and i'm afraid i have bad news
welp

this is what i get for trying to market my app too quickly :v:

Doh004
Apr 22, 2007

Mmmmm Donuts...
Anyone else getting this when trying to submit an App?



*edit* And we're fixed now.

Doh004 fucked around with this message at 20:00 on Oct 30, 2013

kitten smoothie
Dec 29, 2001

Yeah, I am really wondering what the hell goes on in a review that it can be "In Review" for half a day and they don't even open the app once.

Doctor w-rw-rw-
Jun 24, 2008

kitten smoothie posted:

Yeah, I am really wondering what the hell goes on in a review that it can be "In Review" for half a day and they don't even open the app once.

They are known to sometimes analyze the program code, in rare (?) cases.

haveblue
Aug 15, 2005



Toilet Rascal
That's easily automated, in fact they do a quick pass when you first submit and you can get trivially rejected in seconds for accidentally using a private property or something.

Doctor w-rw-rw-
Jun 24, 2008

haveblue posted:

That's easily automated, in fact they do a quick pass when you first submit and you can get trivially rejected in seconds for accidentally using a private property or something.

I'm talking about in-depth human analysis passes. They do it sometimes.

lord funk
Feb 16, 2004

I've got some .txt files that are essentially arrays of numbers (one per line). To get that data into an NSArray, I've been using this:

code:
NSString *title = @"fileName";
NSString *type = @"txt";
NSString *separation = @"\n";
NSString *fileText = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:title ofType:type]
                                               encoding:NSMacOSRomanStringEncoding error:nil];
NSArray *waveformArray = [NSArray arrayWithArray:[fileText componentsSeparatedByString:separation]];
But componentsSeparatedByString is dog slow when I loop this. There has to be a better way.

Carthag Tuek
Oct 15, 2005

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



lord funk posted:

I've got some .txt files that are essentially arrays of numbers (one per line). To get that data into an NSArray

If the files are always the same in a given build, you could add a build step that generates .h/.m files containing the arrays and then include those.

lord funk
Feb 16, 2004

Carthag posted:

If the files are always the same in a given build, you could add a build step that generates .h/.m files containing the arrays and then include those.

That sounds great. How would I do that? :)

Doc Block
Apr 15, 2003
Fun Shoe
Just make a command-line tool that reads in the text files and spits out .h/.m files. Then have it run at build time, before compilation.

lord funk
Feb 16, 2004

Doc Block posted:

Just make a command-line tool that reads in the text files and spits out .h/.m files. Then have it run at build time, before compilation.

Okay got it. Thanks.

Carthag Tuek
Oct 15, 2005

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



Here's a guy using a build step to have Ragel generate an .m from a grammar file:

https://plus.google.com/109028627294998653069/posts/C6d1YkcY8kW

Doctor w-rw-rw-
Jun 24, 2008

Carthag posted:

If the files are always the same in a given build, you could add a build step that generates .h/.m files containing the arrays and then include those.

I don't think generating code in that way is optimal if it's just importing data. Adding a build step that instead generates a plist file that is included in the bundle seems like a better idea, especially since plists are basically NSCoding: the file format.

Doc Block
Apr 15, 2003
Fun Shoe
Yeah, that's a better idea. A command-line utility that splits the text files up into arrays and saves them out to plists, which you can then load on the device easily and fairly quickly.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Also JSON. No idea if it's faster than an XML plist but it's less bulky.

Doc Block
Apr 15, 2003
Fun Shoe
plists are easier to load, but if there's so much data that file size is an issue then you should probably be looking at using Core Data or something.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doc Block posted:

plists are easier to load, but if there's so much data that file size is an issue then you should probably be looking at using Core Data or something.

That's true, by one line :) I wasn't worried about file size, more about reading/editing by hand. But yeah if we're talking millions of numbers SQLite is a good way to ship it.

Adbot
ADBOT LOVES YOU

NoDamage
Dec 2, 2000

lord funk posted:

I've got some .txt files that are essentially arrays of numbers (one per line). To get that data into an NSArray, I've been using this:

code:
NSString *title = @"fileName";
NSString *type = @"txt";
NSString *separation = @"\n";
NSString *fileText = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:title ofType:type]
                                               encoding:NSMacOSRomanStringEncoding error:nil];
NSArray *waveformArray = [NSArray arrayWithArray:[fileText componentsSeparatedByString:separation]];
But componentsSeparatedByString is dog slow when I loop this. There has to be a better way.
Um, Core Data or plists seem like overkill to me. You just need something that can read your text files one line at a time, instead of reading the entire string at once and then splitting it. Like this.

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