Re: NSTableView - populating from C procedure
On Jul 22, 2009, at 10:41 PM, Alexander Bokovikov openwo...@uralweb.ru wrote: where it is said, among other, that NSTableView items may be filled out like this: Tables aren't actually filled with anything. Instead, you provide the table with a data source object that fulfills the table's data needs upon request. getString(rowIndex, buf, len); return [NSString stringWithCString:buf length:len encoding:NSUTF8StringEncoding]; Be aware that this method needs to be *fast*. This might mean caching your values as they are generated, if possible. I.e. is it possible to return a NSString without its preliminary retaining? Re-read the Cocoa memory management guide. +stringWithCString:encoding: does not start with allocate or copy, meaning you don't own it. Therefore you must not release it. Likewise, the method you're implementing doesn't start with allocate or copy, so you must not leak ownership of the returned object. --Kyle Sluder ___ 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: NSTableView - populating from C procedure
Assuming your cstring is null-terminated, you can use [NSString stringWithUTF8String] On Thu, Jul 23, 2009 at 2:41 PM, Alexander Bokovikov openwo...@uralweb.ruwrote: Hi, All, This is my first attempt to deal with Cocoa container class, so I have some unclear points. I've found one of many tutorials here: http://www.cocoadev.com/index.pl?NSTableViewDataSource where it is said, among other, that NSTableView items may be filled out like this: - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { return [[myTableViewArray objectAtIndex: rowIndex] objectForKey:[aTableColumn identifier]] } My specifics is that the data (strings) are delivered by an external procedure, located out of ObjC stuff, and returning C-style strings. My table has only one column. My question is, as usual, about memory manager: May I write something like this: exern void getString(int row, char *s, int *len); - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { char buf[255]; int len; getString(rowIndex, buf, len); return [NSString stringWithCString:buf length:len encoding:NSUTF8StringEncoding]; } I.e. is it possible to return a NSString without its preliminary retaining? Or should I add [... retain] to the returning string? All examples operate by some values, stored in retained structures, like NSArray. Here my question originates from. Thanks. ___ 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/kthemank%40gmail.com This email sent to kthem...@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: NSTableView - populating from C procedure
On 23/07/2009, at 4:25 PM, Alexander Bokovikov wrote: I can it understand, when viruses send something illegal to a webserver, which has flaws in the request processing routine, but in my case it's an internal function, which, of course, should check the buffer size, but how it could be accessible for a virus? If it checks the buffer size and the string size, it should be OK. Not all dialects of C have historically supported sizeof() for stack-based buffers but I think all modern ones do. My warning was of a very general nature, and may not apply to your app. But every time you declare buffer space as a stack array, you should mentally consider whether a buffer exploit might be possible there. --Graham ___ 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
NSTableView: Out-Of-Bounds Array Error on reloadData
Hello Panel-- Ok, this is really annoying me. My app works fabulously on 10.4, but on 10.5, gives an out-of-bounds array error when I reloadData on a tableView with a dataSource. The gist of the code is: code -(void)awakeFromNib { if ([entryArray count] == 0) addNewEntry; // which it does on app opening [tableView reloadData] // which should display the new entry but bombs out on 10.5 with an OOB array error and the doc window does not display } /code The entryArray is, of course, the dataSource for the tableView. Opening a data doc rather than generating a new doc gives the same error, also on a reloadData elsewhere in the code. I am assuming I am hitting a bug in 10.4 that was fixed in 10.5, but for the life of me, I cannot figure out what it may be. Recompiling in 10.5 does not give me any clues. What am I missing? If anyone can steer me in the correct direction, I would be most grateful. Unfortunately, Google has been most unhelpful on this topic. Thanks in advance, Kevin ~Syntonica [kraken release]; ___ 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: NSTableView - populating from C procedure
On 23.07.2009, at 11:52, Graham Cox wrote: BTW, watch out for a potential buffer overflow in getString(...), this is the sort of thing viruses readily exploit. OK, thanks, though I'd like to ask, if it's not a big offtopic, how viruses can exploit my internal function? I can it understand, when viruses send something illegal to a webserver, which has flaws in the request processing routine, but in my case it's an internal function, which, of course, should check the buffer size, but how it could be accessible for a virus? Thanks to all others, who replied. ___ 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: NSTableView - populating from C procedure
On Jul 22, 2009, at 11:38 PM, Graham Cox wrote: My warning was of a very general nature, and may not apply to your app. But every time you declare buffer space as a stack array, you should mentally consider whether a buffer exploit might be possible there. It was a good warning. Since the author can rarely guarantee that some data field will not be filled from an untrusted source *forever* it is always best to check for and not allow overflow. The function getString in the sample code might be safe today, but will it be safe after the nth code change in the future? Does it get or generate its code as a result of user action? Will it always be that way? Easier to ensure that an overflow can't cause harm today then to worry about all future failures. Remember, most security problems stem from abuse of simple bugs. /\/\arc ___ 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
iPhone List?
Hello, I wish to know if this list works also for iPhone developer, I hadn't found one related to iPhone except the govIphone, that its for goverment iPhone apps... so.. :S. If this is the correct list to write then please let me know so I can ask few questions related.. Im a mac developer but starting to dev for iPhone.. Thanks Gustavo ___ 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: iPhone List?
if your questions are Cocoa, Core Foundation etc related and about released software (ie not iPhone OS 3.1), ask away. you can try the apple iphone dev forums too if you like (but I dont find them anywhere as nearly useful as this list) Gustavo Pizano wrote: Hello, I wish to know if this list works also for iPhone developer, I hadn't found one related to iPhone except the govIphone, that its for goverment iPhone apps... so.. :S. If this is the correct list to write then please let me know so I can ask few questions related.. Im a mac developer but starting to dev for iPhone.. Thanks Gustavo ___ 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/rols%40rols.org This email sent to r...@rols.org ___ 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: NSTableView - populating from C procedure
On 23.07.2009, at 12:55, Marco S Hyman wrote: On Jul 22, 2009, at 11:38 PM, Graham Cox wrote: My warning was of a very general nature, and may not apply to your app. But every time you declare buffer space as a stack array, you should mentally consider whether a buffer exploit might be possible there. It was a good warning. Agree completely with all you said below! Indeed, I'm doing a check. Since the author can rarely guarantee that some data field will not be filled from an untrusted source *forever* it is always best to check for and not allow overflow. The function getString in the sample code might be safe today, but will it be safe after the nth code change in the future? Does it get or generate its code as a result of user action? Will it always be that way? Easier to ensure that an overflow can't cause harm today then to worry about all future failures. Remember, most security problems stem from abuse of simple bugs. /\/\arc ___ 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 Animation rendering problem
On Jul 22, 2009, at 10:05 PM, Randall Meadows wrote: Any idea why the drawing is screwing up for the 2nd animation? Are the 2 different methods of animating messing up each other somehow (even though I've removed the 1st animation)? This is working as expected (for the default case at least). By default a view (or layer) is not redraw when it is resized, but the content is scaled. You want to change the contentMode on the UIView if you want it to redraw (and understand that there is a performance penalty for doing this). -- David Duncan Apple DTS Animation and Printing ___ 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: iPhone List? - few questions
Aha ok.. thanks. I need to develop an iPhone app that fetches sms data form the sender, the data are access keys, so I was wondering if tis possible to do such an application. I was reading the iPhone App programing Guide, and there is something interesting, I can register my app with some particular keys, in my case, sms into the UIRequiredDeviceCapabilities, so I can comunicate with teh iPhone app that handles the sms, and fetch the data... am I correct? Thx G. On Jul 23, 2009, at 9:11 AM, Roland King wrote: if your questions are Cocoa, Core Foundation etc related and about released software (ie not iPhone OS 3.1), ask away. you can try the apple iphone dev forums too if you like (but I dont find them anywhere as nearly useful as this list) Gustavo Pizano wrote: Hello, I wish to know if this list works also for iPhone developer, I hadn't found one related to iPhone except the govIphone, that its for goverment iPhone apps... so.. :S. If this is the correct list to write then please let me know so I can ask few questions related.. Im a mac developer but starting to dev for iPhone.. Thanks Gustavo ___ 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/rols%40rols.org This email sent to r...@rols.org ___ 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: iPhone List? - few questions
If you're trying to use data which has been sms'ed to your user, which is something I've thought about doing before, the only way which I thought it could be done is to register your own url for the application and then have the sms you send include the data in a URL format, eg if your app registered URL is foobar you might have foobar://yourdatahere in the SMS. I believe that you'll then have the opportunity in the SMS screen to click the arrow at the side of the screen and your app will launch with that URL as data and you can process it. I don't think you can get any more automated than that. It also relies on you sending the data in a compatible format. Not totally sure this is related to the UIRequiredDeviceCapabilities though, go hunt around the docs for url or 'phone:' and 'text:', I think those are a couple of the URLs that apple registers for stuff and the documentation is around there. If I have misunderstood what you're asking .. sorry Gustavo Pizano wrote: Aha ok.. thanks. I need to develop an iPhone app that fetches sms data form the sender, the data are access keys, so I was wondering if tis possible to do such an application. I was reading the iPhone App programing Guide, and there is something interesting, I can register my app with some particular keys, in my case, sms into the UIRequiredDeviceCapabilities, so I can comunicate with teh iPhone app that handles the sms, and fetch the data... am I correct? Thx G. On Jul 23, 2009, at 9:11 AM, Roland King wrote: if your questions are Cocoa, Core Foundation etc related and about released software (ie not iPhone OS 3.1), ask away. you can try the apple iphone dev forums too if you like (but I dont find them anywhere as nearly useful as this list) Gustavo Pizano wrote: Hello, I wish to know if this list works also for iPhone developer, I hadn't found one related to iPhone except the govIphone, that its for goverment iPhone apps... so.. :S. If this is the correct list to write then please let me know so I can ask few questions related.. Im a mac developer but starting to dev for iPhone.. Thanks Gustavo ___ 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/rols%40rols.org This email sent to r...@rols.org ___ 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: iPhone List? - few questions
Nop you didn\'t miss understood the question, I will have a look at the docs, because the idea is that once Im in my app, put the first credentials, then the server will send me an authorizaiton code, and the idea is to don't leave my app to get the data from the sms, but the app fetch the data of the incoming sms, but if you tell me that you think its not possible to get more automated than clicking the arrow in the Iphone sms app to launch mine with the data in the url then Im kinda stuck... I will take a look at the docs and see what I find out. I will let you know if something as you have been thinking about doing the same, if find a workaround. G. On Jul 23, 2009, at 9:27 AM, Roland King wrote: If you're trying to use data which has been sms'ed to your user, which is something I've thought about doing before, the only way which I thought it could be done is to register your own url for the application and then have the sms you send include the data in a URL format, eg if your app registered URL is foobar you might have foobar://yourdatahere in the SMS. I believe that you'll then have the opportunity in the SMS screen to click the arrow at the side of the screen and your app will launch with that URL as data and you can process it. I don't think you can get any more automated than that. It also relies on you sending the data in a compatible format. Not totally sure this is related to the UIRequiredDeviceCapabilities though, go hunt around the docs for url or 'phone:' and 'text:', I think those are a couple of the URLs that apple registers for stuff and the documentation is around there. If I have misunderstood what you're asking .. sorry Gustavo Pizano wrote: Aha ok.. thanks. I need to develop an iPhone app that fetches sms data form the sender, the data are access keys, so I was wondering if tis possible to do such an application. I was reading the iPhone App programing Guide, and there is something interesting, I can register my app with some particular keys, in my case, sms into the UIRequiredDeviceCapabilities, so I can comunicate with teh iPhone app that handles the sms, and fetch the data... am I correct? Thx G. On Jul 23, 2009, at 9:11 AM, Roland King wrote: if your questions are Cocoa, Core Foundation etc related and about released software (ie not iPhone OS 3.1), ask away. you can try the apple iphone dev forums too if you like (but I dont find them anywhere as nearly useful as this list) Gustavo Pizano wrote: Hello, I wish to know if this list works also for iPhone developer, I hadn't found one related to iPhone except the govIphone, that its for goverment iPhone apps... so.. :S. If this is the correct list to write then please let me know so I can ask few questions related.. Im a mac developer but starting to dev for iPhone.. Thanks Gustavo ___ 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/rols%40rols.org This email sent to r...@rols.org ___ 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 Animation rendering problem
On Jul 22, 2009, at 10:05 PM, Randall Meadows wrote: newBounds.origin.x -= delta/2.0; newBounds.size.width += delta; newBounds.origin.y -= delta/2.0; newBounds.size.height += delta; BTW, you might want to look up the NSInsetRect() function. -jcr ___ 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: NSTableView: Out-Of-Bounds Array Error on reloadData
You should check at the effect of reloadData to all your datasource methods (numberOfRowsInTableView and so on) laurent On Jul 23, 2009, at 8:53 AM, syntonica wrote: Hello Panel-- Ok, this is really annoying me. My app works fabulously on 10.4, but on 10.5, gives an out-of-bounds array error when I reloadData on a tableView with a dataSource. The gist of the code is: code -(void)awakeFromNib { if ([entryArray count] == 0) addNewEntry; // which it does on app opening [tableView reloadData] // which should display the new entry but bombs out on 10.5 with an OOB array error and the doc window does not display } /code The entryArray is, of course, the dataSource for the tableView. Opening a data doc rather than generating a new doc gives the same error, also on a reloadData elsewhere in the code. I am assuming I am hitting a bug in 10.4 that was fixed in 10.5, but for the life of me, I cannot figure out what it may be. Recompiling in 10.5 does not give me any clues. What am I missing? If anyone can steer me in the correct direction, I would be most grateful. Unfortunately, Google has been most unhelpful on this topic. Thanks in advance, Kevin ~Syntonica [kraken release]; ___ 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/lcerveau%40me.com This email sent to lcerv...@me.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
Outline view bound to an NSTreeController's content shows all children at the top level
Hi all, Subject is pretty self-explanatory. The problem: I don't want that behavior. A little longer explanation: The data is a CoreData entity with a self- referencing children-parent many-to-one relationship, which can go arbitrarily deep. The problem is, when call addChild: or insertChild: instead of only appearing one level down, the new instance appears at the top level as well. Likewise, if I make a child from a node on THAT level, the child appears 3 times, once where it's supposed to be, once in the top level, and once one level below its parent's instance at the top level. I get the feeling there's a simple fix for this, but I can't figure out what it is. If it's relevant, I'm not calling add/insertChild: (is there a difference, BTW?) in code, but rather hooking up a button to the treecontroller directly in IB. Thanks, Dan Daniel DeCovnick danhd123 at mac dot 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
Screen Saver test button click notification
Hello List, I have developing a calibration tool , but there is a little issue, When i have done the calibration and go into the system preferences and click screen saver test button , after that calibration is gone, i have try these screen saver notification , com.apple.screensaver.didstart com.apple.screensaver.willstop com.apple.screensaver.didstop but my issue is not fixed, so please give me any detail for screen saver test button click notification. Thanks santosh ___ 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: NSTableView: Out-Of-Bounds Array Error on reloadData
On 23/07/2009, at 4:53 PM, syntonica wrote: The entryArray is, of course, the dataSource for the tableView. No it's not, if entryArray is an NSArray or related. NSArray does not implement NSTableDataSource. Your (controller) code must implement that, maybe by using or referencing an array. If entryArray is the controller, we need to see it. (and, as an aside, it's badly named). I am assuming I am hitting a bug in 10.4 that was fixed in 10.5, but for the life of me, I cannot figure out what it may be. Recompiling in 10.5 does not give me any clues. So show us the real datasource code. The -awakeFromNib snippet tells us nothing useful. Your assumption is very unlikely to be the case, since thousands of tables have been working since the release of Leopard without a hoard of angry developers clamouring for blood... --Graham ___ 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: iPhone List? - few questions
The sms: URL on the iPhone only supports phone number, unless if you're willing to go deep into the private API, but you couldn't distribute your app into the App Store. My advice is, better to install some kind of sms application or gateway on your server, so your iPhone app could send the text into the server, and the server will forward the message through sms. Jesse Armand (http://jessearmand.com) On Thu, Jul 23, 2009 at 2:43 PM, Gustavo Pizanogustavxcodepic...@gmail.com wrote: Nop you didn\'t miss understood the question, I will have a look at the docs, because the idea is that once Im in my app, put the first credentials, then the server will send me an authorizaiton code, and the idea is to don't leave my app to get the data from the sms, but the app fetch the data of the incoming sms, but if you tell me that you think its not possible to get more automated than clicking the arrow in the Iphone sms app to launch mine with the data in the url then Im kinda stuck... I will take a look at the docs and see what I find out. I will let you know if something as you have been thinking about doing the same, if find a workaround. G. On Jul 23, 2009, at 9:27 AM, Roland King wrote: If you're trying to use data which has been sms'ed to your user, which is something I've thought about doing before, the only way which I thought it could be done is to register your own url for the application and then have the sms you send include the data in a URL format, eg if your app registered URL is foobar you might have foobar://yourdatahere in the SMS. I believe that you'll then have the opportunity in the SMS screen to click the arrow at the side of the screen and your app will launch with that URL as data and you can process it. I don't think you can get any more automated than that. It also relies on you sending the data in a compatible format. Not totally sure this is related to the UIRequiredDeviceCapabilities though, go hunt around the docs for url or 'phone:' and 'text:', I think those are a couple of the URLs that apple registers for stuff and the documentation is around there. If I have misunderstood what you're asking .. sorry Gustavo Pizano wrote: Aha ok.. thanks. I need to develop an iPhone app that fetches sms data form the sender, the data are access keys, so I was wondering if tis possible to do such an application. I was reading the iPhone App programing Guide, and there is something interesting, I can register my app with some particular keys, in my case, sms into the UIRequiredDeviceCapabilities, so I can comunicate with teh iPhone app that handles the sms, and fetch the data... am I correct? Thx G. On Jul 23, 2009, at 9:11 AM, Roland King wrote: if your questions are Cocoa, Core Foundation etc related and about released software (ie not iPhone OS 3.1), ask away. you can try the apple iphone dev forums too if you like (but I dont find them anywhere as nearly useful as this list) Gustavo Pizano wrote: Hello, I wish to know if this list works also for iPhone developer, I hadn't found one related to iPhone except the govIphone, that its for goverment iPhone apps... so.. :S. If this is the correct list to write then please let me know so I can ask few questions related.. Im a mac developer but starting to dev for iPhone.. Thanks Gustavo ___ 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/rols%40rols.org This email sent to r...@rols.org ___ 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/mnemonic.fx%40gmail.com This email sent to mnemonic...@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: iPhone List? - few questions
Right, but you can register your own url schemes which will launch your app and let it handle the data. I've assumed that the SMS displaying framework will parse out such URLs, realize they are registered and put the correct hotlink into the message to launch your app. On Jul 23, 2009, at 9:55 PM, Jesse Armand wrote: The sms: URL on the iPhone only supports phone number, unless if you're willing to go deep into the private API, but you couldn't distribute your app into the App Store. My advice is, better to install some kind of sms application or gateway on your server, so your iPhone app could send the text into the server, and the server will forward the message through sms. Jesse Armand (http://jessearmand.com) On Thu, Jul 23, 2009 at 2:43 PM, Gustavo Pizanogustavxcodepic...@gmail.com wrote: Nop you didn\'t miss understood the question, I will have a look at the docs, because the idea is that once Im in my app, put the first credentials, then the server will send me an authorizaiton code, and the idea is to don't leave my app to get the data from the sms, but the app fetch the data of the incoming sms, but if you tell me that you think its not possible to get more automated than clicking the arrow in the Iphone sms app to launch mine with the data in the url then Im kinda stuck... I will take a look at the docs and see what I find out. I will let you know if something as you have been thinking about doing the same, if find a workaround. G. On Jul 23, 2009, at 9:27 AM, Roland King wrote: If you're trying to use data which has been sms'ed to your user, which is something I've thought about doing before, the only way which I thought it could be done is to register your own url for the application and then have the sms you send include the data in a URL format, eg if your app registered URL is foobar you might have foobar://yourdatahere in the SMS. I believe that you'll then have the opportunity in the SMS screen to click the arrow at the side of the screen and your app will launch with that URL as data and you can process it. I don't think you can get any more automated than that. It also relies on you sending the data in a compatible format. Not totally sure this is related to the UIRequiredDeviceCapabilities though, go hunt around the docs for url or 'phone:' and 'text:', I think those are a couple of the URLs that apple registers for stuff and the documentation is around there. If I have misunderstood what you're asking .. sorry Gustavo Pizano wrote: Aha ok.. thanks. I need to develop an iPhone app that fetches sms data form the sender, the data are access keys, so I was wondering if tis possible to do such an application. I was reading the iPhone App programing Guide, and there is something interesting, I can register my app with some particular keys, in my case, sms into the UIRequiredDeviceCapabilities, so I can comunicate with teh iPhone app that handles the sms, and fetch the data... am I correct? Thx G. On Jul 23, 2009, at 9:11 AM, Roland King wrote: if your questions are Cocoa, Core Foundation etc related and about released software (ie not iPhone OS 3.1), ask away. you can try the apple iphone dev forums too if you like (but I dont find them anywhere as nearly useful as this list) Gustavo Pizano wrote: Hello, I wish to know if this list works also for iPhone developer, I hadn't found one related to iPhone except the govIphone, that its for goverment iPhone apps... so.. :S. If this is the correct list to write then please let me know so I can ask few questions related.. Im a mac developer but starting to dev for iPhone.. Thanks Gustavo ___ 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/rols%40rols.org This email sent to r...@rols.org ___ 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/mnemonic.fx%40gmail.com This email sent to mnemonic...@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
[iPhone] Zero opacity causes UIView to go numb
Hi, I *KNOW* this must be something absolutely stupid I'm missing, but I'm stuck with this: I have an UIView that's supposed to display an explanatory overlay image whenever it's touched. When the user lifts the finger, the overlay should fade away. To accomplish this I do the following Inside my OverlayView's init method: self.layer.contents = (id)[UIImage imageNamed:@overlay.png] CGImage]; self.layer.opacity = 0.0; and then, inside the touchBegan: and touchEnded: methods I set the opacity to 1.0 and 0.0 respectively. Now, this doesn't work at all, the view doesn't receive the touchBegan: and touchEnded: methods. But everything works fine if I set the opacity to 0.1 instead of 0.0!! And for instance, when I do this: 1. set opacity to 0.1 in the init call... 2. set opacity to 1.0 in the touchBegan call... 3. set opacity to 0.0 (!!!) in the touchEnded call... all subsequent touches are ignored, touchBegan:, touchEnded:, etc. are never called again. Any help on this is very very much appreciated! Thanks, Sebastian ___ 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
NSTableView is not updated on [reloadData]
Hi, All, So, I'm continuing :) I've connected my NSTableView with AppController (in IB) setting AppController, as NSTableView's datasource. Then I've added a couple of methods to the AppController to implement NSTableDataSource protocol: - (int)numberOfRowsInTableView:(NSTableView *)tableView; - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row; Also I have a timer in my app, which should recalculate something from time to time and, as a result of this procedure, table row count (as well as values) should be updated. onTimer: method is like this one: - (void)onTimer:(NSTimer*)timer { // // here we do some actions, leading to actual changes in the table content. // [myTable reloadData]; } It all is correct for the first look. Isn't it? Now what is happening. numberOfRowsInTableView: is called only once, yet before AppController's awakeFromNib is called. At that moment nothing yet is initialized (initialization goes in awakeFromNib), so numberOfRowsInTableView: returns zero. Nothing happens when [myTable reloadData] is called within onTimer: procedure. None of delegated methods are called, so my table is always empty, though new data (of nonzero length) are created. So, my question is - how to make table view to change its row count and update the data? Thanks. ___ 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: NSTableView is not updated on [reloadData]
On Jul 23, 2009, at 11:21 AM, Alexander Bokovikov wrote: [myTable reloadData]; ... Nothing happens when [myTable reloadData] is called within onTimer: Is your myTable outlet connected to the table view? -- I.S. ___ 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: NSTableView is not updated on [reloadData]
Are you sure [myTable reloadData]; is being executed? reloadData will cause numberOfRowsInTableView to be called. On Jul 23, 2009, at 9:21 AM, Alexander Bokovikov wrote: Hi, All, So, I'm continuing :) I've connected my NSTableView with AppController (in IB) setting AppController, as NSTableView's datasource. Then I've added a couple of methods to the AppController to implement NSTableDataSource protocol: - (int)numberOfRowsInTableView:(NSTableView *)tableView; - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row; Also I have a timer in my app, which should recalculate something from time to time and, as a result of this procedure, table row count (as well as values) should be updated. onTimer: method is like this one: - (void)onTimer:(NSTimer*)timer { // // here we do some actions, leading to actual changes in the table content. // [myTable reloadData]; } It all is correct for the first look. Isn't it? Now what is happening. numberOfRowsInTableView: is called only once, yet before AppController's awakeFromNib is called. At that moment nothing yet is initialized (initialization goes in awakeFromNib), so numberOfRowsInTableView: returns zero. Nothing happens when [myTable reloadData] is called within onTimer: procedure. None of delegated methods are called, so my table is always empty, though new data (of nonzero length) are created. So, my question is - how to make table view to change its row count and update the data? Thanks. ___ 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/airedale%40tularosa.net This email sent to aired...@tularosa.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: closed - NSTableView is not updated on [reloadData]
On 23.07.2009, at 21:25, I. Savant wrote: Is your myTable outlet connected to the table view? I'm fool... :( sorry... I was pretty sure it is, but really it isn't. Also I was sure that BAD_ACCESS exception should occur if not initialized outlet is used to send a message to. Fixed it. Thanks for so quick reply! ___ 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: Recording phone calls
...most states require the consent of both parties for one party to record the conversation. Actually, most states require the consent of only a single party. A handful of states (~10?) require consent of all parties. The point of course remains, that there are some legal restrictions. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ 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: closed - NSTableView is not updated on [reloadData]
On 24/07/2009, at 1:52 AM, Alexander Bokovikov wrote: Also I was sure that BAD_ACCESS exception should occur if not initialized outlet is used to send a message to. Definitely not. Uninitialized outlets are set to nil, and messages to nil are legal - they simply swallow the messages. On t e whole this is much safer than crashing but can lead to the odd bug where nothing happens and you don't immediately know why. --Graham ___ 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: NSTableView: Out-Of-Bounds Array Error on reloadData
Hi Graham-- Thanks for the reply. Sorry about the thumbnail code. I was just trying to get all of my other crap out of the way. The problem is, the reloadData statement is throwing the error and -(id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row -(void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(int)row are never even called! This is why this problem is annoying me so much. I am assuming I am hitting a bug in 10.4 that was fixed in 10.5, but for the life of me, I cannot figure out what it may be. Recompiling in 10.5 does not give me any clues. So show us the real datasource code. The -awakeFromNib snippet tells us nothing useful. Your assumption is very unlikely to be the case, since thousands of tables have been working since the release of Leopard without a hoard of angry developers clamouring for blood... Then the other probability is that 10.5 introduced a bug, which I strongly doubt. I'll just have to stare at the code another week and see if anything comes to mind. Thanks, Kevin ~Syntonica [kraken release]; --- On Thu, 7/23/09, Graham Cox graham@bigpond.com wrote: From: Graham Cox graham@bigpond.com Subject: Re: NSTableView: Out-Of-Bounds Array Error on reloadData To: syntonica synton...@yahoo.com Cc: cocoa-dev@lists.apple.com Date: Thursday, July 23, 2009, 4:34 AM On 23/07/2009, at 4:53 PM, syntonica wrote: The entryArray is, of course, the dataSource for the tableView. No it's not, if entryArray is an NSArray or related. NSArray does not implement NSTableDataSource. Your (controller) code must implement that, maybe by using or referencing an array. If entryArray is the controller, we need to see it. (and, as an aside, it's badly named). --Graham ___ 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: closed - NSTableView is not updated on [reloadData]
Alexander Bokovikov wrote: Also I was sure that BAD_ACCESS exception should occur if not initialized outlet is used to send a message to. An uninitialized outlet is always nil. It is always legal to send messages to nil, although some returned values may be undefined. Re- read the basic docs on messaging, if necessary. It may be illegal to perform other operations with nil, so don't make the opposite mistake of thinking that just because sending a message to nil is legal, so is everything else. -- GG ___ 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: iPhone List? - few questions
@ Jesse: Yes the idea is to distribute the App through the AppStore, so I guess I can't go any deeper. The idea is that in the server there is gonna be a sms application that will send the Authorization code to the registered iPhone that is asking for it, then My app should take that access code and connect to the server, its kinda a 2 step Login system. So if there is gonna be an inpediment, then the sms app in the server will send the sms with the Auth Code, then my iPhone will receive the sms, and the sms app of the iPhone will say Hey you I have a new sms, so now that I have the code, I can just copy-paste it in the access code of my app and do the second part of the authentication. (well that is what its on my mind due that i can't get the data of the incoming sms without leaving my iPhone app ). I dunno how user friendly is to do such a authentication, as you can see we are working with very critical data that requires a strong authentication and data encryption , like a bank sort to speak. G. On Jul 23, 2009, at 4:42 PM, Roland King wrote: Right, but you can register your own url schemes which will launch your app and let it handle the data. I've assumed that the SMS displaying framework will parse out such URLs, realize they are registered and put the correct hotlink into the message to launch your app. On Jul 23, 2009, at 9:55 PM, Jesse Armand wrote: The sms: URL on the iPhone only supports phone number, unless if you're willing to go deep into the private API, but you couldn't distribute your app into the App Store. My advice is, better to install some kind of sms application or gateway on your server, so your iPhone app could send the text into the server, and the server will forward the message through sms. Jesse Armand (http://jessearmand.com) On Thu, Jul 23, 2009 at 2:43 PM, Gustavo Pizanogustavxcodepic...@gmail.com wrote: Nop you didn\'t miss understood the question, I will have a look at the docs, because the idea is that once Im in my app, put the first credentials, then the server will send me an authorizaiton code, and the idea is to don't leave my app to get the data from the sms, but the app fetch the data of the incoming sms, but if you tell me that you think its not possible to get more automated than clicking the arrow in the Iphone sms app to launch mine with the data in the url then Im kinda stuck... I will take a look at the docs and see what I find out. I will let you know if something as you have been thinking about doing the same, if find a workaround. G. On Jul 23, 2009, at 9:27 AM, Roland King wrote: If you're trying to use data which has been sms'ed to your user, which is something I've thought about doing before, the only way which I thought it could be done is to register your own url for the application and then have the sms you send include the data in a URL format, eg if your app registered URL is foobar you might have foobar://yourdatahere in the SMS. I believe that you'll then have the opportunity in the SMS screen to click the arrow at the side of the screen and your app will launch with that URL as data and you can process it. I don't think you can get any more automated than that. It also relies on you sending the data in a compatible format. Not totally sure this is related to the UIRequiredDeviceCapabilities though, go hunt around the docs for url or 'phone:' and 'text:', I think those are a couple of the URLs that apple registers for stuff and the documentation is around there. If I have misunderstood what you're asking .. sorry Gustavo Pizano wrote: Aha ok.. thanks. I need to develop an iPhone app that fetches sms data form the sender, the data are access keys, so I was wondering if tis possible to do such an application. I was reading the iPhone App programing Guide, and there is something interesting, I can register my app with some particular keys, in my case, sms into the UIRequiredDeviceCapabilities, so I can comunicate with teh iPhone app that handles the sms, and fetch the data... am I correct? Thx G. On Jul 23, 2009, at 9:11 AM, Roland King wrote: if your questions are Cocoa, Core Foundation etc related and about released software (ie not iPhone OS 3.1), ask away. you can try the apple iphone dev forums too if you like (but I dont find them anywhere as nearly useful as this list) Gustavo Pizano wrote: Hello, I wish to know if this list works also for iPhone developer, I hadn't found one related to iPhone except the govIphone, that its for goverment iPhone apps... so.. :S. If this is the correct list to write then please let me know so I can ask few questions related.. Im a mac developer but starting to dev for iPhone.. Thanks Gustavo ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post
Re: Core Animation rendering problem
On Jul 23, 2009, at 1:15 AM, David Duncan wrote: On Jul 22, 2009, at 10:05 PM, Randall Meadows wrote: Any idea why the drawing is screwing up for the 2nd animation? Are the 2 different methods of animating messing up each other somehow (even though I've removed the 1st animation)? This is working as expected (for the default case at least). By default a view (or layer) is not redraw when it is resized, but the content is scaled. You want to change the contentMode on the UIView if you want it to redraw (and understand that there is a performance penalty for doing this). That thought actually did occur to me, but I dismissed it for several reasons: 1) The event that causes the explosion is another ball being placed into the view by a click, and everything about this catalyst ball is exactly the same as all the other balls, except it never gets the initial movement animation applied to it. This catalyst ball correctly animates its diameter change animation. B) My interim fix was to remove the original ball view that was moving, create a new ball view with the same properties as the old one and insert it into the parent view, then apply the explosion animation--essentially the same thing as the catalyst ball above. Works great, no jaggies, perfect circle. Again, this object is the same type, created the same way, as all the others, it just doesn't have the initial animation applied to it. That was enough to convince me that there was something else going on, implicating the animation as being part of the problem. Regardless, I changed the contentMode of the animated balls to UIViewContentModeRedraw just to see what would happen, and now it doesn't expand at all. ___ 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: List classes in Bundle?
This is the method that works well for me. There is a bit of overhead since you are looking at all classes but it still seems to be pretty quick. Here is the quick and dirty routine as it works for me with bits cabbaged from different sources. This IS NOT meant to be a demonstration of production coding style but does work for my prototyping application. Feel free to correct my blatant errors so that anyone looking for a reasonable way to do this can find it on the list. Also note that I am looking in the main bundle for my classes because this is just a prototype. In the real world this would almost certainly be different bundle. Thanks for the pointers guys. -(void)getClasses { int i, numClasses = 0, newNumClasses = objc_getClassList(NULL, 0); Class *mClass = NULL; while (numClasses newNumClasses) { numClasses = newNumClasses; mClass = realloc(mClass, sizeof(Class) * numClasses); newNumClasses = objc_getClassList(mClass, numClasses); } for (i=0; inumClasses; i++) { @try { if ([NSBundle bundleForClass:mClass[i]]==[NSBundle mainBundle]) { [classes addObject:[mClass[i] description]]; } } @catch (id theException) { NSLog(@Exception); } } free(mClass); } On Jul 22, 2009, at 10:05 AM, glenn andreas wrote: On Jul 22, 2009, at 12:00 PM, Robert Mullen wrote: Is there a way to actually list all the classes in a given bundle? I know I can look one up if I know the name but I would like to actually be able to present a list. If the bundle is loaded, you should be able to iterate through all the classes in the system (using the various routines in the runtime), and check to see if bundleForClass returns the bundle you are looking for. If it hasn't been loaded, you can parse the macho file format and examine the objective-c sections, but that's a lot of work... Glenn Andreas gandr...@gandreas.com http://www.gandreas.com/ wicked fun! Mad, Bad, and Dangerous to Know ___ 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
NSSliderCell question
I am employing an NSSliderCell in my table view, and I want to slow down the rate of change or increase the resolution of change using a modifier key like commands as I drag. This is employed in a few audio programs to assist a mixer in fine tuning either volume or pan when mixing. Where do I start? I have bound my NSSliderCell to a NSNumber in my NSObjectController. Can anyone think of a way that I could modify the delta of change? Would I have to do this using a NSSliderCell subclass? Any thoughts? Patrick ___ 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: NSSliderCell question
Le 23 juil. 09 à 21:09, livinginlosange...@mac.com a écrit : I am employing an NSSliderCell in my table view, and I want to slow down the rate of change or increase the resolution of change using a modifier key like commands as I drag. This is employed in a few audio programs to assist a mixer in fine tuning either volume or pan when mixing. Where do I start? I have bound my NSSliderCell to a NSNumber in my NSObjectController. Can anyone think of a way that I could modify the delta of change? Would I have to do this using a NSSliderCell subclass? Any thoughts? Just an idea. (not tested at all) A possibility may be to override setDoubleValue: or whatever is used to set the cell value, and check if the current event ([NSApp currentEvent]) is a drag with ctrl down, and if this is the case compute the delta between the current value and the new value and reduce it proportionally before calling the super implementation. ___ 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: iPhone List? - few questions
I have been there before, for a mobile banking project, and they don't want to accept my suggestion to process all of the sms processing (incoming / outgoing) on the server, in order for the iPhone app to communicate with server only. That would provide better user experience, because there's no need to use the carrier-specific features in the iPhone. You can observe CitiMobile for US, see how do they do it, it's just like an internet banking, no need for SMS. In my opinion, iPhone apps shouldn't depend too much on carrier specific features. Jesse Armand (http://jessearmand.com) On Thu, Jul 23, 2009 at 11:19 PM, Gustavo Pizanogustavxcodepic...@gmail.com wrote: @ Jesse: Yes the idea is to distribute the App through the AppStore, so I guess I can't go any deeper. The idea is that in the server there is gonna be a sms application that will send the Authorization code to the registered iPhone that is asking for it, then My app should take that access code and connect to the server, its kinda a 2 step Login system. So if there is gonna be an inpediment, then the sms app in the server will send the sms with the Auth Code, then my iPhone will receive the sms, and the sms app of the iPhone will say Hey you I have a new sms, so now that I have the code, I can just copy-paste it in the access code of my app and do the second part of the authentication. (well that is what its on my mind due that i can't get the data of the incoming sms without leaving my iPhone app ). I dunno how user friendly is to do such a authentication, as you can see we are working with very critical data that requires a strong authentication and data encryption , like a bank sort to speak. G. On Jul 23, 2009, at 4:42 PM, Roland King wrote: Right, but you can register your own url schemes which will launch your app and let it handle the data. I've assumed that the SMS displaying framework will parse out such URLs, realize they are registered and put the correct hotlink into the message to launch your app. On Jul 23, 2009, at 9:55 PM, Jesse Armand wrote: The sms: URL on the iPhone only supports phone number, unless if you're willing to go deep into the private API, but you couldn't distribute your app into the App Store. My advice is, better to install some kind of sms application or gateway on your server, so your iPhone app could send the text into the server, and the server will forward the message through sms. Jesse Armand (http://jessearmand.com) On Thu, Jul 23, 2009 at 2:43 PM, Gustavo Pizanogustavxcodepic...@gmail.com wrote: Nop you didn\'t miss understood the question, I will have a look at the docs, because the idea is that once Im in my app, put the first credentials, then the server will send me an authorizaiton code, and the idea is to don't leave my app to get the data from the sms, but the app fetch the data of the incoming sms, but if you tell me that you think its not possible to get more automated than clicking the arrow in the Iphone sms app to launch mine with the data in the url then Im kinda stuck... I will take a look at the docs and see what I find out. I will let you know if something as you have been thinking about doing the same, if find a workaround. G. On Jul 23, 2009, at 9:27 AM, Roland King wrote: If you're trying to use data which has been sms'ed to your user, which is something I've thought about doing before, the only way which I thought it could be done is to register your own url for the application and then have the sms you send include the data in a URL format, eg if your app registered URL is foobar you might have foobar://yourdatahere in the SMS. I believe that you'll then have the opportunity in the SMS screen to click the arrow at the side of the screen and your app will launch with that URL as data and you can process it. I don't think you can get any more automated than that. It also relies on you sending the data in a compatible format. Not totally sure this is related to the UIRequiredDeviceCapabilities though, go hunt around the docs for url or 'phone:' and 'text:', I think those are a couple of the URLs that apple registers for stuff and the documentation is around there. If I have misunderstood what you're asking .. sorry Gustavo Pizano wrote: Aha ok.. thanks. I need to develop an iPhone app that fetches sms data form the sender, the data are access keys, so I was wondering if tis possible to do such an application. I was reading the iPhone App programing Guide, and there is something interesting, I can register my app with some particular keys, in my case, sms into the UIRequiredDeviceCapabilities, so I can comunicate with teh iPhone app that handles the sms, and fetch the data... am I correct? Thx G. On Jul 23, 2009, at 9:11 AM, Roland King wrote: if your questions are Cocoa,
Re: NSSliderCell question
Hi, I am using the following two methods for a scrolling number box which is essentially a slider in the form of a NSTextField subclass. I have yet to implement this for my custom sliders but maybe this is a good starting point for you? When I first dabbled with custom sliders all I did was override the mouseUp, mouseDown, mouseDragged methods etc now my custom sliders are subclasses of NSControl rather than NSSlider. -(void)mouseUp:(NSEvent*)theEvent { if(drag) drag = NO; } -(void)mouseDragged:(NSEvent*)theEvent { float val = [self floatValue]; if(!drag) { // float start_x = [self convertPoint: [theEvent locationInWindow] fromView: nil].x; start_y = [self convertPoint:[theEvent locationInWindow] fromView: nil].y; prev_y = start_y; drag = YES; }; // key modifier key flags unsigned int flags; flags = [theEvent modifierFlags]; float next_y = [self convertPoint:[theEvent locationInWindow] fromView: nil].y; float deltaY = (next_y - prev_y) / dragSize; prev_y = next_y; if(flags NSAlternateKeyMask) deltaY *= fineGrain; val += range * deltaY; [self checkBounds:val]; [self setFloatValue:val]; // continuously send the action [self sendAction:(SEL)[self action] to:(id)[self target]]; } Hope that helps, Stephen On 23 Jul 2009, at 13:29, Jean-Daniel Dupas wrote: Le 23 juil. 09 à 21:09, livinginlosange...@mac.com a écrit : I am employing an NSSliderCell in my table view, and I want to slow down the rate of change or increase the resolution of change using a modifier key like commands as I drag. This is employed in a few audio programs to assist a mixer in fine tuning either volume or pan when mixing. Where do I start? I have bound my NSSliderCell to a NSNumber in my NSObjectController. Can anyone think of a way that I could modify the delta of change? Would I have to do this using a NSSliderCell subclass? Any thoughts? Just an idea. (not tested at all) A possibility may be to override setDoubleValue: or whatever is used to set the cell value, and check if the current event ([NSApp currentEvent]) is a drag with ctrl down, and if this is the case compute the delta between the current value and the new value and reduce it proportionally before calling the super implementation. ___ 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/stephen.blinkhorn%40audiospillage.com This email sent to stephen.blinkh...@audiospillage.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
Comparing NSImages
We're having problems where the same code is producing corrupt output on certain OS versions but not others. We're trying to track this down, but are running into issues trying to verify intermediate results in the process, in particular NSImage data. Question 1: Is it normal for [NSImage TIFFRepresentation] to differ from release to release on identical images? There are pieces of very basic code [1] that are producing NSImages with different TIFFRepresentations on the same input on the different OSes, so I'm not convinced that's a reliable way to tell whether it's producing the expected output. Question 2: Assuming TIFFRepresentation isn't unique, what's the best practice to verify programmatically, say in a unit test, that the output matches an expected output? Thanks, Benjamin Rister [1] Very basic code: // input is NSImage* img, identical on both OSes (TIFFRepresentation exactly identical) int height = [img size].height; int width = [img size].width; NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:width pixelsHigh:height bitsPerSample:8 samplesPerPixel:3 hasAlpha:NO isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:width * 3 bitsPerPixel:24]; NSImage *newImage = [[NSImage alloc] init]; [newImage addRepresentation:imageRep]; [imageRep release]; [newImage lockFocus]; NSRect imgRect = NSMakeRect(0,0,width,height); [img drawInRect:imgRect fromRect:imgRect operation:NSCompositeSourceOver fraction:1.0f]; [newImage unlockFocus]; // output [newImage TIFFRepresentation] is different on the different OSes ___ 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: NSSliderCell question
Oh, where: range = max_slider_value - min_slider_value; fineGrain = 0.125; Stephen On 23 Jul 2009, at 14:55, Stephen Blinkhorn wrote: Hi, I am using the following two methods for a scrolling number box which is essentially a slider in the form of a NSTextField subclass. I have yet to implement this for my custom sliders but maybe this is a good starting point for you? When I first dabbled with custom sliders all I did was override the mouseUp, mouseDown, mouseDragged methods etc now my custom sliders are subclasses of NSControl rather than NSSlider. -(void)mouseUp:(NSEvent*)theEvent { if(drag) drag = NO; } -(void)mouseDragged:(NSEvent*)theEvent { float val = [self floatValue]; if(!drag) { // float start_x = [self convertPoint: [theEvent locationInWindow] fromView: nil].x; start_y = [self convertPoint:[theEvent locationInWindow] fromView: nil].y; prev_y = start_y; drag = YES; }; // key modifier key flags unsigned int flags; flags = [theEvent modifierFlags]; float next_y = [self convertPoint:[theEvent locationInWindow] fromView: nil].y; float deltaY = (next_y - prev_y) / dragSize; prev_y = next_y; if(flags NSAlternateKeyMask) deltaY *= fineGrain; val += range * deltaY; [self checkBounds:val]; [self setFloatValue:val]; // continuously send the action [self sendAction:(SEL)[self action] to:(id)[self target]]; } Hope that helps, Stephen On 23 Jul 2009, at 13:29, Jean-Daniel Dupas wrote: Le 23 juil. 09 à 21:09, livinginlosange...@mac.com a écrit : I am employing an NSSliderCell in my table view, and I want to slow down the rate of change or increase the resolution of change using a modifier key like commands as I drag. This is employed in a few audio programs to assist a mixer in fine tuning either volume or pan when mixing. Where do I start? I have bound my NSSliderCell to a NSNumber in my NSObjectController. Can anyone think of a way that I could modify the delta of change? Would I have to do this using a NSSliderCell subclass? Any thoughts? Just an idea. (not tested at all) A possibility may be to override setDoubleValue: or whatever is used to set the cell value, and check if the current event ([NSApp currentEvent]) is a drag with ctrl down, and if this is the case compute the delta between the current value and the new value and reduce it proportionally before calling the super implementation. ___ 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/stephen.blinkhorn%40audiospillage.com This email sent to stephen.blinkh...@audiospillage.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/stephen.blinkhorn%40audiospillage.com This email sent to stephen.blinkh...@audiospillage.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
Model index and Array Controller index
I have a simple situation that I can't decide on a good solution to. I have a model object that has an index property. These objects are displayed in a simple table view which should be ordered by index. This is easily done by adding a sort descriptor to the array controller that feeds the tableview. The array controller also implements drag n' drop reordering as per mmalc's Bookmarks example. The problem I'm having is that I can't find a decent way of propagating index changes in the array controller back down to the model. Does anyone have a good method of doing this? Thanks, -Ben -- Ben Lachman Acacia Tree Software http://acaciatreesoftware.com email: blach...@mac.com twitter: @benlachman mobile: 740.590.0009 ___ 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: Comparing NSImages
Well, before you worry about release differences, you should probably worry about the NSDeviceRGBColorSpace - if you want consistency between different platforms, I'd think you should be using sRGB, Adobe RGB or similar. Sandy On Jul 23, 2009, at 11:00 PM, Benjamin Rister wrote: We're having problems where the same code is producing corrupt output on certain OS versions but not others. We're trying to track this down, but are running into issues trying to verify intermediate results in the process, in particular NSImage data. Question 1: Is it normal for [NSImage TIFFRepresentation] to differ from release to release on identical images? There are pieces of very basic code [1] that are producing NSImages with different TIFFRepresentations on the same input on the different OSes, so I'm not convinced that's a reliable way to tell whether it's producing the expected output. Question 2: Assuming TIFFRepresentation isn't unique, what's the best practice to verify programmatically, say in a unit test, that the output matches an expected output? Thanks, Benjamin Rister [1] Very basic code: // input is NSImage* img, identical on both OSes (TIFFRepresentation exactly identical) int height = [img size].height; int width = [img size].width; NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:width pixelsHigh:height bitsPerSample:8 samplesPerPixel:3 hasAlpha:NO isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:width * 3 bitsPerPixel:24]; NSImage *newImage = [[NSImage alloc] init]; [newImage addRepresentation:imageRep]; [imageRep release]; [newImage lockFocus]; NSRect imgRect = NSMakeRect(0,0,width,height); [img drawInRect:imgRect fromRect:imgRect operation:NSCompositeSourceOver fraction:1.0f]; [newImage unlockFocus]; // output [newImage TIFFRepresentation] is different on the different OSes ___ 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/mcguffogl%40gmail.com This email sent to mcguff...@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: Comparing NSImages
On Jul 23, 2009, at 3:00 PM, Benjamin Rister wrote: Question 1: Is it normal for [NSImage TIFFRepresentation] to differ from release to release on identical images? Considering that there are several different variations on the TIFF file format (e.g. big-endian vs. little-endian, 0 is black vs. 1 is black, and then there's metadata), this would not surprise me. 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: iPhone List? - few questions
You should look into the push notification API, it ends up being very similar to SMS (e.g. small payloads) and is directly developer accessible. -Ben -- Ben Lachman Acacia Tree Software http://acaciatreesoftware.com email: blach...@mac.com twitter: @benlachman mobile: 740.590.0009 On Jul 23, 2009, at 12:19 PM, Gustavo Pizano wrote: @ Jesse: Yes the idea is to distribute the App through the AppStore, so I guess I can't go any deeper. The idea is that in the server there is gonna be a sms application that will send the Authorization code to the registered iPhone that is asking for it, then My app should take that access code and connect to the server, its kinda a 2 step Login system. So if there is gonna be an inpediment, then the sms app in the server will send the sms with the Auth Code, then my iPhone will receive the sms, and the sms app of the iPhone will say Hey you I have a new sms, so now that I have the code, I can just copy-paste it in the access code of my app and do the second part of the authentication. (well that is what its on my mind due that i can't get the data of the incoming sms without leaving my iPhone app ). I dunno how user friendly is to do such a authentication, as you can see we are working with very critical data that requires a strong authentication and data encryption , like a bank sort to speak. G. On Jul 23, 2009, at 4:42 PM, Roland King wrote: Right, but you can register your own url schemes which will launch your app and let it handle the data. I've assumed that the SMS displaying framework will parse out such URLs, realize they are registered and put the correct hotlink into the message to launch your app. On Jul 23, 2009, at 9:55 PM, Jesse Armand wrote: The sms: URL on the iPhone only supports phone number, unless if you're willing to go deep into the private API, but you couldn't distribute your app into the App Store. My advice is, better to install some kind of sms application or gateway on your server, so your iPhone app could send the text into the server, and the server will forward the message through sms. Jesse Armand (http://jessearmand.com) On Thu, Jul 23, 2009 at 2:43 PM, Gustavo Pizanogustavxcodepic...@gmail.com wrote: Nop you didn\'t miss understood the question, I will have a look at the docs, because the idea is that once Im in my app, put the first credentials, then the server will send me an authorizaiton code, and the idea is to don't leave my app to get the data from the sms, but the app fetch the data of the incoming sms, but if you tell me that you think its not possible to get more automated than clicking the arrow in the Iphone sms app to launch mine with the data in the url then Im kinda stuck... I will take a look at the docs and see what I find out. I will let you know if something as you have been thinking about doing the same, if find a workaround. G. On Jul 23, 2009, at 9:27 AM, Roland King wrote: If you're trying to use data which has been sms'ed to your user, which is something I've thought about doing before, the only way which I thought it could be done is to register your own url for the application and then have the sms you send include the data in a URL format, eg if your app registered URL is foobar you might have foobar://yourdatahere in the SMS. I believe that you'll then have the opportunity in the SMS screen to click the arrow at the side of the screen and your app will launch with that URL as data and you can process it. I don't think you can get any more automated than that. It also relies on you sending the data in a compatible format. Not totally sure this is related to the UIRequiredDeviceCapabilities though, go hunt around the docs for url or 'phone:' and 'text:', I think those are a couple of the URLs that apple registers for stuff and the documentation is around there. If I have misunderstood what you're asking .. sorry Gustavo Pizano wrote: Aha ok.. thanks. I need to develop an iPhone app that fetches sms data form the sender, the data are access keys, so I was wondering if tis possible to do such an application. I was reading the iPhone App programing Guide, and there is something interesting, I can register my app with some particular keys, in my case, sms into the UIRequiredDeviceCapabilities, so I can comunicate with teh iPhone app that handles the sms, and fetch the data... am I correct? Thx G. On Jul 23, 2009, at 9:11 AM, Roland King wrote: if your questions are Cocoa, Core Foundation etc related and about released software (ie not iPhone OS 3.1), ask away. you can try the apple iphone dev forums too if you like (but I dont find them anywhere as nearly useful as this list) Gustavo Pizano wrote: Hello, I wish to know if this list works also for iPhone developer, I hadn't found one related to iPhone except the
Re: NSSliderCell question
Thanks for your ideas Here is what I did: Here is what I did. I set up KVO for the variable that I attached to my NSSliderCell. When I made any changes to the underlying variable, the obersever method would trigger. When you add an observer you can retrieve the old and new values from the change dictionary and derive your new value. I temporary suppressed kvo so the routine didn't infinitely recurse when I set the value using kvo compliant setters (look at _ignoreObservation). I also updated the slider using the setFloatValue method. This constrained the slider as well. Now when I press the command key, I query the current event using your idea for getting the current event, [NSApp currentEvent], in my oberve value method. This works sufficiently for my purposes. Patrick - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id) object change:(NSDictionary *)change context:(void *)context { if([keyPath isEqualToString:@val]){ if (_ignoreObservation != YES) { if(([[NSApp currentEvent] modifierFlags] NSCommandKeyMask) == NSCommandKeyMask){ float _old = [[change valueForKey:@old] floatValue]; float _new = [[change valueForKey:@new]floatValue]; _ignoreObservation = YES; if(_new _old){ float newT = _old + ((_new - _old)/100); [self setVal:[NSNumber numberWithFloat:newT]]; [mySlider setFloatValue:newT]; } else { float newT = _old + ((_new - _old)/100); [self setVal:[NSNumber numberWithFloat:newT]]; [mySlider setFloatValue:newT]; } } } _ignoreObservation = NO; } } On Jul 23, 2009, at 12:29 PM, Jean-Daniel Dupas wrote: Le 23 juil. 09 à 21:09, livinginlosange...@mac.com a écrit : I am employing an NSSliderCell in my table view, and I want to slow down the rate of change or increase the resolution of change using a modifier key like commands as I drag. This is employed in a few audio programs to assist a mixer in fine tuning either volume or pan when mixing. Where do I start? I have bound my NSSliderCell to a NSNumber in my NSObjectController. Can anyone think of a way that I could modify the delta of change? Would I have to do this using a NSSliderCell subclass? Any thoughts? Just an idea. (not tested at all) A possibility may be to override setDoubleValue: or whatever is used to set the cell value, and check if the current event ([NSApp currentEvent]) is a drag with ctrl down, and if this is the case compute the delta between the current value and the new value and reduce it proportionally before calling the super implementation. ___ 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: Comparing NSImages
Benjamin Rister wrote: Question 2: Assuming TIFFRepresentation isn't unique, what's the best practice to verify programmatically, say in a unit test, that the output matches an expected output? Subtract the test's output image from the reference image, pixel by pixel, and look for any non-zero differences. This assumes compatible representations and no differences introduced by any other image-handling steps (e.g. device-RGB is device-dependent, so can't be assumed to be unvarying). Even so, you might encounter small non-zero differences that originate from outside your code-under-test. If these are larger than +/-1 they could be significant; +/-1 I'd probably accept as within the margin-of-error for rounding. -- GG ___ 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
Challenge: Block Main Thread while Work is done, with Timeout
I'd often like to block the main thread while another thread or process performs a little task, but subject to a short timeout. A few weeks ago, I was able to achieve this by running the main thread's run loop while an NSTask completed. But I did this after hours of experimenting and still don't understand how it works. Today, when I tried to generalize the code, waiting for a little worker thread instead of an NSTask, my run loop just gets stuck. I know the trouble is that, although I have read the NSRunLoop documentation and related material in the Threading Programming Guide many times, I just don't understand the magic behind this: while ([[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]) { // do something } I know that it only runs when an input source fires, and so I believe I need to add an input source, but when I try to do that I end up creating ports and distributed objects, which is obviously wrong. Below is a little demo project. If you look at the end, in main(), you'll see that, in Test #1, I start a job with a duration of 1.0 seconds and a timeout of 2.0 seconds. Expected result: The job should complete and program should continue. Actual result: Run loop never fires, so the program gets stuck. (In Test #2, I would start a similar job which ^should^ time out.) Can anyone show how to fix this? Sincerely, Jerry Krinock #import Cocoa/Cocoa.h NSString* const SSYThreadBlockerIsDoneNotification = @SSYThreadBlockerIsDoneNotification ; @interface SSYThreadBlocker : NSObject { // To do: @synchronize access to these? BOOL isDone ; BOOL didTimeout ; } @property BOOL isDone ; @property BOOL didTimeout ; @end @implementation SSYThreadBlocker @synthesize isDone ; @synthesize didTimeout ; - (void)timeout:(NSTimer*)timeoutTimer { NSLog(@380 %s, __PRETTY_FUNCTION__) ; if (![self isDone]) { [self setDidTimeout:YES] ; } [self setIsDone:YES] ; } - (void)workerDone:(NSNotification*)note { NSLog(@533 %s, __PRETTY_FUNCTION__) ; [self setIsDone:YES] ; } /*! @briefStarts a job on another thread and blocks the current thread until the job notifies that it is complete, subject to a timeout @details When the job is complete, the worker must post an SSYThreadBlockerIsDoneNotification notification from the default notification center, with the notification object set to itself. @paramworker The target which will perform the job. @paramselector The selector which defines the job. If no garbage collection, this selector must create and destroy an autorelease pool. @paramobject A parameter which will be passed to selector @paramworkerThread The thread on which the job will be performed. If you pass nil, a temporary thread will be created. @paramtimeout The time before the job is aborted. @result YES if the job completed, NO if it timed out. */ + (BOOL)blockUntilWorker:(id)worker selector:(SEL)selector object:(id)object thread:(NSThread*)workerThread timeout:(NSTimeInterval)timeout { SSYThreadBlocker* instance = [[SSYThreadBlocker alloc] init] ; NSTimer* timeoutTimer = [NSTimer scheduledTimerWithTimeInterval:timeout target:instance selector:@selector(timeout:) userInfo:nil repeats:NO] ; [[NSNotificationCenter defaultCenter] addObserver:instance selector:@selector(workerDone:) name:SSYThreadBlockerIsDoneNotification object:worker] ; // Begin Work if (workerThread) { [worker performSelector:selector onThread:workerThread withObject:object waitUntilDone:NO] ; } else { // Default if no workerThread given is to create one workerThread = [[[NSThread alloc] initWithTarget:worker selector:selector object:object] autorelease] ; // Name the thread, to help in debugging. [workerThread setName:@Worker created by SSYThreadBlocker] ; [workerThread start] ; } // Re-run the current run loop. (Magic) NSLog(@1415 Will 'run' the Run loop) ; while ([[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]) { NSLog(@2813: Run loop did fire) ; if ([instance isDone]) { break ; } }
Re: Model index and Array Controller index
On Jul 23, 2009, at 5:05 PM, Ben Lachman wrote: The problem I'm having is that I can't find a decent way of propagating index changes in the array controller back down to the model. Does anyone have a good method of doing this? I usually get the array controller's -arrangedObjects as a mutable copy, move the objects in that array, then call a category method I wrote called -reeumerateObjectsByKey: which does as the name suggests. You then ask the array controller to -rearrangeObjects. Essentially, you're reordering the objects in a working array, then just rolling through each object setting the new [NSNumber numberWithUnsignedInteger:++index] for the passed in key. There's probably a better way to do it, but it only took me a few minutes to dream it up and implement it as above and it works perfectly for me and is quite readable / maintainable. -- I.S. ___ 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: Recording phone calls
It's also a gross violation of customer security. Sent from my iPhone On Jul 22, 2009, at 8:55 PM, Chunk 1978 chunk1...@gmail.com wrote: iPhone apps are sandboxed, and are not able to run while a call comes in. On Wed, Jul 22, 2009 at 5:23 PM, Alfonso Urdanetaalfo...@red82.com wrote: Mahaboob wrote: If I developed this application, will apple store approve this? Given the laws governing the recording of telephone conversations, probably not. -- alfonso e. urdaneta red82.com - are you ready? ___ 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/ chunk1978%40gmail.com This email sent to chunk1...@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/ricklangschultz%40me.com This email sent to ricklangschu...@me.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: Recording phone calls
iPhone apps are sandboxed, and are not able to run while a call comes in. On Wed, Jul 22, 2009 at 5:23 PM, Alfonso Urdanetaalfo...@red82.com wrote: Mahaboob wrote: If I developed this application, will apple store approve this? Given the laws governing the recording of telephone conversations, probably not. -- alfonso e. urdaneta red82.com - are you ready? ___ 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/chunk1978%40gmail.com This email sent to chunk1...@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: SpeechSynthesis
On Thu, Jul 23, 2009 at 3:00 PM, Brian Heibert heib...@me.com wrote: How can I get my program to speak something like a string of text? I am writing this program in a BASIC language why is it relevant here because I am using _PASSTHROUGH code that is Objective C I can handle putting the code in the passthrough but what I don't know is the Objective C code for speaking text I am not using Interface Builder Here is a example of how to get the data from the basic program #if def _PASSTHROUGHFUNCTION // put objective C code here long functionname { // put objective C code here } #endif //Here is the toolbox call to call the function toolbox fn functioname window 1 print fn functionname do handleevents until (gFBQuit) // All I really want to do is use the speech synthesizer from C to speak some text /// so I need the C command to speak some text Brian Please check the API documentation for NSSpeechSynthesizer. Good luck, -Conrad ___ 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/conradwt%40gmail.com This email sent to conra...@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
Using the Document Architecture and Reading files one buffer at a time
I'm trying to use the document architecture in an application that will create documents for some very big files. I'd like not to have an entire file in memory at once. To use the document architecture, I'm subclassing NSDocument and overriding the readFromFileWrapper method. As far as I can tell, there is no way to use a FileWrapper object to read a file one buffer at a time. Can I find out a filename, or a filehandle from a FileWrapper? Alternatively, is there any way to have an NSDocument using the document architecture which reads its files one buffer at a time? ___ 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: Recording phone calls
On Thu, Jul 23, 2009 at 8:53 AM, Scott Ribe scott_r...@killerbytes.comwrote: ...most states require the consent of both parties for one party to record the conversation. Actually, most states require the consent of only a single party. A handful of states (~10?) require consent of all parties. The point of course remains, that there are some legal restrictions. The single party rules is as follows: if Person A wants to record the conversation with Person B, then Person B must be made aware that Person A is recording the conversation. -Conrad -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ 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/conradwt%40gmail.com This email sent to conra...@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: Confusion about Lablel Font Size: 13 or 10 ?
On Jul 22, 2009, at 12:46 PM, Thomas Wetmore wrote: For the layout manager I must calculate the lengths of all the labels to be used on a given form so I can lay them all out together using Apple UI guidelines. To find the sizes of the label text I create an NSAttributedString for each one with the correct font and font size and then ask for the length of this attributed string. You mean you ask for its [attributedString size].width? My question is. Why are labels rendered at 13 font when the NSFont method labelFontSize returns a value of 10? What deep dark secrets do I still have to learn? Here's something interesting about your query: 1 - Quit and relaunch IB. 2 - Create a new app document 3 - Drag a multi-line label into the window. 4 - Note the size. 5 - Drag a Label into the window. 6 - Note the size. Now: 1 - Quit and relaunch IB. 2 - Create a new app document 3 - Drag a Label into the window. 4 - Note the size. 5 - Drag a multi-line label into the window. 6 - Note the size. ... I think IB is doing it wrong. :-) File a bug. If I recall correctly, in earlier IB versions, there used to be a regular text field using + systemFontSizeForControlSize: with NSRegularControlSize and a smaller label using the +labelFontSize, but I might just be making that up. I thought I noted when Leopard was in beta that this seems to have changed. Never thought twice about it until now. -- I.S. ___ 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: Framework Image Error
On 2009 Jul 22, at 10:49, Stephen Smith wrote: The frameworks used in the program are all within a build phase titled Link Binary With Libraries and are also within a Frameworks folder as a part of the project. But does it get built into the product? Right-click the product in Finder, select Show Package Contents, then see if Contents/ Frameworks/AVCVideoServices.framework is in there. If not, then in your project's app Target, you need to add a Copy Files Build Phase. In its General tab, set Destination to Frameworks. Then add the built framework into this new Build Phase. Recommended: Name this Build Phase something like Copy Frameworks. Also recommended: If you have the source code for the framework and you build it, add it as a dependency to your project. http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/CreatingFrameworks.html#/ /apple_ref/doc/uid/20002258-106880-BAJJBIEF ___ 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: Recording phone calls
I think we can safely summarize in two points: 1 - It's a matter of opinion in some areas, a matter of law in others. 2 - This discussion has veered *way* off-topic for cocoa-dev. -- I.S. On Jul 23, 2009, at 7:29 PM, Rick Langschultz wrote: It's also a gross violation of customer security. Sent from my iPhone On Jul 22, 2009, at 8:55 PM, Chunk 1978 chunk1...@gmail.com wrote: iPhone apps are sandboxed, and are not able to run while a call comes in. On Wed, Jul 22, 2009 at 5:23 PM, Alfonso Urdanetaalfo...@red82.com wrote: Mahaboob wrote: If I developed this application, will apple store approve this? Given the laws governing the recording of telephone conversations, probably not. -- alfonso e. urdaneta red82.com - are you ready? ___ 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/chunk1978%40gmail.com This email sent to chunk1...@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/ricklangschultz%40me.com This email sent to ricklangschu...@me.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/idiotsavant2005%40gmail.com This email sent to idiotsavant2...@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
SpeechSynthesis
How can I get my program to speak something like a string of text? I am writing this program in a BASIC language why is it relevant here because I am using _PASSTHROUGH code that is Objective C I can handle putting the code in the passthrough but what I don't know is the Objective C code for speaking text I am not using Interface Builder Here is a example of how to get the data from the basic program #if def _PASSTHROUGHFUNCTION // put objective C code here long functionname { // put objective C code here } #endif //Here is the toolbox call to call the function toolbox fn functioname window 1 print fn functionname do handleevents until (gFBQuit) // All I really want to do is use the speech synthesizer from C to speak some text /// so I need the C command to speak some text Brian ___ 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: iPhone List? - few questions
Well you can't register to listen to SMSes, that hook just doesn't exist. So if you rely on proving who someone is by sending something to a specific phone (ie making use of the telephone companys vast network ability to locate one device with that particular SIM card in it at that point in time anywhere in the world), SMS is kind of about the only way to do it. I took a look to see what happens when you're running an app and an SMS comes in, with a URL on it . it's not totally pretty, you get to option to 'reply', which closes your app, or 'close' which closes the SMS. So the best you could do like that is hit reply, close your app, hit the link in the SMS which opens it up again, you'd need a quick-start app for that. The only other way is to have done the SMS thing way in advance and cached a token on the phone you use at the time direct to the server, but that's not very good security, the token would go with the phone, swap SIM cards and someone else is now you. Gustavo Pizano wrote: @ Jesse: Yes the idea is to distribute the App through the AppStore, so I guess I can't go any deeper. The idea is that in the server there is gonna be a sms application that will send the Authorization code to the registered iPhone that is asking for it, then My app should take that access code and connect to the server, its kinda a 2 step Login system. So if there is gonna be an inpediment, then the sms app in the server will send the sms with the Auth Code, then my iPhone will receive the sms, and the sms app of the iPhone will say Hey you I have a new sms, so now that I have the code, I can just copy-paste it in the access code of my app and do the second part of the authentication. (well that is what its on my mind due that i can't get the data of the incoming sms without leaving my iPhone app ). I dunno how user friendly is to do such a authentication, as you can see we are working with very critical data that requires a strong authentication and data encryption , like a bank sort to speak. G. On Jul 23, 2009, at 4:42 PM, Roland King wrote: Right, but you can register your own url schemes which will launch your app and let it handle the data. I've assumed that the SMS displaying framework will parse out such URLs, realize they are registered and put the correct hotlink into the message to launch your app. On Jul 23, 2009, at 9:55 PM, Jesse Armand wrote: The sms: URL on the iPhone only supports phone number, unless if you're willing to go deep into the private API, but you couldn't distribute your app into the App Store. My advice is, better to install some kind of sms application or gateway on your server, so your iPhone app could send the text into the server, and the server will forward the message through sms. Jesse Armand (http://jessearmand.com) On Thu, Jul 23, 2009 at 2:43 PM, Gustavo Pizanogustavxcodepic...@gmail.com wrote: Nop you didn\'t miss understood the question, I will have a look at the docs, because the idea is that once Im in my app, put the first credentials, then the server will send me an authorizaiton code, and the idea is to don't leave my app to get the data from the sms, but the app fetch the data of the incoming sms, but if you tell me that you think its not possible to get more automated than clicking the arrow in the Iphone sms app to launch mine with the data in the url then Im kinda stuck... I will take a look at the docs and see what I find out. I will let you know if something as you have been thinking about doing the same, if find a workaround. G. On Jul 23, 2009, at 9:27 AM, Roland King wrote: If you're trying to use data which has been sms'ed to your user, which is something I've thought about doing before, the only way which I thought it could be done is to register your own url for the application and then have the sms you send include the data in a URL format, eg if your app registered URL is foobar you might have foobar://yourdatahere in the SMS. I believe that you'll then have the opportunity in the SMS screen to click the arrow at the side of the screen and your app will launch with that URL as data and you can process it. I don't think you can get any more automated than that. It also relies on you sending the data in a compatible format. Not totally sure this is related to the UIRequiredDeviceCapabilities though, go hunt around the docs for url or 'phone:' and 'text:', I think those are a couple of the URLs that apple registers for stuff and the documentation is around there. If I have misunderstood what you're asking .. sorry Gustavo Pizano wrote: Aha ok.. thanks. I need to develop an iPhone app that fetches sms data form the sender, the data are access keys, so I was wondering if tis possible to do such an application. I was reading the iPhone App programing Guide, and there is something
Text is flipped vertically
Hi: I am rotating the text but sometime I would like to reset CGContextRef? I was unable to find where I have flipped the CGContextRef and for some strange reason my text is flipped vertically. Any idea how to reset CGContextRef? Agha ___ 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
Confusion about Lablel Font Size: 13 or 10 ?
I am writing a genealogy program that provides a variety of forms for entering data from many sources, eg, censuses, marriage registers. Instead of custom designing user input panels for each type of record, I am using a specification file that describes the fields and tool tips needed for each form and then use a custom layout manager to layout a specific user interface panel/dialog for each form on the the fly. In writing this I have discovered that the font used in labels is LucidaGrande with a font size of 13. The value of labels is generally just an NSString which Aqua lays out in LucidaGrande/13. For the layout manager I must calculate the lengths of all the labels to be used on a given form so I can lay them all out together using Apple UI guidelines. To find the sizes of the label text I create an NSAttributedString for each one with the correct font and font size and then ask for the length of this attributed string. This all works and seems to be fine, but I have found something that bothers me a little bit. As mentioned I have discovered that the font size in labels (when created directly from Interface Builder) is 13. However, when using the NSFont method +(CGFloat)labelFontSize the value returned is 10. Before I discovered that the font size used in labels was 13 I was using the labelFontSize when setting up the attributed strings, so things didn't work. My question is. Why are labels rendered at 13 font when the NSFont method labelFontSize returns a value of 10? What deep dark secrets do I still have to learn? Tom Wetmore ___ 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
Framework Image Error
Hello, I was attempting to compile some code when I got the following error: [Session started at 2009-07-22 10:29:18 -0400.] *dyld: Library not loaded: @executable_path/../Frameworks/AVCVideoServices.framework/Versions/A/AVCVideoServices * * Referenced from: /Users/steven/Desktop/Roboplasm/build/Debug/Roboplasm.app/Contents/MacOS/Roboplasm * * Reason: image not found* The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has exited due to signal 5 (SIGTRAP). The frameworks used in the program are all within a build phase titled Link Binary With Libraries and are also within a Frameworks folder as a part of the project. If I am missing something about this AVCVideoServices, i.e. an update or a file location preference, any clues would help. Thank you in advance, Stephen ___ 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
Obj-C and MySQL bindings
Hello. I'm looking for some people to work with on a Open Source MySQL connector for Obj-C since the one I found doesn't seem to be work in progress anymore and is missing a lot of features introduced in Obj-C 2.0 like garbage collection and fast enumeration. (http://code.google.com/p/mysql-cocoa-framework/ ) I've set up a google code project and started to commit some test code that I think will present the overall plan for the connector. If anyone would be interested in helping out or just have some feedback, criticism or anything else that could be of use for a successful project, please contact me. You may find the project at the following URL: http://code.google.com/p/mysql-for-obj-c/ and my initial idea and approach here: http://grenangen.se/Content/Full/553f975a-730d-4a6d-80e0-d71842c8f937 Oh, and I'm fairly new to the OS X developer community, so please, be gentle if this request on this particular list might not be OK :O) Regards /Marcus ___ 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
[solved] Outline view bound to an NSTreeController's content shows all children at the top level
FTA: Adding parent == nil to the fetch predicate in IB solves this problem. Replace parent with your relationship name. -Daniel On Jul 23, 2009, at 3:32 AM, Daniel DeCovnick wrote: Hi all, Subject is pretty self-explanatory. The problem: I don't want that behavior. A little longer explanation: The data is a CoreData entity with a self-referencing children-parent many-to-one relationship, which can go arbitrarily deep. The problem is, when call addChild: or insertChild: instead of only appearing one level down, the new instance appears at the top level as well. Likewise, if I make a child from a node on THAT level, the child appears 3 times, once where it's supposed to be, once in the top level, and once one level below its parent's instance at the top level. I get the feeling there's a simple fix for this, but I can't figure out what it is. If it's relevant, I'm not calling add/insertChild: (is there a difference, BTW?) in code, but rather hooking up a button to the treecontroller directly in IB. Thanks, Dan Daniel DeCovnick danhd123 at mac dot 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/danhd123%40mac.com This email sent to danhd...@mac.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: Screen Saver test button click notification
I think because its not actually the ScreenSaverEngine that runs, because its the ScreenSaverEngine app that sends these notifications. So instead of hitting the test button try setting a hot corner and use that... /MK On 2009-07-23, at 12:57, Santosh Sinha wrote: Hello List, I have developing a calibration tool , but there is a little issue, When i have done the calibration and go into the system preferences and click screen saver test button , after that calibration is gone, i have try these screen saver notification , com.apple.screensaver.didstart com.apple.screensaver.willstop com.apple.screensaver.didstop but my issue is not fixed, so please give me any detail for screen saver test button click notification. Thanks santosh ___ 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/cocoadev.mk%40xybernic.com This email sent to cocoadev...@xybernic.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
Using the Document Architecture and Reading files one buffer at a time
I'm trying to use the document architecture in an application that will create documents for some very big files. I'd like not to have an entire file in memory at once. To use the document architecture, I'm subclassing NSDocument and overriding the readFromFileWrapper method. As far as I can tell, there is no way to use a FileWrapper object to read a file one buffer at a time. Can I find out a filename, or a filehandle from a FileWrapper? Alternatively, is there any way to have an NSDocument using the document architecture which reads its files one buffer at a time? ___ 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: [iPhone] Zero opacity causes UIView to go numb
Completely transparent views (opacity 0.0) don't receive touch events - you're not missing anything there. As you have found, a little opacity is enough to catch them again. Depending on what's in your view, you might be able to set the background color to [UIColor clearColor] to get the same effect. Or, maybe you can replace the view you're hiding with another (empty) one that has a transparent background color. I'm not sure what will work for you without knowing more, but there are ways to accomplish what you're trying to do. Good luck, Hank On Jul 23, 2009, at 10:49 AM, Sebastian Morsch wrote: Hi, I *KNOW* this must be something absolutely stupid I'm missing, but I'm stuck with this: I have an UIView that's supposed to display an explanatory overlay image whenever it's touched. When the user lifts the finger, the overlay should fade away. To accomplish this I do the following Inside my OverlayView's init method: self.layer.contents = (id)[UIImage imageNamed:@overlay.png] CGImage]; self.layer.opacity = 0.0; and then, inside the touchBegan: and touchEnded: methods I set the opacity to 1.0 and 0.0 respectively. Now, this doesn't work at all, the view doesn't receive the touchBegan: and touchEnded: methods. But everything works fine if I set the opacity to 0.1 instead of 0.0!! And for instance, when I do this: 1. set opacity to 0.1 in the init call... 2. set opacity to 1.0 in the touchBegan call... 3. set opacity to 0.0 (!!!) in the touchEnded call... all subsequent touches are ignored, touchBegan:, touchEnded:, etc. are never called again. Any help on this is very very much appreciated! Thanks, Sebastian ___ 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/hank.list %40runbox.com This email sent to hank.l...@runbox.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
mouse entered/exited in nscollectionviewitem's view
Hi there, I hope someone can help me with this. I have an NSCollectionView set up in IB with a connected NSCollectionViewItem and its View prototype. What I want to do is draw a different colored background for a view in the collection when the user mouses over it. I tried to set it up using tracking areas in the view prototype, but since it's just that - a prototype - the setup code only gets called once and then none of the actually displayed views in the collection handle any of my intended mouse tracking. Could anyone please point me into the right direction where to go on from here? Any help is appreciated. Thanks, Ben Salanki ___ 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
iPhone: getting the pixel data from a PNG file
Hello, all ... I need to be able to make an iPhone app read a PNG file and retrieve the values of its' pixels. I know that libPNG can do this, but my questions are: 1. does libPNG already exist on the iPhone, or do I need to compile it as a .a and link with it? 2. are there Cocoa Touch or other iPhone APIs to help me do this, maybe without needing to use libPNG? Regards, John Falling You - exploring the beauty of voice and sound http://www.fallingyou.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
memory allocation different in simulator and on the iPhone
Hi, I am working on a animal encyclopedia on iPhone. One of the pages displays one photo of an animal. When the user swipes the screen the image is replaced with another one. This works fine and when tested in the simulator with the Instrument for Object Allocation, all looks cool. When I tested on the real iPhone with Instrument, the memory used increases slowly but constantly so that eventually the application dies. Here is the method that is doing the image changing (direction means if the new image should come from left or from right). The class is a UIViewController -(void) displayAnimal: (int) animaIndex fromDirection:(int)direction{ crtIndex = animaIndex; NSString* animalName = [[animalList objectAtIndex:animaIndex] objectForKey: @name]; NSString* fileName = [[animalList objectAtIndex:animaIndex] objectForKey: @file]; self.title = animalName; //remove all the subviews for (UIView *view in self.view.subviews) { [view removeFromSuperview]; } UIView* backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; backgroundView.backgroundColor = [UIColor blackColor]; [self.view addSubview:backgroundView]; [backgroundView release]; UIImage* image = [UIImage imageNamed:fileName]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; [image release]; CGRect imageFrame = imageView.frame; imageFrame.origin = CGPointMake(320*direction,0); imageView.frame = imageFrame; [self.view addSubview:imageView]; [UIView beginAnimations: nil context: @identifier]; [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:0.5]; imageFrame.origin = CGPointMake(0,0); imageView.frame = imageFrame; [UIView commitAnimations]; [imageView release]; } Can you see anything that is not right? Why is the memory allocation showing different in simulator and on the iPhone? Thanks a lot, Dragos ___ 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: Text is flipped vertically
On Jul 23, 2009, at 6:03 PM, Agha Khan agha.k...@me.com wrote: I was unable to find where I have flipped the CGContextRef and for some strange reason my text is flipped vertically. Any idea how to reset CGContextRef? Maybe it's a better idea to figure out where you're flipping the context. How are you drawing the text? The text system is extremely sensitive about the flippedness of the views it draws into. --Kyle Sluder ___ 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 the Document Architecture and Reading files one buffer at a time
On 24/07/2009, at 5:46 AM, Korei Klein wrote: I'm trying to use the document architecture in an application that will create documents for some very big files. I'd like not to have an entire file in memory at once. To use the document architecture, I'm subclassing NSDocument and overriding the readFromFileWrapper method. As far as I can tell, there is no way to use a FileWrapper object to read a file one buffer at a time. Can I find out a filename, or a filehandle from a FileWrapper? Alternatively, is there any way to have an NSDocument using the document architecture which reads its files one buffer at a time? Have you looked at the API for NSFileWrapper? You can get the filename, and (I guess) as long as you don't call - regularFileContents, you can use whatever NSData methods make sense to get at parts of the file on demand. There's no requirement that NSDocument actually loads the whole file - you can return YES to tell it everything went OK, and retain and manage the data internally however you see fit. --Graham ___ 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 the Document Architecture and Reading files one buffer at a time
Actually, I think you'll need to cut in before the file wrapper gets made - it looks like it does load the file content into memory. So, instead, override - (BOOL)readFromURL:(NSURL *)absoluteURL ofType: (NSString *)typeName error:(NSError **)outError and then you can get at the original URL before the file wrapper gets created, and do whatever. Note that NSData has the method + (id)dataWithContentsOfURL:(NSURL *)aURL options:(NSUInteger)mask error:(NSError **)errorPtr and one of the options is NSMappedRead which allows you to memory map the file, or you can get a NSFileHandle using the URL's path, which would be another way to read from the file in sections. --Graham On 24/07/2009, at 1:24 PM, Graham Cox wrote: On 24/07/2009, at 5:46 AM, Korei Klein wrote: I'm trying to use the document architecture in an application that will create documents for some very big files. I'd like not to have an entire file in memory at once. To use the document architecture, I'm subclassing NSDocument and overriding the readFromFileWrapper method. As far as I can tell, there is no way to use a FileWrapper object to read a file one buffer at a time. Can I find out a filename, or a filehandle from a FileWrapper? Alternatively, is there any way to have an NSDocument using the document architecture which reads its files one buffer at a time? Have you looked at the API for NSFileWrapper? You can get the filename, and (I guess) as long as you don't call - regularFileContents, you can use whatever NSData methods make sense to get at parts of the file on demand. There's no requirement that NSDocument actually loads the whole file - you can return YES to tell it everything went OK, and retain and manage the data internally however you see fit. --Graham ___ 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/graham.cox%40bigpond.com This email sent to graham@bigpond.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: Model index and Array Controller index
On Jul 23, 2009, at 6:51 PM, I. Savant wrote: On Jul 23, 2009, at 5:05 PM, Ben Lachman wrote: The problem I'm having is that I can't find a decent way of propagating index changes in the array controller back down to the model. Does anyone have a good method of doing this? I usually get the array controller's -arrangedObjects as a mutable copy, move the objects in that array, then call a category method I wrote called -reeumerateObjectsByKey: which does as the name suggests. You then ask the array controller to -rearrangeObjects. So when do you actually do this, in the drop methods or somewhere more central? Thanks, -Ben -- Ben Lachman Acacia Tree Software http://acaciatreesoftware.com email: blach...@mac.com twitter: @benlachman mobile: 740.590.0009 ___ 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: Screen Saver test button click notification
On 23 Jul 2009, at 03:57, Santosh Sinha wrote: I have developing a calibration tool , but there is a little issue, When i have done the calibration and go into the system preferences and click screen saver test button , after that calibration is gone, What kind of calibration are you attempting to perform, and how are you applying it? If this is for a screen color profile, you you're probably either not using ColorSync or using it incorrectly. ___ 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