A big project of mine has been released, Team UmiZoomi: Zoom Into Numbers from Nickelodeon. It's doing great, been on the top most downloaded iPad/iPhone educational apps for a few weeks.
Here's a link, I'm stoked because my name is on it. It's for kids 6 and under, so not so exciting unless you are either 6, or have a 6 year old. Still, pretty cool!
Showing posts with label ipod. Show all posts
Showing posts with label ipod. Show all posts
Saturday, December 10, 2011
objc_associate magic.
So say you've got an object that doesn't have a User Info or Tag inside it, but you really really really want to attach something to it specifically without juggling another synthesized property. Easy.
Import this:
Import this:
#import <objc/runtime.h>
Then use this line to attach the object:
objc_setAssociatedObject(yourObject, (const void*)0x314, objectToAttach, OBJC_ASSOCIATION_RETAIN);
Use this line later to get the object back:
id objectThatWasAttached = objc_getAssociatedObject(yourObject, (const void*)0x314);
Trust me, you'll find a use for it.
Ignore the Mute Button
So you want your sounds to play even if the iPad, iPhone, iPod is muted?
Simple:
UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty(kAudioSessionProperty_Audi oCategory, sizeof(sessionCategory), &sessionCategory);
These two lines will force your sounds to play even if the mute button is flipped on. This used to be very much not okay, but recently Apple has changed their stance, so go wild.
Simple:
UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty(kAudioSessionProperty_Audi oCategory, sizeof(sessionCategory), &sessionCategory);
These two lines will force your sounds to play even if the mute button is flipped on. This used to be very much not okay, but recently Apple has changed their stance, so go wild.
Labels:
ios,
ipad,
iphone,
ipod,
mute button,
objective c,
xcoe
Subscribe to:
Comments (Atom)