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
DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
Awesome, thanks!

On that note, any reason why UITapGestureRecognizer would "work" in the simulator, but once on a real device, it doesn't receive any taps? Found this one bug only after deploying on my device, it was working perfectly on the simulator.

Is there a situation where the device is able to distinguish between different kinds of touch events and the simulator cannot?

Adbot
ADBOT LOVES YOU

Doh004
Apr 22, 2007

Mmmmm Donuts...
Is it a small area that receives the tap? I always find that I'm much more precise with a click of the mouse (duh) and sometimes things aren't as easy as they were.

tarepanda
Mar 26, 2011

Living the Dream
Is it possible to set separate storyboards for separate devices? I'm aware of autolayout, but there are some things I could do with the extra real estate on the iPhone 5...

Doc Block
Apr 15, 2003
Fun Shoe
I don't think there's anything automagic. You'd have to detect the bigger screen in code and then use the appropriate storyboard.

Bonefish
Jul 29, 2008
Using the notification MPAVControllerPlaybackStateChangedNotification solves a problem for me in my app, but I am concerned that using it will block my app from the app store since it is not documented. Does anyone have any insight on my chances, or suggestions on whether or not to use it? It really is the only way to provide a convenient feature to my app.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I would make sure your app still works without that notification, since you're relying on undocumented behaviour, but I doubt using that notification would net you a rejection. Anyone can listen to everything passing through a NSNotificationCenter, that's the entire point.

tarepanda
Mar 26, 2011

Living the Dream
I'm a little confused about Testflight.

Am I correct in assuming from what I've read that:

1. Developers have access to a master dashboard showing all devices and the versions of the app installed.

2. Developers can wirelessly push new versions of the app to selected devices without user interaction.

3. Developers can use Tflog like NSLog to log things, then remotely access those logs from the dashboard.

Edit: I'm really vague on what I'm even supposed to be doing. There are no screenshots of the dashboards that I can find, no examples on how to get started... do I just grab the SDK and put it in the app?

Not a big fan of the site...

tarepanda fucked around with this message at 00:35 on Nov 8, 2012

Doc Block
Apr 15, 2003
Fun Shoe
1)yes
2)no, user interaction is required
3)yes, it sends them off to TestFlight (you aren't remotely accessing them on the user's device or anything like that)

In order for TestFlight to be the most useful you have to send it the user's UDID, but Apple doesn't allow this and will reject your app. So I have some macros that call TestFlight when compiled with BETA_TEST defined, log to the console for regular debug builds, and do nothing for distribution builds.

edit: they have directions right there on the site.

tarepanda
Mar 26, 2011

Living the Dream
Hmm, I've been looking for something I could use to push updates to all of the iPads we have for demo/testing.

Where are the directions? All I see are feature lists.

Doc Block
Apr 15, 2003
Fun Shoe
Download the SDK, and on the download page there'll be a link to the SDK documentation, including how to set it up.

You might have to create an account first, I don't remember.

tarepanda
Mar 26, 2011

Living the Dream
Aha.

See, in my mind, I didn't want to download the SDK or sign up until I knew what I was getting into.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Stop being so fussy, Testflight is great.

tarepanda
Mar 26, 2011

Living the Dream

Ender.uNF posted:

Stop being so fussy, Testflight is great.

I'm sure it is, but it's not what I was looking for and it was really hard to figure that out from what was on the site.

Doc block, you might be able to help with this.

I'm using a subclass based on Doc block's AVfoundation stuff that he graciously posted earlier; I have a UIView that I made in the storyboard editor and set to that subclass.

Every time I switch to that particular scene, my memory usage jumps up... and doesn't go down accordingly if I leave the scene. However, if I never start the capture session, the memory usage doesn't jump up.

Am I doing something fundamentally wrong here?

tarepanda fucked around with this message at 08:16 on Nov 8, 2012

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Well if it helps, Testflight will notify users when a new build is available and tracks who actually installed it, all without the SDK.

Have you done a simulate memory warning in the simulator? The AVFoundation classes seem to cache a lot of stuff so long as memory is available. For playback it adjusts how much it caches from flash based on memory. Speaking of, is this on device or in the simulator?

