-[AppDelegate managedObjectContext]: unrecognized selector sent to instance - ObjCUnrecognized selector crash when getting intValue from NSNumber in CoreData entityForeign controller : Unrecognised selector sent to instanceios - NSArray unrecognized selector sent to instance“-[__NSDictionaryI length]: unrecognized selector sent to instance” error without NSDictionary?tableview crash when click on cell indexsharing problems in ipadiOS application crash on [ParseCrashReporting enable]UIImagePickerController is getting crash while allocation with “[UIView setImage:]: unrecognized selector sent to instance ” messageTerminating app due to uncaught exception 'NSInvalidArgumentException', reason: [__NSArrayI length]: unrecognized selector sent to instanceGetting Error : unrecognized selector sent to instance 0x7fe2b1e71b90 while retrieving data from NSUserDefaults object
Exactly which act of bravery are Luke and Han awarded a medal for?
When was it publicly revealed that a KH-11 spy satellite took pictures of the first Shuttle flight?
Opposite party turned away from voting when ballot is all opposing party
What should I use to get rid of some kind of weed in my onions
Examples where existence is harder than evaluation
My parents are Afghan
The unknown and unexplained in science fiction
Can you turn a recording upside-down?
Company stopped paying my salary. What are my options?
Creating Stored Procedure in local db that references tables in linked server
How can one see if an address is multisig?
Visual Studio Code download existing code
Names of the Six Tastes
Gift for mentor after his thesis defense?
Is it possible to do moon sighting in advance for 5 years with 100% accuracy?
Linear Independence for Vectors of Cosine Values
Mindfulness of Watching Youtube
Why are thrust reversers not used down to taxi speeds?
Why is there a cap on 401k contributions?
Should one save up to purchase a house/condo or maximize their 401(k) first?
Magical Modulo Squares
Why does this pattern in powers happen?
Two (probably) equal real numbers which are not proved to be equal?
Is there an application which does HTTP PUT?
-[AppDelegate managedObjectContext]: unrecognized selector sent to instance - ObjC
Unrecognized selector crash when getting intValue from NSNumber in CoreData entityForeign controller : Unrecognised selector sent to instanceios - NSArray unrecognized selector sent to instance“-[__NSDictionaryI length]: unrecognized selector sent to instance” error without NSDictionary?tableview crash when click on cell indexsharing problems in ipadiOS application crash on [ParseCrashReporting enable]UIImagePickerController is getting crash while allocation with “[UIView setImage:]: unrecognized selector sent to instance ” messageTerminating app due to uncaught exception 'NSInvalidArgumentException', reason: [__NSArrayI length]: unrecognized selector sent to instanceGetting Error : unrecognized selector sent to instance 0x7fe2b1e71b90 while retrieving data from NSUserDefaults object
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
This is my code I type in Xcode 10.1
- (void)createData
id delegate = [[UIApplication sharedApplication] delegate];
NSManagedObjectContext *context = [delegate managedObjectContext];
NSManagedObject *personObj = [NSEntityDescription insertNewObjectForEntityForName:@"Person" inManagedObjectContext:context];
[personObj setValue:@"Bob" forKey:@"fullname"];
[personObj setValue:@(15) forKey:@"age"];
if ([context save:nil])
NSLog(@"Update Person SUCCESS");
else
NSLog(@"Update Person FAIL");
I checked the check box when I compile the project, but I get the following error.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate managedObjectContext]: unrecognized selector sent to instance 0x60800003c200'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107ab8d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001070f921e objc_exception_throw + 48
2 CoreFoundation 0x0000000107b28f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000107a3e005 ___forwarding___ + 1013
4 CoreFoundation 0x0000000107a3db88 _CF_forwarding_prep_0 + 120
5 MyStore 0x0000000106b1ff80 -[DeviceViewController managedObjectContext] + 128
6 MyStore 0x0000000106b20058 -[DeviceViewController viewDidAppear:] + 88
7 UIKit 0x0000000108084a6c -[UIViewController _setViewAppearState:isAnimating:] + 945
8 UIKit 0x00000001080b98d7 -[UINavigationController viewDidAppear:] + 207
9 UIKit 0x0000000108084a6c -[UIViewController _setViewAppearState:isAnimating:] + 945
10 UIKit 0x00000001080877da __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 42
11 UIKit 0x0000000108085ac4 -[UIViewController _executeAfterAppearanceBlock] + 86
12 UIKit 0x0000000107ee977c _runAfterCACommitDeferredBlocks + 653
13 UIKit 0x0000000107ed6273 _cleanUpAfterCAFlushAndRunDeferredBlocks + 566
14 UIKit 0x0000000107ef9757 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke_2 + 194
15 CoreFoundation 0x0000000107a5d6ac __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
16 CoreFoundation 0x0000000107a426f4 __CFRunLoopDoBlocks + 356
17 CoreFoundation 0x0000000107a41e65 __CFRunLoopRun + 901
18 CoreFoundation 0x0000000107a41884 CFRunLoopRunSpecific + 420
19 GraphicsServices 0x000000010b952a6f GSEventRunModal + 161
20 UIKit 0x0000000107edcc68 UIApplicationMain + 159
21 MyStore 0x0000000106b2132f main + 111
22 libdyld.dylib 0x000000010a9ae68d start + 1
23 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I am new to using coreData in objective c. I have searched thorough stack and internet but couldn't find a solution for this.
objective-c
add a comment |
This is my code I type in Xcode 10.1
- (void)createData
id delegate = [[UIApplication sharedApplication] delegate];
NSManagedObjectContext *context = [delegate managedObjectContext];
NSManagedObject *personObj = [NSEntityDescription insertNewObjectForEntityForName:@"Person" inManagedObjectContext:context];
[personObj setValue:@"Bob" forKey:@"fullname"];
[personObj setValue:@(15) forKey:@"age"];
if ([context save:nil])
NSLog(@"Update Person SUCCESS");
else
NSLog(@"Update Person FAIL");
I checked the check box when I compile the project, but I get the following error.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate managedObjectContext]: unrecognized selector sent to instance 0x60800003c200'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107ab8d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001070f921e objc_exception_throw + 48
2 CoreFoundation 0x0000000107b28f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000107a3e005 ___forwarding___ + 1013
4 CoreFoundation 0x0000000107a3db88 _CF_forwarding_prep_0 + 120
5 MyStore 0x0000000106b1ff80 -[DeviceViewController managedObjectContext] + 128
6 MyStore 0x0000000106b20058 -[DeviceViewController viewDidAppear:] + 88
7 UIKit 0x0000000108084a6c -[UIViewController _setViewAppearState:isAnimating:] + 945
8 UIKit 0x00000001080b98d7 -[UINavigationController viewDidAppear:] + 207
9 UIKit 0x0000000108084a6c -[UIViewController _setViewAppearState:isAnimating:] + 945
10 UIKit 0x00000001080877da __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 42
11 UIKit 0x0000000108085ac4 -[UIViewController _executeAfterAppearanceBlock] + 86
12 UIKit 0x0000000107ee977c _runAfterCACommitDeferredBlocks + 653
13 UIKit 0x0000000107ed6273 _cleanUpAfterCAFlushAndRunDeferredBlocks + 566
14 UIKit 0x0000000107ef9757 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke_2 + 194
15 CoreFoundation 0x0000000107a5d6ac __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
16 CoreFoundation 0x0000000107a426f4 __CFRunLoopDoBlocks + 356
17 CoreFoundation 0x0000000107a41e65 __CFRunLoopRun + 901
18 CoreFoundation 0x0000000107a41884 CFRunLoopRunSpecific + 420
19 GraphicsServices 0x000000010b952a6f GSEventRunModal + 161
20 UIKit 0x0000000107edcc68 UIApplicationMain + 159
21 MyStore 0x0000000106b2132f main + 111
22 libdyld.dylib 0x000000010a9ae68d start + 1
23 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I am new to using coreData in objective c. I have searched thorough stack and internet but couldn't find a solution for this.
objective-c
TryAppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
– vadian
Mar 23 at 8:26
add a comment |
This is my code I type in Xcode 10.1
- (void)createData
id delegate = [[UIApplication sharedApplication] delegate];
NSManagedObjectContext *context = [delegate managedObjectContext];
NSManagedObject *personObj = [NSEntityDescription insertNewObjectForEntityForName:@"Person" inManagedObjectContext:context];
[personObj setValue:@"Bob" forKey:@"fullname"];
[personObj setValue:@(15) forKey:@"age"];
if ([context save:nil])
NSLog(@"Update Person SUCCESS");
else
NSLog(@"Update Person FAIL");
I checked the check box when I compile the project, but I get the following error.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate managedObjectContext]: unrecognized selector sent to instance 0x60800003c200'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107ab8d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001070f921e objc_exception_throw + 48
2 CoreFoundation 0x0000000107b28f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000107a3e005 ___forwarding___ + 1013
4 CoreFoundation 0x0000000107a3db88 _CF_forwarding_prep_0 + 120
5 MyStore 0x0000000106b1ff80 -[DeviceViewController managedObjectContext] + 128
6 MyStore 0x0000000106b20058 -[DeviceViewController viewDidAppear:] + 88
7 UIKit 0x0000000108084a6c -[UIViewController _setViewAppearState:isAnimating:] + 945
8 UIKit 0x00000001080b98d7 -[UINavigationController viewDidAppear:] + 207
9 UIKit 0x0000000108084a6c -[UIViewController _setViewAppearState:isAnimating:] + 945
10 UIKit 0x00000001080877da __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 42
11 UIKit 0x0000000108085ac4 -[UIViewController _executeAfterAppearanceBlock] + 86
12 UIKit 0x0000000107ee977c _runAfterCACommitDeferredBlocks + 653
13 UIKit 0x0000000107ed6273 _cleanUpAfterCAFlushAndRunDeferredBlocks + 566
14 UIKit 0x0000000107ef9757 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke_2 + 194
15 CoreFoundation 0x0000000107a5d6ac __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
16 CoreFoundation 0x0000000107a426f4 __CFRunLoopDoBlocks + 356
17 CoreFoundation 0x0000000107a41e65 __CFRunLoopRun + 901
18 CoreFoundation 0x0000000107a41884 CFRunLoopRunSpecific + 420
19 GraphicsServices 0x000000010b952a6f GSEventRunModal + 161
20 UIKit 0x0000000107edcc68 UIApplicationMain + 159
21 MyStore 0x0000000106b2132f main + 111
22 libdyld.dylib 0x000000010a9ae68d start + 1
23 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I am new to using coreData in objective c. I have searched thorough stack and internet but couldn't find a solution for this.
objective-c
This is my code I type in Xcode 10.1
- (void)createData
id delegate = [[UIApplication sharedApplication] delegate];
NSManagedObjectContext *context = [delegate managedObjectContext];
NSManagedObject *personObj = [NSEntityDescription insertNewObjectForEntityForName:@"Person" inManagedObjectContext:context];
[personObj setValue:@"Bob" forKey:@"fullname"];
[personObj setValue:@(15) forKey:@"age"];
if ([context save:nil])
NSLog(@"Update Person SUCCESS");
else
NSLog(@"Update Person FAIL");
I checked the check box when I compile the project, but I get the following error.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate managedObjectContext]: unrecognized selector sent to instance 0x60800003c200'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107ab8d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001070f921e objc_exception_throw + 48
2 CoreFoundation 0x0000000107b28f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000107a3e005 ___forwarding___ + 1013
4 CoreFoundation 0x0000000107a3db88 _CF_forwarding_prep_0 + 120
5 MyStore 0x0000000106b1ff80 -[DeviceViewController managedObjectContext] + 128
6 MyStore 0x0000000106b20058 -[DeviceViewController viewDidAppear:] + 88
7 UIKit 0x0000000108084a6c -[UIViewController _setViewAppearState:isAnimating:] + 945
8 UIKit 0x00000001080b98d7 -[UINavigationController viewDidAppear:] + 207
9 UIKit 0x0000000108084a6c -[UIViewController _setViewAppearState:isAnimating:] + 945
10 UIKit 0x00000001080877da __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 42
11 UIKit 0x0000000108085ac4 -[UIViewController _executeAfterAppearanceBlock] + 86
12 UIKit 0x0000000107ee977c _runAfterCACommitDeferredBlocks + 653
13 UIKit 0x0000000107ed6273 _cleanUpAfterCAFlushAndRunDeferredBlocks + 566
14 UIKit 0x0000000107ef9757 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke_2 + 194
15 CoreFoundation 0x0000000107a5d6ac __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
16 CoreFoundation 0x0000000107a426f4 __CFRunLoopDoBlocks + 356
17 CoreFoundation 0x0000000107a41e65 __CFRunLoopRun + 901
18 CoreFoundation 0x0000000107a41884 CFRunLoopRunSpecific + 420
19 GraphicsServices 0x000000010b952a6f GSEventRunModal + 161
20 UIKit 0x0000000107edcc68 UIApplicationMain + 159
21 MyStore 0x0000000106b2132f main + 111
22 libdyld.dylib 0x000000010a9ae68d start + 1
23 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I am new to using coreData in objective c. I have searched thorough stack and internet but couldn't find a solution for this.
objective-c
objective-c
asked Mar 23 at 7:45
Nonpawit EkburanawatNonpawit Ekburanawat
1
1
TryAppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
– vadian
Mar 23 at 8:26
add a comment |
TryAppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
– vadian
Mar 23 at 8:26
Try
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
– vadian
Mar 23 at 8:26
Try
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
– vadian
Mar 23 at 8:26
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55311706%2fappdelegate-managedobjectcontext-unrecognized-selector-sent-to-instance-ob%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55311706%2fappdelegate-managedobjectcontext-unrecognized-selector-sent-to-instance-ob%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
– vadian
Mar 23 at 8:26