Created
August 23, 2015 16:10
-
-
Save svyatogor/eeca3a3d8ddc5633b7cf to your computer and use it in GitHub Desktop.
Crash in Xcode 7b5 on corefoundation object autorelease
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
class AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
rootViewController = UIViewController.alloc.init | |
rootViewController.title = 'cftest' | |
rootViewController.view.backgroundColor = UIColor.whiteColor | |
navigationController = UINavigationController.alloc.initWithRootViewController(rootViewController) | |
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
@window.rootViewController = navigationController | |
@window.makeKeyAndVisible | |
h = test | |
true | |
end | |
def test | |
# Get access to contacts — irrelevant for the test itself. | |
ab = ABAddressBookCreateWithOptions(nil, nil) | |
access_callback = lambda { |granted, error| @address_book_access_granted = granted } | |
ABAddressBookRequestAccessWithCompletion ab, access_callback | |
sleep 0.1 while @address_book_access_granted.nil? | |
@address_book_access_granted | |
people = ABAddressBookCopyArrayOfAllPeople(ab) | |
ABRecordCopyValue(people[0], KABPersonFirstNameProperty) | |
# Xcode 7b5 version: CFBridgingRetain ABRecordCopyValue(people[0], KABPersonFirstNameProperty) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Crash: