-[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;








0















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.










share|improve this question






















  • Try AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

    – vadian
    Mar 23 at 8:26

















0















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.










share|improve this question






















  • Try AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

    – vadian
    Mar 23 at 8:26













0












0








0








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.










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 23 at 7:45









Nonpawit EkburanawatNonpawit Ekburanawat

1




1












  • 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
















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












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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현