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
lord funk
Feb 16, 2004

pokeyman posted:

Check out the organizer, I think there's lists of projects and/or repositories. Try deleting anything that looks relevant to that dialog box.

I did this again and again - I could even reload Xcode, check that it's not there, and then it will reappear 5 seconds later.

Turns out I had to hunt down the project folder and delete it.

Adbot
ADBOT LOVES YOU

lord funk
Feb 16, 2004

Is there a good way to determine the exact model iPad at compile time (1 or 2)? I need to change some things to optimize between the two, and I'd rather do it at compile time than runtime.

If it needs to be runtime, is there a better solution than this StackOverflow answer?

lord funk
Feb 16, 2004

Re: iPad 1 vs. 2 check --

I'm writing an audio synthesis app that really pushes the processor to get every drop of power, and I've been developing on an iPad 2. I continue to optimize every ounce of performance out of my synthesis code, but I fear that I may need to make some cuts to the synthesis code itself to avoid sample dropping on the iPad 1. For example, I might need to drop the maximum voice polyphony. This would mean loading a lighter version of the synthesis graph.

Checking for device capabilities is already done. But I'm anticipating a hit in the processor, and for that I would need to know which device it's running on.

I'll be getting my hands on an iPad 1 within the next week or so. We'll see how bad it is...

lord funk
Feb 16, 2004

nolen posted:

My suggestion that I posted earlier would tell you which iPad you are running on currently. No camera + UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad tells you that you are on an iPad with no camera. iPad first generation, ahoy.

Like I said, still not the "proper" way of handling such a test but I would say it's better than checking device types specifically like the StackOverflow link.

Good enough for me - thanks!

lord funk
Feb 16, 2004

ynohtna posted:

S'up, audio programming comrade.

Has your synthesis sub-system got any self-monitoring metrics in it?

No, I have a fixed number of voices (only 8) that render continuously, with a router that steals voices when the max is exceeded. I don't have an effective way to dynamically allocate voices, and even if I did, for this project I'd rather have the consistency to say 'You have X number of voices available,' even if the number is a bit lower for the iPad 1.

In other news, I'm so close to entering beta testing I can barely contain myself. drat the beginning of the school year!

lord funk
Feb 16, 2004

ynohtna posted:

Good luck with the beta and subsequent review and release!

Thanks!

quote:

Are you also supporting CoreMIDI?

Nope, I'm rolling my own control system. I'll be showing it off as soon as I get it out there!

lord funk
Feb 16, 2004

If I implement application-didFinishLaunchingWithOptions:, will application-didFinishLaunching ever get called? I'm testing the ability for my app to resume its state, and if it quits in the background it just launches -didFinishLaunchingWithOptions: when it opens up again.

Edit: nevermind, just looked it up in the documentation and I don't need to implement it.

lord funk fucked around with this message at 23:19 on Sep 3, 2011

lord funk
Feb 16, 2004

Does it bother anyone else that using 'genstrings' to create localized strings doesn't use the comments to initially assign the string? IE - it will use:

/ * This is the string. */
"kThisIsTheString" = "kThisIsTheString"

instead of

/ * This is the string. */
"kThisIsTheString" = "This is the string. "

[/whine]

lord funk
Feb 16, 2004

Funso Banjo posted:

Nothing like that.

Don't presume that just because someone is having trouble with Apple that they must be trying to do something underhand. I can't go into details due to the contract with the client, but the issue with Apple is a simple thing that would be sorted out in moments if a proper dialogue system was in place.

There is some intentionally vague language in the App Store Review Guidelines, and I'm sure the reviewers have to walk on eggshells. If they write you and tell you they rejected your app for X specific reason, or that you could do Y thing to fix it, it sets precedent for other developers to find ways around it. It's a legal thing.

PT6A posted:

Yeah, I was ready for app approval to be a massive pain in the rear end, but three apps later, they've overlooked all of my several UI flaws (meaning the UI is usable, and it doesn't explicitly break any rules they've written down, but it's not ideal).

My first release of an app didn't launch at all on iPod touches, and it passed through. I wish they had rejected it... :(

lord funk
Feb 16, 2004

I'm getting an odd response from moving a UISlider (that, up until now, has been perfectly normal). It seems like something in the system is making a new [NSDictionary dictionaryWithContentsOfFile] when I move it. Instruments readout:



I only call dictionaryWithContentsOfFile in my -didFinishLaunching method, and nowhere else. Where might this be coming from?

Edit: figured it out. It sends a notification that the current preset has been changed, and that was writing to the user defaults every time. Fixed.

lord funk fucked around with this message at 17:57 on Sep 8, 2011

lord funk
Feb 16, 2004

I've started using YES/NO because it's shorter to type and fits the readability more.

lord funk
Feb 16, 2004

I always figured you'd have to build a separate pirate build that's gimped in some way, then be the one to upload it to whatever pirate sites are out there. Seems a bit risky though - the chance of it backfiring with negative feedback seems pretty high.

lord funk
Feb 16, 2004

Small White Dragon posted:

How do I symbolicate a crash file in Xcode 4?

Ha! I just taught myself how to do this yesterday. Here are my notes:

1. Make sure you archive the Build Products of the exact version that generated the crash log.
2. Move the crash log, the app bundle, and the .dSYM file into the same directory.
3. Run the symbolicate script. You can make an alias:

code:
alias symbolicate="/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash -v"
...then run it on the crash log:

code:
symbolicate AppNamel_2011-09-30-151456_iPad.crash

lord funk
Feb 16, 2004

Can someone explain this graphic result to me? I'm making a simple rect background with OpenGL, with different color corners to make a gradient. On my iPad 2, it looks like this:



In the simulator, AND the first generation iPad 1, it looks like this:



Why the difference?

lord funk fucked around with this message at 20:22 on Oct 1, 2011

lord funk
Feb 16, 2004

Doc Block posted:

Insufficient color precision would be my guess. Are you using a 16-bit or 32-bit framebuffer?

I'm not actually sure how to find out. I'm assuming it's somewhere where I create the framebuffer? Here's the code:

code:
        [EAGLContext setCurrentContext:context];
        
        // Create default framebuffer object. The backing will be allocated for the current layer in -resizeFromLayer
        glGenFramebuffers(1, &defaultFramebuffer);
	glBindFramebuffer(GL_FRAMEBUFFER, defaultFramebuffer);
		
        glGenRenderbuffers(1, &colorRenderbuffer);
        glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer);
        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorRenderbuffer);
        
	glGenFramebuffers(1, &msaaFramebuffer);         // msaa fb
	glGenRenderbuffers(1, &msaaRenderbuffer);		// msaa color buffer
	glGenRenderbuffers(1, &msaaDepthbuffer);		// msaa depth buffer
        
        // allocate color buffer backing based on the current layer size
        glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer);
        [context renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer *)self.layer];
        glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &framebufferWidth);
        glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &framebufferHeight);
        
        GLint maxSamplesAllowed;
        glGetIntegerv(GL_MAX_SAMPLES_APPLE, &maxSamplesAllowed);
        
        // operation on msaa fb
        glBindFramebuffer(GL_FRAMEBUFFER, msaaFramebuffer);
        
        glBindRenderbuffer(GL_RENDERBUFFER, msaaRenderbuffer);
        glRenderbufferStorageMultisampleAPPLE(GL_RENDERBUFFER, maxSamplesAllowed, GL_RGBA4, framebufferWidth, framebufferHeight);
        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, msaaRenderbuffer);
        
        glBindRenderbuffer(GL_RENDERBUFFER, msaaDepthbuffer);
        glRenderbufferStorageMultisampleAPPLE(GL_RENDERBUFFER, maxSamplesAllowed, GL_DEPTH_COMPONENT16, framebufferWidth, framebufferHeight);
        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, msaaDepthbuffer);

lord funk
Feb 16, 2004

I think I found it:

code:
        eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
                                        [NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking,
                                        kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat,
                                        nil];
It looks like the options are kEAGLColorFormatRGBA8 or kEAGLColorFormatRGB565, where the former is 32 bit and the latter is 16. Unfortunately, neither solves the problem.

lord funk
Feb 16, 2004

iOS 5 dev chat:

Interesting to see that Apple is using the volume button as a camera snapshot button in iOS 5. I seem to remember devs complaining that their apps were rejected if they used the volume buttons for anything other than volume.

lord funk
Feb 16, 2004

What is configd, why is it taking so much memory on my iPad, and why does my app get jettisoned when it tries to launch but others don't?



Here is the "LowMemory-2011-10-05-140147.log" it makes:

quote:

Incident Identifier: 9EF6760E-D92B-48A2-B616-4A2B36F970A4
CrashReporter Key: f04a97e36e988f55d4fcd28fa6ebcbd8a6413409
Hardware Model: iPad2,1
OS Version: iPhone OS 4.3.1 (8G4)
Kernel Version: Darwin Kernel Version 11.0.0: Thu Feb 10 21:47:57 PST 2011; root:xnu-1735.46~2/RELEASE_ARM_S5L8940X
Date: 2011-10-05 14:01:47 -0500
Time since snapshot: 193 ms

Free pages: 923
Wired pages: 23131
Purgeable pages: 0
Largest process: configd

Processes
Name UUID Count resident pages
sandboxd <b36908f3fede35a792ab4c1a5458a0ba> 179
TouchControl <a0072c66a0da3a3a8c56cbaf62d08454> 10962 (jettisoned) (active)
DTMobileIS <48c048053a903511a264eeb98cdf28cc> 485
notification_pro <698dca6c4cba390a8017315bd25f18f8> 138
installd <bb3639d8ae403a4ea7bc4878c726b7ee> 454
lockbot <b44f11d2089238a6b6b4e6d4c48bc12c> 110
syslog_relay <344c7c41bec5360aae33f4fd412ea95f> 85
notification_pro <698dca6c4cba390a8017315bd25f18f8> 108
notification_pro <698dca6c4cba390a8017315bd25f18f8> 108
afcd <c3f31c6da39930acbad9a87c466c10bf> 117
ptpd <6072e173aed83310b9b7589a70a24b0b> 578
debugserver <919dbac91c0e3133a517d6c7a99e667e> 99
lsd <3fafa485b73836acb973d50feabd963a> 245
notifyd <9966082842de313a8e05a001c783faf4> 131
BTServer <d2eec19c86653b589db027999e5f222c> 162
CommCenter <90a33bee2da6357fa88c404fde13b49e> 248
SpringBoard <6e9a0987ea69363ba38f1539595874ca> 4120 (active)
accessoryd <d30e340e36df356bbde3347a6ed1ef87> 140
apsd <77b48c187e973193bfab88c749aa85d7> 271
configd <a6d457fca42732d9ba809d03a2b3e3ae> 73418
fairplayd.K93 <03202c4b3f15373baac4e203347a60c3> 96
imagent <2ca31f39adc9359f96818552bf60016b> 228
locationd <de6587ea245c3cd287837c25d3f55ca8> 700
mDNSResponder <2e9063a87abc3c889250101d69579319> 390
mediaremoted <21af791e80823c9f90f0be2b77a3d885> 244
mediaserverd <c731263114c33a07aef7bccdcf667271> 799
lockdownd <bf727b82d79930d78685810bdb4b11f2> 316
syslogd <d81669e7bdb93f9b9012020beac826f4> 103
usbethernetshari <36a2c261d4973e66b43830af64a38d84> 100
launchd <2d76192187733a77ac436d6a7ce806ab> 113

**End**

lord funk
Feb 16, 2004

I got tired of not having a good image of accelerometer / gyroscope motions for the iPad, so I made my own. Figured I'd share if anyone else wanted it for a manual or something:


Illustrator file and PDF:
https://rapidshare.com/files/2834131909/ipad-device-motion-vector.zip

lord funk
Feb 16, 2004

Funso Banjo posted:

How much are you guys seeing per app sold?

My general rule is that you will bank 50% of the selling price after taxes.

Also: updated device motion graphic (now with depth!).
https://rapidshare.com/files/3471396788/ipad-device-motion-1.zip

lord funk
Feb 16, 2004

Where do you begin when EXC_BAD_ACCESS just points to your main() instead of a specific variable or function? There are 10 million things that could be happening here, but there has to be a way to see what's really causing this. :(

lord funk
Feb 16, 2004

OHIO posted:

Have you tried Zombie mode with the profiler in the simulator? That might give you some helpful info.

Holy poo poo, thank you. I enabled NSZombieEnabled as an environment variable instead, and it points to exactly what was called.

Now excuse me while I go commit suicide for spending months debugging like a caveman.

lord funk
Feb 16, 2004

pokeyman posted:

Feel even dumber maybe!

Mac OS X Debugging Magic
iOS Debugging Magic

:lol: at the top note:

Apple posted:

If you're developing for iOS, you should look through this list to see if you're missing out on something that will make your life easier.

Yep, nailed it right there.

