Re: In a modal pickle

2012-05-19 Thread Ayers, Joseph
Just tried that. Unfortunately, no joy...

Joseph

On May 19, 2012, at 3:23 PM, Stephen J. Butler wrote:

> On Sat, May 19, 2012 at 12:04 PM, NUExchange  wrote:
>> I have a core data app that opens two windows when it starts up. One of the 
>> two has a NSSearchField. The cursor is in search field and I can enter and 
>> delete text, but any other operation on either of the windows causes the 
>> screen to flash and the system beeps. This even happens when I hit Command-Q 
>> to try to exit the app. Nothing appears in the GDB debugger and if I pause 
>> the app in the debugger it's always in main. Any idea what could make it go 
>> in such a mode?
> 
> Maybe there's an NSBeep() hiding somewhere in your code or a 3rd party
> framework? It shouldn't be in the system frameworks, but it has
> happened before.
> 
> Try setting a breakpoint on NSBeep.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


mogenerator and key path error

2012-03-27 Thread Ayers, Joseph
I have a CoreData entity named Tapes.
I used mogenerator to create:
_Tapes.h  where:
@interface Tapes : _Tapes {}

and Tapes.h where
@interface _Tapes : NSManagedObject {}

I declare an instance tapes in AppDelegate.h as:
@property (nonatomic, retain)  Tapes* tapes;
and in AppDelegate.m as
@dynamic tapes;

In mainMenu.xib I have a NSArrayController. TapesController:NSArrayController
With ObjectController mode set to EntityName
and the EntityName set to tapes
In ContentController TapeController is bound to AppDelegate
with Model Key Path set to tapes and Raises For Not Applicable Keys checked
Under parameters, ManagedObjectContext is bound to 
AppDelegate.managedObjectContext

A Second NSArrayController VideoClip has a ContentSet
TapesController.selection.VideoClip
Under parameters, ManagedObjectContext is bound to 
AppDelegate.managedObjectContext

At run time, I get the Error:

2012-03-27 13:53:09.787 Roboplasm[72209:403] Cocoa Bindings: Error accessing 
value for key path tapes of object  (from bound 
object [entity: tapes, number of selected 
objects: 0]): [ valueForUndefinedKey:]: this class 
is not key value coding-compliant for the key tapes.

Any Idea where I have gone astray?

Thanks,
Joseph
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Interpreting GDB Stack Frames

2012-01-01 Thread Ayers, Joseph
For some reason the APP started looping on the window initialization that was 
in Init, so I moved it to applicationDidFinishLaunching. Now it doesn't get to 
that with the message in GBD:
warning: UUID mismatch detected between:
/Developer/Library/Xcode/PrivatePlugIns/DebuggerFoundation.ideplugin/Contents/Resources/DebuggerIntrospectionSupport.dylib
/Developer/Library/Xcode/PrivatePlugIns/DebuggerFoundation.ideplugin/Contents/Resources/DebuggerIntrospectionSupport.dylib.dSYM/Contents/Resources/DWARF/DebuggerIntrospectionSupport.dylib...

and an EXEC_BAD_ACC in objc_msgSend

Oh well


On Jan 1, 2012, at 11:22 AM, Fritz Anderson wrote:

[Stripped xcode-users from the recipients. Do not cross-post.]

On 1 Jan 2012, at 9:26 AM, Ayers, Joseph wrote:

5   AppKit  0x7fff86718a0f 
-[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 591
6   AppKit  0x7fff86711d25 -[NSIBObjectData 
nibInstantiateWithOwner:topLevelObjects:] + 1079
7   AppKit  0x7fff8670833b loadNib + 322

Here's a couple of approaches, maybe not solutions.

Your exception occurs when the NIB loader tries to set up a binding. In the Run 
panel of the Scheme editor, Arguments tab, add this command-line argument:

-NSBindingDebugLogLevel 1

The resulting log may give you a better picture of what's gone wrong.

Also, if you're not setting "Raises For Not Applicable Keys" for all your 
bindings, and don't know why you shouldn't, you should.

Something that catches my eye:

2012-01-01 09:16:30.648 Roboplasm[36368:707] *** Terminating app due to 
uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot create 
NSArray from object  of class 
NSManagedObjectContext'

I'd look for a value binding directly to something.managedObjectContext, 
instead of to a keypath in the selection of an NSArrayController.

— F


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Interpreting GDB Stack Frames

2012-01-01 Thread Ayers, Joseph
I have a program crashing loading a NIB that isn't explicitly specified. The 
call frame is below From the call frame it looks like it's called in line 8. 
How do I reveal the name of the nib file?

Thanks,
Joseph Ayers

2012-01-01 09:16:30.648 Roboplasm[36368:707] *** Terminating app due to 
uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot create 
NSArray from object  of class 
NSManagedObjectContext'
*** First throw call stack:
(
0   CoreFoundation  0x7fff8c551286 
__exceptionPreprocess + 198
1   libobjc.A.dylib 0x7fff8a88dd5e objc_exception_throw 
+ 43
2   CoreFoundation  0x7fff8c5510ba +[NSException 
raise:format:arguments:] + 106
3   AppKit  0x7fff86982490 
_NSValueOfClassWithSpecialSpecificErrorMessage + 245
4   AppKit  0x7fff8698206c 
-[NSArrayDetailBinder _refreshDetailContentInBackground:] + 691
5   AppKit  0x7fff86718a0f 
-[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 591
6   AppKit  0x7fff86711d25 -[NSIBObjectData 
nibInstantiateWithOwner:topLevelObjects:] + 1079
7   AppKit  0x7fff8670833b loadNib + 322
8   AppKit  0x7fff86707834 
+[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 217
9   AppKit  0x7fff8670774f 
+[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 141
10  AppKit  0x7fff868f6134 -[NSWindowController 
loadWindow] + 221
11  AppKit  0x7fff868f5eef -[NSWindowController 
window] + 75
12  AppKit  0x7fff868f5d5d -[NSWindowController 
showWindow:] + 40
13  Roboplasm   0x0001000178bc 
-[RoboplasmAppDelegate showMediaWindow:] + 92
14  Roboplasm   0x000100017046 
-[RoboplasmAppDelegate awakeFromNib] + 166
15  CoreFoundation  0x7fff8c5482e1 -[NSObject 
performSelector:] + 49
16  CoreFoundation  0x7fff8c548262 -[NSSet 
makeObjectsPerformSelector:] + 274
17  AppKit  0x7fff86711dcb -[NSIBObjectData 
nibInstantiateWithOwner:topLevelObjects:] + 1245
18  AppKit  0x7fff8670833b loadNib + 322
19  AppKit  0x7fff86707834 
+[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 217
20  AppKit  0x7fff8670774f 
+[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 141
21  AppKit  0x7fff86707692 
+[NSBundle(NSNibLoading) loadNibNamed:owner:] + 364
22  AppKit  0x7fff8697a8eb NSApplicationMain + 
398
23  Roboplasm   0x00019772 main + 34
24  Roboplasm   0x000118c4 start + 52
)
terminate called throwing an exception(gdb) info args f 8
self = (RoboplasmAppDelegate *) 0x101a0a430
_cmd = (SEL) 0x10007400d
sender = (id) 0x101a0a430
(gdb) info locals f8
No locals.
(gdb) info f 8
Stack frame at 0x7fff5fbfde80:
 rip = 0x7fff8c1b2152 in __gxx_exception_cleanup(_Unwind_Reason_Code, 
_Unwind_Exception*); saved rip 0x7fff8a88de7a
 called by frame at 0x7fff5fbfee50, caller of frame at 0x7fff5fbfde60
 Arglist at 0x7fff5fbfde78, args:
 Locals at 0x7fff5fbfde78, Previous frame's sp is 0x7fff5fbfde80
 Saved registers:
  rbx at 0x7fff5fbfde68, rbp at 0x7fff5fbfde70, rip at 0x7fff5fbfde78
(gdb)
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Lexical or Preprocessor Issue 'Cocoa/Cocoa.h file not found

2011-11-25 Thread Ayers, Joseph
When compiling a Cocoa Document based app with LLVM is get the following errors:

Roboplasm-Prefix.pch
Lexical or Preprocessor Issue
 'Cocoa/Cocoa.h file not found

  <--The text of this for some reason is red
Lexical or Preprocessor issue
 
'/Users/lobster/Library/Developer/Xcode/DerivedData/Roboplasm-akiemjkznbayrtfwyfhbdjfitgcx/Build/PrecompiledHeaders/Roboplasm-Prefix-aufdjccarvtonzhbrezzlevjjkjl/Roboplasm-Prefix.pch'
 file not found

Roboplasm-Prefix.pch contains:
//
// Prefix header for all source files of the 'Roboplasm' target in the 
'Roboplasm' project
//

#ifdef __OBJC__
#import 
#endif

The path to Cocoa.h is:
MacOSX10.7>Frameworks>Cocoa.framework>Cocoa.h and a search finds it.

Any idea what's going on here?

Thanks,
Joseph

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: EXC_BAD_ACCESS in NSApplicationMain

2011-07-25 Thread Ayers, Joseph
That certainly made a difference. It's choking on a nib

#0 0x97876d54 in objc_msgSend ()
#1 0x96e6a960 in CFHash ()
#2 0x96e709c0 in __CFSetStandardHashKey ()
#3 0x96e740c2 in CFBasicHashAddValue ()
#4 0x96e8b2d4 in CFSetAddValue ()
#5 0x96ee3395 in -[__NSCFSet addObject:] ()
#6 0x94a595b1 in -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] ()
#7 0x94a4f679 in loadNib ()
#8 0x94a4ea60 in +[NSBundle(NSNibLoading) 
_loadNibFile:nameTable:withZone:ownerBundle:] ()
#9 0x94a4e96a in +[NSBundle(NSNibLoading) 
loadNibFile:externalNameTable:withZone:] ()
#10 0x94a4e89e in +[NSBundle(NSNibLoading) loadNibNamed:owner:] ()
#11 0x94cd58f3 in NSApplicationMain ()
#12 0x00010d64 in main at /Users/lobster/Desktop/Roboplasm/main.m:14

Off to ponder that.

ja


On Jul 24, 2011, at 8:04 PM, Quincey Morris wrote:

On Jul 24, 2011, at 15:50, Ayers, Joseph wrote:

In XCode 4.1. and Lion,, compiling for OS X 10.6, My application is crashing in 
main.m. Specifically it exhibits EXC_BAD_ACCESS errors in main.m, 
NSApplicationMain and obj_msgSend on disassembly. I've got symbolic breakpoints 
at:  “objc_exception_throw” and “[NSException raise]“.

Any idea how to get beyond this?

Your application didn't really crash in NSApplicationMain, but Xcode has 
collapsed the backtrace so that you can't see the place it stopped.  This is a 
usability issue in Xcode 4.

With the Debugger tab of the Navigator pane visible, look at the "level of 
detail" slider at the bottom of the pane, and drag it all the way to right-hand 
end.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


EXC_BAD_ACCESS in NSApplicationMain

2011-07-24 Thread Ayers, Joseph
In XCode 4.1. and Lion,, compiling for OS X 10.6, My application is crashing in 
main.m. Specifically it exhibits EXC_BAD_ACCESS errors in main.m, 
NSApplicationMain and obj_msgSend on disassembly. I've got symbolic breakpoints 
at:  “objc_exception_throw” and “[NSException raise]“.

Any idea how to get beyond this?

Thanks,
Joseph

main.m

#import 

int main(int argc, char *argv[])
{
return NSApplicationMain(argc, (const char **) argv);   < Thread 1 
EXC_BAD_ACCESS (code = 1, address = 0x553838b0)
}

Errors

in  objc_msgSend_disassembly_0x97876d54.s

The offending line is

0x97876d54:  movl   8(%edi,%edx,4), %eax < Thread 1 EXC_BAD_ACCESS (code = 1,

in NSApplicationMain_disassembly_0x94cd58f3.s

The offending line is:

0x94cd58f3:  testb  %al, %al < Thread 1 EXC_BAD_ACCESS (code = 1,

in main.m, the offending line is:

return NSApplicationMain(argc, (const char **) argv); < Thread 1 
EXC_BAD_ACCESS (code = 1,

argc = (int) 1
argv = (char**) 0xbb18



Joseph Ayers, Professor
Department of Biology and
Marine Science Center
Northeastern University
East Point, Nahant, MA 01908
Phone (781) 581-7370 x309(office), x335(lab)
Boston: 444 Richards Hall (617) 373-4044
Cellular (617) 755-7523, FAX: (781) 581-6076
Google Voice: (781) 346-9589
eMail: lobs...@neu.edu
iPhone: robopl...@gmail.com
http://www.neurotechnology.neu.edu/
http://robobees.seas.harvard.edu/
http://cyberplasm.net/











___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Trouble retrieving selection from NSArrayController

2011-02-22 Thread Ayers, Joseph
Here's the interface

I understood from Scott Stevensons book that in 32bit mode you had to declare 
the instance variables.

//
//  Tapes.h
//  Roboplasm
//
//  Created by Joseph Ayers on 10/11/10.
//  Copyright 2010 Northeastern University. All rights reserved.
//

#import 

#import "VideoClip.h"
//@class VideoClip;

@interface Tapes :  NSManagedObject  
{
NSString * TapeName;
NSDate   * TapeDate;
NSString * Notes;
NSSet* VideoClip;
}
//attributes
@property (nonatomic, retain) NSString * TapeName;
@property (nonatomic, retain) NSDate   * TapeDate;
@property (nonatomic, retain) NSString * Notes;
//relationships
@property (nonatomic, retain) NSSet* VideoClip;

@end


@interface Tapes (CoreDataGeneratedAccessors)
- (void)addTapesObject:(Tapes *)value;
- (void)removeTapesObject:(Tapes *)value;
- (void)addTapes:(NSSet *)value;
- (void)removeTapes:(NSSet *)value;

- (void)addVideoClipObject:(VideoClip *)value;
- (void)removeVideoClipObject:(VideoClip *)value;
- (void)addVideoClip:(NSSet *)value;
- (void)removeVideoClip:(NSSet *)value;

@end

On Feb 22, 2011, at 5:34 PM, Quincey Morris wrote:

> On Feb 22, 2011, at 13:30, Ayers, Joseph wrote:
> 
>> @interface Tapes :  NSManagedObject
>> {
>>   NSString * TapeName;
>>   NSDate   * TapeDate;
>>   NSString * Notes;
>>   NSSet* VideoClip;
>> }
> 
> Incidentally, what are those instance variables doing in the managed object 
> subclass? They seem *extremely* unlikely.
> 
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Trouble retrieving selection from NSArrayController

2011-02-22 Thread Ayers, Joseph
I have an app that has a NSTableView populated with and array of Tapes  from 
CoreData. Tapes is declared as:
@interface Tapes :  NSManagedObject
{
NSString * TapeName;
NSDate   * TapeDate;
NSString * Notes;
NSSet* VideoClip;
}
The TableView is bound to an NSArrayController (tapesController). If I select a 
row in the table and execute

NSArray * tapeSelection = [tapesController selectedObjects];



Tapes *  theTape = [tapeSelection objectAtIndex:0];

the local variable
theTape = (Tapes*) 0x

How do I get a valid selection


Joseph Ayers, Professor
Department of Biology and
Marine Science Center
Northeastern University
East Point, Nahant, MA 01908
Phone (781) 581-7370 x309(office), x335(lab)
Boston: 444 Richards Hall (617) 373-4044
Cellular (617) 755-7523, FAX: (781) 581-6076
Google Voice: (781) 346-9589
eMail: lobs...@neu.edu
iPhone: robopl...@gmail.com
http://www.neurotechnology.neu.edu/
http://robobees.seas.harvard.edu/
http://cyberplasm.net/











___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Runtime Error: Incompatable applications

2010-12-28 Thread Ayers, Joseph
I get a run time error on my application Roboplasm. To wit:

2010-12-28 09:02:30.573 Roboplasm[29731:903] Incompatible applications: 
app=com.northeastern.Roboplasm, targetApp=com.apple.Safari

Any idea what's happening here?

Thanks,
Joseph
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Core Data: Error while saving. Multiple validation errors occurred. SOLVED

2010-12-14 Thread Ayers, Joseph
Indeed, changing them to optional solved the problem

Many thanks,
Joseph Ayers

On Dec 14, 2010, at 6:22 PM, Nick Zitzmann wrote:

> 
> On Dec 14, 2010, at 4:18 PM, Ayers, Joseph wrote:
> 
>> When I log Userinfo from the save operation, 
>>   NSError *error = nil;  //Now 
>> try saving the data
>>   if (![[self managedObjectContext] save: &error]) {
>>  NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
> 
> That's not really necessary. Just break on the error in the debugger and type 
> "po [error userInfo]" to print the results of sending the -userInfo message 
> to the error.
> 
>> I get:
>> 2010-12-14 17:40:19.829 Roboplasm[23542:903] Unresolved error Error 
>> Domain=NSCocoaErrorDomain Code=1560 UserInfo=0x43f870 "Multiple validation 
>> errors occurred.", {
>>   NSDetailedErrors = (
>>   Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x43ec90 "TapeDate 
>> is a required value.",
>>   Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x43f2e0 "ClipDate 
>> is a required value.",
>>   Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x43f830 "TableDate 
>> is a required value."
>>   );
>> }
>> 
>> Indeed, these are the attributes that I added to the entities that are 
>> specified with type "date". I'm at a loss for how to rectify this. 
> 
> That means that you added three keys to the model _and_ marked them as 
> required, and then the application failed to fill each of those keys with a 
> value prior to saving. Either you need to make the app fill those keys with 
> values, or you need to re-evaluate whether or not those keys should be 
> required to be filled & change the model accordingly.
> 
> Nick Zitzmann
> <http://www.chronosnet.com/>
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Core Data: Error while saving. Multiple validation errors occurred.

2010-12-14 Thread Ayers, Joseph
When I log Userinfo from the save operation, 
NSError *error = nil;   //Now 
try saving the data
if (![[self managedObjectContext] save: &error]) {
   NSLog(@"Unresolved error %@, %@", error, [error userInfo]);

I get:
2010-12-14 17:40:19.829 Roboplasm[23542:903] Unresolved error Error 
Domain=NSCocoaErrorDomain Code=1560 UserInfo=0x43f870 "Multiple validation 
errors occurred.", {
NSDetailedErrors = (
Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x43ec90 "TapeDate 
is a required value.",
Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x43f2e0 "ClipDate 
is a required value.",
Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x43f830 "TableDate 
is a required value."
);
}

Indeed, these are the attributes that I added to the entities that are 
specified with type "date". I'm at a loss for how to rectify this. 

Joseph 

On Dec 14, 2010, at 2:49 PM, Nick Zitzmann wrote:

> 
> On Dec 14, 2010, at 12:21 PM, Ayers, Joseph wrote:
> 
>>> I changed a couple attributes of three properties in my data model. Even if 
>>> I trash the previous store, I get the error: 
>>> Error while saving
>>> Multiple validation errors occurred.
>>> 
>>> Any idea what is causing this
> 
> Usually it happens because you tried to add or modify several records at once 
> and did not push a value for a required property in more than one of them. I 
> think that error also happens if you left a dangling reference in a 
> relationship property for more than one record.
> 
>>> or where to look for a fix?
> 
> Check the error's userInfo for more information about what went wrong. The 
> userInfo dictionary will contain more specific information about what went 
> wrong.
> 
> Nick Zitzmann
> <http://www.chronosnet.com/>
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Core Data: Error while saving. Multiple validation errors occurred.

2010-12-14 Thread Ayers, Joseph
> I changed a couple attributes of three properties in my data model. Even if I 
> trash the previous store, I get the error: 
> Error while saving
> Multiple validation errors occurred.
> 
> Any idea what is causing this or where to look for a fix?
> 
> Thanks,
> Joseph
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Traversing multiple to-many relationships.

2010-11-06 Thread Ayers, Joseph
Does anyone know of any sample code that traverses multiple two-many 
relationships in the context of core data?

Thanks,
Joseph Ayers___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: CoreData models as structures

2010-11-06 Thread Ayers, Joseph
The fundamental problem seems to be nested to-many relationships. The sample 
code twomanycontroller seems to do what I want, but it's pre-core data and the 
data model won't open. One wonders how a coredata version of that would work.

ja 
 
On Nov 6, 2010, at 1:25 PM, Quincey Morris wrote:

> On Nov 6, 2010, at 06:54, Ayers, Joseph wrote:
> 
>> On Nov 5, 2010, at 7:52 PM, Quincey Morris wrote:
>> 
>>> A. With your declarations, 'tapeList.tapes' is a NSSet. The set doesn't 
>>> have a "VideoClio" property (though its members do), and the compiler is 
>>> correctly telling you that you can't refer to such a property. *Which* 
>>> 'tapes' object are you trying to refer to?
>> 
>> That is indeed the problem. VideoClip is a relationship of tapes. How should 
>> this be addressed?
> 
> Well, it depends what you're trying to do. You mentioned a reference to 
> 'tapeList.tapes.VideoClip'. What's the context of that reference, and what 
> object or objects are you trying to use there?
> 
>>> 
>>> B. This is not how you use properties in Core Data -- you do NOT declare 
>>> instance variables corresponding to the properties in your data model. 
>>> Instead, those properties are defined for you by Core Data. You *do* have 
>>> to supply property declarations to keep the compiler happy (as described in 
>>> the Core Data documentation).
>>> 
>> 
>> The manual says that you have to declare the properties to maintain 32bit 
>> compatability.
> 
> There's nothing in the documentation that says you need to declare *instance 
> variables*. Using NSManagedObject subclasses is described here:
> 
>   
> http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdManagedObjects.html%23//apple_ref/doc/uid/TP40003397-258615
> 
> There are no instance variables in this pattern. (Note that there are custom 
> property scenarios where extra instance variables are needed, but that's not 
> the scenario you have.)
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/j.ayers%40neu.edu
> 
> This email sent to j.ay...@neu.edu

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: CoreData models as structures

2010-11-06 Thread Ayers, Joseph

On Nov 5, 2010, at 7:52 PM, Quincey Morris wrote:

> On Nov 5, 2010, at 15:13, Ayers, Joseph wrote:
> 
>> I have a core data model that has a series of to-many relationships of the 
>> type:
>> 
>> @interface TapeList :  NSManagedObject
>> {
>>   NSString * ListURL;
>>   NSSet* tapes;
>> }
>> 
>> @interface tapes :  NSManagedObject
>> {
>>   NSString * Notes;
>>   NSString * TapeName;
>>   NSSet* VideoClip;
>> }
>> 
>> @interface VideoClip :  NSManagedObject
>> {
>>   NSString * StartTimeCode;
>>   QTMovie * mMovie;
>>   NSString * EndTimeCode;
>>   NSString * Notes;
>>   NSString * movieURL;
>>   tapes * CurrentTape;
>>   NSSet* Table;
>> }
>> 
>> @interface Table :  NSManagedObject
>> {
>>   NSString * Notes;
>>   NSString * Name;
>>   NSSet* CommandStates;
>>   NSSet* Flexions;
>>   NSSet* DataSources;
>> }
>> 
>> A reference to tapeList.tapes works fine, but a reference to 
>> tapeList.tapes.VideoClip gives me a
>> "request for member "VideoClip in something not a structure or union" 
>> compile time error.
> 
> I think you've got something wrong here, but there are 2 possibilities for 
> what it is. Choose A or B, if either applies. :)
> 
> A. With your declarations, 'tapeList.tapes' is a NSSet. The set doesn't have 
> a "VideoClio" property (though its members do), and the compiler is correctly 
> telling you that you can't refer to such a property. *Which* 'tapes' object 
> are you trying to refer to?

That is indeed the problem. VideoClip is a relationship of tapes. How should 
this be addressed?
> 
> B. This is not how you use properties in Core Data -- you do NOT declare 
> instance variables corresponding to the properties in your data model. 
> Instead, those properties are defined for you by Core Data. You *do* have to 
> supply property declarations to keep the compiler happy (as described in the 
> Core Data documentation).
> 
> The manual says that you have to declare the properties to maintain 32bit 
> compatability.
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/j.ayers%40neu.edu
> 
> This email sent to j.ay...@neu.edu

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


CoreData models as structures

2010-11-05 Thread Ayers, Joseph
I have a core data model that has a series of to-many relationships of the type:

@interface TapeList :  NSManagedObject
{
NSString * ListURL;
NSSet* tapes;
}

@interface tapes :  NSManagedObject
{
NSString * Notes;
NSString * TapeName;
NSSet* VideoClip;
}

@interface VideoClip :  NSManagedObject
{
NSString * StartTimeCode;
QTMovie * mMovie;
NSString * EndTimeCode;
NSString * Notes;
NSString * movieURL;
tapes * CurrentTape;
NSSet* Table;
}

@interface Table :  NSManagedObject
{
NSString * Notes;
NSString * Name;
NSSet* CommandStates;
NSSet* Flexions;
NSSet* DataSources;
}

A reference to tapeList.tapes works fine, but a reference to 
tapeList.tapes.VideoClip gives me a
"request for member "VideoClip in something not a structure or union" compile 
time error.

The structure is pretty obvious from the model
see:
http://dl.dropbox.com/u/2415080/datamodel.pdf

 but I'm baffled where it should reside in the code.

Thanks,

Joseph Ayers, Professor
Department of Biology and
Marine Science Center
Northeastern University
East Point, Nahant, MA 01908
Phone (781) 581-7370 x309(office), x335(lab)
Boston: 444 Richards Hall (617) 373-4044
Cellular (617) 755-7523, FAX: (781) 581-6076
Google Voice: (781) 346-9589
eMail: lobs...@neu.edu
iPhone: robopl...@gmail.com
http://www.neurotechnology.neu.edu/
http://robobees.seas.harvard.edu/
http://cyberplasm.net/











___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


CoreDataGeneratedAccessors

2010-10-27 Thread Ayers, Joseph
When I try to use the method addTapesObject defined as

@interface TapeList (CoreDataGeneratedAccessors)
- (void)addTapesObject:(tapes *)value;
- (void)removeTapesObject:(tapes *)value;
- (void)addTapes:(NSSet *)value;
- (void)removeTapes:(NSSet *)value;

@end

I get the error:

2010-10-27 12:09:04.718 Roboplasm[5169:903] -[TapeList addTapesObject:]: 
unrecognized selector sent to instance 0x222ade0

Do I have to provide the CoreDataGeneratedAccessors, or does core data generate 
them as the name implies?

Thanks,
Joseph Ayers


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Saving Managed Object Context

2010-08-24 Thread Ayers, Joseph
That solved it. We made the reciprocal to-one relationship optional and it 
saved.

Thanks,
Joseph

On Aug 23, 2010, at 5:48 PM, Quincey Morris wrote:

> On Aug 23, 2010, at 09:33, Ayers, Joseph wrote:
> 
>> NSError *error = nil;
>> if (![[self managedObjectContext] save: &error]) {
>> NSLog(@"Error while saving\n%@",
>> ([error localizedDescription] != nil) ? [error localizedDescription]: 
>> @"Unknown Error");
>> 
>> Results in:
>> 
>> 2010-08-22 20:31:32.385 Roboplasm[3508:a0f] Error while saving
>> TapeList is a required value.
> 
> The error means that some entity is defined to have a to-one relationship to 
> TapeList, and the relationship property is defined to be non-optional, but in 
> some object the relationship is actually nil.
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/j.ayers%40neu.edu
> 
> This email sent to j.ay...@neu.edu

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Saving Managed Object Context

2010-08-23 Thread Ayers, Joseph
Attempting to save a NSManagedObjectContext with:

  NSError *error = nil;
  if (![[self managedObjectContext] save: &error]) {
  NSLog(@"Error while saving\n%@",
([error localizedDescription] != nil) ? [error localizedDescription]: @"Unknown 
Error");

Results in:

2010-08-22 20:31:32.385 Roboplasm[3508:a0f] Error while saving
TapeList is a required value.

TapeList is the base entity in my object graph and is inserted into the context 
with:

NSManagedObjectModel *mom = [self managedObjectModel];
...
NSEntityDescription *tapeListEntity = [[mom entitiesByName] 
objectForKey:@"TapeList"];
NSLog(@"TapeList Entity: %@", tapeListEntity);
// [self setValue:tapeListEntity forKey:@"TapeList"];
[self setTapeList:[NSEntityDescription 
insertNewObjectForEntityForName:@"TapeList" inManagedObjectContext:[self 
managedObjectContext]]];


Any idea what's going on here?

Thanks,
Joseph Ayers
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com