Skip to content

Instantly share code, notes, and snippets.

View null-loop's full-sized avatar

Daniel Gray null-loop

View GitHub Profile
@null-loop
null-loop / savemp3.m
Last active December 19, 2015 22:18
Saving MP3 to Documents folder in iOS
- (IBAction)saveRingtoneButtonClicked:(UIButton *)sender {
m_saveRingtoneButtonLowlighted = false;
m_saveRingtoneButtonHighlighted = true;
[self animateSaveRingtoneButton];
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,true);
NSString* sourceFilePath = [[NSBundle mainBundle] pathForResource:[m_activeClip.mp3 componentsSeparatedByString:@"."][0] ofType:@"mp3"];
NSData* mainBundleFile = [NSData dataWithContentsOfFile:sourceFilePath];
@null-loop
null-loop / PanoramaHandling
Created June 19, 2013 23:15
Having to add this to pages that host panoramas to work around this bug - https://connect.microsoft.com/VisualStudio/feedback/details/772715/wp8-panorama-using-itemssource-does-not-keep-track-of-selectedindex - what's the point of data binding if it's not universal? Basically you can't databind a panorama control in WP8 and expect it to work - 7…
public void WirePanorama(ObservableCollection<Screen> topNavItems)
{
Dispatcher.BeginInvoke(() =>
{
Panorama.Items.Clear();
foreach (var pi in topNavItems.Select(CreatePanoramaItemForViewModel))
{
Panorama.Items.Add(pi);
}