lord funk
Feb 16, 2004

I'm in the habit of doing something like this:

code:
@synthesize scrollView = _scrollView;
then initializing the instance

code:
UIScrollView *_scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 120, self.view.frame.size.width, 240)];
But does the scrollview really have to be a property in this case? Does it need that accessibility?

lord funk
Feb 16, 2004

Yeah, sorry. It should only be

code:
_scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 120, self.view.frame.size.width, 240)];

lord funk
Feb 16, 2004

What really bothers me is not knowing when a random blog post or article about Xcode is for 3 or 4. I tried (and failed) to get an ad hoc build for a beta tester, but I was piecing together different articles that were spanned 4 years apart.

lord funk
Feb 16, 2004

pokeyman posted:

I agree it's useful to know, but it's an unnecessary detour when learning. If you're in a rush, you won't bother, and if you're willing to take a time-intensive detour, you might as well go whole hog.

Also, maybe I'm alone, but I find I spend much more time using the 'objective' part than the 'C' part when using Objective-C. Maybe they should learn Smalltalk first?

This isn't a bad idea. I went from Processing to OpenFrameworks to iOS. The object part is still what hangs me up the most.

lord funk
Feb 16, 2004

Slave posted:

Is there a setting I need to enable somewhere to make this work?

Just a minor check, but did you make your file .mm instead of .m?

lord funk
Feb 16, 2004

I have gotten an EXC_BREAKPOINT (SIGTRAP) crash in my device motion stopping method. Is my test to make sure _motionManager is alive correct? What could be causing this (infrequent) crash?

code:
- (void)stopDeviceMotion {
    //stop updates
    if (_motionManager != nil) {
        [_motionManager stopDeviceMotionUpdates];
    }
    if (_locationManager != nil) {
        [_locationManager stopUpdatingHeading];
    }
    _deviceMotionInUse = NO;
    [orientationButton setHidden:YES];
}
Is there a difference between if (_motionManager != nil) and if (_motionManager)?

lord funk
Feb 16, 2004

Here is the crash log. Anything jump out?

I'm going to look more into the SIGTRAP thing. I am blocking some things out, but this crash seems to have happened on Thread 0 (don't know if that means anything).

lord funk
Feb 16, 2004

pokeyman posted:

Looks like an unknown selector -stopDeviceMotion is being sent to the touch control view controller.

So it looks like an issue when I get a memory warning - level 2. My views are unloading, objects deallocating, and then they're getting called. Sigh. If I didn't suck at interface building this app would have been out long ago.

Edit: okay, I think I get it. This is why you release the main view's subviews in the ViewDidUnload method, right? As long as I nil out everything, this should go away.

lord funk fucked around with this message at 15:29 on Nov 6, 2011

lord funk
Feb 16, 2004

I should say that a lot more poo poo has begun happening. I'm getting crashes in multiple views. My view controller management is crap. I have massive memory leaks that are there (iPad) / not there (simulator) / not there (iPad with a fresh install). Instruments' Leaks won't run for more than 6 seconds. It hasn't been a good day.

So the unknown selector issue has kind of taken a back seat until I figure out how much of this I have to nuke and rebuild.

lord funk
Feb 16, 2004

And don't forget to archive your old SDKs (assuming you still want to compile to them).

lord funk
Feb 16, 2004

