Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

[DEBUG] Session could not be started:
Error Domain=DTiPhoneSimulatorErrorDomain
Code=1
"The application that opened iOS Simulator failed to send all of the required information (sessionUUID, sdkRoot, deviceInfo)."
UserInfo=0x7f9c09e35890
{
NSLocalizedDescription=The application that opened iOS Simulator failed to send all of the required information (sessionUUID, sdkRoot, deviceInfo).,
@dodikk
dodikk / BoxingExample.mm
Created May 6, 2014 14:43
Example of code with and without boxing to NSNumber
#import "MUVersionDetector.h"
#define CPP_STRING_LINKER_ERRORS 0
#if !CPP_STRING_LINKER_ERRORS
typedef std::map<std::string, MUApplicationVersion> MUCacheFolderForVersionMap;
typedef MUCacheFolderForVersionMap::const_iterator MUCacheFolderForVersionMap_ci;
#endif
@implementation MUVersionDetector
@dodikk
dodikk / SCRangeSliderViewDelegate.h
Last active August 29, 2015 14:01
iOS UI control localizations and appearance tuning
@protocol SCRangeSliderViewDelegate < NSObject >
#pragma mark - DataSource methods
@required
-(NSUInteger)numberOfSectionsForRangeSliderView:( SCRangeSliderView* )view_;
-(NSUInteger)maxRangeLengthForSliderView:( SCRangeSliderView* )view_;
-(void)didChangeSelectedRangeOfRangeSliderView:( SCRangeSliderView* )view_;
@dodikk
dodikk / GetPublicKeyTasks.cs
Created May 23, 2014 15:02
REST API flow with Xamarin async
public class GetPublicKeyTasks : IRestApiCallTasks<string, Stream, PublicKeyX509Certificate>
{
public async Task<string> BuildRequestUrlForRequestAsync( string instanceUrl )
{
return await Task.Factory.StartNew ( () => instanceUrl + "/-/item/v1/-/actions/getpublickey" );
}
public async Task<Stream> SendRequestForUrlAsync( string requestUrl )
{
return await this.httpClient.GetStreamAsync(requestUrl);
@dodikk
dodikk / AsyncLoadImage.cs
Last active August 29, 2015 14:05
Async image downloading for monotouch
byte[] data = null;
using (Stream response = await session.DownloadResourceAsync(request))
using (MemoryStream responseInMemory = new MemoryStream())
{
await response.CopyToAsync(responseInMemory);
data = responseInMemory.ToArray();
}
BeginInvokeOnMainThread(delegate
{
@dodikk
dodikk / LogicalProjectStructure.txt
Created October 1, 2014 11:41
Mix of cocoapods and manual dependency management
MyWorkspaceAfterPodInstall.xcworkspace
|
|
|---MyApp.xcodeproj
|---|
|---|--target : MyApp.app
|---|
|---|--MyLib.xcodeproj
|---| |
@dodikk
dodikk / Solution by @proger
Last active August 29, 2015 14:07
iOS simulator locations
dodikk$ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/simctl list
== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
@dodikk
dodikk / AddGitRepo.sh
Created October 6, 2014 10:59
Emulating submodule in svn or other VCS
#!/bin/bash
git clone <myRepo.git>
git checkout <commit hash GUID/tag name/branch name>
@dodikk
dodikk / KillNSObject.mm
Created October 29, 2014 13:24
Как убить объект в Objective-C
// избавляемся от свидетелей
while (object.retainCount) {
[object release];
}
// 146% убиваем объект. Мамом клянусь - да!
[object release];
// контрольный в голову
[object dealloc];
@dodikk
dodikk / GetLogs.sh
Created November 6, 2014 07:59
iOS simulator logs
tail -f ~/Library/Logs/CoreSimulator/<simulator_id>/system.log | grep <app_name>