Could be a good old fashioned memory leak too.

Simulated fucked around with this message at 14:19 on Nov 8, 2012

Doc Block
Apr 15, 2003
Fun Shoe
Hopefully it isn't a memory leak. I use that class in a shipping app, and didn't see any memory leaks in instruments.

Does the memory usage keep jumping every time you go to the camera view, or does it just go up and stay up the first time? It could be AVFoundation itself getting loaded.

Does the leaks instrument show anything?

edit: you're compiling it with ARC, right?

tarepanda
Mar 26, 2011

Living the Dream
Using ARC. It jumps by about 10 MB every time the view appears and never goes back down. The other view I'm using it in works fine and transitions without leaks at all.

The only difference between the two is that one is the actual view and the other (the leaky one) is a view inside the view in a scene.

Leaks tool and Analyze tool didn't find anything.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
Can one test one's app with the AppStore provisioning profile? I'd like to get as close as possible to the final thing in testing before submitting it.

Also, do I need to create a new profile for each certificate that was enabled for a new iOS capability such as Remote Notifications? As in, I already have a non-Push-enabled AppStore profile from the previous version. I added the capability in the new version. Do I need a new profile?

DreadCthulhu fucked around with this message at 23:00 on Nov 8, 2012

Doh004
Apr 22, 2007

Mmmmm Donuts...
Anyone have any idea why my UIActionSheet isn't being initialized? I break right when it's going to be init'd, and when I go to the next line it's still nil. This is after the view loaded.

code:
    
self.profileOptionSheet = [[UIActionSheet alloc] 
	initWithTitle:[self.entity valueForKey:@"DisplayName"] 
	delegate:self 
	cancelButtonTitle:@"Cancel" 
	destructiveButtonTitle:@"huh" 
	otherButtonTitles:@"Sup", @"Bro", nil];
self.profileOptionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
:(

*edit* And yes, I added UIActionSheetDelegate to the ViewController. It's a UITableViewController. Does that matter?

*edit #2* I even set it to a dummy frame, and I've tried showing it in the self.view, self.tableView and also

code:
[self.profileOptionSheet showInView:[UIApplication sharedApplication].keyWindow];

Doh004 fucked around with this message at 23:05 on Nov 8, 2012

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

DreadCthulhu posted:

Can one test one's app with the AppStore provisioning profile? I'd like to get as close as possible to the final thing in testing before submitting it.

You do an archive using a distribution profile, then do Distribute...->Save for Enterprise... and make an IPA using an Ad Hoc distribution profile. You can then install that IPA on your device from the Device panel of the Organizer.

After you test that IPA you can submit the same build without changing anything.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

ultramiraculous posted:

You do an archive using a distribution profile, then do Distribute...->Save for Enterprise... and make an IPA using an Ad Hoc distribution profile. You can then install that IPA on your device from the Device panel of the Organizer.

After you test that IPA you can submit the same build without changing anything.

So you're saying I can submit to the app store with an IPA using the AdHoc profile? Is an AdHoc profile completely interchangeable with an AppStore profile?

Doh004
Apr 22, 2007

Mmmmm Donuts...

Doh004 posted:

Anyone have any idea why my UIActionSheet isn't being initialized? I break right when it's going to be init'd, and when I go to the next line it's still nil. This is after the view loaded.

code:
    
self.profileOptionSheet = [[UIActionSheet alloc] 
	initWithTitle:[self.entity valueForKey:@"DisplayName"] 
	delegate:self 
	cancelButtonTitle:@"Cancel" 
	destructiveButtonTitle:@"huh" 
	otherButtonTitles:@"Sup", @"Bro", nil];
self.profileOptionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
:(

*edit* And yes, I added UIActionSheetDelegate to the ViewController. It's a UITableViewController. Does that matter?

*edit #2* I even set it to a dummy frame, and I've tried showing it in the self.view, self.tableView and also

code:
[self.profileOptionSheet showInView:[UIApplication sharedApplication].keyWindow];

Aha! I had to set it as strong when defining the property! Interesting :iiam:

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.

tarepanda posted:

Using ARC. It jumps by about 10 MB every time the view appears and never goes back down. The other view I'm using it in works fine and transitions without leaks at all.

The only difference between the two is that one is the actual view and the other (the leaky one) is a view inside the view in a scene.

Leaks tool and Analyze tool didn't find anything.

The leaks tool by itself doesn't do much good under ARC. You need to be using the Allocations instrument and doing heapshots, looking for the top-most object that is leaking and finding a circular reference that's keeping it alive.

I believe you can go into the Leaks tool and see all of the retain and release statements that reference said object, even under ARC, though I've had mixed luck doing so.

Doc Block
Apr 15, 2003
Fun Shoe
tarepanda, make sure your completion block isn't retaining self. Only thing I could think of off the top of my head.

I'll look into SRCameraView tonight and see if I missed anything. In my app I push and pop it and its view controller onto a navigation controller without any obvious memory leaks. Memory usage goes up when it's created (though not by 10MB IIRC), then back down when it's destroyed.

Doc Block
Apr 15, 2003
Fun Shoe

tarepanda posted:

Using ARC. It jumps by about 10 MB every time the view appears and never goes back down. The other view I'm using it in works fine and transitions without leaks at all.

The only difference between the two is that one is the actual view and the other (the leaky one) is a view inside the view in a scene.

Leaks tool and Analyze tool didn't find anything.

That's strange. Maybe the problem isn't SRCameraView but the other view?

Also, I looked at SRCameraView again and couldn't find any problems. The idle memory consumption of the CameraTest app hovers around a megabyte. When a picture is taken memory usage jumps up to 32MB (!!!) on my iPhone 5, but goes back down after you hit Retake or Use.

edit: pushed a small update to Github. No drastic changes, certainly not anything that would make a 10MB memory leak go away.

Doc Block fucked around with this message at 07:17 on Nov 9, 2012

tarepanda
Mar 26, 2011

Living the Dream
I thought it was my view first too, but then when I checked everything over, I decided to comment out the lines starting/ending the camera session... and boom, no leak.

Doc Block
Apr 15, 2003
Fun Shoe
Hmmm... no idea. I'll look into it some more tomorrow.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

DreadCthulhu posted:

So you're saying I can submit to the app store with an IPA using the AdHoc profile? Is an AdHoc profile completely interchangeable with an AppStore profile?

Basically any archive build that has an "iPhone Distribution" code signing identity, as opposed to "iPhone Developer" identity, can be submitted to the App Store or distributed with a distribution Ad Hoc cert.

So, yes, I think?

tarepanda
Mar 26, 2011

Living the Dream

Doc Block posted:

tarepanda, make sure your completion block isn't retaining self. Only thing I could think of off the top of my head.

If it were, wouldn't the Analyzer point it out?

I'm convinced it has something to do with me setting a small UIView to the subclass in the XIB, since that seems to be the only difference between the two scenes...

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

tarepanda posted:

If it were, wouldn't the Analyzer point it out?
No, not necessarily. Static analysis cannot be both complete and sound without running into the halting problem, and while clang's analyzer is quite impressive, it's not that hard to trick. It also has some outright bugs; at least in 4.3 it did not detect self-retains which used the dot syntax.

tarepanda
Mar 26, 2011

Living the Dream

Plorkyeran posted:

No, not necessarily. Static analysis cannot be both complete and sound without running into the halting problem, and while clang's analyzer is quite impressive, it's not that hard to trick. It also has some outright bugs; at least in 4.3 it did not detect self-retains which used the dot syntax.

Crap -- I use the dot syntax everywhere, too.

Edit: Doc Block, I don't think it's you. I went back into Allocations and tried some other things -- apparently every time I go to the other scene, it makes a new instance of the cameraview AND the view controller. Every single time.

Edit 2: Apparently, for some reason, the scene is calling viewDidLoad every single time it appears...

Edit 3: And apparently my big leak is due to a CIFilter applied in one scene that's retained when we go to the next, though all of them are released properly if you go back to the original scene... huh.

tarepanda fucked around with this message at 01:16 on Nov 10, 2012

dizzywhip
Dec 23, 2005

This is a bit of a longshot, but does anyone have experience with using Core Audio with app sandboxing? I've just enabled sandboxing, and now my Core Audio code doesn't work. In particular, when I call AUGraphAddNode, it returns the error invalidComponentID, saying just "The operation couldn't be completed". A number of other Core Audio calls seem to work correctly before that, though.

It doesn't seem to be a direct sandbox violation, as there aren't any messages from sandboxd in Console, but it definitely works when I turn off sandboxing. Anyone know why this would possibly happen? The only thing I can imagine is that maybe it's trying to read files that I don't have access to, although I would think that would give me a sandboxing error.

Update:

I've narrowed down the issue a little bit. AUGraphAddNode only fails if I try to add a node with the component type kAudioUnitType_MusicDevice and subtype kAudioUnitSubType_DLSSynth, so it seems to be an issue with that particular component in sandboxing mode.

Update 2:

I've figured out a hacky workaround. If I add a temporary exception entitlement to enable read-write access to the user's entire home directory, the error no longer happens. This is obviously not ideal, so I'm continuing to search for better options. I tried to narrow down the access required by adding entitlements for more specific subdirectories, but that didn't work.

dizzywhip fucked around with this message at 01:54 on Nov 11, 2012

Harvey Mantaco
Mar 6, 2007

Someone please help me find my keys =(
You spend enough hours on something stupid, it's time to ask for help.

I have a Cocos2d project and a CCScene "MainDisplay" that has been getting touch events just dandy until now.

I downloaded a UIView/Controller from an opensource project I wanted to use and added it to MainDisplay using:
code:
    self.viewController = [[MLGViewController alloc] init];
    [[[CCDirector sharedDirector] view] addSubview:self.viewController.view];
    [self.viewController.view resignFirstResponder];
And it works fine. I double click and the selection box pops up where I double click. The only problem is that now the MainDisplay isn't get any touch events anymore!

The MLGViewController receives it's own touch events, and I'm not really able to remove it as a subview and manually funnel in the touch events from the MainDisplay class because within the MLGViewController there is this method:

code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    if (doubleClickReady)
    {
        NSArray *touchesArray = [touches allObjects];
        UITouch *touch = (UITouch *)[touchesArray objectAtIndex:0];
       [b] CGPoint point = [touch locationInView:self.view];[/b]
        
        [self handleCGPointGesture:point];
    }
    
    doubleClickReady =YES;
    [self performSelector:@selector(resetDoubleClickReady) withObject:nil afterDelay:.75f];
}
and this method finds the location to make this little UIView modal selection box pop up where it was clicked on the view, so if I funnel in touches from my CCScene it just breaks the goddamn thing, because I'm not able to tell where that click was on the view, because it wasn't clicked on the view :smith:

I'm ok with with not knowing too much about UIKit, I don't really need it for what I'm playing with, but this UIView is perfect and I really would like to use it - is there a solution I'm missing here? I'm hoping there's something obvious to one of you folks that I'm missing.

Doc Block
Apr 15, 2003
Fun Shoe
It would be helpful to know what you're trying to do with MLGViewController. From what I can see, it's just an example view controller to show how to make an MGTileMenu.

You should still be able to funnel touch input into the other view. The line CGPoint point = [touch locationInView:self.view]; is just converting the touch input coordinates (which are in screen space IIRC) into the view's coordinates. You should be able to call the method yourself from your own touch handler methods.

If you're just trying to detect a double tap so you can pop open an MGTileMenu, it'd probably be better to just detect the double tap yourself. The version of MLGViewController on GitHub doesn't use -touchesBegan:withEvent:, but instead uses a double tap gesture recognizer.

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

Gordon Cole posted:

This is a bit of a longshot, but does anyone have experience with using Core Audio with app sandboxing? I've just enabled sandboxing, and now my Core Audio code doesn't work. In particular, when I call AUGraphAddNode, it returns the error invalidComponentID, saying just "The operation couldn't be completed". A number of other Core Audio calls seem to work correctly before that, though.

It doesn't seem to be a direct sandbox violation, as there aren't any messages from sandboxd in Console, but it definitely works when I turn off sandboxing. Anyone know why this would possibly happen? The only thing I can imagine is that maybe it's trying to read files that I don't have access to, although I would think that would give me a sandboxing error.

Update:

I've narrowed down the issue a little bit. AUGraphAddNode only fails if I try to add a node with the component type kAudioUnitType_MusicDevice and subtype kAudioUnitSubType_DLSSynth, so it seems to be an issue with that particular component in sandboxing mode.

Update 2:

I've figured out a hacky workaround. If I add a temporary exception entitlement to enable read-write access to the user's entire home directory, the error no longer happens. This is obviously not ideal, so I'm continuing to search for better options. I tried to narrow down the access required by adding entitlements for more specific subdirectories, but that didn't work.

Is the component in the user's AU folder in ~/Library/Application Support/AudioComponent or whatever (I forget the exact folder name)? Or does that component rely on access to media files somewhere else?

I wonder what Apple's recommendation is for this... Should the CoreAudio part of your app be in a service process that has more permissive entitlements?

Harvey Mantaco
Mar 6, 2007

Someone please help me find my keys =(

Doc Block posted:

It would be helpful to know what you're trying to do with MLGViewController. From what I can see, it's just an example view controller to show how to make an MGTileMenu.

You should still be able to funnel touch input into the other view. The line CGPoint point = [touch locationInView:self.view]; is just converting the touch input coordinates (which are in screen space IIRC) into the view's coordinates. You should be able to call the method yourself from your own touch handler methods.

If you're just trying to detect a double tap so you can pop open an MGTileMenu, it'd probably be better to just detect the double tap yourself. The version of MLGViewController on GitHub doesn't use -touchesBegan:withEvent:, but instead uses a double tap gesture recognizer.

Yes, yes and yes. It did all these things and everything is wonderful in the world :slick:

I didn't realize you could just pass it into locationInView, I had tried that since it seemed obvious and it didn't work, but it was something else at the time buggering it up so I did it again and it worked. I'm detecting the double tap myself so we're good. Cheers.

dizzywhip
Dec 23, 2005

Ender.uNF posted:

Is the component in the user's AU folder in ~/Library/Application Support/AudioComponent or whatever (I forget the exact folder name)? Or does that component rely on access to media files somewhere else?

I wonder what Apple's recommendation is for this... Should the CoreAudio part of your app be in a service process that has more permissive entitlements?

I'm not really sure where it is to be honest. The only locations I know of where audio components are stored only have components that I've added myself, so I'm not sure where the native ones are. It does seem likely that that component is loading files that could be outside of the sandbox since it's a sampler, which could explain why this is the only component that causes this problem.

What's strange is that it seems to be doing something with the home folder itself. I get the error if I ask for permission for any of its subdirectories, including hidden ones.

It seems like a bug to me -- there's nothing about playing MIDI sequences that should require access to any files except the audio samples, and that should be a readable resource without any extra entitlements. I'm filing a bug report, hopefully it'll get fixed.

lord funk
Feb 16, 2004

Anyone know why the escape symbol ⎋ wouldn't be showing up for me? At first I thought it was because the Proxima Nova font didn't have it, but I checked and it does.



Edit: nevermind. Proxima Nova does not have that symbol. :/

lord funk fucked around with this message at 17:58 on Nov 12, 2012

Doh004
Apr 22, 2007

Mmmmm Donuts...
Hey, I need to check if there's a cookie saved for my app when it starts up. I know how to do all of this; however, how do I do this correctly while developing? Whenever I do a new build, it clears out the cookies for the app thus negating my development testing.

I'm trying to check for a cookie that has our login token, and if it's there, move past the login screen.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Cookies shouldn't be cleared between builds, so I'm not sure what that's about.

That said, you can grab the cookies from NSHTTPCookieStorage, grab their properties dictionary, and save that. Then you can deserialize them as needed.

Adbot
ADBOT LOVES YOU

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
Any recommendations for really cheap/free but still effective analytics services? I like the Mixpanel UX, but it gets really expensive really fast. They insist you only track a couple of events, but at my app's really early evolution stage I need to know everything about it.

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