So I've made a French localized version of Localizable.strings, changed my iPad to French, and the French version of the strings doesn't pop up (it's still clearly using the English file).

I've changed the file encoding to UTF-16, I tried adding a CFBundleLocalizations array to the Info.plist, neither kicked it into French. What am I missing?

I've done this before. :(

Edit: deleting the app from the iPad then reloading did it. Weird.

lord funk fucked around with this message at 01:12 on Nov 28, 2011

lord funk
Feb 16, 2004

Speaking of OpenGL, I'm trying to programmatically take a screenshot of my EAGLView, so I found this post over in the dev center about how to do that. I dropped the call to the screenshot function before presentFramebuffer, but the PNG file delivered is completely blank. It's the right size - but it's empty.

code:
- (BOOL)presentFramebuffer {
    BOOL success = FALSE;
    
    if (context) {
        [EAGLContext setCurrentContext:context];
        
        // discard depth buffer whenever possible, to gain more memory bandwidth.
        // this is no necessary for MSAA but helps boost performance even in non-MSAA cases.
        GLenum attachments[] = {GL_DEPTH_ATTACHMENT};
        glDiscardFramebufferEXT(GL_READ_FRAMEBUFFER_APPLE, 1, attachments);
        
        glBindFramebuffer(GL_READ_FRAMEBUFFER_APPLE, msaaFramebuffer);
		glBindFramebuffer(GL_DRAW_FRAMEBUFFER_APPLE, defaultFramebuffer);
		glResolveMultisampleFramebufferAPPLE();
        
        // need to restore colorRenderbuffer if it's MSAA enabled
        glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer);
        
        //save snapshot every 500 frames
        static GLint screenshotFrameCounter = 0;
        screenshotFrameCounter++;
        if (screenshotFrameCounter % 500 == 0) {
            NSFileManager *fileManager = [NSFileManager defaultManager];
            UIImage *screenshot = [self takeSnapshot:self];
            NSData *myImageData = UIImagePNGRepresentation(screenshot);
            [fileManager createFileAtPath:[NSString stringWithFormat:@"%@/screenshot.png",DOCUMENTS_FOLDER,screenshotFrameCounter] 
                                 contents:myImageData 
                               attributes:nil];
            NSLog(@"taking screenshot");
        }
        
        [context presentRenderbuffer:GL_RENDERBUFFER];
    }
    
    return success;
}
I'm using OpenGL ES 2.0, so the only thing I changed from - (UIImage*)snapshot:(UIView*)eaglview is changing

glBindRenderbufferOES(GL_RENDERBUFFER_OES, _colorRenderbuffer);
to
glBindRenderbuffer(GL_RENDERBUFFER, _colorRenderbuffer);.

Why would my image be blank?

lord funk
Feb 16, 2004

I thought this might do it: changing kCGImageAlphaPremultipliedLast to kCGImageAlphaNoneSkipLast, since my layer is opaque, but now I get a completely black image.

code:
// Create a CGImage with the pixel data
    // If your OpenGL ES content is opaque, use kCGImageAlphaNoneSkipLast to ignore the alpha channel
    // otherwise, use kCGImageAlphaPremultipliedLast
    CGDataProviderRef ref = CGDataProviderCreateWithData(NULL, data, dataLength, NULL);
    CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
    CGImageRef iref = CGImageCreate(width, 
                                    height, 
                                    8, 
                                    32,
                                    width * 4, 
                                    colorspace, 
                                    kCGBitmapByteOrder32Big | kCGImageAlphaNoneSkipLast,
                                    ref, NULL, true, kCGRenderingIntentDefault);

lord funk
Feb 16, 2004

Here is the entire EAGLView.m if it helps.

lord funk fucked around with this message at 21:24 on Nov 29, 2011

lord funk
Feb 16, 2004

I'm about to finish my next app (feels strange to say it), and I can't remember: does the project name matter anymore? I have a bundle display name set, and I think you give the App Store name when you create the app in iTunes Connect. Does the Xcode project name matter?

Edit: I guess it doesn't.

lord funk fucked around with this message at 21:06 on Dec 10, 2011

lord funk
Feb 16, 2004

Welp. Holy poo poo. It's done.

I just finished my iPad app TC-11, a fully programable multi-touch synthesizer. It has been a monster - but it's out there now. Tomorrow I'm going to make a Musician's Lounge thread about it, post it in the YouTube thread, but first...

Seriouspost for a minute: you guys are the best little programming community. I'm not making GBS threads you when I say this app wouldn't have happened without you guys. Grab some promo codes below, enjoy, and thanks.

https://vimeo.com/33756537

More info:
http://www.bitshapesoftware.com/instruments/tc-11/

KFH43JFLN9RE
3WNWKRE4XK6J
7TAAPRJEN6YJ
FWJ3JT4ELYWH
JMFEAPLFPEFW

lord funk fucked around with this message at 14:48 on Dec 16, 2011

Adbot
ADBOT LOVES YOU

lord funk
Feb 16, 2004

ManicJason posted:

drat, this is very well polished and customizable. Every time I looked at a new options menu, my jaw dropped.

I wish there was a way to temporarily disable the four/five finger OS gestures and whatnot, but it seems that there is not. I kept inadvertantly changing apps and also had some touches dying that I suspect were also from the multitasking gestures.
I'm not sure what you mean by temporarily, but look under Settings >> General >> Multitasking Gestures. You can turn them off there. You really can't play the instrument otherwise. :)

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