This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CoreData | |
let model = NSManagedObjectModel() | |
let entity = NSEntityDescription() | |
entity.name = "Entity" | |
model.entities = [entity] | |
let coordinator = NSPersistentStoreCoordinator(managedObjectModel: model) | |
let storeURL = URL.temporaryDirectory.appending(component: UUID().uuidString).appendingPathExtension("sqlite") | |
let description = NSPersistentStoreDescription(url: storeURL) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CoreData | |
class Delegate: NSObject, NSFetchedResultsControllerDelegate { | |
func controller(_ controller: NSFetchedResultsController<any NSFetchRequestResult>, didChangeContentWith diff: CollectionDifference<NSManagedObjectID>) { | |
} | |
} | |
var delegate: Delegate! | |
var fetchedResultsController: NSFetchedResultsController<NSManagedObject>! | |
var token_1: (any NSObjectProtocol)! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CoreData | |
let c1 = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType) | |
let c2 = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType) | |
// 문제 없음 | |
c1.performAndWait { | |
c2.performAndWait { | |
c1.performAndWait { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
@globalActor | |
actor MyActor { | |
let queue = DispatchSerialQueue(label: "Test") | |
nonisolated var unownedExecutor: UnownedSerialExecutor { queue.asUnownedSerialExecutor() } | |
static let shared = MyActor() | |
var count: Int = 0 | |
func binding() -> Binding<Int> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private import Foundation | |
private import _DarwinFoundation3.pthread | |
fileprivate final class Box<U> { | |
let value: U | |
init(value: U) { | |
self.value = value | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <AppleArchive/AppleArchive.h> | |
extern void * AAAssetExtractorCreate(const char *, void *, unsigned long); | |
extern int AAAssetExtractorSetParameterPtr(void *, int, void *); | |
extern int AAAssetExtractorSetParameterCallback(void *, int, void *); | |
extern void AAAssetBuilderDestroy(void *); | |
extern size_t AAAssetExtractorWrite(void *, void *, ssize_t); | |
BOOL foo(void) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ViewController.h" | |
#include <objc/message.h> | |
#include <objc/runtime.h> | |
@interface MyLabel : UILabel | |
@end | |
@implementation MyLabel | |
- (void)willMoveToWindow:(UIWindow *)newWindow { | |
[super willMoveToWindow:newWindow]; | |
if (newWindow == nil) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private import Darwin.POSIX.dlfcn | |
public import UIKit | |
/* | |
expr -l objc -O -- [(Class)NSClassFromString(@"UIScene") _scenesIncludingInternal:0x1] | |
expr -l objc -i0 -O -- [(Class)NSClassFromString(@"MRUIHelper") descriptionForWindow:(id)0x0] | |
*/ | |
@_objcRuntimeName(__MRUIHeloper) | |
fileprivate final class MRUIHelper { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#include <dlfcn.h> | |
#include <objc/message.h> | |
#include <objc/message.h> | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
{ | |
void *handle = dlopen("/System/Library/PrivateFrameworks/DiskImages2.framework/DiskImages2", RTLD_NOW); | |
assert(handle != NULL); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface FooObject : NSObject | |
@end | |
@implementation FooObject | |
- (NSString *)getTitle { | |
abort(); | |
} | |
- (NSString *)title { | |
abort(); |
NewerOlder