As seen in Ambiance, UAModalPanel is an alternative modal panel that you can popup in your view controllers to show content that might not need an entire new screen to show. It works on the iPhone and iPad, with or without rotation, and is a non-ARC project.
UAModalPanel is hosted on Github
I recently finished a Mac App called Thumbs and I wanted to upload and submit the binary to the Mac App Store through Xcode. Sounds easy enough right? I ran into this error:
Ok. So after (wrongfully) tinkering with the Base SDK and deployment target, ensuring I was on Xcode 4.2.1 (non-beta), I re-read the error and refocused on the OS. I am running Lion 10.7.2, but it turns out I was on the Beta track! Simple fix right? Nope.Trying to get back to 10.7.2 official didn't work for me at all. I tried downloading it from the Apple developer site but they redirected me to the Mac App Store. Mac App Store sees that I am already running 10.7.2 and wouldn't let me download. I found an Update on Apple support pages that claimed I could update to 10.7.2, but nope. I thought about partitioning my hard drive and installing fresh, but that would mean that I had to deal with exporting importing my keys, development environment and profiles. Ugh. I decided to hit the twitterverse and a few minutes later, I got a reply from @christian_beer:
Ooooh, a hack. Me likes. I couldn't find the referenced post, but I was able to find the plist anyway at/System/Library/CoreServices/SystemVersion.plist
The fix was simple: Change the ProductBuildVersion to be 11C74 (or the most current non-beta build of OS X), restart Xcode, and rebuild your project. To verify your change, open About This Mac:
Don't forget to change it back right after you upload. I would not advise restarting your computer or doing anything else. I don't know what else this could affect.
You can Archive and Submit from Xcode now and you won't be held up by the error:
This bundle is invalid. Apple is not currently accepting applications built with this version of the OS.
I was testing the dynamically loaded dependencies of a static ffmpeg binary today, and I saw that libSystem.B.dylib was indeed a dependency.
coneybeare $ otool -L ffmpeg:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.0.0)
coneybeare $ sudo mv /usr/lib/libSystem.B.dylib /usr/lib/_libSystem.B.dylib
The library moved and I tried running a command using the ffmpeg binary, when BAM, I got a missing library error. I did some research and found that the libSystem.B.dylib library should exist on any functional OS X install, so I decided to not worry about the error and attempted to move the library back
coneybeare $ sudo mv /usr/lib/_libSystem.B.dylib /usr/lib/libSystem.B.dylib
… Missing Library Error. Then it hit me, sudo, mv and all other bash goodies were dependent on this library and in order to move the library back to its original position, it needed to be loaded. It could not be loaded though because the library was in an unexpected location. Shit. I tried sshing in to see if I could do something that way, didn't work. ssh must also depend on the library. I tried a restart in safe mode, but the safe-mode boot must also depend on the library as it spun on the gray load screen for ever. I tried setting up the computer in target mode, but that did not work as well. I tried to open the cd tray to load in my OS X disc and get the terminal but my bluetooth keyboard was not working, probably because of the missing library. I really thought I was fucked here. At long last I remembered the low level boot disk switcher! I tracked down a USB keyboard and mouse, plugged them in and restarted the computer holding down the Option key. After a short while, I was presented with the Boot Disk selection screen! I tapped the eject button and threw in my Restore disk. After choosing the default language, I went to the title bar and opened up terminal. then I was able to run my command:
coneybeare $ mv /Volumes/Macintosh\ HD/usr/lib/_libSystem.B.dylib /Volumes/Macintosh\ HD/usr/lib/libSystem.B.dylib
After a reboot, all was working once again :) Hope this helps anybody else who made the same bonehead mistake that I did.
It happens more than you think. I mean really, have you ever really read the 43 page long terms of agreement that these sites make you agree to before signing up? Many of them probably say something along the lines of "we may give your email to special partners blah blah blah". While you can't always prevent this from happening, you can figure out how that spammy viagra email landed in your Gmail account.
This trick has been around for awhile now, but I have only recently started using it and it works flawlessly. When you sign up for new services on sites that require an email, you won't use your real Gmail address but a slightly modified one. You take whatever your Gmail name is (before the @ sign) add a "+", then add the site name after that, but before the "@". It is not as hard as it sounds.
Lets say Dexter comes along and wants to setup an account at Phlebotomy Emporium to get a quick discount on needles. He would take his original email, add a "+", then add "phlebotomy_emporium" to it like so:
The trick here is that Gmail will ignore anything after the "+", and send it to your real account. If they ever sell your email to somebody else, you will still see which company it originated from when it is sent to you. In some cases, they might have broken the law when selling your email so check up on it and act accordingly.
Test it out by simply sending an email to yourself with +foobar or something else. This may work with other mail carriers but I haven't tested them out. Perhaps you can comment here if you see it working on somewhere other than Gmail. Happy spam fighting!
I have been using this theme in Xcode and have become quite accustomed to the subtle, light on dark colors of it. It only has 5 colors (KISS) and is easy on the eyes during those late night coding sessions. I really only use Coda for Rails development so, there are only seestyles for Ruby, ERB, HTML and CSS.
UPDATE: 9/24/11
Many people have asked me to writeup some custom HTML code for thier signatures. So many, in fact, that I have decided to formally anounce my availability to do so here. For $40, I will take your information and appearance requests, generate a few different options to choose from, formulate HTML code that is safe for emails, host any custom images for you, and help guide you through the installation process. Contact me to get started.
ORIGINAL POST
There are plenty of tutorials online to create an HTML signature in Apple Mail with Snow Leopard, but it has changed slightly for Lion. Here is how to do it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<br /> <br /> <div id="sig" style="min-width: 960px; min-height: 82px; line-height: 18px; margin: 6px 0; padding: 8px; border-top: 1px #999999 dotted; border-bottom: 1px #999999 dotted; font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; font-size: 12px; color: #999999; " > <a href="http://urbanapps.com" title="urbanapps.com"><img src="http://.../images/logo_noshad_80.png" alt="Urban Apps" style="float: left; padding: 2px 6px 0 0; border: none;"></a> <div style="padding: 6px 0 0 0"> <span style="font-size:14px"><strong style="color: #333333">Matt Coneybeare</strong>, Founder</span><br /> <strong><a href="http://urbanapps.com" title="urbanapps.com" style="color: #666666; text-decoration: none; border-bottom: 1px #cccccc dotted;">Urban Apps, LLC</a></strong><br /> PO Box 765, Centereach, New York, 11720, U.S.A. | Telephone: 347.688.7226 | Fax: 631.615.6716<br /> <a href="http://twitter.com/urbanapps"><img src="http://.../images/social/twitter_16.png" alt="Twitter" style="float: left; margin: 2px 4px 0 0; border: none;"></a> <a href="http://facebook.com/urbanapps"><img src="http://.../images/social/facebook_16.png" alt="Facebook" style="float: left; margin: 2px 4px 0 0; border: none;"></a> <a href="http://www.linkedin.com/in/coneybeare"><img src="http://.../images/social/linkedin_16.png" alt="Linked In" style="float: left; margin: 2px 4px 0 0; border: none;"></a> </div> <div style="clear:both"></div> </div> <br /> <br /> |
I Do Mass Quantities Of… Coke Code.
Yes, those are 1's and 0's on the scale :) A great gift from Aunt Robyn and Uncle Dan
Something is compelling me to go in here… Found on Massachusetts Ave. in Cambridge, MA.
mkdir -p ~/Library/Developer/Xcode/UserData/FontAndColorThemes; cd ~/Library/Developer/Xcode/UserData/FontAndColorThemes; curl -O http://files.urbanapps.com/ǝɹɐǝqʎǝuoɔ.dvtcolortheme
Enjoy :)
Ambiance for the Desktop was released this week and we got some pretty great reviews about it:
These posts drove tons of traffic to the main Ambiance website where we had thousands of downloads:
This was great news for us and we were expecting to stand out in the Adobe Air Marketplace, but when we checked our download count on the Ambiance product page, there were only a few hundred.
We quickly figured out that Adobe is only counting downloads that are directly from their site in this total, and most of the Ambiance downloads came direct from our website. Even though the files downloaded are exactly the same, the download stats weren't updating from our site. Here is how we fixed it.We ran the excellent HTTPScoop to trace all outgoing calls made on our test machine. We then visited the Ambiance product page and clicked download, collecting the 4 http calls that were sent to Adobe during the process.
The last GET was the actual file, the stats GET was for Adobe Analytics of some sort, so we tried the other 2. We ran a simple curl test on the POST call to see if it affected the download count:
1
|
while true; do curl -d "OFFERINGID=20777&PUBLISHERID=21008&MARKETPLACEID=1&method=trackClickThrough&_=" http://www.adobe.com/cfusion/marketplace/remote/uiWidgetsService.cfc; sleep 10; done |
We ran this for a few minutes, then checked the Ambiance product page once more and voila! The count went up by the same number of POSTs we sent. Knowing this, we added an onclick to the div that contains our download button on our website:
1 2 3 4 |
<div id="flashcontent" onclick="$.post('http://www.adobe.com/cfusion/marketplace/remote/uiWidgetsService.cfc', { OFFERINGID: '20777', PUBLISHERID: '21008', MARKETPLACEID:'1', method:'trackClickThrough', _:'' } );"> ... </div> |
Now, whenever anybody downloads from the Ambiance website directly, or downloads from the Ambiance product page, the download count will accurately increment by 1.
At Urban Apps, we want to help spread the cheer this holiday season and what better way than by offering our Award Winning app, Ambiance for only $0.99. Get it while you can because this is only a temporary sale and will go back to the regular price of $2.99 in a few days.
- Urban Apps Staff
Available Now
This update finally brings full iPad support for iPad OS 3.2 and 4.2 as a Universal app. If you have already bought Ambiance for your iPhone, now you can get it on your iPad at no additional cost!
ADDED
UPDATE: 2:39 AM
We had to remove the app from the store temporarily but it should be back soon
UPDATE: Nov 12th, 8:17 PM
The app is now back live in the store as version 3.1.1
I have been using this Xcode theme for awhile now and I think its rather nice. If you like it, just copy the line below into terminal and run it to install. Restart Xcode and check preferences for "ǝɹɐǝqʎǝuoɔ".
mkdir -p ~/Library/Application\ Support/Xcode/Color\ Themes; cd ~/Library/Application\ Support/Xcode/Color\ Themes; curl http://files.urbanapps.com/ǝɹɐǝqʎǝuoɔ.xccolortheme > ǝɹɐǝqʎǝuoɔ.xccolortheme
Enjoy :)
I have been using this grid iPhone wallpaper for awhile now and it lined up perfectly until some recent 4.2 build. Notice that in the iOS 4.2 screenshot, the icons in columns 3 and 4 appear to be shifted to the right by 1 pixel. The pixel shift probably won't affect anybody except for wallpaper designers. I wonder why they did this?
UPDATE: 11/06/2010
It also appears that the corner radius has been adjusted slightly as well. In iOS 4.2, they seem to have shaved a bit more off the corner to make the radius a tad bigger. It is strikingly apparent in the Stocks, Calendar and Messages apps. This might have an impact on any developer who has fine tuned their icon in the corner for highlights, borders or whatever and some might have to be edited for this new corner radius.
You should never be editing the Three20 project directly unless you are altering something that cannot be done with subclassing. Three20 should be added to your project as a subproject. Then, if you want to add other things like ShareKit, you can do it by adding it to your own project, as a sibling to the Three20 subproject.
412 Likes: http://ambianceapp.com
169 Likes: https://www.facebook.com/ambianceapp
<meta property="fb:admins" content="1230951" />
<meta property="fb:page_id" content="168164236564309" />
<meta property="fb:app_id" content="156067184497"/>
On first glance, I thought that it was combining the page_id and app_id, but ever since I moved away from the Facebook SDK in my app (one a year ago), the Like count for the app page has dwindled to only a handful. Not enough to count towards the 412.
How can I ensure that all 412 people who have liked my site are notified when I post to my Facebook page, and why isn't Facebook showing an accurate count?
This is really a question about syntax when traversing objective-c data structures, not JSON. Look at the documentation for accessing a NSDictionary and NSArray
25 frames per second is very close to the iPhone movie fps of 24.0 − 30 fps. Why not make a movie, then pull out the frames from the movie to get your shots.
Yes, but you are limited to 100 testers a year per the iTunes developer agreement. Performance is the same.
If AppIRater is too heavy for you, you can send them directly to the page by using the format:
itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=APP_ID
… where APP_ID is your iTunes numerical application id.
Create a custom setter/getter:
+ (BOOL)awesomeClassVar {
return _classVar;
}
+ (void)setAwesomeClassVar:(BOOL)newVar {
_classVar = newVar;
}
then call as a method from the other class:
BOOL theOtherClassVar = [AwesomeClass awesomeClassVar];
[AwesomeClass setAwesomeClassVar:!theOtherClassVar];
I have made a slick NSScroller subclass, but can't figure out how to make it overlay on top of the NSScrollView instead of pushing the documentView aside.
Here you can see the background of a NSCollectionView that I wish to make 100% wide, and have the scroller sit along top. Currently, I have to set a white background to the scroller because drawing with a clearColor is not showing as transparent, but as black.
Am I going about this the wrong way? Am I missing something obvious here? How can I achieve the behavior of a transparent-tracked NSScroller that sits atop a NSScrollView's contents?
Don't reinvent the wheel. There is an open source project called core-plot. If you want to learn while implementing, look at and understand the source code.
What you want is a UISearchDisplayController. Check out the Apple TableSearch sample code
You would comment out the 3 lines of code in the TARGET_OS_IPHONE block
You don't need to change the delegate for simple operations. Just implement this method in your controller:
- (void)didSelectObject:(id)object atIndexPath:(NSIndexPath*)indexPath;
Source: I do it... and the three20 source file
I have done some extensive searching for code examples on this but cannot find anything.
In particular, I am looking to add a shadow to a png drawable I am using in an ImageView. This png drawable is a rounded rect with transparent corners.
Can somebody please provide a code example of how to add a decent drop shadow to a view either in code or XML?
NSString *labelText = @"foobar";
[textLayer setString:labelText];
This must be run on the main thread, so I use this:
NSString *labelText = @"foobar";
[textLayer performSelector:@selector(setString:) withObject:labelText waitUntilDone:YES];
And if you are updating frequently, you should disable the animations between the text changes:
NSString *labelText = @"foobar";
[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];
[textLayer performSelector:@selector(setString:) withObject:labelText waitUntilDone:YES];
[CATransaction commit];
To get the contents of a directory
- (NSArray *)ls {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSArray *directoryContent = [[NSFileManager defaultManager] directoryContentsAtPath: documentsDirectory];
NSLog(@"%@", documentsDirectory);
return directoryContent;
}
To get the last path component,
[[path pathComponents] lastObject]
You won't be able to post a file, but you can post a link to the file in a public place, preferably on your server. So:
PDF to your server from the appI have a Drag/Drop NSView which should accept the same file types and extensions that I have listed in my plist under the key CFBundleDocumentTypes. The app accepts any type of video file, folders and several file extensions that aren't picked up by the public.movie type.
The (rather long) list of CFBundleDocumentTypes is:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Folder</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>fold</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key>
<string>Movies</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>public.movie</string>
</array>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>flv</string>
</array>
<key>CFBundleTypeName</key>
<string>Flash Video File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>ram</string>
<string>rm</string>
<string>rmvb</string>
</array>
<key>CFBundleTypeName</key>
<string>RealPlayer Media Files</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>vob</string>
</array>
<key>CFBundleTypeName</key>
<string>VOB File (DVD Video)</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>ogm</string>
</array>
<key>CFBundleTypeName</key>
<string>Ogg MPEG-4 Video File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>ogv</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>video/ogg</string>
</array>
<key>CFBundleTypeName</key>
<string>Ogg Video File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>axv</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>video/annodex</string>
</array>
<key>CFBundleTypeName</key>
<string>Annodex Video File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>avi</string>
</array>
<key>CFBundleTypeName</key>
<string>AVI container</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mov</string>
<string>moov</string>
<string>qt</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>video/quicktime</string>
</array>
<key>CFBundleTypeName</key>
<string>Apple QuickTime container</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>divx</string>
</array>
<key>CFBundleTypeName</key>
<string>DivX file</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>dv</string>
</array>
<key>CFBundleTypeName</key>
<string>DV file</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>wmv</string>
<string>wm</string>
</array>
<key>CFBundleTypeName</key>
<string>Windows Media Video</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mpg</string>
<string>mpeg</string>
<string>mpeg1</string>
<string>mpeg2</string>
</array>
<key>CFBundleTypeName</key>
<string>multiplexed MPEG-1/2</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>m1v</string>
</array>
<key>CFBundleTypeName</key>
<string>MPEG-1 Video File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>ts</string>
<string>m2ts</string>
<string>mts</string>
<string>mt2s</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>video/mp2t</string>
</array>
<key>CFBundleTypeName</key>
<string>MPEG-2 Transport Stream</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>m2v</string>
<string>mpv</string>
</array>
<key>CFBundleTypeName</key>
<string>MPEG-2 Video File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mp4</string>
<string>mpeg4</string>
<string>m4v</string>
</array>
<key>CFBundleTypeName</key>
<string>MPEG-4 File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>3gp</string>
</array>
<key>CFBundleTypeName</key>
<string>3GPP File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mkv</string>
</array>
<key>CFBundleTypeName</key>
<string>Matroska Video File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>webm</string>
</array>
<key>CFBundleTypeName</key>
<string>WebM Video File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>nuv</string>
</array>
<key>CFBundleTypeName</key>
<string>NuppleVideo File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
</array>
I am already able to verify drop acceptance in my NSView's draggingEntered method, but I want to be able to run through the Info.plist entries for CFBundleDocumentTypes instead of duplicating all the entries in this method. How can I do this so that my view accepts the exact same files as listed in the CFBundleDocumentTypes entry?
On iOS, there is a UIDevice class which lets you get tons of great info about the device model, operating system etc…
I am looking for something equivalent on the Mac. I know about calling system_profiler from the command line, but even the mini setting takes several seconds to get any info.
I am interested in fast ways to get the machine type (Macbook Air, Mac Mini, etc…), OS version, and other quick machine details from within a Mac App. The details are going o be used as a footer on support emails sent from within the app. Is there any equivalent to UIDevice, or another fast way to get some info that could help describe a user's machine?
Let me preface my question by saying that this code works. The question is about performance tuning this code.
I have a complex layer-backed NSView with multiple layer-backed sublayers that I need to write out to an NSImage. I render the layers then convert to a NSBitmapImageRep so I can write to an image using the following code:
- (NSBitmapImageRep*)bitmapImageRep {
CGContextRef context = NULL;
CGColorSpaceRef colorSpace;
int bitmapBytesPerRow;
int pixelsHigh = (int)[[self layer] bounds].size.height;
int pixelsWide = (int)[[self layer] bounds].size.width;
bitmapBytesPerRow = (pixelsWide * 4);
colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
context = CGBitmapContextCreate (NULL,
pixelsWide,
pixelsHigh,
8,
bitmapBytesPerRow,
colorSpace,
kCGImageAlphaPremultipliedLast);
if (context == NULL) {
DebugLog(@"Failed to create context.");
CGColorSpaceRelease( colorSpace );
return nil;
}
CGColorSpaceRelease( colorSpace );
[[self layer] renderInContext:context];
CGImageRef img = CGBitmapContextCreateImage(context);
CFRelease(context);
NSBitmapImageRep *bitmap = [[[NSBitmapImageRep alloc] initWithCGImage:img] autorelease];
CFRelease(img);
return bitmap;
}
The problem is that for my large views (full screen sized) this rendering process takes up to a second long. This code runs on a background thread so it won't freeze the UI while generating the image. In practice this sounds like it would work, but I find that the UI still freezes while doing this rendering. My guess is that even though this code is run on a background thread, the rendering process takes place on the main thread.
My question is, how can I make my app more performant when using this method by ensuring that it exclusively renders on a background thread
I have an audio app that is having some problems with the way iOS 5 has changed audio behaviors. When my app's audio is playing (AVAudioSessionCategoryPlayback), and a Clock.app alarm or timer is fired from the OS, the UIAlertView notification pops up, but without the audio alert. My application sound ducks fine to get out of the way of the audio alert, but the alarm app's audio alert does not sound.
Naturally, tons of support requests poured in over the iOS 5 change. I have solved this temporarily by setting kAudioSessionProperty_OverrideCategoryMixWithOthers which lets the alarm audio come through, but there are a few very undesirable side-effects when doing this:
None of the above drawbacks are acceptable for my app's requirements. I have been hacking away at this for some time now but haven't been able to crack it. How can I setup my audio such that:
AVAudioSessionCategoryPlayback category for background audio.After writing this question I went to file a bug report on this. I created a small sample project that I thought would replicate the issue, but I could not replicate it! This caused me to dig in deep once again and try to figure out what was up here…
I fired up an iOS alarm, then I placed a break point in audioPlayerBeginInterruption: and traced through my code line by line in the debugger. I noticed that before my code ran (while I was paused in the debugger), the iOS 5 alarm was sounding! Luckily it still sounded even as I was stepping through my app, so I was able to figure out which pieces of code specifically caused it to stop sounding.
Part of my interruptionHandler is to (obviously) stop the internal audio of my app to let the interruption come through. I never thought to inspect this method before, but turns out the problem existed in there. My stop method would call prepareToPlay immediately after stopping to make resuming faster the next time.
[self.player stop];
[self.player prepareToPlay]; // <- iOS 5 alarm sound stopped here.
The docs state the prepareToPlay method
preloads buffers and acquires the audio hardware needed for playback, which minimizes the lag between calling the play method and the start of sound output.
Sounds reasonable, and this worked for lesser iOS versions. My hypothesis is that must have made a change to the Clock.app alarm system such that the new alarm sounds use the hardware, whereas before it used the software. This is what I think is causing the iOS 5 alarms to be silent in some apps.
Removing the prepareToPlay lines caused the alarm to sound without using kAudioSessionProperty_OverrideCategoryMixWithOthers, thus solving all my issues laid out in this question.
TL;DR
Remove the prepareToPlay calls from your stop sound code logic. It will take a microsecond longer to start later, but will allow interruptions to sound.
[self.messageLabel setNumberOfLines:0];
Source: apple docs
Your path is nil on the device.
First, try cleaning your project.
Then, ensure the files are being copied over in the "Copy Bundle Resources" build phase
And as Anna Karenina suggested, make sure the names are being handled in a case sensitive manner.
An objective-c category is useful if you want to alter the behavior of ALL instances of the class, with minimal code. Subclassing is more useful if you want to alter the behavior of only certain instances, and retain the original method for others.
Categories can be dangerous, especially if you cannot view the source of the original method, so you should generally use subclasses on third-party and private frameworks rather than a category.
It is not available for public use in the iOS SDK as of iOS 5
The if (player … line always returns false because you have player as a local variable, not an instance ivar. Add a player ivar to your .h file, then save the one you init to it, not to a local player.
Yes. Checkout Local Notifications
Facebook has not provided this in their SDK, but there is an open-source Github project called FacebookLikeView that you can either use or inspect to see how they did it.
You can override the output to the internal speaker
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; // lets the system sounds come out of the speaker
OSStatus err = AudioSessionSetProperty(kAudioSessionProperty_OverrideAudioRoute, sizeof(audioRouteOverride), &audioRouteOverride);
if (err != noErr) {
// handle error
}
Pythagorean theorem: a^2 + b^2 = c^2
You have the a and b from the width and height of the CGPoint minus the width and height of the center. Solve for c, then convert to a percentage based on whatever you constraint is (you don't mention)
It gets its data by scanning gthe sales reports from Apple. You can import older reports though, but it can't magically produce the ones that are not on iTunes connect.
Got it all sorted out, sort of. Had to jump through some hoops but I got everything merged finally
OK, i understand that they are separate entities, but where did the likes go? Surely the likes on my webpage must go somewhere? Are they linked into the app page but not displayed at facebook.com/ambiance ?
So if I understand correctly, the 169 is all people who have liked my website when shared from other people in their timelines? And anybody that presses like on my actual site is actually liking the old app_id? Where are the 412 showing then?
yes. It converts the raw JSON into basic objective-c data structures, notable, NSArrays, NSDictionaries, NSStrings and NSNumbers
You are right… I haven't had my coffee yet :P
Then that is probably not possible due to hardware limitations and limited API access
He is asking about class variables, not instance variables.
The two methods go in CLASS A. The bottom two lines access the variable from CLASS B.
They were not deprecated. ARC is still optional. Memory management, through ARC or manual, is still integral in software development and should not be dismissed
There is really no reason this question should be down voted. It is an honest question, albeit poorly written, and follow all rules of Stack Overflow.
You can access the tableview of the search display controller and set it to be hidden whenever you want. Look at the UISearchDisplayControllerDelegate methods to get your hooks.
no, but you are getting the float value and logging as a float. Float does not have the capacity to display certain exact numbers. Obviously 111.100000 is one of them
well... no, but maybe they would return a string of 32 0's or something else. They probably wouldn't, but to make assumptions would not be wise.
It is only safe if Apple completely removes it. If they decide to return a DEADBEEF uuid or something, it would create problems.