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
Doh004
Apr 22, 2007

Mmmmm Donuts...

lord funk posted:

I am so sick of reusable views it's beyond description.

Go on...

Adbot
ADBOT LOVES YOU

lord funk
Feb 16, 2004

How hard can it really be? Cell for item at indexPath. Use the indexPath to look up the model, populate the cell with the content of the model.

Am I doing this wrong? Because my cell content just jumbles itself around as it sees fit.

Edit: this is mostly rhetorical, since I know I'm doing it wrong

lord funk fucked around with this message at 23:50 on Feb 28, 2014

lord funk
Feb 16, 2004

Yep. I have a tableView inside each cell of my collectionView. I thought it would be wasteful to -reloadData every time they reappear, so I tried a lightweight method that only updated visible cells. Works great, until all the collectionView cells play musical chairs with the reusable views and the tableViews' count doesn't match its model.

wakachamo
Dec 3, 2013

You had me at "tableView inside each cell".

My brain hurts now.

lord funk
Feb 16, 2004

Had to go that route. Too many views to load, and scrolling got so bad it caused other apps' audio to stutter.

Any time you see this many repeated views, it just makes sense to tableview that bitch up:


Scrolling:

haveblue
Aug 15, 2005



Toilet Rascal
How do you present a modal popover with a custom frame? No matter what I do the OS forces it to the "form sheet" size.

Doh004
Apr 22, 2007

Mmmmm Donuts...

haveblue posted:

How do you present a modal popover with a custom frame? No matter what I do the OS forces it to the "form sheet" size.

Set the bounds on the modal view's superview to the size you want on viewWillLayoutSubviews.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

haveblue posted:

How do you present a modal popover with a custom frame? No matter what I do the OS forces it to the "form sheet" size.

If you mean popover as in UIPopoverController, set its popoverContentSize or the content view controller's preferredContentSize. If you mean -presentViewController:animated:completion: then do a custom transition (here's a decent intro, though the warning at the top about landscape orientation issues is overblown). Custom transitions are new in iOS 7, so if you support earlier versions that's no good.

There's also mucking with your modal's superview as mentioned above but I remember that stopped working or changed behavior between iOS releases? Either way mucking with view hierarchies you don't control can be a pain to support.

haveblue
Aug 15, 2005



Toilet Rascal
Sorry, I meant just a modal VC.

The "mess with superview" method seems to be working for now, and we do have to support <7. Thanks!

Doh004
Apr 22, 2007

Mmmmm Donuts...

pokeyman posted:

There's also mucking with your modal's superview as mentioned above but I remember that stopped working or changed behavior between iOS releases? Either way mucking with view hierarchies you don't control can be a pain to support.

It's a dumb hack IMO but it's still working for us in iOS7 *knocks on wood*

lmao zebong
Nov 25, 2006

NBA All-Injury First Team
Has anyone messed around with creating a preprocessor definition that, if it meets a certain criteria, inserts a #warning pragma? At my work some of the code we are writing is simply to work around some iOS7 oddities (namely, a UITableViewCells' clipToBounds is YES on 7.0 but set to NO on 7.1), and we wanted to create a preprocessor definition that can take in a deployment target and if our deployment target is 7.1, a warning is created to remind us to remove now redundant code. Something to the effect of :

code:
#define depreciated(deploymentTarget)                                   \
        if (__IPHONE_OS_VERSION_MIN_REQUIRED > deploymentTarget) {      \
            #warning THIS CODE IS NOW DEPRECIATED AND SHOULD BE REMOVED \
        }
but Xcode is obviously not happy with that. Is there any way to achieve what we're trying to do here gracefully?

duck monster
Dec 15, 2004

Is XCode normally retarded when it comes to C++ and warnings/autocomplete?

Normally all that poo poo works great with ObjC , but I'm doing C++ at the moment and the thing can take sometimes a couple of minutes to register a change in a header and update the errors marked in the .cpp file, not to mention complete autocomplete uselessness.

