Re: MainMenu.nib won't load
Hi Ulf, The first instance of NSDocumentController (or a subclass) becomes the shared instance. It sounds like some code is instantiating an instance of NSDocumentController before your class, so the shared instance is of the base class instead of your subclass. I don't know what would be causing that, but you might look in your code for direct messages to NSDocumentController, instead of your subclass. Good luck tracking it down, -Peter On Apr 10, 2010, at 2:43 AM, Ulf Dunkel wrote: > I am kind of stuck with a support question which I cannot explain myself. If > someone in this list can give me a hint, I would be more than happy. If this > list is the wrong place to ask for this issue, please excuse (and point me to > the right place, if possible). > > One of our customers cannot use our pure Cocoa app Barcody properly. He > complains that several menu items cannot be used. (And of course he is the > first and only one who complains about this.) > > Console.app tells us this (on his Mac OS X 10.6.3 machine): > > - snip - > 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action > showPreferences: to target of class NSDocumentController > 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action > showCreditsWindow: to target of class NSDocumentController > 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action gotoToReg: > to target of class NSDocumentController > 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action visitURL: > to target of class NSDocumentController > 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action > stopModalDialog: to target of class NSDocumentController > - snap - > > So it looks like the MainMenu.nib won't load properly on his machine. > Although he is the only one who has this issue, I would be able to understand > WHY this can happen. > > Could we have done something wrong using the MainMenu.nib? Are there any > known issues with Snowy and NSDocumentController? > > If you want to check the Barcody Resources, just grab the multi-lingual app > from here: > > http://www.dsd.net/prod/mac/barcody.php?lan=en&pmode=download > > (And yes, it happens whatever language and country he sets in his System > Prefs.) > > Clueless, > Ulf Dunkel > ___ > > 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/pammon%40apple.com > > This email sent to pam...@apple.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
QCRenderer.... how do you do that?
I'm trying to use a Quartz Composer filter in a cocoa app. I've published inputs and outputs: one image input, one image output. I can successfully set the input image, but when I try to get the output image, I get 0x0 no error messages, just a null pointer. Here's my code: QCComposition* myComp = [QCComposition compositionWithFile:@"/Users/esmith/Desktop/Simple.qtz"]; QCRenderer* myRenderer = [[QCRenderer alloc] initWithComposition:myComp colorSpace:CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB)]; NSBitmapImageRep* theRep = [[[NSBitmapImageRep alloc] initWithCIImage:[ciImageRep CIImage]] autorelease]; BOOL isSet = [myRenderer setValue:theRep forInputKey:@"InputImage"]; NSBitmapImageRep* theOutput = [myRenderer valueForOutputKey:@"OutputImage" ofType:@"Image"]; Am I missing a step where I tell the renderer to render? (PS, I've tried renderattime:0, but it doesn't help). Ideas? Thanks, Eric ___ 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: Cant read second table from same sqlite database iphone
I was able to successfully retrieve data on the first table. But I can't seem to retrieve from the second table. I know it has data inside it because I used an SQLite Browser to view the data. I also tried performing queries there and it worked fine. Only when I used the queries in the code that it doesn't work. Below is the code writing the database in the Users/Documents folder for Iphone - (void) createDatabaseIfNeeded { NSError * error; //gets access to the file system NSFileManager * fileManager = [NSFileManager defaultManager]; // gets the complete users document directory path NSArray * paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); // gets the first path in the array NSString * documentsDirectory = [paths objectAtIndex:0]; // create the complete path for the database file NSString * databasePath = [documentsDirectory stringByAppendingString:@"/Database.sql"]; DebugLog("databasePath = %s\n",[databasePath UTF8String]); // check if file exists or not BOOL success = [fileManager fileExistsAtPath:databasePath]; if (success) return; // the database does not exist so copy it in the users documents directory NSString * dbPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"/Database.sql"]; DebugLog("dbpath is %s\n",[dbPath UTF8String]); //copy the database file to ther users docuement directory success = [fileManager copyItemAtPath:dbPath toPath:databasePath error:&error]; if (!success) NSAssert(0,@"Failed to copy Database!\n"); } From: Ben Trumbull To: cnape...@yahoo.com Cc: Cocoa dev Sent: Sunday, April 11, 2010 9:27:46 Subject: re: Cant read second table from same sqlite database iphone > Hello All, > > I am having trouble reading the second table from my database because it > returns nothing even if there is data inside it. How do you know it has data inside it ? A common mistake is to try to write to databases in the read only part of an application's sandbox on the iphone. Where in the sandbox is the database ? > - (NSMutableArray*) getProvinces > { >NSMutableArray * data = [[NSMutableArray alloc] init]; >const char * sql = "SELECT * FROM Provinces"; >sqlite3_stmt * statement; > >//prepare the select statement >int returnValue = sqlite3_prepare_v2(mDatabase, sql, -1, &statement, NULL); > >DebugLog("return value = %d\n",returnValue); > >if (returnValue == SQLITE_OK) >{ >//sqlite3_bind_int(statement, 1, regionID); >//loop all the rows returned by the query >while (sqlite3_step(statement) == SQLITE_ROW) >{ You don't check the return codes here properly. sqlite3_prepare_v2() can return SQLITE_BUSY, or SQLITE_SCHEMA, or SQLITE_MISUSE. More importantly, you don't check if sqlite3_step() returns SQLITE_DONE which would indicate that you have 0 rows in this table. - Ben Get your new Email address! Grab the Email name you've always wanted before someone else does! http://mail.promotions.yahoo.com/newdomains/aa/ ___ 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: Cant read second table from same sqlite database iphone
> Hello All, > > I am having trouble reading the second table from my database because it > returns nothing even if there is data inside it. How do you know it has data inside it ? A common mistake is to try to write to databases in the read only part of an application's sandbox on the iphone. Where in the sandbox is the database ? > - (NSMutableArray*) getProvinces > { >NSMutableArray * data = [[NSMutableArray alloc] init]; >const char * sql = "SELECT * FROM Provinces"; >sqlite3_stmt * statement; > >//prepare the select statement >int returnValue = sqlite3_prepare_v2(mDatabase, sql, -1, &statement, NULL); > >DebugLog("return value = %d\n",returnValue); > >if (returnValue == SQLITE_OK) >{ >//sqlite3_bind_int(statement, 1, regionID); >//loop all the rows returned by the query >while (sqlite3_step(statement) == SQLITE_ROW) >{ You don't check the return codes here properly. sqlite3_prepare_v2() can return SQLITE_BUSY, or SQLITE_SCHEMA, or SQLITE_MISUSE. More importantly, you don't check if sqlite3_step() returns SQLITE_DONE which would indicate that you have 0 rows in this table. - Ben ___ 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: NSInvocation error when closing a dirty document
On 2010 Apr 10, at 12:43, Brad Stone wrote: > I have a strange bug that I've been tracking for a while and I'd like the > benefit of your experience. It happens with I close a window that needs to > be saved. > > When closing a dirty Core Data NSPersistentDocument I get the following error > between the "Do you want to save" sheet and the save panel: > > [58341:a0f] +[NSInvocation invocationWithMethodSignature:]: method signature > argument cannot be nil > If I make the document dirty by typing text into any of the combo boxes or > the text view I get the above error after I press the "Save" button on the > "Do you want to save…" sheet Well, as usual, there are two routes to attack this. I was going to say to try either, but in this case, since you know it has something to do with the combo boxes or text view, I'd try Route 2 first. Route 1 - The Scientist. Use debugging information to try and narrow down where the problem might be. To do this, set breakpoints on the following symbols. (Some are irrelevant for this case, but you should have these handy in any project): handleFailureInMethod:object:file:lineNumber:description: objc_exception_throw malloc_printf -[NSException raise] handleFailureInFunction:file:lineNumber:description: raise:format:arguments: Then "Debug - Breakpoints On". Reproduce your problem, and the debugger will stop where the exception occurs. Look at the call stack and think real hard. To get more food for thought, in your Xcode documentation browser, search for and open the "Document-Based Applications Overview". Click on the chapter, "Message Flow in the Document Architecture", then scroll down to and feast your eyes upon Figure 6. Route 2 - The Engineer. Figure out what you're doing that's different than what everyone else is doing, and change your design toward the more conventional until the problem goes away. You didn't say much about how you're binding these combo boxes and text view. Look at Apple's DepartmentAndEmployees sample code, in the MyDocument.nib, and note how the DepartmentController, an NSObjectController, is interposed between the user interface and the data model. One reason to do that is so that your data model will be updated when the window is closed, and then you won't need to do this: > have the bindings set, in IB, to "Continuously Updates Value". which is definitely *not* conventional. (Again, look at the bindings in DepartmentAndEmployees MyDocument.nib.) Other reasons may be related to your current problem. ___ 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: ObjC question
On Apr 10, 2010, at 5:11 PM, Tony Romano wrote: > When you create the file system event, you can pass a void * via the > structure which is accessible in the event callback. In this pointer, I want > to pass my Volume object so I know which volume the event was for. I could > have easily passed the volume object pointer in when I create the > FileSystemEvent object but I always like to stretch my thinking. I'm not sure how this relates to your previous question. I think you may have misspoken/left something out above. I'm guessing you meant that when you setup the FSEvent callback, you're passing in the FileSystemEvent object instead of the Volume object? In the callback, in order to use the Volume, the FileSystemEvent would need a reference to the Volume. Otherwise you'd need to pass the volume to the callback and get the FileSystemEvent object from the Volume. Additionally, you could also create a struct which separately contains references to both the FileSystemEvent and the Volume if for some reason you don't have and don't want a reference to the Volume in the FileSystemEvent. -- Seth Willits ___ 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
Cant read second table from same sqlite database iphone
Hello All, I am having trouble reading the second table from my database because it returns nothing even if there is data inside it. I have a function below - (NSMutableArray*) getRegions { NSMutableArray * data = [[NSMutableArray alloc] init]; const char * sql = "SELECT * FROM Regions ORDER BY RegionName"; sqlite3_stmt * statement; //prepare the select statement int returnValue = sqlite3_prepare_v2(mDatabase, sql, -1, &statement, NULL); DebugLog("return value = %d\n",returnValue); if (returnValue == SQLITE_OK) { //loop all the rows returned by the query while (sqlite3_step(statement) == SQLITE_ROW) { //get the name and the score int iDen = sqlite3_column_int(statement, 0); NSString* name = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 1)]; DebugLog("ColumnName = %s\n",[name UTF8String]); DebugLog("ColumnID %d\n",iDen); [data addObject:[NSDictionary dictionaryWithObjectsAndKeys:name, REGION_NAME, [NSNumber numberWithUnsignedInt:iDen], REGION_ID, nil]]; } } sqlite3_finalize(statement); return [data autorelease]; } and it works fine but then when I call the second function below after performing the above function, - (NSMutableArray*) getProvinces { NSMutableArray * data = [[NSMutableArray alloc] init]; const char * sql = "SELECT * FROM Provinces"; sqlite3_stmt * statement; //prepare the select statement int returnValue = sqlite3_prepare_v2(mDatabase, sql, -1, &statement, NULL); DebugLog("return value = %d\n",returnValue); if (returnValue == SQLITE_OK) { //sqlite3_bind_int(statement, 1, regionID); //loop all the rows returned by the query while (sqlite3_step(statement) == SQLITE_ROW) { //get the name and the score int iDen = sqlite3_column_int(statement, 0); NSString* name = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 0)]; int recordIden = sqlite3_column_int(statement, 2); DebugLog("ColumnName = %s\n",[name UTF8String]); DebugLog("ColumnID %d\n",iDen); [data addObject:name]; } } sqlite3_finalize(statement); return [data autorelease]; } I get nothing Get your new Email address! Grab the Email name you've always wanted before someone else does! http://mail.promotions.yahoo.com/newdomains/aa/ ___ 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: ObjC question
You cannot. You will have a pointer of some kind in your Foo class that points to the current "container". Sent from my iPad On Apr 10, 2010, at 14:38, Tony Romano wrote: > Using the sample below, how do I get the instance of the class in which I am > contained WITHOUT passing it as a parameter or using hacky sizeof tricks in > the method Foo:method? Thanks people! If this is not the correct alias for > this type of question, apologizes in advance. > > > @interface Foo : NSObject > { > id containerClass; > } > -(void) method; > @end > > @implementation Foo > > -(void) method > { > // set containerClass member to point to the instance in which I am > contained > // (i.e. the pointer to the instance of Bar. > // 'self' refers to an instance of Foo > } > @end > > ** > > @interface Bar : NSObject > { > Foo * f; // contains a Foo > } > @end > > @implementation Bar > - (id) init > { > ... > > // Call 'method' on object 'f' of type Foo > [f method]; > > ... > } > @end > > > > -tony > > > ___ > > 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/clarkcox3%40gmail.com > > This email sent to clarkc...@gmail.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: ObjC question
Appreciate all the replies. Here is the scenario. I have an object that represents a volume that is derived from a more generic object called node, Volume : node. Within the volume definition, it contains an object called FileSystemEvent. FileSystemEvent is an object that wraps the core foundation FSEvent... functions to detect changes. The way the events are handled are via an eventcallback. When you create the file system event, you can pass a void * via the structure which is accessible in the event callback. In this pointer, I want to pass my Volume object so I know which volume the event was for. I could have easily passed the volume object pointer in when I create the FileSystemEvent object but I always like to stretch my thinking. I couldn't find anything in the language that was obvious so I reached out to the community to get their thoughts. Again, many thanks! -tony On Apr 10, 2010, at 4:41 PM, Kevin Brock wrote: > On Apr 10, 2010, at 2:38 PM, Tony Romano wrote: > >> Using the sample below, how do I get the instance of the class in which I >> am contained WITHOUT passing it as a parameter or using hacky sizeof tricks >> in the method Foo:method? Thanks people! If this is not the correct alias >> for this type of question, apologizes in advance. > > You do need to pass it as a parameter. If you look at how Interface Builder > connects with code, actions called by, for example, buttons include a > 'sender' parameter: > > - (void) myAction:(id)sender; > > This is done all over the place... > > You call the method: > > [f method:self]; > > and you're done. I'm not clear on why you don't want to pass it as a > parameter. If that's really a firm restriction you'll need to explain why in > order for anyone to answer the question adequately. > > BTW, when you say (in a later message) that an instance of f is contained in > one instance of Bar, that's not a language restriction. It's just how you > designed it. If it's an explicit part of the design it's OK to write code > that knows about that... > > try this. I've left out anything related to reference counting, but I think > it's basically right: > > @interface Foo : NSObject > { > id containerClass: > } > > - (id) initWithContainer:(id)container; > @end > > @implementation Foo > > - (id) initWithContainer:(id)container > { > self = [super init]; > if(self) > containerClass = container; > return self; > } > > @end > > @interface Bar : NSObject > { > Foo* f; > } > @end > > @implementation Bar > > @implementation Bar > - (id) init > { > f = [[Foo alloc] initWithContainer:self]; > } > @end > > Kevin > > -tony ___ 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: ObjC question
On Apr 10, 2010, at 16:02, Tony Romano wrote: > Thanks for the reply but I am not sure I follow your point. An instance of > 'f' is contained precisely in one instance of Bar. I can have many Bars but > each have their own instance of the class Foo. Does the language support > getting the containing instance? I think the confusion here (between the question and the answers) is that the Bar object only contains a *pointer* to the Foo object, not the Foo object itself. In that sense, the Foo is *not* contained within the BAR at all -- the concept of "containing instance" doesn't exist in Obj-C (unlike, say, C++). So, if you want your Bar to be the "parent" of a Foo, and you want the Foo to know its parent, you have to pass the Bar's object pointer as a parameter when setting up the Foo, as others have told you. ___ 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: ObjC question
On Apr 10, 2010, at 2:38 PM, Tony Romano wrote: > Using the sample below, how do I get the instance of the class in which I am > contained WITHOUT passing it as a parameter or using hacky sizeof tricks in > the method Foo:method? Thanks people! If this is not the correct alias for > this type of question, apologizes in advance. You do need to pass it as a parameter. If you look at how Interface Builder connects with code, actions called by, for example, buttons include a 'sender' parameter: - (void) myAction:(id)sender; This is done all over the place... You call the method: [f method:self]; and you're done. I'm not clear on why you don't want to pass it as a parameter. If that's really a firm restriction you'll need to explain why in order for anyone to answer the question adequately. BTW, when you say (in a later message) that an instance of f is contained in one instance of Bar, that's not a language restriction. It's just how you designed it. If it's an explicit part of the design it's OK to write code that knows about that... try this. I've left out anything related to reference counting, but I think it's basically right: @interface Foo : NSObject { id containerClass: } - (id) initWithContainer:(id)container; @end @implementation Foo - (id) initWithContainer:(id)container { self = [super init]; if(self) containerClass = container; return self; } @end @interface Bar : NSObject { Foo* f; } @end @implementation Bar @implementation Bar - (id) init { f = [[Foo alloc] initWithContainer:self]; } @end Kevin ___ 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: ObjC question
On Apr 10, 2010, at 4:13 PM, Noah Desch wrote: > If you need to enforce a specific one to one relationship between Bars and Fs > you need to write code to support that. If you want Fs to know which Bar > "owns" it, you need to write code to support that. I would suggest giving F a > property "myBar" and giving it an initializer - (id)initWithBar:(Bar *)owner > which sets the myBar property. Also, if you tell us why you need to do this, we might be able to suggest the idiomatic Cocoa pattern that would be appropriate. -- Dave Carrigan d...@rudedog.org Seattle, WA, USA ___ 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: ObjC question
On Apr 10, 2010, at 7:02 PM, Tony Romano wrote: > Thanks for the reply but I am not sure I follow your point. An instance of > 'f' is contained precisely in one instance of Bar. I can have many Bars but > each have their own instance of the class Foo. Does the language support > getting the containing instance? But how does the language know that only one instance of f is contained in one instance of Bar? You could have multiple Bars pointing to the same f, or you could instantiate an f without first enclosing it in a Bar. These are just dumb objects which you could do any number of things with. If you need to enforce a specific one to one relationship between Bars and Fs you need to write code to support that. If you want Fs to know which Bar "owns" it, you need to write code to support that. I would suggest giving F a property "myBar" and giving it an initializer - (id)initWithBar:(Bar *)owner which sets the myBar property. -Noah___ 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: ObjC question
Thanks for the reply but I am not sure I follow your point. An instance of 'f' is contained precisely in one instance of Bar. I can have many Bars but each have their own instance of the class Foo. Does the language support getting the containing instance? On Apr 10, 2010, at 3:05 PM, Seth Willits wrote: > On Apr 10, 2010, at 2:38 PM, Tony Romano wrote: > >> Using the sample below, how do I get the instance of the class in which I >> am contained WITHOUT passing it as a parameter or using hacky sizeof tricks >> in the method Foo:method? Thanks people! If this is not the correct alias >> for this type of question, apologizes in advance. > > You don't. That just doesn't make any sense. "f" can be "contained" by a > billion different objects. > > > -- > Seth Willits > > > ___ > > 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/tonyrom%40hotmail.com > > This email sent to tony...@hotmail.com > -tony ___ 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: ObjC question
On Apr 10, 2010, at 2:38 PM, Tony Romano wrote: > Using the sample below, how do I get the instance of the class in which I am > contained WITHOUT passing it as a parameter or using hacky sizeof tricks in > the method Foo:method? Thanks people! If this is not the correct alias for > this type of question, apologizes in advance. You don't. That just doesn't make any sense. "f" can be "contained" by a billion different objects. -- Seth Willits ___ 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: Automator Actions and CFBundleExecutable key
On Apr 10, 2010, at 3:51 PM, Fritz Anderson wrote: > Did you change the action type to Cocoa after starting with AppleScript or > shell script? No > Have you examined the contents of the action bundle in the problem case? > Clean the target first, then build. Control-click Products > yourBundle in > the Groups & Files list, and Show in Finder. Control-click on the icon and > Show Package Contents. The debug version does NOT contain the MacOS executable but the release compile DOES contain this... I've poured over the build settings and simply do not see the what is preventing the debug compilation from producing this…. There are no other warnings tossed out during either compilation Any thoughts? > Is the processed Info.plist as you expect? What would I be looking for? > (Examine it with a text editor or Open As > Source in Xcode; the graphical > plist editor can be deceiving.) OK but what am I supposed to be checking?___ 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
ObjC question
Using the sample below, how do I get the instance of the class in which I am contained WITHOUT passing it as a parameter or using hacky sizeof tricks in the method Foo:method? Thanks people! If this is not the correct alias for this type of question, apologizes in advance. @interface Foo : NSObject { id containerClass; } -(void) method; @end @implementation Foo -(void) method { // set containerClass member to point to the instance in which I am contained // (i.e. the pointer to the instance of Bar. // 'self' refers to an instance of Foo } @end ** @interface Bar : NSObject { Foo * f; // contains a Foo } @end @implementation Bar - (id) init { ... // Call 'method' on object 'f' of type Foo [f method]; ... } @end -tony ___ 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: Automator Actions and CFBundleExecutable key
On 10 Apr 2010, at 3:19 PM, Steve Cronin wrote: > XC 3.2.1 SDK 10.6 My mistake; I said 3.1.3 (which is the iPhone OS). I meant 3.2.2. 10.6 SDK. >> I created a kill-me Cocoa action in Xcode, from the template. Info.plist ha >> a CFBundleExecutable key, set to ${EXECUTABLE_NAME}. Again, this makes >> sense, because the plug-in has a binary executable. >> > So what happens if you compile for debug? Build succeeded. No warnings. Did you change the action type to Cocoa after starting with AppleScript or shell script? I'm betting that different run-script-phase scripts come from the template depending on the type, and changing the type will do the Wrong Thing. Have you examined the contents of the action bundle in the problem case? Clean the target first, then build. Control-click Products > yourBundle in the Groups & Files list, and Show in Finder. Control-click on the icon and Show Package Contents. (You know all this, but I'm appallingly thorough.) Is the executable there? Is the processed Info.plist as you expect? (Examine it with a text editor or Open As > Source in Xcode; the graphical plist editor can be deceiving.) — 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
Re: Automator Actions and CFBundleExecutable key
On Apr 10, 2010, at 3:08 PM, Fritz Anderson wrote: > You don't say what kind of Automator action you are building — script, > AppleScript, or Cocoa? Cocoa > And what do you mean by "compile warnings?" The compiler doesn't know or care > about the contents of Info.plist. The build system might. But as far as I can > tell by your message, the build system didn't complain at all — you only > state your opinion that the key is "pointless." my bad 'compiler warnings' PhaseScriptExecution "Run Script" "build/XYZ.build/Debug/New Foo From Files.build/Script-AA5E153E10B0AFCF0082C21B.sh" cd /Volumes/DaBook/Projects/myProject/XYZ/Code .. /bin/sh -c "\"/Volumes/DaBook/Projects/myProject/XYZ/Code/build/XYZ.build/Debug/New Foo From Files.build/Script-AA5E153E10B0AFCF0082C21B.sh\"" warning: CFBundleExecutable key is pointless with no executable. Run Script:/usr/bin/amlint "${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}" > > And why does your action have "no executable" on debug compiles (or with the > CFBundleExecutable key present), and "has executable" on release compiles (or > with the key absent)? The presence of the key has no effect on whether a > binary is built. The build configuration has no effect on whether a binary is > built (modulo some really perverse build settings). It has the key - I merely cited the outcomes based on two different setups that I had constructed trying to understand what is going on... I have the key and remain puzzled by the 'pointless' warning that is tossed off as show immediately above > Xcode 3.1.3 (you'd do well to tell us what version of Xcode and what SDK > you're using, and how you created your project): XC 3.2.1 SDK 10.6 > > I created a kill-me Cocoa action in Xcode, from the template. Info.plist ha a > CFBundleExecutable key, set to ${EXECUTABLE_NAME}. Again, this makes sense, > because the plug-in has a binary executable. > So what happens if you compile for debug? > > Would you please clarify your problem? Trying ___ 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: Automator Actions and CFBundleExecutable key
On 10 Apr 2010, at 2:01 PM, Steve Cronin wrote: > I have an Automator action that is giving me a confusing result. > > If I include an 'Executable File' key in the info.plist > - debug compile - with no executable this key is pointless > - release compile - no warning > > If I remove the 'Executable File' key from the info.plist > - debug compile - no warnings > - release compile - bundle has executable but no CFBundleExecutable key > > Damned if I do and damned if I don't…. > Should I just include the key and ignore the debug compile warnings? > Is there a compiler flag that I should be more informed about? You don't say what kind of Automator action you are building — script, AppleScript, or Cocoa? And what do you mean by "compile warnings?" The compiler doesn't know or care about the contents of Info.plist. The build system might. But as far as I can tell by your message, the build system didn't complain at all — you only state your opinion that the key is "pointless." And why does your action have "no executable" on debug compiles (or with the CFBundleExecutable key present), and "has executable" on release compiles (or with the key absent)? The presence of the key has no effect on whether a binary is built. The build configuration has no effect on whether a binary is built (modulo some really perverse build settings). Xcode 3.1.3 (you'd do well to tell us what version of Xcode and what SDK you're using, and how you created your project): I created a kill-me scripted action in Xcode, from the template. Info.plist had no CFBundleExecutable, which makes sense. There is a file that executes — the script — but that's now what I understand the key to mean. I created a kill-me Cocoa action in Xcode, from the template. Info.plist ha a CFBundleExecutable key, set to ${EXECUTABLE_NAME}. Again, this makes sense, because the plug-in has a binary executable. The templates as they are instantiated do the right thing, and in both cases, the actions build without complaint (though there was a category key the Info.plist processor wanted filled-in). Would you please clarify your problem? — 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
NSInvocation error when closing a dirty document
I have a strange bug that I've been tracking for a while and I'd like the benefit of your experience. It happens with I close a window that needs to be saved. When closing a dirty Core Data NSPersistentDocument I get the following error between the "Do you want to save" sheet and the save panel: [58341:a0f] +[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil Yes, I know something is nil but I have not ventured into any of the methods that handle this behavior (I start with SaveDocument) and I don't know exactly what is nil. This happens whether its a document that's never been saved or one that has. I've tracked it down to an exact sequence of events. The document's window has two combo boxes, a radio button matrix and a text view. If I make the document dirty by changing the selected radio button and then close the window everything works as expected ("Do you want to save" sheet comes up, I press "Save" and the save panel comes up. If I make the document dirty by typing text into any of the combo boxes or the text view I get the above error after I press the "Save" button on the "Do you want to save…" sheet (the sheet closes like normal but nothing happens after the error) After the sheet disappears. I press the close box again and everything works fine: the save panel comes up and the document saves normally. This made me think that maybe the edits weren't getting updated but those three objects have the bindings set, in IB, to "Continuously Updates Value". Thanks for the help.___ 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
Automator Actions and CFBundleExecutable key
Folks; I have an Automator action that is giving me a confusing result. If I include an 'Executable File' key in the info.plist - debug compile - with no executable this key is pointless - release compile - no warning If I remove the 'Executable File' key from the info.plist - debug compile - no warnings - release compile - bundle has executable but no CFBundleExecutable key Damned if I do and damned if I don't…. Should I just include the key and ignore the debug compile warnings? Is there a compiler flag that I should be more informed about? Thanks for any information! Steve___ 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: MainMenu.nib won't load
On Apr 10, 2010, at 3:43 AM, Ulf Dunkel wrote: > I am kind of stuck with a support question which I cannot explain myself. If > someone in this list can give me a hint, I would be more than happy. If this > list is the wrong place to ask for this issue, please excuse (and point me to > the right place, if possible). > > One of our customers cannot use our pure Cocoa app Barcody properly. He > complains that several menu items cannot be used. (And of course he is the > first and only one who complains about this.) > > Console.app tells us this (on his Mac OS X 10.6.3 machine): > > - snip - > 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action > showPreferences: to target of class NSDocumentController > 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action > showCreditsWindow: to target of class NSDocumentController > 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action gotoToReg: > to target of class NSDocumentController > 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action visitURL: > to target of class NSDocumentController > 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action > stopModalDialog: to target of class NSDocumentController > - snap - > > So it looks like the MainMenu.nib won't load properly on his machine. > Although he is the only one who has this issue, I would be able to understand > WHY this can happen. Did you ask the user to boot into safe mode, then try launching? This might at least tell you that something foreign is interfering.. Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business" ___ 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: MainMenu.nib won't load
Hi Ulf > Could we have done something wrong using the MainMenu.nib? Are there any > known issues with Snowy and NSDocumentController? > > If you want to check the Barcody Resources, just grab the multi-lingual app > from here: > > http://www.dsd.net/prod/mac/barcody.php?lan=en&pmode=download We really can't tell too much from the built app bundle - the nibs are compiled and cannot be opened and the source files for the controller are not there. The app runs here - Macbook Pro OS X 10.6.3 French. British English and (US) English Joanna -- Joanna Carter Carter Consulting ___ 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
MainMenu.nib won't load
I am kind of stuck with a support question which I cannot explain myself. If someone in this list can give me a hint, I would be more than happy. If this list is the wrong place to ask for this issue, please excuse (and point me to the right place, if possible). One of our customers cannot use our pure Cocoa app Barcody properly. He complains that several menu items cannot be used. (And of course he is the first and only one who complains about this.) Console.app tells us this (on his Mac OS X 10.6.3 machine): - snip - 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action showPreferences: to target of class NSDocumentController 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action showCreditsWindow: to target of class NSDocumentController 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action gotoToReg: to target of class NSDocumentController 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action visitURL: to target of class NSDocumentController 4/7/10 8:44:12 AM Barcody[83923] Could not connect the action stopModalDialog: to target of class NSDocumentController - snap - So it looks like the MainMenu.nib won't load properly on his machine. Although he is the only one who has this issue, I would be able to understand WHY this can happen. Could we have done something wrong using the MainMenu.nib? Are there any known issues with Snowy and NSDocumentController? If you want to check the Barcody Resources, just grab the multi-lingual app from here: http://www.dsd.net/prod/mac/barcody.php?lan=en&pmode=download (And yes, it happens whatever language and country he sets in his System Prefs.) Clueless, Ulf Dunkel ___ 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: Using a SOAP Web Service from iPhone
Hi, I'll refrain from saying bad things about SOAP, but http://72.249.21.88/nonintersecting/2006/11/15/the-s-stands-for-simple/?year=2006&monthnum=11&day=15&name=the-s-stands-for-simple&page= is a must-read. In my experience, gSOAP (www.genivia.com) works best when trying to consume WebServices on the iPhone. Note that it generates C++ (or even plain C) but I've successfully wrapped that in Objective-C on several occasions. I wish you luck and perseverance - you'll need both. Regards, Sander ___ 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
IKImageView delegate
The documentation (updated this morning) says: "An IKImageView object’s delegate [...] is informed of various actions by the image view through delegation messages." This begs the question: What are these "delegation messages" and where are they documented? Also: IKImageView seems to understand the cut:, copy:, paste: etc. messages. But I can't find any documentation about this (neither in IKImageView nor in it's superclasses). According to the documentation cut: seems to be implemented only by NSText and WebView. Another thing: IKImageView can mark a region (IKToolModeSelect). How to get this region from IKImageView? (Clumsy workaround: send it a copy: message and look at the pasteboard). A link to the appropiate documentation would be most welcome. Kind regards, Gerriet. ___ 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