- Override
OnStartup
andOnExit
.
- Create TempDirectory (if needed)
- Implement
InstanceChecker
to prevent multiple instances of an application from running. - Setup
CrashReporter
events and handlers
/// <summary> | |
/// Cleans paths of invalid characters. | |
/// </summary> | |
public static class PathSanitizer | |
{ | |
/// <summary> | |
/// The set of invalid filename characters, kept sorted for fast binary search | |
/// </summary> | |
private readonly static char[] invalidFilenameChars; | |
/// <summary> |
I've done something similar to what you're trying to do. Let me tell you what I've learned and how I did it.
I assume you have a one-to-one relationship between your Core Data object and the model (or db schema) on the server. You simply want to keep the server contents in sync with the clients, but clients can also modify and add data. If I got that right, then keep reading.
I added four fields to assist with synchronization:
// MARK: - UIView Extension for Dance | |
@available(iOS 10.0, *) | |
extension UIView { | |
fileprivate struct DanceAssociatedKey { | |
static var dance = "dance_key" | |
} | |
public var dance: Dance { |
-- Convert Base64 value in a variable to varbinary: | |
declare @str varchar(20); | |
set @str = '3qAAAA=='; | |
select cast(N'' as xml).value('xs:base64Binary(sql:variable("@str"))', 'varbinary(20)'); | |
-- Convert binary value in a variable to Base64: | |
declare @bin varbinary(20); | |
set @bin = 0xDEA00000; | |
select cast(N'' as xml).value('xs:base64Binary(xs:hexBinary(sql:variable("@bin")))', 'varchar(20)'); |