:(

Not sure if set up wrong, or just XCode being poo poo at C++.

Hughlander
May 11, 2005

lmao zebong posted:

Has anyone messed around with creating a preprocessor definition that, if it meets a certain criteria, inserts a #warning pragma? At my work some of the code we are writing is simply to work around some iOS7 oddities (namely, a UITableViewCells' clipToBounds is YES on 7.0 but set to NO on 7.1), and we wanted to create a preprocessor definition that can take in a deployment target and if our deployment target is 7.1, a warning is created to remind us to remove now redundant code. Something to the effect of :

code:
#define depreciated(deploymentTarget)                                   \
        if (__IPHONE_OS_VERSION_MIN_REQUIRED > deploymentTarget) {      \
            #warning THIS CODE IS NOW DEPRECIATED AND SHOULD BE REMOVED \
        }
but Xcode is obviously not happy with that. Is there any way to achieve what we're trying to do here gracefully?

Look into static assert and check my post history here. I did something similar for version warning in cross compile code.

Doctor w-rw-rw-
Jun 24, 2008
Two of the things the Paper team made have been open-sourced:

https://github.com/facebook/KVOController
https://github.com/facebook/Shimmer

The first one made KVO a lot cleaner, the second one was how we made things shimmer in Paper.

lord funk
Feb 16, 2004

:neckbeard: This is great, thanks!

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

lmao zebong posted:

Has anyone messed around with creating a preprocessor definition that, if it meets a certain criteria, inserts a #warning pragma? At my work some of the code we are writing is simply to work around some iOS7 oddities (namely, a UITableViewCells' clipToBounds is YES on 7.0 but set to NO on 7.1), and we wanted to create a preprocessor definition that can take in a deployment target and if our deployment target is 7.1, a warning is created to remind us to remove now redundant code. Something to the effect of :

code:
#define depreciated(deploymentTarget)                                   \
        if (__IPHONE_OS_VERSION_MIN_REQUIRED > deploymentTarget) {      \
            #warning THIS CODE IS NOW DEPRECIATED AND SHOULD BE REMOVED \
        }
but Xcode is obviously not happy with that. Is there any way to achieve what we're trying to do here gracefully?

The best I could come up with without using C++ is doing something like this:

Objective-C code:
/* Deprecation.h */

#import <Foundation/NSObjCRuntime.h>

// This is the macro to use.
#define deprecated(version) deprecated_##version ()

// Machinery to make that work:

// Missing from iOS 7.0 SDK (and iOS 6 SDKs).
#ifndef __NSd_7_1
#define __NSd_7_1 ,deprecated=7.1
#endif

// The 2_0 here is when the API was "introduced".
// For our purposes this just needs to be at least the deployment target.
#define deprecated_helper(version) \
    void deprecated_##version (void) NS_DEPRECATED_IOS(2_0, version, "This code is obsolete."); \
    void deprecated_##version (void) {}

// One of these for each version we care about.
deprecated_helper(7_0);
deprecated_helper(7_1);
You might use it like this (the curly braces just section the relevant part):

Objective-C code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = ...

    { deprecated(7_1);
        cell.clipsToBounds = NO;
    }
}
But it's kinda ugly. I'd prefer to make helper methods/functions and add the deprecated attribute to those. Handy macros are defined in NSObjCRuntime.h as you can see above.

lmao zebong
Nov 25, 2006

NBA All-Injury First Team

Fantastic, thanks! It's a pretty interesting thought exercise and has generated a lot of discussion within my team, thanks for the help.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Facebook open sourced a thing:
https://github.com/facebook/chisel

Facebook posted:

Chisel is a collection of LLDB commands to assist in the debugging of iOS apps.

Pretty neat.

shodanjr_gr
Nov 20, 2007

duck monster posted:

Is XCode normally retarded when it comes to C++ and warnings/autocomplete?

Normally all that poo poo works great with ObjC , but I'm doing C++ at the moment and the thing can take sometimes a couple of minutes to register a change in a header and update the errors marked in the .cpp file, not to mention complete autocomplete uselessness.

:(

Not sure if set up wrong, or just XCode being poo poo at C++.

I think that's the case. For a large-ish project (40-50k LoC) with multiple sub-libraries and big external dependencies (boost, qt, etc), Xcode code sense frequently chokes. VS2012 also struggles a bit but not as much.

I was wondering, are there any alternatives to Apple's OpenGL Profiler for debugging GL applications in Mavericks? I've got one particular QT4.8 application that uses OpenGL 4.0 Core and just dies when I try to break into it with the profiler.

dizzywhip
Dec 23, 2005

This is a bit of a long shot, but if anyone has some experience with Core Audio I could use some help.

I'm doing some basic MIDI playback on iOS and my output volume is pretty low, so I wanted to boost it a bit. I'm trying to add a dynamics processor effect unit so I can adjust the gain on it to get the volume I want.

What I've been using is a few sampler units going into a multichannel mixer unit which goes into a remote IO unit. That's been working fine, but when I insert a dynamics processor unit between the mixer and the remote IO, I get error -10868 (kAudioUnitErr_FormatNotSupported) when initializing the graph. Here's the output of CAShow in both cases:

Without dynamics processor

code:
AudioUnitGraph 0x159B001:
  Member Nodes:
	node 1: 'aumx' 'mcmx' 'appl', instance 0x14eb5a20 O I
	node 2: 'auou' 'rioc' 'appl', instance 0x14e2d290 O I
	node 3: 'aumu' 'samp' 'appl', instance 0x14da0f60 O I
	node 4: 'aumu' 'samp' 'appl', instance 0x14db1eb0 O I
	node 5: 'aumu' 'samp' 'appl', instance 0x181677d0 O I
	node 6: 'aumu' 'samp' 'appl', instance 0x18177910 O I
  Connections:
	node   1 bus   0 => node   2 bus   0  [ 2 ch,  44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved]
	node   3 bus   0 => node   1 bus   0  [ 2 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
	node   4 bus   0 => node   1 bus   1  [ 2 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
	node   5 bus   0 => node   1 bus   2  [ 2 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
	node   6 bus   0 => node   1 bus   3  [ 2 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
  CurrentState:
	mLastUpdateError=0, eventsToProcess=F, isInitialized=T, isRunning=F
With dynamics processor

code:
AudioUnitGraph 0x1584001:
  Member Nodes:
	node 1: 'aumx' 'mcmx' 'appl', instance 0x17652760 O  
	node 2: 'aufx' 'dcmp' 'appl', instance 0x176b3100 O  
	node 3: 'auou' 'rioc' 'appl', instance 0x175e9a50 O  
	node 4: 'aumu' 'samp' 'appl', instance 0x1752dfd0 O  
	node 5: 'aumu' 'samp' 'appl', instance 0x17522650 O  
	node 6: 'aumu' 'samp' 'appl', instance 0x17752840 O  
	node 7: 'aumu' 'samp' 'appl', instance 0x1750d980 O  
  Connections:
	node   1 bus   0 => node   2 bus   0  [ 2 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
	node   2 bus   0 => node   3 bus   0  [ 2 ch,      0 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
	node   4 bus   0 => node   1 bus   0  [ 2 ch,  44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved]
	node   5 bus   0 => node   1 bus   1  [ 2 ch,  44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved]
	node   6 bus   0 => node   1 bus   2  [ 2 ch,  44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved]
	node   7 bus   0 => node   1 bus   3  [ 2 ch,  44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved]
  CurrentState:
	mLastUpdateError=0, eventsToProcess=F, isInitialized=F, isRunning=F
So a few things are weird here -- the sample rate is set to 0 for the connection between the dynamics processor and the output. I set it to 44100 manually, which fixes that particular issue, but I still get the same error.

What seems to be the bigger issue is that when the dynamics processor is present, the mixer and output seem to go from using an integer format to a floating point format, while the opposite happens for the sampler nodes. The "I" at the end of each node also disappears, but I don't know what that means. I tried manually setting the formats back to what they were before adding the dynamics processor, but it didn't seem to have any effect.

If anyone can explain what's going on or has any advice, I'd appreciate it. All I want to do is make the output louder, so it'd be awesome if there was some easier way to do that that I'm overlooking.

lord funk
Feb 16, 2004

dizzywhip posted:

... if there was some easier way to do that that I'm overlooking.
Have you increased the note on velocity values of your MIDI file? Also make sure both CC 7 and CC 11 are set to 127 (although this is generally the default). You may have already looked at that, though.

dizzywhip
Dec 23, 2005

Yeah, it's still pretty quiet even when the velocity values and the volumes of each track are maxed out. I think the samples I'm using are just kind of quiet. There needs to be some variance in the velocity anyways because this is for an app where the user can control the dynamics of the notes being played. Thanks though!

no.op
Oct 27, 2007
Maybe need to add converter AUs before and after the dynamics processor AU?

This looks similar:
http://stackoverflow.com/questions/13684162/ios-audioformat-issue-linking-up-mixer-remoteio-and-dynamics-processor?rq=1

lord funk
Feb 16, 2004

I'm interested in the solution just for curiosity sake, but I still think the problem is your source samples being too quiet. Do you supply your own samples? Are they normalized / gain adjusted to get the maximum volume? A dynamics plugin just to increase the volume of sample playback sounds like a bandaid solution to me.

dizzywhip
Dec 23, 2005

no.op posted:

Maybe need to add converter AUs before and after the dynamics processor AU?

This looks similar:
http://stackoverflow.com/questions/13684162/ios-audioformat-issue-linking-up-mixer-remoteio-and-dynamics-processor?rq=1

Hmm this looks like the most likely solution. Now I just gotta figure out how to actually set up the converters.

I also opened up a technical support issue with Apple about this, so if this doesn't pan out, hopefully they can help. I'll keep you all updated on what happens.

lord funk posted:

I'm interested in the solution just for curiosity sake, but I still think the problem is your source samples being too quiet. Do you supply your own samples? Are they normalized / gain adjusted to get the maximum volume? A dynamics plugin just to increase the volume of sample playback sounds like a bandaid solution to me.

Yeah, that's kind of the core problem. The samples come from a general MIDI soundfont that I bought, and there's something like a couple hundred samples, so it'd be really tedious to fix all of them unfortunately. Even if I did though, I'd like to have a tweakable gain setting, and I also actually want to use the compression features of the dynamics processor, so either way I'd like to get it working.

dizzywhip
Dec 23, 2005

The converter units ended up fixing things. It took me a while to figure it out, but it works perfectly when I configure them with the output format of the mixer and the input format of the compressor. Thanks for the help!

Doh004
Apr 22, 2007

Mmmmm Donuts...
7.1 is live. Anyone notice any big changes for apps?

lord funk
Feb 16, 2004

Doh004 posted:

7.1 is live. Anyone notice any big changes for apps?

I feel bad because I've been testing with BeepStreet's Sunrizer synth, and the app would crash whenever you tried to switch presets. Should have sent him a note - he's just pushing a fix now.

Doh004
Apr 22, 2007

Mmmmm Donuts...
I just updated a poo poo ton of integer/unsignedinteger/long warnings.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doh004 posted:

I just updated a poo poo ton of integer/unsignedinteger/long warnings.

On a related topic, is there a decent explanation of which way to cast when you're comparing integers of different signedness? I have a feeling it's not as simple as I'd like because C. Assume the numbers I'm comparing are both in the range of [0, MAX_INT].

My intuition is that it doesn't matter.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

pokeyman posted:

On a related topic, is there a decent explanation of which way to cast when you're comparing integers of different signedness? I have a feeling it's not as simple as I'd like because C. Assume the numbers I'm comparing are both in the range of [0, MAX_INT].

My intuition is that it doesn't matter.

It doesn't matter if the numbers are both in the common range. In general, you're more likely to run into the boundary conditions of unsigned numbers. Mostly, you should consistently use one type if you can.

Carthag Tuek
Oct 15, 2005

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



Doh004 posted:

7.1 is live. Anyone notice any big changes for apps?

Look thru for every release:

https://github.com/nst/iOS-Runtime-Headers/commit/7ef0330f961248b9021e59e12aa3182440194817

Doh004
Apr 22, 2007

Mmmmm Donuts...

I feel very dumb for asking this, but how do I see the differences in the specific header file that I want to see?

Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do
To pull away from code discussion a little, I'm struggling to understand how a developed app gets tested on a device, then deployed to the App Store.

Let's start with a single developer. Alice has created a simple app. She has an Apple ID that she uses for development: alice@example.com (is this the same Apple ID as her iCloud/iTunes account? Should it / should it not be?). So she signs up for 99$/year for alice@example.com to be able to sell apps on the App Store. With some magic, she gets a provisioning profile that allows her to test the app on her phone. Once it's tested, she uploads the app to Apple (is it uploaded as code or as a compiled binary?). Apple does some signing magic with it, then puts it on the iTunes Store under Alice's name.

Is that an accurate summary?

Where I'm really struggling is with a small company, though. Let's have a company (ABC Inc) that consists of Alice, Bob, and Carol as developers. Do they each have their own individual Apple IDs that are tagged as developers (without paying the 99$ a year)? Does the company have its own Apple ID, tied to like, abc@example.com? How do Alice, Bob, and Carol all individually load the app onto their device(s) to test? When an app is uploaded to Apple, who does that uploading? How does this change if it's not actually the case that Alice, Bob, and Carol have their *own* machines, but will randomly use one of the three machines in the office on any given day?

I guess what I'm struggling with is the relationship between developer-person, workstation, Apple ID, and companies.

I'm presuming the Enterprise account works just like a small company, except with more weird things around provisioning profiles.

Can someone please shed some light? I've read through Apple's documents and done some googling, but have generally only come out more confused than before.

Doc Block
Apr 15, 2003
Fun Shoe
A company can add multiple developers to its account IIRC. So each developer would need their own Apple ID (as would the company, obviously) but wouldn't have to individually enroll in the developer program. Then the company can just enter any devices it wants to test on in the device provisioning portal.

Then it's just a matter of installing the necessary provisioning profile(s) on those devices.

And you upload the app as a binary; Apple never sees the source code.

HaB
Jan 5, 2001

What are the odds?

Axiem posted:

To pull away from code discussion a little, I'm struggling to understand how a developed app gets tested on a device, then deployed to the App Store.

Let's start with a single developer. Alice has created a simple app. She has an Apple ID that she uses for development: alice@example.com (is this the same Apple ID as her iButt/iTunes account? Should it / should it not be?). So she signs up for 99$/year for alice@example.com to be able to sell apps on the App Store. With some magic, she gets a provisioning profile that allows her to test the app on her phone. Once it's tested, she uploads the app to Apple (is it uploaded as code or as a compiled binary?). Apple does some signing magic with it, then puts it on the iTunes Store under Alice's name.

Is that an accurate summary?

Where I'm really struggling is with a small company, though. Let's have a company (ABC Inc) that consists of Alice, Bob, and Carol as developers. Do they each have their own individual Apple IDs that are tagged as developers (without paying the 99$ a year)? Does the company have its own Apple ID, tied to like, abc@example.com? How do Alice, Bob, and Carol all individually load the app onto their device(s) to test? When an app is uploaded to Apple, who does that uploading? How does this change if it's not actually the case that Alice, Bob, and Carol have their *own* machines, but will randomly use one of the three machines in the office on any given day?

I guess what I'm struggling with is the relationship between developer-person, workstation, Apple ID, and companies.

I'm presuming the Enterprise account works just like a small company, except with more weird things around provisioning profiles.

Can someone please shed some light? I've read through Apple's documents and done some googling, but have generally only come out more confused than before.

I am no expert, but the Provisioning profile for Development and for Production are usually two different things. A, B or C can create it, and add the other 2 devs devices to it for testing purposes. When the app goes to production, you can use the Company provisioning profile instead.

Edit: to clarify - for development/testing on A, B & C's devices - AppleID doesn't matter. One of them can create the profile, then adds the device UDID (can be gotten from iTunes) to the profile, then the app will run on any device which is on the list. Like, I am a sole developer, but I have about 5-6 friends who test for me on their phones, none of whom are developers. They sent me Device IDs for their phones, and I create a profile that has all the IDs on it. Then I can send them an .ipa file to test with, and they can install in iTunes.

HaB fucked around with this message at 19:49 on Mar 12, 2014

Filburt Shellbach
Nov 6, 2007

Apni tackat say tujay aaj mitta juu gaa!
code:
(lldb) p destination.section
error: property 'section' not found on object of type 'NSIndexPath *'
lldb, quit gaslighting me about this one. Jesus.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Frustrating as gently caress, I just print out the entire NSIndexPath and read its description.

Carthag Tuek
Oct 15, 2005

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



Doh004 posted:

I feel very dumb for asking this, but how do I see the differences in the specific header file that I want to see?

Github is suppressing them cause the changeset is huge, but you can clone the repo and look that way.

Adbot
ADBOT LOVES YOU

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I'll hit the parts that I didn't see answered here. Overall though you might be better off calling Apple and asking them directly about what you want to do (you're being a little vague). They're not too bad on the phone.

Axiem posted:

Let's start with a single developer. Alice has created a simple app. She has an Apple ID that she uses for development: alice@example.com (is this the same Apple ID as her iCloud/iTunes account? Should it / should it not be?).

It can be the same ID. It doesn't have to be. I'm not aware of any particular downside with either approach. Some people keep them separate for organizational convenience, or maybe to have a stronger password on their developer account that they don't have to type in for every purchase on their phone. Others combine everything together.

quote:

Where I'm really struggling is with a small company, though. Let's have a company (ABC Inc) that consists of Alice, Bob, and Carol as developers. Do they each have their own individual Apple IDs that are tagged as developers (without paying the 99$ a year)? Does the company have its own Apple ID, tied to like, abc@example.com? How do Alice, Bob, and Carol all individually load the app onto their device(s) to test? When an app is uploaded to Apple, who does that uploading? How does this change if it's not actually the case that Alice, Bob, and Carol have their *own* machines, but will randomly use one of the three machines in the office on any given day?

The company buys an account and adds other Apple IDs to it as developers. Those developers do not need to spend any money in order to use the company account. An Apple ID can belong to many companies/organizations/groups (including their own personal developer account), you just pick which organization you want whenever you log in or do things through Xcode. As mentioned, accounts (even individual developer accounts) can add other Apple IDs, giving them various permissions (ranging from "just sales data" to "manages apps and versions thereof").

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